Bump version numbers for 3.13
[maemo-rb.git] / apps / gui / statusbar.h
blob7ad07d0c789ebaf087c2757237e44855d7a3fe02
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Kevin Ferrare
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _GUI_STATUSBAR_H_
23 #define _GUI_STATUSBAR_H_
25 #include "config.h"
26 #include "status.h"
27 #include "screen_access.h"
28 #include "events.h"
30 #define STATUSBAR_X_POS 0
31 #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
32 #define STATUSBAR_HEIGHT 8
34 struct status_info {
35 int battlevel;
36 int batt_charge_step;
37 int volume;
38 int playmode;
39 int repeat;
40 #if CONFIG_CHARGING
41 bool inserted;
42 #endif
43 #ifdef HAVE_USB_POWER
44 bool usb_inserted;
45 #endif
46 bool battery_state;
47 bool shuffle;
48 bool keylock;
49 #ifdef HAS_REMOTE_BUTTON_HOLD
50 bool keylockremote;
51 #endif
52 #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
53 bool led; /* disk LED simulation in the status bar */
54 #endif
58 /* statusbar visibility/position, used for settings also */
59 enum statusbar_values { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
61 struct gui_statusbar
63 long battery_icon_switch_tick;
65 long volume_icon_switch_tick;
66 int last_volume;
67 bool redraw_volume; /* true if the volume gauge needs updating */
69 struct status_info info;
70 struct status_info lastinfo;
71 #if CONFIG_RTC
72 struct tm *time;
73 int last_tm_min;
74 #endif
75 struct screen * display;
79 extern struct gui_syncstatusbar statusbars;
82 * Attach the status bar to a screen
83 * (The previous screen attachement is lost)
84 * - bar : the statusbar structure
85 * - display : the screen to attach
87 #define gui_statusbar_set_screen(gui_statusbar, _display) \
88 (gui_statusbar)->display = (_display);
92 * Draws the status bar on the attached screen
93 * - bar : the statusbar structure
95 extern void gui_statusbar_draw(struct gui_statusbar * bar,
96 bool force_redraw, struct viewport *vp);
99 struct gui_syncstatusbar
101 struct gui_statusbar statusbars[NB_SCREENS];
104 extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) INIT_ATTR;
105 extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
106 bool force_redraw);
107 #if !defined(HAVE_REMOTE_LCD) || defined(__PCTOOL__)
108 #include "settings.h"
109 #define statusbar_position(a) ((enum statusbar_values)global_settings.statusbar)
110 #else
111 enum statusbar_values statusbar_position(int screen);
112 #endif
114 #endif /*_GUI_STATUSBAR_H_*/