Remove unneeded symbols and improve the comment to the VP parsing function
[kugel-rb/myfork.git] / apps / gui / viewport.h
blob16f52eb2921c96965d9ad5c864edf986c1b24d11
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 #include "config.h"
24 #include "lcd.h"
25 #include "system.h"
26 #include "screen_access.h"
28 /* return the number of text lines in the vp viewport */
29 int viewport_get_nb_lines(struct viewport *vp);
31 void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
33 /* Parse a viewport definition (vp_def), which looks like:
35 * Screens with depth > 1:
36 * X|Y|width|height|font|foregorund color|background color
37 * Screens with depth = 1:
38 * X|Y|width|height|font
40 * | is a separator and can be specified via the parameter
42 * Returns the pointer to the char after the last character parsed
43 * if everything went OK or NULL if an error happened (some values
44 * not specified in the definition)
46 #ifdef HAVE_LCD_BITMAP
47 const char* viewport_parse_viewport(struct viewport *vp,
48 enum screen_type screen,
49 const char *vp_def,
50 const char separator);
51 #endif
53 /* Used to specify which screens the statusbar (SB) should be displayed on.
55 * The parameter is a bit OR'ed combination of the following (screen is
56 * SCREEN_MAIN or SCREEN_REMOTE from screen_access.h):
58 * VP_SB_HIDE_ALL means "hide the SB on all screens"
59 * VP_SB_ONSCREEN(screen) means "display the SB on the given screen
60 * as specified by the SB setting for that screen"
61 * VP_SB_IGNORE_SETTING(screen) means "ignore the SB setting for that screen"
62 * VP_SB_ALLSCREENS means "VP_SB_ONSCREEN for all screens"
64 * In most cases, VP_SB_ALLSCREENS should be used which means display the SB
65 * as specified by the settings.
66 * For the WPS (and other possible exceptions) use VP_SB_IGNORE_SETTING() to
67 * FORCE the statusbar on for the given screen (i.e it will show regardless
68 * of the setting)
70 * Returns the status before the call. This value can be used to restore the
71 * SB "displaying rules".
73 #define VP_SB_HIDE_ALL 0
74 #define VP_SB_ONSCREEN(screen) BIT_N(screen)
75 #define VP_SB_IGNORE_SETTING(screen) BIT_N(4+screen)
76 #define VP_SB_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1))
77 int viewportmanager_set_statusbar(int enabled);
79 /* callbacks for GUI_EVENT_* events */
80 void viewportmanager_draw_statusbars(void*data);
81 void viewportmanager_statusbar_changed(void* data);