diff options
author | quou <quou@disroot.org> | 2024-06-01 12:19:16 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-06-01 12:20:17 +1000 |
commit | ea7cd94f7aeb177618db3907a6c86b7252e018f0 (patch) | |
tree | e972f9cf590ef756c2e41f3eac5b03e16db08300 /ui.h |
Initial commit.
Diffstat (limited to 'ui.h')
-rw-r--r-- | ui.h | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +#ifndef ui_h +#define ui_h + +#include "render.h" +#include "rect.h" + +typedef struct { + Font* font; +} UI; + +Rectangle rectcut_left (Rectangle* l, int a); +Rectangle rectcut_right (Rectangle* l, int a); +Rectangle rectcut_top (Rectangle* l, int a); +Rectangle rectcut_bottom(Rectangle* l, int a); +Rectangle shrink_rect (const Rectangle* l, int a); +Rectangle centre_rect ( + const Rectangle* l, + const Rectangle* t +); + +void init_ui(UI* u, Font* f); +void ui_begin(UI* u, Rectangle* l); +void ui_end(UI* u); +int ui_button( + UI* u, + const Rectangle* l, + const char* label +); +void ui_label( + UI* u, + const Rectangle* l, + const char* text +); +void ui_container( + UI* u, + const Rectangle* l, + Rectangle* r, + const Rectangle* c +); + +#endif |