summaryrefslogtreecommitdiff
path: root/guifs.h
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-11 16:39:26 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-11 16:39:26 +0000
commit0ad54d136ef33d61172658e97b538f7cd6a91c26 (patch)
tree2aa2817fbebca09ef0feffc507cb9b1b0acd654e /guifs.h
parent7aeae86d36a1a04e93bb4be2216cb735acfab714 (diff)
Add a basic textbox element
Diffstat (limited to 'guifs.h')
-rw-r--r--guifs.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/guifs.h b/guifs.h
index 3a38d1d..49e8e38 100644
--- a/guifs.h
+++ b/guifs.h
@@ -5,15 +5,18 @@ enum {
Ppadding,
Porientation,
Pbordercolour,
+ Ptext,
+ Ptextcolour,
Pmax,
};
enum {
- nbaseprops = 4
+ nbaseprops = 5
};
enum {
Gcontainer,
+ Gtextbox,
Gmax,
};
@@ -46,11 +49,12 @@ union PropVal {
Colour *colour;
Spacing *spacing;
int orientation;
+ Rune *text;
};
struct PropSpec {
char *name;
- PropVal (*def)(void);
+ PropVal (*def)(int, int);
char *(*print)(PropVal);
char *(*parse)(char *, PropVal *);
};
@@ -65,6 +69,7 @@ struct GuiSpec {
char *name;
void (*draw)(GuiElement *);
void (*layout)(GuiElement *, Rectangle);
+ int leafnode;
int nprops;
int *proptags;
};
@@ -91,6 +96,7 @@ struct GuiElement {
Rectangle border;
Rectangle rect;
+ Rectangle content;
};
extern GuiElement *root;
@@ -99,14 +105,17 @@ extern GuiSpec guispecs[Gmax];
extern int baseprops[nbaseprops];
void *emalloc(ulong);
+int allspace(char *);
Colour *mkcolour(ulong);
void initgraphics(void);
void layout(GuiElement *, Rectangle);
void updategui(int);
void drawcontainer(GuiElement *);
+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