diff options
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 |
