diff options
Diffstat (limited to 'guifs.h')
-rw-r--r-- | guifs.h | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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 |