- Display* dpy = (Display*) display;
- Cursor cursor = (Cursor) 0;
-
- switch (id)
- {
- case wxCURSOR_WAIT:
- {
- cursor = XCreateFontCursor (dpy, XC_watch);
- break;
- }
- case wxCURSOR_CROSS:
- {
- cursor = XCreateFontCursor (dpy, XC_crosshair);
- break;
- }
- case wxCURSOR_CHAR:
- {
- // Nothing
- break;
- }
- case wxCURSOR_HAND:
- {
- cursor = XCreateFontCursor (dpy, XC_hand1);
- break;
- }
- case wxCURSOR_BULLSEYE:
- {
- cursor = XCreateFontCursor (dpy, XC_target);
- break;
- }
- case wxCURSOR_PENCIL:
- {
- cursor = XCreateFontCursor (dpy, XC_pencil);
- break;
- }
- case wxCURSOR_MAGNIFIER:
- {
- cursor = XCreateFontCursor (dpy, XC_sizing);
- break;
- }
- case wxCURSOR_IBEAM:
- {
- cursor = XCreateFontCursor (dpy, XC_xterm);
- break;
- }
- case wxCURSOR_NO_ENTRY:
- {
- cursor = XCreateFontCursor (dpy, XC_pirate);
- break;
- }
- case wxCURSOR_LEFT_BUTTON:
- {
- cursor = XCreateFontCursor (dpy, XC_leftbutton);
- break;
- }
- case wxCURSOR_RIGHT_BUTTON:
- {
- cursor = XCreateFontCursor (dpy, XC_rightbutton);
- break;
- }
- case wxCURSOR_MIDDLE_BUTTON:
- {
- cursor = XCreateFontCursor (dpy, XC_middlebutton);
- break;
- }
- case wxCURSOR_QUESTION_ARROW:
- {
- cursor = XCreateFontCursor (dpy, XC_question_arrow);
- break;
- }
- case wxCURSOR_SIZING:
- {
- cursor = XCreateFontCursor (dpy, XC_sizing);
- break;
- }
- case wxCURSOR_WATCH:
- {
- cursor = XCreateFontCursor (dpy, XC_watch);
- break;
- }
- case wxCURSOR_SPRAYCAN:
- {
- cursor = XCreateFontCursor (dpy, XC_spraycan);
- break;
- }
- case wxCURSOR_PAINT_BRUSH:
- {
- cursor = XCreateFontCursor (dpy, XC_spraycan);
- break;
- }
- case wxCURSOR_SIZENWSE:
- case wxCURSOR_SIZENESW:
- {
- // Not available in X
- cursor = XCreateFontCursor (dpy, XC_crosshair);
- break;
- }
- case wxCURSOR_SIZEWE:
- {
- cursor = XCreateFontCursor (dpy, XC_sb_h_double_arrow);
- break;
- }
- case wxCURSOR_SIZENS:
- {
- cursor = XCreateFontCursor (dpy, XC_sb_v_double_arrow);
- break;
- }
- case wxCURSOR_POINT_LEFT:
- {
- cursor = XCreateFontCursor (dpy, XC_sb_left_arrow);
- break;
- }
- case wxCURSOR_POINT_RIGHT:
- {
- cursor = XCreateFontCursor (dpy, XC_sb_right_arrow);
- break;
- }
- // (JD Huggins) added more stock cursors for X
- // X-only cursors BEGIN
- case wxCURSOR_CROSS_REVERSE:
- {
- cursor = XCreateFontCursor(dpy, XC_cross_reverse);
- break;
- }
- case wxCURSOR_DOUBLE_ARROW:
- {
- cursor = XCreateFontCursor(dpy, XC_double_arrow);
- break;
- }
- case wxCURSOR_BASED_ARROW_UP:
- {
- cursor = XCreateFontCursor(dpy, XC_based_arrow_up);
- break;
- }
- case wxCURSOR_BASED_ARROW_DOWN:
- {
- cursor = XCreateFontCursor(dpy, XC_based_arrow_down);
- break;
- }
- default:
- case wxCURSOR_ARROW:
- {
- cursor = XCreateFontCursor (dpy, XC_top_left_arrow);
- break;
- }
- case wxCURSOR_BLANK:
- {
- GC gc;
- XGCValues gcv;
- Pixmap empty_pixmap;
- XColor blank_color;
-
- empty_pixmap = XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
- 16, 16, 1);
- gcv.function = GXxor;
- gc = XCreateGC (dpy,
- empty_pixmap,
- GCFunction,
- &gcv);
- XCopyArea (dpy,
- empty_pixmap,
- empty_pixmap,
- gc,
- 0, 0,
- 16, 16,
- 0, 0);
- XFreeGC (dpy, gc);
- cursor = XCreatePixmapCursor (dpy,
- empty_pixmap,
- empty_pixmap,
- &blank_color,
- &blank_color,
- 8, 8);
-
- break;
- }
- }
- return (WXCursor) cursor;