diff options
Diffstat (limited to 'src/event.c')
-rw-r--r-- | src/event.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/event.c b/src/event.c new file mode 100644 index 0000000..9b98ee6 --- /dev/null +++ b/src/event.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "event.h" | ||
2 | |||
3 | #include "constants.h" | ||
4 | #include "uiLibrary.h" | ||
5 | |||
6 | #include <cassert.h> | ||
7 | |||
8 | void PushWidgetEvent(uiWidgetEvent* event) { | ||
9 | assert(event); | ||
10 | assert(g_ui.num_widget_events < MaxWidgetEvents); | ||
11 | |||
12 | g_ui.widget_events[g_ui.num_widget_events++] = *event; | ||
13 | } | ||
14 | |||
15 | int uiGetEvents(uiWidgetEvent const** ppWidgetEvents) { | ||
16 | assert(ppWidgetEvents); | ||
17 | |||
18 | const int count = g_ui.num_widget_events; | ||
19 | g_ui.num_widget_events = 0; | ||
20 | |||
21 | *ppWidgetEvents = g_ui.widget_events; | ||
22 | return count; | ||
23 | } | ||