summaryrefslogtreecommitdiff
path: root/src/ui/root.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 11:59:28 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 11:59:28 +0300
commit9a7aa34e63132edb5906914ff99b861e64ee9099 (patch)
tree327e275b7f4fd6eb05150f7c03a87a72794d22a0 /src/ui/root.h
parent170209cf926e2f714d507fefaa6b30fd245811ad (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.h27
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
6iDeclareType(RootData) 6iDeclareType(Root)
7 7
8/* TODO: Rename to Root, include `iWidget *root` as well. */ 8struct Impl_Root {
9struct 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
17iDeclareTypeConstruction(Root)
18
17/*----------------------------------------------------------------------------------------------*/ 19/*----------------------------------------------------------------------------------------------*/
18 20
19iWidget * createUserInterface_Root (void); 21void createUserInterface_Root (iRoot *);
20 22
21void setCurrent_Root (iWidget *root, iRootData *rootData); 23void setCurrent_Root (iRoot *);
22iWidget * get_Root (void); 24iRoot * get_Root (void);
23iRootData * data_Root (void);
24 25
25iPtrArray * onTop_RootData (void); 26iPtrArray * onTop_Root (iRoot *);
26void destroyPending_RootData (iRootData *); 27void destroyPending_Root (iRoot *);
27 28
28void updateMetrics_Root (iWidget *); 29void updateMetrics_Root (iRoot *);
29void updatePadding_Root (iWidget *); /* TODO: is part of metrics? */ 30void updatePadding_Root (iRoot *); /* TODO: is part of metrics? */
30void dismissPortraitPhoneSidebars_Root (iWidget *); 31void dismissPortraitPhoneSidebars_Root (iRoot *);
31void showToolbars_Root (iWidget *, iBool show); 32void showToolbars_Root (iRoot *, iBool show);