1. Refactors the code which chooses the best visual.
The code was changed to ensure a visual which allows
bitwise copying of bitmaps from Windows to X pixmaps to
be used in preference to all others. Otherwise, it
makes sure to chose the best visual, as long as it's
not a problematic >24bpp visual. If a TrueColor visual
is not available, it picks an 8-plane
256-colormap-entries PseudoColor visual, whcih is the
only pseudocolor (colormap'd) visual we support. All in
all, we support 8, 15, 16 and 24 color depths. In all
other cases, we'll avoid running at all, presenting an
intelligible error message (instead of being unable to
draw and just displaying a blank window).
2. Rephrases error messages to be more precise.
3. Makes a clear distinction between the terms "depth"
and "bpp": depth is the meaningful bits, bpp is the
actual bits per pixel, including alignment. The patch
makes sure the correct terms are used throughout
variable names and messages.
4. Eliminates some compilation warnings along the way :)
The patch was tested on:
- 24-plane R8G8B8 visual with 32bpp pixmaps
- 16-plane R5G6B5 visual with 16bpp pixmaps
- 15-plane R5G5B5 visual with 16bpp pixmaps
- 8-plane 256-colormap-size visual
Whenever available, I made sure to test the optimized
(no-bitmap-translation) code path.