Color Cursors

The DIB Engine's software cursor supports color cursors. A color cursor consists of a monochrome AND mask followed by an XOR device dependent bitmap. For example, on an 8 bpp display, the color cursor passed to the display driver on the SetCursor call would look like:

csHotX        DW    ?
csHotY        DW    ?
csWidth       DW    ?
csHeight      DW    ?
csWidthBytes  DW    ?
csColor       DW    ?            ; 0101h = mono, 0801h = 8bpp, etc.
csANDBits     DB    4*8 dup (?)  ; 32x32 bit mask = 4 bytes/row 
                                 ; with 8 rows
csXORBitS     DB    32*8 dup (?)    ; 32x32 pixels = 32 bytes/row 
                                 ; with 8 rows
 

Note that the device dependent portion of the cursor is still XORed onto the screen.

A driver informs the system that it is color-cursor capable by setting the C1_COLORCURSOR bit in the dpCaps1 field of the GDIINFO structure passed back to GDI Enable is called to get the capability bits. The DIB engine does not set this bit even though it supports color cursors. Minidrivers must set this bit explicitly.

If the driver does not set this bit, it will never be passed a color cursor. If the driver sets this bit, it can receive either monochrome or color cursors.

Most minidrivers should just let the DIB Engine's software cursor code handle the drawing of the color cursor. This presents special problems for drivers that have hardware monochrome cursors. A driver has to dynamically "turn off" its hardware cursor and "turn on" the DIB Engine's software cursor.