summaryrefslogtreecommitdiff
path: root/apps/gui/viewport.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/viewport.h')
-rw-r--r--apps/gui/viewport.h82
1 files changed, 59 insertions, 23 deletions
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index 6c3fb92998..2ed138b365 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -34,26 +34,6 @@ int viewport_get_nb_lines(struct viewport *vp);
34 34
35void viewport_set_defaults(struct viewport *vp, enum screen_type screen); 35void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
36 36
37/* Parse a viewport definition (vp_def), which looks like:
38 *
39 * Screens with depth > 1:
40 * X|Y|width|height|font|foregorund color|background color
41 * Screens with depth = 1:
42 * X|Y|width|height|font
43 *
44 * | is a separator and can be specified via the parameter
45 *
46 * Returns the pointer to the char after the last character parsed
47 * if everything went OK or NULL if an error happened (some values
48 * not specified in the definition)
49 */
50#ifdef HAVE_LCD_BITMAP
51const char* viewport_parse_viewport(struct viewport *vp,
52 enum screen_type screen,
53 const char *vp_def,
54 const char separator);
55#endif
56
57/* Used to specify which screens the statusbar (SB) should be displayed on. 37/* Used to specify which screens the statusbar (SB) should be displayed on.
58 * 38 *
59 * The parameter is a bit OR'ed combination of the following (screen is 39 * The parameter is a bit OR'ed combination of the following (screen is
@@ -74,14 +54,70 @@ const char* viewport_parse_viewport(struct viewport *vp,
74 * Returns the status before the call. This value can be used to restore the 54 * Returns the status before the call. This value can be used to restore the
75 * SB "displaying rules". 55 * SB "displaying rules".
76 */ 56 */
57
58
59#define THEME_STATUSBAR (BIT_N(0))
60#define THEME_UI_VIEWPORT (BIT_N(1))
61#define THEME_ALL (~(0u))
62
77#define VP_SB_HIDE_ALL 0 63#define VP_SB_HIDE_ALL 0
78#define VP_SB_ONSCREEN(screen) BIT_N(screen) 64#define VP_SB_ONSCREEN(screen) BIT_N(screen)
79#define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen) 65#define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
80#define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1)) 66#define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
67
68/*
69 * Initialize the viewportmanager, which in turns initializes the UI vp and
70 * statusbar stuff
71 */
72void viewportmanager_init(void);
73int viewportmanager_get_statusbar(void);
81int viewportmanager_set_statusbar(int enabled); 74int viewportmanager_set_statusbar(int enabled);
82 75
83/* callbacks for GUI_EVENT_* events */ 76/* call this when a theme changed */
84void viewportmanager_draw_statusbars(void*data); 77void viewportmanager_theme_changed(int);
85void viewportmanager_statusbar_changed(void* data); 78
79/*
80 * Initializes the given viewport with maximum dimensions minus status- and
81 * buttonbar
82 */
83void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen);
86 84
85#ifdef HAVE_LCD_BITMAP
86
87/*
88 * Parse a viewport definition (vp_def), which looks like:
89 *
90 * Screens with depth > 1:
91 * X|Y|width|height|font|foregorund color|background color
92 * Screens with depth = 1:
93 * X|Y|width|height|font
94 *
95 * | is a separator and can be specified via the parameter
96 *
97 * Returns the pointer to the char after the last character parsed
98 * if everything went OK or NULL if an error happened (some values
99 * not specified in the definition)
100 */
101const char* viewport_parse_viewport(struct viewport *vp,
102 enum screen_type screen,
103 const char *vp_def,
104 const char separator);
105
106/*
107 * Returns a pointer to the current viewport
108 * - That could be the UI vp, or a viewport passed to do_menu() or the like
109 */
110struct viewport* viewport_get_current_vp(void);
111
112/*
113 * Set the UI vp pointer to a different one - NULL to reset to the UI vp
114 *
115 * This is needed since the UI viewport needs is kept in RAM.
116 */
117void viewport_set_current_vp(struct viewport* vp);
118
119#else /* HAVE_LCD_CHARCELL */
120#define viewport_set_current_vp(a)
121#define viewport_get_current_vp() NULL
122#endif
87#endif /* __VIEWPORT_H__ */ 123#endif /* __VIEWPORT_H__ */