summaryrefslogtreecommitdiff
path: root/src/ui/window.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
commit852689943bfbbbb933ba617cb0a971f82923a2f3 (patch)
tree11f7b934e5ea0fdd4f96efabbb213eb3189d6863 /src/ui/window.h
parent379c1f8befcc30b72f0b50dcbd653704348e4761 (diff)
Refactor: Update event processing to not assume a single UI root
Most actions should occur in the context of the current UI root.
Diffstat (limited to 'src/ui/window.h')
-rw-r--r--src/ui/window.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/window.h b/src/ui/window.h
index a95d9f40..12c540d3 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -67,7 +67,7 @@ struct Impl_Window {
67 uint32_t focusGainedAt; 67 uint32_t focusGainedAt;
68 SDL_Renderer *render; 68 SDL_Renderer *render;
69 iInt2 size; 69 iInt2 size;
70 iRoot root; /* root widget and UI state */ 70 iRoot * roots[2]; /* root widget and UI state; second one is for split mode */
71 float pixelRatio; /* conversion between points and pixels, e.g., coords, window size */ 71 float pixelRatio; /* conversion between points and pixels, e.g., coords, window size */
72 float displayScale; /* DPI-based scaling factor of current display, affects uiScale only */ 72 float displayScale; /* DPI-based scaling factor of current display, affects uiScale only */
73 float uiScale; 73 float uiScale;
@@ -83,6 +83,7 @@ struct Impl_Window {
83}; 83};
84 84
85iBool processEvent_Window (iWindow *, const SDL_Event *); 85iBool processEvent_Window (iWindow *, const SDL_Event *);
86iBool dispatchEvent_Window (iWindow *, const SDL_Event *);
86void draw_Window (iWindow *); 87void draw_Window (iWindow *);
87void drawWhileResizing_Window(iWindow *d, int w, int h); /* workaround for SDL bug */ 88void drawWhileResizing_Window(iWindow *d, int w, int h); /* workaround for SDL bug */
88void resize_Window (iWindow *, int w, int h); 89void resize_Window (iWindow *, int w, int h);
@@ -101,10 +102,12 @@ iInt2 maxTextureSize_Window (const iWindow *);
101float uiScale_Window (const iWindow *); 102float uiScale_Window (const iWindow *);
102iInt2 coord_Window (const iWindow *, int x, int y); 103iInt2 coord_Window (const iWindow *, int x, int y);
103iInt2 mouseCoord_Window (const iWindow *); 104iInt2 mouseCoord_Window (const iWindow *);
105iAnyObject *hitChild_Window (const iWindow *, iInt2 coord);
104uint32_t frameTime_Window (const iWindow *); 106uint32_t frameTime_Window (const iWindow *);
105SDL_Renderer *renderer_Window (const iWindow *); 107SDL_Renderer *renderer_Window (const iWindow *);
106int snap_Window (const iWindow *); 108int snap_Window (const iWindow *);
107iBool isFullscreen_Window (const iWindow *); 109iBool isFullscreen_Window (const iWindow *);
110iRoot * findRoot_Window (const iWindow *, const iWidget *widget);
108 111
109iWindow * get_Window (void); 112iWindow * get_Window (void);
110 113