Controls work (sans deleting, previewing edges)
[clav.git] / ui.h
blob4ff5380513820802db07a62fb6aeec8db5bb9a27
1 enum event_type {
2 ET_NONE = 0,
3 ET_CHANGE_FATNESS,
4 ET_CONFIRM,
5 ET_DELETE_EDGE,
6 ET_DELETE_VERTEX,
7 ET_DENY,
8 ET_FORCE_QUIT,
9 ET_INITIAL_QUIT,
10 ET_MUTATE,
11 ET_NEW_EDGE,
12 ET_NEW_VERTEX,
15 struct ui_event {
16 /* What event this is */
17 enum event_type type;
19 /* Event-specific data */
20 size_t idx_1;
21 size_t idx_2;
22 int int_1;
23 int int_2;
24 int_fast8_t a;
25 uint_fast8_t b;
28 /* Initialize whatever UI is present */
29 int
30 ui_init(struct quiver *q);
32 /* Tear down whatever UI was made */
33 int
34 ui_teardown(void);
36 /* Deal with the fact that the quiver was changed */
37 int
38 ui_respond_quiver_change(void);
40 /* Record that a frame has been started */
41 int
42 ui_start_frame(void);
44 /* Draw a frame, sleep to framelimit */
45 int
46 ui_finish_frame(void);
48 /* Get some kind of ui-agnostic event (like `quit' or `mutate' */
49 int
50 ui_get_event(struct ui_event *e, uint_fast8_t *more);
52 /* Display a message. Y/n eventually handed back through ui_get_event() */
53 int
54 ui_confirm_deny(const char *s);