summaryrefslogtreecommitdiff
path: root/src/uiLibrary.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uiLibrary.h')
-rw-r--r--src/uiLibrary.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/uiLibrary.h b/src/uiLibrary.h
index 98719d7..f6faf01 100644
--- a/src/uiLibrary.h
+++ b/src/uiLibrary.h
@@ -6,8 +6,31 @@
6 6
7#include <font.h> 7#include <font.h>
8 8
9#ifndef NDEBUG
10#include <stdio.h>
11#define UI_LOG(...) printf("[ui] " __VA_ARGS__ "\n")
12#else
13#define UI_LOG
14#endif
15
16/// Input handling of scrollbars.
17typedef struct uiScrollState {
18 int scrollbar_handle_y_start; // y-coordinate of the scrollbar handle at the
19 // start of the scroll.
20 int table_offset_start; // Row offset of a table at the start of the scroll.
21 bool scrolling; // Whether a scrollbar is being dragged.
22} uiScrollState;
23
24/// Input handling of mouse-down events.
25typedef struct uiMouseDownState {
26 uiPtr widget; // The widget currently processing a mouse down event.
27 uiPoint start_point; // Mouse position when the mouse went down.
28} uiMouseDownState;
29
9typedef struct uiLibrary { 30typedef struct uiLibrary {
10 FontAtlas* font; 31 FontAtlas* font;
32 uiScrollState scroll;
33 uiMouseDownState mouse_down;
11 uiMouseButtonState mouse_button_state[uiMouseButtonMax]; 34 uiMouseButtonState mouse_button_state[uiMouseButtonMax];
12 uiWidgetEvent widget_events[MaxWidgetEvents]; 35 uiWidgetEvent widget_events[MaxWidgetEvents];
13 int num_widget_events; 36 int num_widget_events;