diff options
Diffstat (limited to 'guifs.h')
-rw-r--r-- | guifs.h | 35 |
1 files changed, 30 insertions, 5 deletions
@@ -1,14 +1,29 @@ enum { Pbackground, + Pborder, + Pmargin, + Ppadding, + Porientation, + Pbordercolour, Pmax, }; enum { - Gnone, + nbaseprops = 4 +}; + +enum { Gcontainer, Gmax, }; + +enum { + Horizontal, + Vertical, +}; + typedef struct Colour Colour; +typedef struct Spacing Spacing; typedef union PropVal PropVal; typedef struct PropSpec PropSpec; typedef struct Prop Prop; @@ -20,8 +35,17 @@ struct Colour { ulong code; }; +struct Spacing { + int up; + int right; + int down; + int left; +}; + union PropVal { Colour *colour; + Spacing *spacing; + int orientation; }; struct PropSpec { @@ -42,10 +66,12 @@ struct GuiSpec { void (*draw)(GuiElement *); void (*layout)(GuiElement *, Rectangle); int nprops; - int proptags[]; + int *proptags; }; struct GuiElement { + RWLock lock; + int type; int id; @@ -63,13 +89,14 @@ struct GuiElement { int nprops; Prop *props; + Rectangle border; Rectangle rect; - }; extern GuiElement *root; extern PropSpec propspecs[Pmax]; extern GuiSpec guispecs[Gmax]; +extern int baseprops[nbaseprops]; void *emalloc(ulong); @@ -77,10 +104,8 @@ Colour *mkcolour(ulong); void initgraphics(void); void layout(GuiElement *, Rectangle); void updategui(int); -void drawnone(GuiElement *); void drawcontainer(GuiElement *); -void layoutnone(GuiElement *, Rectangle); void layoutcontainer(GuiElement *, Rectangle); PropVal getprop(GuiElement *, int); |