summaryrefslogtreecommitdiff
path: root/sys/include/mouse.h
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
commitc558a99e0be506a9abdf677f0ca4490644e05fc1 (patch)
tree17aef678ad05a32ef96ce8385703cb3fe089a5c7 /sys/include/mouse.h
parente5888a1ffdae813d7575f5fb02275c6bb07e5199 (diff)
Import sources from 2011-03-30 iso image - sys/include
Diffstat (limited to 'sys/include/mouse.h')
-rwxr-xr-xsys/include/mouse.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sys/include/mouse.h b/sys/include/mouse.h
new file mode 100755
index 000000000..14d26de6d
--- /dev/null
+++ b/sys/include/mouse.h
@@ -0,0 +1,46 @@
+#pragma src "/sys/src/libdraw"
+
+typedef struct Channel Channel;
+typedef struct Cursor Cursor;
+typedef struct Menu Menu;
+typedef struct Mousectl Mousectl;
+
+struct Mouse
+{
+ int buttons; /* bit array: LMR=124 */
+ Point xy;
+ ulong msec;
+};
+
+struct Mousectl
+{
+ Mouse;
+ Channel *c; /* chan(Mouse) */
+ 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 */
+ 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*);
+extern void setcursor(Mousectl*, Cursor*);
+extern void drawgetrect(Rectangle, int);
+extern Rectangle getrect(int, Mousectl*);
+extern int menuhit(int, Mousectl*, Menu*, Screen*);