summaryrefslogtreecommitdiff
path: root/guifs.h
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 22:20:34 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 22:20:34 +0000
commit58363833ce933924ef340eb53f0caa4d0d1f6ae5 (patch)
tree777ac4b6c20002798a15f494db7c300606c1efe7 /guifs.h
parent3a0e0b8bb6e7fd9bcf510167980d9715e3faeb7b (diff)
implement mousedown, mouseup, mouseclick, and mousescroll events
Diffstat (limited to 'guifs.h')
-rw-r--r--guifs.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/guifs.h b/guifs.h
index abfb81e..1121c3c 100644
--- a/guifs.h
+++ b/guifs.h
@@ -23,6 +23,17 @@ enum {
enum {
Horizontal,
Vertical,
+ Up,
+ Down,
+};
+
+enum {
+ Xmousedown,
+ Xmouseup,
+ Xmouseclick,
+ Xmousescroll,
+ Xkeyboard,
+ Xmax,
};
typedef struct Colour Colour;
@@ -67,7 +78,12 @@ struct Prop {
};
struct Event {
- Rune r;
+ int type;
+ union {
+ Mouse m;
+ Rune r;
+ int direction;
+ };
};
struct GuiSpec {
@@ -90,7 +106,6 @@ struct GuiElement {
Qid qevent;
Qid qtype;
Qid qprops;
- Qid qwait;
int nchildren;
GuiElement **children;
@@ -100,9 +115,10 @@ struct GuiElement {
int nprops;
Prop *props;
- int listening; /* the user is reading from the 'event' file */
+ uvlong listening; /* the user is reading from the 'event' file. Bitmask of which events are wanted */
Channel *events;
char *currentevents;
+ int buttons;
Rectangle border;
Rectangle rect;
@@ -131,5 +147,5 @@ void layouttextbox(GuiElement *, Rectangle);
PropVal getprop(GuiElement *, int, int);
void setprop(GuiElement *, int, PropVal, int);
-int mouseevent(int);
+int mouseevent(Mouse);
int keyboardevent(Rune); \ No newline at end of file