cursorswitch.c - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
cursorswitch.c (1078B) | |
--- | |
1 /* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
2 #include <u.h> | |
3 #include <libg.h> | |
4 #include "libgint.h" | |
5 | |
6 #include <X11/cursorfont.h> | |
7 | |
8 extern Window _topwindow; | |
9 | |
10 static Cursor arrow; | |
11 static Cursor sweep; | |
12 static Cursor crosshair; | |
13 static Cursor pirate; | |
14 static Cursor watch; | |
15 static Cursor defcursor; | |
16 | |
17 void | |
18 cursorswitch(unsigned int c) | |
19 { | |
20 Cursor i = defcursor; | |
21 | |
22 switch (c){ | |
23 case ArrowCursor: i = arrow; break; | |
24 case SweepCursor: i = sweep; break; | |
25 case BullseyeCursor: i = crosshair; break; | |
26 case DeadCursor: i = pirate; break; | |
27 case LockCursor: i = watch; break; | |
28 default: i = defcursor; break; | |
29 } | |
30 | |
31 XDefineCursor(_dpy, _topwindow, i); | |
32 } | |
33 | |
34 void | |
35 initcursors(void) | |
36 { | |
37 sweep = XCreateFontCursor(_dpy, XC_sizing); | |
38 crosshair = XCreateFontCursor(_dpy, XC_crosshair); | |
39 pirate = XCreateFontCursor(_dpy, XC_pirate); | |
40 watch = XCreateFontCursor(_dpy, XC_watch); | |
41 arrow = XCreateFontCursor(_dpy, XC_left_ptr); | |
42 defcursor = XCreateFontCursor(_dpy, XC_xterm); | |
43 } | |
44 |