summaryrefslogtreecommitdiff
path: root/guifs.h
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 20:39:09 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 20:39:09 +0000
commit3a0e0b8bb6e7fd9bcf510167980d9715e3faeb7b (patch)
tree17f5aaaddf15ea6c8bbb0043e89f87be0ce7021e /guifs.h
parent0ad54d136ef33d61172658e97b538f7cd6a91c26 (diff)
Even more work :)
Diffstat (limited to 'guifs.h')
-rw-r--r--guifs.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/guifs.h b/guifs.h
index 49e8e38..abfb81e 100644
--- a/guifs.h
+++ b/guifs.h
@@ -30,6 +30,7 @@ typedef struct Spacing Spacing;
typedef union PropVal PropVal;
typedef struct PropSpec PropSpec;
typedef struct Prop Prop;
+typedef struct Event Event;
typedef struct GuiSpec GuiSpec;
typedef struct GuiElement GuiElement;
@@ -65,6 +66,10 @@ struct Prop {
Qid qid;
};
+struct Event {
+ Rune r;
+};
+
struct GuiSpec {
char *name;
void (*draw)(GuiElement *);
@@ -85,6 +90,7 @@ struct GuiElement {
Qid qevent;
Qid qtype;
Qid qprops;
+ Qid qwait;
int nchildren;
GuiElement **children;
@@ -94,11 +100,16 @@ struct GuiElement {
int nprops;
Prop *props;
+ int listening; /* the user is reading from the 'event' file */
+ Channel *events;
+ char *currentevents;
+
Rectangle border;
Rectangle rect;
Rectangle content;
};
+extern Point mousexy;
extern GuiElement *root;
extern PropSpec propspecs[Pmax];
extern GuiSpec guispecs[Gmax];
@@ -117,5 +128,8 @@ void drawtextbox(GuiElement *);
void layoutcontainer(GuiElement *, Rectangle);
void layouttextbox(GuiElement *, Rectangle);
-PropVal getprop(GuiElement *, int);
-void setprop(GuiElement *, int, PropVal); \ No newline at end of file
+PropVal getprop(GuiElement *, int, int);
+void setprop(GuiElement *, int, PropVal, int);
+
+int mouseevent(int);
+int keyboardevent(Rune); \ No newline at end of file