NAME
XCreatePixmapCursor − create a cursor from two bitmaps.
Synopsis
Cursor XCreatePixmapCursor(display, source, mask,
foreground_color, background_color, x, y)
Display *display;
Pixmap source;
Pixmap mask;
XColor *foreground_color;
XColor *background_color;
unsigned int x, y;
Arguments
displaySpecifies a connection to an X server; returned from XOpenDisplay().
sourceSpecifies the shape of the source cursor. A pixmap of depth 1.
maskSpecifies the bits of the cursor that are to be displayed (the mask or stipple). A pixmap of depth 1. May be None.
foreground_color
Specifies the red, green, and blue (RGB) values for the foreground.
background_color
Specifies the red, green, and blue (RGB) values for the background.
x
ySpecify the coordinates of the cursor’s hotspot relative to the source’s origin. Must be a point within the source.
Description
XCreatePixmapCursor() creates a cursor and returns a cursor ID. Foreground and background RGB values must be specified using foreground_color and background_color, even if the server only has a monochrome screen. The foreground_color is used for the 1 bits in the source, and the background is used for the 0 bits. Both source and mask (if specified) must have depth 1, but can have any root. The mask pixmap defines the shape of the cursor; that is, the 1 bits in the mask define which source pixels will be displayed. If no mask is given, all pixels of the source are displayed. The mask, if present, must be the same size as the source. The pixmaps can be freed immediately if no further explicit references to them are to be made. For more information on cursors, see Volume One, Chapter 6, Drawing Graphics and Text.
Structures
typedef struct {
unsigned long pixel;
unsigned short red, green, blue;
char flags;/* DoRed, DoGreen, DoBlue */
char pad;
} XColor;
Errors
BadAlloc
BadMatchMask bitmap must be the same size as source bitmap.
BadPixmap
See Also
XCreateBitmapFromData(), XDefineCursor(), XCreateFontCursor(), XCreatePixmap(), XCreatePixmapCursor(), XFreeCursor(), XFreePixmap(), XQueryBestCursor(), XQueryBestCursor(), XQueryBestSize(), XQueryBestSize(), XReadBitmapFile(), XRecolorCursor(), XUndefineCursor().
Copyright O’Reilly & Assoc. —