diff options
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); |
