diff options
| author | katalx | 2026-01-28 18:26:48 -0500 |
|---|---|---|
| committer | katalx | 2026-01-28 18:26:48 -0500 |
| commit | ccec3e7f471e727fd008eb94454412281b8a4e43 (patch) | |
| tree | 039d86b29a9596198d6ac2c2f15628424f6a7942 /ui.h | |
uhhh git
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 + +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 |
