diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 17:01:58 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 17:01:58 +0300 |
commit | 852689943bfbbbb933ba617cb0a971f82923a2f3 (patch) | |
tree | 11f7b934e5ea0fdd4f96efabbb213eb3189d6863 /src/ui/window.h | |
parent | 379c1f8befcc30b72f0b50dcbd653704348e4761 (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.h | 5 |
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 | ||
85 | iBool processEvent_Window (iWindow *, const SDL_Event *); | 85 | iBool processEvent_Window (iWindow *, const SDL_Event *); |
86 | iBool dispatchEvent_Window (iWindow *, const SDL_Event *); | ||
86 | void draw_Window (iWindow *); | 87 | void draw_Window (iWindow *); |
87 | void drawWhileResizing_Window(iWindow *d, int w, int h); /* workaround for SDL bug */ | 88 | void drawWhileResizing_Window(iWindow *d, int w, int h); /* workaround for SDL bug */ |
88 | void resize_Window (iWindow *, int w, int h); | 89 | void resize_Window (iWindow *, int w, int h); |
@@ -101,10 +102,12 @@ iInt2 maxTextureSize_Window (const iWindow *); | |||
101 | float uiScale_Window (const iWindow *); | 102 | float uiScale_Window (const iWindow *); |
102 | iInt2 coord_Window (const iWindow *, int x, int y); | 103 | iInt2 coord_Window (const iWindow *, int x, int y); |
103 | iInt2 mouseCoord_Window (const iWindow *); | 104 | iInt2 mouseCoord_Window (const iWindow *); |
105 | iAnyObject *hitChild_Window (const iWindow *, iInt2 coord); | ||
104 | uint32_t frameTime_Window (const iWindow *); | 106 | uint32_t frameTime_Window (const iWindow *); |
105 | SDL_Renderer *renderer_Window (const iWindow *); | 107 | SDL_Renderer *renderer_Window (const iWindow *); |
106 | int snap_Window (const iWindow *); | 108 | int snap_Window (const iWindow *); |
107 | iBool isFullscreen_Window (const iWindow *); | 109 | iBool isFullscreen_Window (const iWindow *); |
110 | iRoot * findRoot_Window (const iWindow *, const iWidget *widget); | ||
108 | 111 | ||
109 | iWindow * get_Window (void); | 112 | iWindow * get_Window (void); |
110 | 113 | ||