Blob


1 typedef struct Menu Menu;
2 typedef struct Mousectl Mousectl;
4 struct Mouse
5 {
6 int buttons; /* bit array: LMR=124 */
7 Point xy;
8 ulong msec;
9 };
11 struct Mousectl
12 {
13 Mouse m;
14 struct Channel *c; /* chan(Mouse) */
15 struct Channel *resizec; /* chan(int)[2] */
16 /* buffered in case client is waiting for a mouse action before handling resize */
18 char *file;
19 int mfd; /* to mouse file */
20 int cfd; /* to cursor file */
21 int pid; /* of slave proc */
22 Display *display;
23 /*Image* image; / * of associated window/display */
24 };
26 struct Menu
27 {
28 char **item;
29 char *(*gen)(int);
30 int lasthit;
31 };
33 /*
34 * Mouse
35 */
36 extern Mousectl* initmouse(char*, Image*);
37 extern void moveto(Mousectl*, Point);
38 extern int readmouse(Mousectl*);
39 extern void closemouse(Mousectl*);
40 struct Cursor;
41 extern void setcursor(Mousectl*, struct Cursor*);
42 extern void drawgetrect(Rectangle, int);
43 extern Rectangle getrect(int, Mousectl*);
44 extern int menuhit(int, Mousectl*, Menu*, Screen*);