Blob


1 #ifndef _MOUSE_H_
2 #define _MOUSE_H_ 1
3 #if defined(__cplusplus)
4 extern "C" {
5 #endif
6 typedef struct Menu Menu;
7 typedef struct Mousectl Mousectl;
9 struct Mouse
10 {
11 int buttons; /* bit array: LMR=124 */
12 Point xy;
13 ulong msec;
14 };
16 struct Mousectl
17 {
18 Mouse m;
19 struct Channel *c; /* chan(Mouse) */
20 struct Channel *resizec; /* chan(int)[2] */
21 /* buffered in case client is waiting for a mouse action before handling resize */
23 char *file;
24 int mfd; /* to mouse file */
25 int cfd; /* to cursor file */
26 int pid; /* of slave proc */
27 Display *display;
28 /*Image* image; / * of associated window/display */
29 };
31 struct Menu
32 {
33 char **item;
34 char *(*gen)(int);
35 int lasthit;
36 };
38 /*
39 * Mouse
40 */
41 extern Mousectl* initmouse(char*, Image*);
42 extern void moveto(Mousectl*, Point);
43 extern int readmouse(Mousectl*);
44 extern void closemouse(Mousectl*);
45 struct Cursor;
46 extern void setcursor(Mousectl*, struct Cursor*);
47 extern void drawgetrect(Rectangle, int);
48 extern Rectangle getrect(int, Mousectl*);
49 extern int menuhit(int, Mousectl*, Menu*, Screen*);
52 #if defined(__cplusplus)
53 }
54 #endif
55 #endif