Next: , Previous: Graphics Context, Up: Top

5 Cursor

— Function: x:create-cursor display shape

X provides a set of standard cursor shapes in a special font named cursor. Applications are encouraged to use this interface for their cursors because the font can be customized for the individual display type. The shape argument specifies which glyph of the standard fonts to use.

The hotspot comes from the information stored in the cursor font. The initial colors of a cursor are a black foreground and a white background (see X:Recolor-Cursor). The names of all cursor shapes are defined with the prefix XC: in x11.scm. — Function: x:create-cursor source-font source-char mask-font mask-char fgc bgc

Creates a cursor from the source and mask bitmaps obtained from the specified font glyphs. The integer source-char must be a defined glyph in source-font. The integer mask-char must be a defined glyph in mask-font. The origins of the source-char and mask-char glyphs are positioned coincidently and define the hotspot. The source-char and mask-char need not have the same bounding box metrics, and there is no restriction on the placement of the hotspot relative to the bounding boxes. — Function: x:create-cursor source-font source-char #f #f fgc bgc

If mask-font and mask-char are #f, all pixels of the source are displayed. — Function: x:create-cursor source-pixmap mask-pixmap fgc bgc origin

mask-pixmap must be the same size as the pixmap defined by the source-pixmap argument. The foreground and background RGB values must be specified using foreground-color and background-color, even if the X server only has a x:Static-Gray or x:Gray-Scale screen. The hotspot must be a point within the source-pixmap.

X:Create-Cursor creates and returns a cursor. The foreground-color is used for the pixels set to 1 in the source, and the background-color is used for the pixels set to 0. Both source and mask must have depth one but can have any root. The mask-pixmap defines the shape of the cursor. The pixels set to 1 in mask-pixmap define which source pixels are displayed, and the pixels set to 0 define which pixels are ignored. — Function: x:create-cursor source-pixmap #f fgc bgc origin

If mask-pixmap is #f, all pixels of the source are displayed.