A bit of quiver work
[clav.git] / ui.h
blob34d4557b2577c93af4bb3a0976449b9c49c214d5
1 enum event_type {
2 ET_NONE = 0,
3 ET_INITIAL_QUIT,
4 ET_FORCE_QUIT,
5 ET_CONFIRM,
6 ET_DENY,
7 };
9 struct ui_event {
10 /* What event this is */
11 enum event_type type;
14 /* Initialize whatever UI is present */
15 int
16 ui_init(void);
18 /* Tear down whatever UI was made */
19 int
20 ui_teardown(void);
22 /* Record that a frame has been started */
23 int
24 ui_start_frame(void);
26 /* Draw a frame, sleep to framelimit */
27 int
28 ui_finish_frame(void);
30 /* Get some kind of ui-agnostic event (like `quit' or `mutate' */
31 int
32 ui_get_event(struct ui_event *e, uint_fast8_t *more);
34 /* Display a message. Y/n eventually handed back through ui_get_event() */
35 int
36 ui_confirm_deny(const char *s);