From ccec3e7f471e727fd008eb94454412281b8a4e43 Mon Sep 17 00:00:00 2001 From: katalx Date: Wed, 28 Jan 2026 18:26:48 -0500 Subject: uhhh git --- ui.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ui.h (limited to 'ui.h') 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 -- cgit v1.2.3