From 76193d7cb0457807b2f0b95f909ab5de19480cd7 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 30 Sep 2003 17:47:42 +0000 Subject: Initial revision --- src/libdraw/mouse.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/libdraw/mouse.h (limited to 'src/libdraw/mouse.h') diff --git a/src/libdraw/mouse.h b/src/libdraw/mouse.h new file mode 100644 index 00000000..f0a0f697 --- /dev/null +++ b/src/libdraw/mouse.h @@ -0,0 +1,44 @@ +typedef struct Menu Menu; +typedef struct Mousectl Mousectl; + +struct Mouse +{ + int buttons; /* bit array: LMR=124 */ + Point xy; + ulong msec; +}; + +struct Mousectl +{ + Mouse m; + struct Channel *c; /* chan(Mouse) */ + struct Channel *resizec; /* chan(int)[2] */ + /* buffered in case client is waiting for a mouse action before handling resize */ + + char *file; + int mfd; /* to mouse file */ + int cfd; /* to cursor file */ + int pid; /* of slave proc */ + Display *display; + /*Image* image; / * of associated window/display */ +}; + +struct Menu +{ + char **item; + char *(*gen)(int); + int lasthit; +}; + +/* + * Mouse + */ +extern Mousectl* initmouse(char*, Image*); +extern void moveto(Mousectl*, Point); +extern int readmouse(Mousectl*); +extern void closemouse(Mousectl*); +struct Cursor; +extern void setcursor(Mousectl*, struct Cursor*); +extern void drawgetrect(Rectangle, int); +extern Rectangle getrect(int, Mousectl*); +extern int menuhit(int, Mousectl*, Menu*, Screen*); -- cgit v1.2.3