diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 11:59:28 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-27 11:59:28 +0300 |
commit | 9a7aa34e63132edb5906914ff99b861e64ee9099 (patch) | |
tree | 327e275b7f4fd6eb05150f7c03a87a72794d22a0 /src/ui/root.h | |
parent | 170209cf926e2f714d507fefaa6b30fd245811ad (diff) |
Refactor: Added a proper Root object
`Root` encapsulates the root widget and the associated UI state.
Diffstat (limited to 'src/ui/root.h')
-rw-r--r-- | src/ui/root.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/ui/root.h b/src/ui/root.h index fcb5b1b0..4b14b942 100644 --- a/src/ui/root.h +++ b/src/ui/root.h | |||
@@ -3,10 +3,10 @@ | |||
3 | #include "widget.h" | 3 | #include "widget.h" |
4 | #include <the_Foundation/ptrset.h> | 4 | #include <the_Foundation/ptrset.h> |
5 | 5 | ||
6 | iDeclareType(RootData) | 6 | iDeclareType(Root) |
7 | 7 | ||
8 | /* TODO: Rename to Root, include `iWidget *root` as well. */ | 8 | struct Impl_Root { |
9 | struct Impl_RootData { | 9 | iWidget * widget; |
10 | iWidget * hover; | 10 | iWidget * hover; |
11 | iWidget * mouseGrab; | 11 | iWidget * mouseGrab; |
12 | iWidget * focus; | 12 | iWidget * focus; |
@@ -14,18 +14,19 @@ struct Impl_RootData { | |||
14 | iPtrSet * pendingDestruction; | 14 | iPtrSet * pendingDestruction; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | iDeclareTypeConstruction(Root) | ||
18 | |||
17 | /*----------------------------------------------------------------------------------------------*/ | 19 | /*----------------------------------------------------------------------------------------------*/ |
18 | 20 | ||
19 | iWidget * createUserInterface_Root (void); | 21 | void createUserInterface_Root (iRoot *); |
20 | 22 | ||
21 | void setCurrent_Root (iWidget *root, iRootData *rootData); | 23 | void setCurrent_Root (iRoot *); |
22 | iWidget * get_Root (void); | 24 | iRoot * get_Root (void); |
23 | iRootData * data_Root (void); | ||
24 | 25 | ||
25 | iPtrArray * onTop_RootData (void); | 26 | iPtrArray * onTop_Root (iRoot *); |
26 | void destroyPending_RootData (iRootData *); | 27 | void destroyPending_Root (iRoot *); |
27 | 28 | ||
28 | void updateMetrics_Root (iWidget *); | 29 | void updateMetrics_Root (iRoot *); |
29 | void updatePadding_Root (iWidget *); /* TODO: is part of metrics? */ | 30 | void updatePadding_Root (iRoot *); /* TODO: is part of metrics? */ |
30 | void dismissPortraitPhoneSidebars_Root (iWidget *); | 31 | void dismissPortraitPhoneSidebars_Root (iRoot *); |
31 | void showToolbars_Root (iWidget *, iBool show); | 32 | void showToolbars_Root (iRoot *, iBool show); |