rsc | f701258 | 2003-11-25 01:40:27 +0000 | [diff] [blame] | 1 | #ifndef _MOUSE_H_ |
| 2 | #define _MOUSE_H_ 1 |
| 3 | #if defined(__cplusplus) |
| 4 | extern "C" { |
| 5 | #endif |
rsc | b2cfc4e | 2003-09-30 17:47:41 +0000 | [diff] [blame] | 6 | typedef struct Menu Menu; |
| 7 | typedef struct Mousectl Mousectl; |
| 8 | |
| 9 | struct Mouse |
| 10 | { |
| 11 | int buttons; /* bit array: LMR=124 */ |
| 12 | Point xy; |
| 13 | ulong msec; |
| 14 | }; |
| 15 | |
| 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 */ |
| 22 | |
| 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 | }; |
| 30 | |
| 31 | struct Menu |
| 32 | { |
| 33 | char **item; |
| 34 | char *(*gen)(int); |
| 35 | int lasthit; |
| 36 | }; |
| 37 | |
| 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*); |
rsc | f701258 | 2003-11-25 01:40:27 +0000 | [diff] [blame] | 50 | |
rsc | 4f30f3b | 2004-03-30 05:03:29 +0000 | [diff] [blame] | 51 | extern void bouncemouse(Mouse*); |
| 52 | extern int _windowhasfocus; /* XXX do better */ |
| 53 | extern int _wantfocuschanges; |
rsc | f701258 | 2003-11-25 01:40:27 +0000 | [diff] [blame] | 54 | |
| 55 | #if defined(__cplusplus) |
| 56 | } |
| 57 | #endif |
| 58 | #endif |