summaryrefslogtreecommitdiff
path: root/src/ui/root.h
blob: 039e67ad137c2247ef825d8707ecb5ce33b123ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "widget.h"
#include "color.h"
#include <the_Foundation/ptrset.h>
#include <the_Foundation/vec2.h>

iDeclareType(Root)
    
struct Impl_Root {
    iWidget *  widget;
    iPtrArray *onTop; /* order is important; last one is topmost */
    iPtrSet *  pendingDestruction;
    int        loadAnimTimer;
    iColor     tmPalette[tmMax_ColorId]; /* theme-specific palette */
};

iDeclareTypeConstruction(Root)

/*----------------------------------------------------------------------------------------------*/

void        createUserInterface_Root            (iRoot *);

void        setCurrent_Root                     (iRoot *);
iRoot *     current_Root                        (void);
iRoot *     get_Root                            (void); /* assert != NULL */
iAnyObject *findWidget_Root                     (const char *id); /* under current Root */

iPtrArray * onTop_Root                          (iRoot *);
void        destroyPending_Root                 (iRoot *);
    
void        updateMetrics_Root                  (iRoot *);
void        updatePadding_Root                  (iRoot *); /* TODO: is part of metrics? */
void        dismissPortraitPhoneSidebars_Root   (iRoot *);
void        showToolbars_Root                   (iRoot *, iBool show);

iInt2       size_Root                           (const iRoot *);
iRect       rect_Root                           (const iRoot *);
iRect       safeRect_Root                       (const iRoot *);
iInt2       visibleSize_Root                    (const iRoot *); /* may be obstructed by software keyboard */
iBool       isNarrow_Root                       (const iRoot *);