From 170209cf926e2f714d507fefaa6b30fd245811ad Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 27 Apr 2021 11:40:50 +0300 Subject: Refactor: Moving RootData so it can become non-global state --- src/ui/root.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/ui/root.h') 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 @@ #pragma once #include "widget.h" +#include + +iDeclareType(RootData) + +/* TODO: Rename to Root, include `iWidget *root` as well. */ +struct Impl_RootData { + iWidget * hover; + iWidget * mouseGrab; + iWidget * focus; + iPtrArray *onTop; /* order is important; last one is topmost */ + iPtrSet * pendingDestruction; +}; + +/*----------------------------------------------------------------------------------------------*/ iWidget * createUserInterface_Root (void); -void setCurrent_Root (iWidget *root); +void setCurrent_Root (iWidget *root, iRootData *rootData); iWidget * get_Root (void); +iRootData * data_Root (void); +iPtrArray * onTop_RootData (void); +void destroyPending_RootData (iRootData *); + void updateMetrics_Root (iWidget *); void updatePadding_Root (iWidget *); /* TODO: is part of metrics? */ void dismissPortraitPhoneSidebars_Root (iWidget *); -- cgit v1.2.3