diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 11:40:50 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 11:40:50 +0300 |
commit | 170209cf926e2f714d507fefaa6b30fd245811ad (patch) | |
tree | 1dd6ff1e7c9ecf69c0857b8524bfdc82f07794b9 /src/ui/root.h | |
parent | 83e14d99ba75316da265cfa5f3fd092caa1498cf (diff) |
Refactor: Moving RootData so it can become non-global state
Diffstat (limited to 'src/ui/root.h')
-rw-r--r-- | src/ui/root.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ui/root.h b/src/ui/root.h index a3e595ba..fcb5b1b0 100644 --- a/src/ui/root.h +++ b/src/ui/root.h | |||
@@ -1,12 +1,30 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include "widget.h" | 3 | #include "widget.h" |
4 | #include <the_Foundation/ptrset.h> | ||
5 | |||
6 | iDeclareType(RootData) | ||
7 | |||
8 | /* TODO: Rename to Root, include `iWidget *root` as well. */ | ||
9 | struct Impl_RootData { | ||
10 | iWidget * hover; | ||
11 | iWidget * mouseGrab; | ||
12 | iWidget * focus; | ||
13 | iPtrArray *onTop; /* order is important; last one is topmost */ | ||
14 | iPtrSet * pendingDestruction; | ||
15 | }; | ||
16 | |||
17 | /*----------------------------------------------------------------------------------------------*/ | ||
4 | 18 | ||
5 | iWidget * createUserInterface_Root (void); | 19 | iWidget * createUserInterface_Root (void); |
6 | 20 | ||
7 | void setCurrent_Root (iWidget *root); | 21 | void setCurrent_Root (iWidget *root, iRootData *rootData); |
8 | iWidget * get_Root (void); | 22 | iWidget * get_Root (void); |
23 | iRootData * data_Root (void); | ||
9 | 24 | ||
25 | iPtrArray * onTop_RootData (void); | ||
26 | void destroyPending_RootData (iRootData *); | ||
27 | |||
10 | void updateMetrics_Root (iWidget *); | 28 | void updateMetrics_Root (iWidget *); |
11 | void updatePadding_Root (iWidget *); /* TODO: is part of metrics? */ | 29 | void updatePadding_Root (iWidget *); /* TODO: is part of metrics? */ |
12 | void dismissPortraitPhoneSidebars_Root (iWidget *); | 30 | void dismissPortraitPhoneSidebars_Root (iWidget *); |