ref: 7aeae86d36a1a04e93bb4be2216cb735acfab714
dir: /guifs.h/
enum { Pbackground, Pborder, Pmargin, Ppadding, Porientation, Pbordercolour, Pmax, }; enum { 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; typedef struct GuiSpec GuiSpec; typedef struct GuiElement GuiElement; struct Colour { Image *image; ulong code; }; struct Spacing { int up; int right; int down; int left; }; union PropVal { Colour *colour; Spacing *spacing; int orientation; }; struct PropSpec { char *name; PropVal (*def)(void); char *(*print)(PropVal); char *(*parse)(char *, PropVal *); }; struct Prop { int tag; PropVal val; Qid qid; }; struct GuiSpec { char *name; void (*draw)(GuiElement *); void (*layout)(GuiElement *, Rectangle); int nprops; int *proptags; }; struct GuiElement { RWLock lock; int type; int id; Qid qid; Qid qclone; Qid qevent; Qid qtype; Qid qprops; int nchildren; GuiElement **children; GuiElement *parent; 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); Colour *mkcolour(ulong); void initgraphics(void); void layout(GuiElement *, Rectangle); void updategui(int); void drawcontainer(GuiElement *); void layoutcontainer(GuiElement *, Rectangle); PropVal getprop(GuiElement *, int); void setprop(GuiElement *, int, PropVal);