summaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-01 12:19:16 +1000
committerquou <quou@disroot.org>2024-06-01 12:20:17 +1000
commitea7cd94f7aeb177618db3907a6c86b7252e018f0 (patch)
treee972f9cf590ef756c2e41f3eac5b03e16db08300 /ui.h
Initial commit.
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/ui.h b/ui.h
new file mode 100644
index 0000000..6a36566
--- /dev/null
+++ b/ui.h
@@ -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