diff dynamin/c/xlib.d @ 23:d55b5b998412

Implement built-in mouse cursors with X.
author Jordan Miner <jminer7@gmail.com>
date Sat, 25 Jul 2009 14:58:43 -0500
parents e6e201c3a439
children 43a88caead16
line wrap: on
line diff
--- a/dynamin/c/xlib.d	Sat Jul 25 14:47:45 2009 -0500
+++ b/dynamin/c/xlib.d	Sat Jul 25 14:58:43 2009 -0500
@@ -245,6 +245,13 @@
 	uint bg,
 	uint depth);
 
+Pixmap XCreateBitmapFromData(
+	Display* display,
+	Drawable d,
+	/*const*/ char* data,
+	uint width,
+	uint height);
+
 int XFreePixmap(Display* display, Pixmap pixmap);
 //}}}
 
@@ -258,12 +265,95 @@
 	uint x,
 	uint y);
 
+Cursor XCreateFontCursor(Display* display, uint shape);
+
 int XDefineCursor(Display* display, Window w, Cursor cursor);
 
 int XUndefineCursor(Display* display, Window w);
 
 int XFreeCursor(Display* display, Cursor cursor);
 
+// cursorfont.h
+enum {
+	XC_num_glyphs        = 154,
+	XC_X_cursor          = 0,
+	XC_arrow             = 2,
+	XC_based_arrow_down  = 4,
+	XC_based_arrow_up    = 6,
+	XC_boat              = 8,
+	XC_bogosity          = 10,
+	XC_bottom_left_corner  = 12,
+	XC_bottom_right_corner = 14,
+	XC_bottom_side       = 16,
+	XC_bottom_tee        = 18,
+	XC_box_spiral        = 20,
+	XC_center_ptr        = 22,
+	XC_circle            = 24,
+	XC_clock             = 26,
+	XC_coffee_mug        = 28,
+	XC_cross             = 30,
+	XC_cross_reverse     = 32,
+	XC_crosshair         = 34,
+	XC_diamond_cross     = 36,
+	XC_dot               = 38,
+	XC_dotbox            = 40,
+	XC_double_arrow      = 42,
+	XC_draft_large       = 44,
+	XC_draft_small       = 46,
+	XC_draped_box        = 48,
+	XC_exchange          = 50,
+	XC_fleur             = 52,
+	XC_gobbler           = 54,
+	XC_gumby             = 56,
+	XC_hand1             = 58,
+	XC_hand2             = 60,
+	XC_heart             = 62,
+	XC_icon              = 64,
+	XC_iron_cross        = 66,
+	XC_left_ptr          = 68,
+	XC_left_side         = 70,
+	XC_left_tee          = 72,
+	XC_leftbutton        = 74,
+	XC_ll_angle          = 76,
+	XC_lr_angle          = 78,
+	XC_man               = 80,
+	XC_middlebutton      = 82,
+	XC_mouse             = 84,
+	XC_pencil            = 86,
+	XC_pirate            = 88,
+	XC_plus              = 90,
+	XC_question_arrow    = 92,
+	XC_right_ptr         = 94,
+	XC_right_side        = 96,
+	XC_right_tee         = 98,
+	XC_rightbutton       = 100,
+	XC_rtl_logo          = 102,
+	XC_sailboat          = 104,
+	XC_sb_down_arrow     = 106,
+	XC_sb_h_double_arrow = 108,
+	XC_sb_left_arrow     = 110,
+	XC_sb_right_arrow    = 112,
+	XC_sb_up_arrow       = 114,
+	XC_sb_v_double_arrow = 116,
+	XC_shuttle           = 118,
+	XC_sizing            = 120,
+	XC_spider            = 122,
+	XC_spraycan          = 124,
+	XC_star              = 126,
+	XC_target            = 128,
+	XC_tcross            = 130,
+	XC_top_left_arrow    = 132,
+	XC_top_left_corner   = 134,
+	XC_top_right_corner  = 136,
+	XC_top_side          = 138,
+	XC_top_tee           = 140,
+	XC_trek              = 142,
+	XC_ul_angle          = 144,
+	XC_umbrella          = 146,
+	XC_ur_angle          = 148,
+	XC_watch             = 150,
+	XC_xterm             = 152,
+}
 //}}}
 
 //{{{ keyboard functions