<<<<<<<<<<<<<<<<

xpixmap_cursor(x) Xlib xpixmap_cursor(x)

NAME

xpixmap_cursor - an X pixmap cursor

DESCRIPTION

The xpixmap_cursor class provides an interface to X pixmap cursors.

SUPERCLASS

xcursor

INSTANCE VARIABLES

hotspot is the (x,y) position in the cursor that is used to determine where the cursor is pointing.

mask is the name of the mask pixmap.

source is the name of the source pixmap.

MESSAGES

create! creates the cursor and sets the id instance variable.

hotspot= x y sets the hotspot instance variable.

hotspot? returns the value of the hotspot instance variable on the argument stack.

mask= xpixmap_name sets the mask instance variable.

mask? returns the value of the mask instance variable on the argument stack.

source= xpixmap_name sets the source instance variable.

source? returns the value of the source instance variable on the argument stack.

EXAMPLE

/* create a pixmap cursor of hobbes */ /* read source bitmap */

xbitmap new: hobbes_bitmap read_bitmap_file: "hobbes.xbm";

/* read mask bitmap */

xbitmap new: hobbesmask_bitmap

read_bitmap_file: "hobbesmask.xbm";

/* create cursor. Note that xpixmap_cursors expect

pixmaps with a depth of 1 */

xpixmap_cursor new: hobbes_cursor

foreground_rgb= (0, 0, 1)

background_rgb= (1, 0, 1)

source= hobbes_bitmap

mask= hobbesmask_bitmap

hotspot= (16, 15);

/* get root window and set the cursor.*/

xwindow new: w1

id= [xdisplay default_root_window?]

cursor: hobbes_cursor;

/*flush the display so the cursor "takes effect" */

xdisplay flush!;

/***********************************************************************

Bitmap files:

hobbes.xbm:

#define hobbes_width 25

#define hobbes_height 25

#define hobbes_x_hot 16

#define hobbes_y_hot 15

static char hobbes_bits[] = {

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,

0x78, 0xe0, 0x07, 0x00, 0xfc, 0xf8, 0x07, 0x00, 0xcc, 0x07, 0x04, 0x00,

0x0c, 0xf0, 0x0b, 0x00, 0x7c, 0x1c, 0x06, 0x00, 0x38, 0x00, 0x00, 0x00,

0xe0, 0x03, 0x10, 0x00, 0xe0, 0x41, 0x11, 0x00, 0x20, 0x40, 0x11, 0x00,

0xe0, 0x07, 0x10, 0x00, 0xe0, 0xc1, 0x17, 0x00, 0x10, 0xe0, 0x2f, 0x00,

0x20, 0xe0, 0x6f, 0x00, 0x18, 0xe0, 0x2f, 0x00, 0x20, 0xc6, 0x67, 0x00,

0x18, 0x84, 0x2b, 0x00, 0x20, 0x08, 0x64, 0x00, 0x70, 0xf0, 0x13, 0x00,

0x80, 0x01, 0x08, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00};

hobbesmask.xbm:

#define hobbesmask_width 25

#define hobbesmask_height 25

static char hobbesmask_bits[] = { 0x00, 0x00, 0x00, 0xfe, 0x00, 0xe0, 0x07, 0xfe, 0xfc, 0xf0, 0x0f, 0xfe, 0xfe, 0xfd, 0x0f, 0xfe, 0xfe, 0xff, 0x0f, 0xfe, 0xfe, 0xff, 0x1f, 0xfe, 0xfe, 0xff, 0x1f, 0xfe, 0xfe, 0xff, 0x1f, 0xfe, 0xfe, 0xff, 0x3f, 0xfe, 0xfc, 0xff, 0x3f, 0xfe, 0xf0, 0xff, 0x3f, 0xfe, 0xf0, 0xff, 0x3f, 0xfe, 0xf0, 0xff, 0x3f, 0xfe, 0xf8, 0xff, 0x7f, 0xfe, 0xf8, 0xff, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xf8, 0xff, 0xff, 0xfe, 0xf8, 0xff, 0x3f, 0xfe, 0xc0, 0xff, 0x1f, 0xfe, 0x00, 0xff, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0xfe, }; ***********************************************************************/

SEE ALSO

xdisplay, xgc, xcursor, xfont_cursor


Last Updated On: Fri Mar 10 15:38:47 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache