aboutsummaryrefslogtreecommitdiff
path: root/include/mouse.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-09-30 17:47:41 +0000
committerrsc <devnull@localhost>2003-09-30 17:47:41 +0000
commitb2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4 (patch)
treef382987fec33cf639d75b1fe1b5d76b8f155d074 /include/mouse.h
parent5f7d5e8d1899f41b0e5366c0251530ea1dc753d0 (diff)
downloadplan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.tar.gz
plan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.tar.bz2
plan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.zip
Initial revision
Diffstat (limited to 'include/mouse.h')
-rw-r--r--include/mouse.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/mouse.h b/include/mouse.h
new file mode 100644
index 00000000..f0a0f697
--- /dev/null
+++ b/include/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*);