![]() |
CCrsr |
Header: Quickdraw.h |
struct CCrsr { SInt16 crsrType; PixMapHandle crsrMap; Handle crsrData; Handle crsrXData; SInt16 crsrXValid; Handle crsrXHandle; Bits16 crsr1Data; Bits16 crsrMask; Point crsrHotSpot; SInt32 crsrXTable; SInt32 crsrID; }; typedef CCrsr CCrsrPtr;
The type of cursor. Possible values are $8000 for a black-and-white cursor and $8001 for a color cursor.
A handle to the PixMap structure defining the cursors characteristics.When the screen depth is greater than 2 bits per pixel, the crsrMap field and the crsrData field define the image. The pixels within the mask replace the destination pixels. Color QuickDraw transfers the pixels outside the mask into the destination pixels using the XOR Boolean transfer mode. Therefore, if pixels outside the mask are white, the destination pixels arent changed. If pixels outside the mask are all black, the destination pixels are inverted. All other values outside of the mask cause unpredictable results.
A handle to the cursors pixel data.To work properly, a color cursors image should contain white pixels (R=G= B=$FFFF) for the transparent part of the image, and black pixels (R=G=B=$0000) for the part of the image to be inverted, in addition to the other colors in the cursors image. Thus, to define a cursor that contains two colors, its necessary to use a 2-bit cursor image (that is, a four-color image.)
A handle to the expanded pixel image used internally by Color QuickDraw.
The depth of the expanded cursor image. If you change the cursors data or color table, set this field to 0 to cause the cursor to be re-expanded. Never set it to any other values.
Reserved for future use.
A 16-by-16 pixel image with a pixel depth of 1 to be displayed when the cursor is on screens with pixel depths of 1 or 2 bits.
The cursors mask data. QuickDraw uses the mask to crop the cursors outline into a background color or pattern. QuickDraw then draws the cursor into this shape. The same 1-bit mask is used with images specified by the crsrData and crsr1Data fields.
The cursors hot spot.
Reserved for future use.
The color table seed for the cursor.
Your application typically does not create CCrsr structures. Although you can create a CCrsr structure, it is usually easier to create a color cursor in a color cursor resource, ‘crsr.
A color cursor is a 256-pixel color image in a 16-by-16 pixel square defined in a color cursor ('crsr') resource. When your application uses the GetCCursor function to get a color cursor from a 'crsr' resource, GetCCursor loads the resource into memory as a CCrsr structure. Your application can then display the color cursor by using the SetCCursor function.
CCrsr is substantially different from the Cursor structure. The fields crsr1Data, crsrMask, and crsrHotSpot in the CCrsr structure are the only ones that have counterparts in the Cursor structure.
The first four fields of the CCrsr structure are similar to the first four fields of the PixPat record, and are used in the same manner by QuickDraw.
The display of a cursor involves a relationship between a mask, stored in the crsrMask field with the same format used for 1-bit cursor masks, and an image. There are two possible sources for a color cursors image. When the cursor is on a screen whose depth is 1 or 2 bits per pixel, the image for the cursor is taken from the crsr1Data field, which contains bitmap cursor data, similar to the bitmap in a 'CURS' resource.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)