diff options
| author | nathan <nathansmith@disroot.org> | 2025-11-17 05:50:31 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-11-17 05:50:31 +0000 |
| commit | f6922dc12deb981cf95498afeb939f24171a5fc4 (patch) | |
| tree | 4add44cdcdc1d4801d43cb4a557f7332fc6eef56 /src/ui.h | |
| parent | fe39cc897fbc8d8470d790df5306550c841d95d4 (diff) | |
| download | FindThings-f6922dc12deb981cf95498afeb939f24171a5fc4.tar.gz FindThings-f6922dc12deb981cf95498afeb939f24171a5fc4.tar.bz2 FindThings-f6922dc12deb981cf95498afeb939f24171a5fc4.zip | |
Testing widgets in the wm
Diffstat (limited to 'src/ui.h')
| -rw-r--r-- | src/ui.h | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -14,15 +14,18 @@ #define UI_WINDOW_TITLE_MAX 32 #define UI_WINDOW_MAX 4 -typedef void (*DrawWindowContentCallback)(Vector2 position, Vector2 scroll); +typedef struct FloatingWindow FloatingWindow; +typedef enum FocusCommand FocusCommand; +typedef FocusCommand (*DrawWindowContentCallback)(FloatingWindow* window, + Game* game); -typedef enum { +enum FocusCommand { NO_FOCUS_ACTION, REQUEST_FOCUS, DEMAND_FOCUS -} FocusCommand; +}; -typedef struct { +struct FloatingWindow { char title[UI_WINDOW_TITLE_MAX]; Rectangle rect; bool minimized; @@ -32,7 +35,8 @@ typedef struct { Vector2 contentSize; Vector2 scroll; bool hasFocus; -} FloatingWindow; + void* data; +}; typedef struct { FloatingWindow windows[UI_WINDOW_MAX]; @@ -40,10 +44,10 @@ typedef struct { } WindowManager; FloatingWindow createFloatingWindow(const char* title, Rectangle rect); -FocusCommand updateFloatingWindow(FloatingWindow* window); +FocusCommand updateFloatingWindow(FloatingWindow* window, Game* game); void initWindowManager(WindowManager* wm); -void updateWindowManager(WindowManager* wm); +void updateWindowManager(WindowManager* wm, Game* game); void addWindowToWindowManager(WindowManager* wm, FloatingWindow window); void focusOnWindow(WindowManager* wm, int windowIndex); |
