more green seen as everyone has a green fetish atm
[Rockbox.git] / apps / gui / statusbar.h
blob88626205960f3762ba45637c4e1d1d2426e6b4f4
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Kevin Ferrare
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _GUI_STATUSBAR_H_
21 #define _GUI_STATUSBAR_H_
23 #include "status.h"
24 #include "screen_access.h"
26 #define STATUSBAR_X_POS 0
27 #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
28 #define STATUSBAR_HEIGHT 8
30 struct status_info {
31 int battlevel;
32 int batt_charge_step;
33 int volume;
34 int playmode;
35 int repeat;
36 #if CONFIG_CHARGING
37 bool inserted;
38 #endif
39 #ifdef HAVE_USB_POWER
40 bool usb_inserted;
41 #endif
42 bool battery_state;
43 bool shuffle;
44 bool keylock;
45 #ifdef HAS_REMOTE_BUTTON_HOLD
46 bool keylockremote;
47 #endif
48 #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
49 bool led; /* disk LED simulation in the status bar */
50 #endif
54 struct gui_statusbar
56 long battery_icon_switch_tick;
58 long volume_icon_switch_tick;
59 int last_volume;
60 bool redraw_volume; /* true if the volume gauge needs updating */
62 struct status_info info;
63 struct status_info lastinfo;
64 #if CONFIG_RTC
65 struct tm *time;
66 int last_tm_min;
67 #endif
68 struct screen * display;
72 extern struct gui_syncstatusbar statusbars;
75 * Attach the status bar to a screen
76 * (The previous screen attachement is lost)
77 * - bar : the statusbar structure
78 * - display : the screen to attach
80 #define gui_statusbar_set_screen(gui_statusbar, _display) \
81 (gui_statusbar)->display = (_display);
85 * Draws the status bar on the attached screen
86 * - bar : the statusbar structure
88 extern void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw);
91 struct gui_syncstatusbar
93 struct gui_statusbar statusbars[NB_SCREENS];
96 extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars);
97 extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw);
99 #endif /*_GUI_STATUSBAR_H_*/