Replace limiter with dynamic range compressor
[kugel-rb.git] / apps / gui / viewport.h
blob9cabc0046896f07a7365d56dd379b56e712a69e9
2 /***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
11 * Copyright (C) 2008 by Jonathan Gordon
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
23 #ifndef __VIEWPORT_H__
24 #define __VIEWPORT_H__
27 #include "config.h"
28 #include "lcd.h"
29 #include "system.h"
30 #include "screen_access.h"
32 /* return the number of text lines in the vp viewport */
33 int viewport_get_nb_lines(struct viewport *vp);
35 void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
37 /* Used to specify which screens the statusbar (SB) should be displayed on.
39 * The parameter is a bit OR'ed combination of the following (screen is
40 * SCREEN_MAIN or SCREEN_REMOTE from screen_access.h):
42 * VP_SB_HIDE_ALL means "hide the SB on all screens"
43 * VP_SB_ONSCREEN(screen) means "display the SB on the given screen
44 * as specified by the SB setting for that screen"
45 * VP_SB_IGNORE_SETTING(screen) means "ignore the SB setting for that screen"
46 * VP_SB_ALLSCREENS means "VP_SB_ONSCREEN for all screens"
48 * In most cases, VP_SB_ALLSCREENS should be used which means display the SB
49 * as specified by the settings.
50 * For the WPS (and other possible exceptions) use VP_SB_IGNORE_SETTING() to
51 * FORCE the statusbar on for the given screen (i.e it will show regardless
52 * of the setting)
54 * Returns the status before the call. This value can be used to restore the
55 * SB "displaying rules".
59 #define THEME_STATUSBAR (BIT_N(0))
60 #define THEME_UI_VIEWPORT (BIT_N(1))
61 #define THEME_BUTTONBAR (BIT_N(2))
62 #define THEME_ALL (~(0u))
64 #define VP_SB_HIDE_ALL 0
65 #define VP_SB_ONSCREEN(screen) BIT_N(screen)
66 #define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
67 #define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
69 #ifndef __PCTOOL__
71 * Initialize the viewportmanager, which in turns initializes the UI vp and
72 * statusbar stuff
74 void viewportmanager_init(void);
75 int viewportmanager_get_statusbar(void);
76 int viewportmanager_set_statusbar(int enabled);
78 /* call this when a theme changed */
79 void viewportmanager_theme_changed(int);
82 * Initializes the given viewport with maximum dimensions minus status- and
83 * buttonbar
85 void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen);
87 #ifdef HAVE_LCD_BITMAP
90 * Returns a pointer to the current viewport
91 * - That could be the UI vp, or a viewport passed to do_menu() or the like
93 struct viewport* viewport_get_current_vp(void);
96 * Set the UI vp pointer to a different one - NULL to reset to the UI vp
98 * This is needed since the UI viewport needs is kept in RAM.
100 void viewport_set_current_vp(struct viewport* vp);
103 * returns true if the ui viewport is active on the screen
105 bool viewport_ui_vp_get_state(enum screen_type screen);
106 #ifdef HAVE_TOUCHSCREEN
107 bool viewport_point_within_vp(const struct viewport *vp, int x, int y);
108 #endif
110 #else /* HAVE_LCD_CHARCELL */
111 #define viewport_set_current_vp(a)
112 #define viewport_get_current_vp() NULL
113 #endif
115 #endif /* __PCTOOL__ */
117 #ifdef HAVE_LCD_BITMAP
120 * Parse a viewport definition (vp_def), which looks like:
122 * Screens with depth > 1:
123 * X|Y|width|height|font|foregorund color|background color
124 * Screens with depth = 1:
125 * X|Y|width|height|font
127 * | is a separator and can be specified via the parameter
129 * Returns the pointer to the char after the last character parsed
130 * if everything went OK or NULL if an error happened (some values
131 * not specified in the definition)
133 const char* viewport_parse_viewport(struct viewport *vp,
134 enum screen_type screen,
135 const char *vp_def,
136 const char separator);
137 #endif /* HAVE_LCD_BITMAP */
138 #endif /* __VIEWPORT_H__ */