summaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorkatalx2026-01-28 18:26:48 -0500
committerkatalx2026-01-28 18:26:48 -0500
commitccec3e7f471e727fd008eb94454412281b8a4e43 (patch)
tree039d86b29a9596198d6ac2c2f15628424f6a7942 /ui.h
uhhh git
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..9263a28
--- /dev/null
+++ b/ui.h
@@ -0,0 +1,41 @@
+#ifndef UI_H
+#define UI_H
+
+typedef enum {
+ UI_REDRAW,
+ UI_KEY_DOWN,
+ UI_KEY_UP
+} UiEventType;
+
+typedef enum {
+ UIK_UP,
+ UIK_DOWN,
+ UIK_LEFT,
+ UIK_RIGHT,
+ UIK_RETURN,
+ UIK_HOME,
+ UIK_END,
+ UIK_PGUP,
+ UIK_PGDN,
+ UIK_UNKNOWN
+} UiKey;
+
+typedef struct {
+ UiKey key;
+ char str[16];
+ int strn;
+} UiKeyEvent;
+
+typedef struct {
+ UiEventType type;
+ union {
+ UiKeyEvent key;
+ };
+} UiEvent;
+
+void ui_init(void);
+void ui_fini(void);
+void ui_draw(Str input, int seli, Str *opt, int optn);
+int ui_wait_event(UiEvent *e);
+
+#endif