diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2005-11-22 03:38:07 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2005-11-22 03:38:07 +0000 |
commit | 74b6af93b1436dc61e8f10b3aff3c79face5faba (patch) | |
tree | f5d17c6b0adb9f6cc448a112b309a6dff7451a76 /apps/gui/quickscreen.h | |
parent | 8042640ce967014f10dbc0e3f382cd1876310b66 (diff) | |
download | rockbox-74b6af93b1436dc61e8f10b3aff3c79face5faba.tar.gz rockbox-74b6af93b1436dc61e8f10b3aff3c79face5faba.zip |
Added multi-screen support for quickscreen (mostly rewritten from scratch) and USB screen ; just looking at the hour makes me think it could be buggy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8039 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/quickscreen.h')
-rw-r--r-- | apps/gui/quickscreen.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/apps/gui/quickscreen.h b/apps/gui/quickscreen.h new file mode 100644 index 0000000000..09a0390d93 --- /dev/null +++ b/apps/gui/quickscreen.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Kevin Ferrare | ||
11 | * | ||
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. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "button.h" | ||
20 | #include "config.h" | ||
21 | #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ | ||
22 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
23 | |||
24 | #ifndef _GUI_QUICKSCREEN_H_ | ||
25 | #define _GUI_QUICKSCREEN_H_ | ||
26 | |||
27 | #define HAS_QUICKSCREEN | ||
28 | |||
29 | #include "option_select.h" | ||
30 | #include "screen_access.h" | ||
31 | |||
32 | #define QUICKSCREEN_LEFT BUTTON_LEFT | ||
33 | #define QUICKSCREEN_BOTTOM BUTTON_DOWN | ||
34 | #define QUICKSCREEN_BOTTOM_INV BUTTON_UP | ||
35 | #define QUICKSCREEN_RIGHT BUTTON_RIGHT | ||
36 | |||
37 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
38 | #define QUICKSCREEN_QUIT BUTTON_F2 | ||
39 | #define QUICKSCREEN_QUIT2 BUTTON_F3 | ||
40 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
41 | #define QUICKSCREEN_QUIT BUTTON_MODE | ||
42 | #define QUICKSCREEN_QUIT2 BUTTON_OFF | ||
43 | #define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE | ||
44 | #ifdef CONFIG_REMOTE_KEYPAD | ||
45 | #define QUICKSCREEN_RC_LEFT BUTTON_RC_REW | ||
46 | #define QUICKSCREEN_RC_BOTTOM BUTTON_RC_VOL_DOWN | ||
47 | #define QUICKSCREEN_RC_BOTTOM_INV BUTTON_RC_VOL_UP | ||
48 | #define QUICKSCREEN_RC_RIGHT BUTTON_RC_FF | ||
49 | #endif | ||
50 | |||
51 | #endif | ||
52 | |||
53 | struct gui_quickscreen; | ||
54 | /* | ||
55 | * Callback function called each time the quickscreen gets modified | ||
56 | * - qs : the quickscreen that did the modification | ||
57 | */ | ||
58 | typedef void (quickscreen_callback)(struct gui_quickscreen * qs); | ||
59 | |||
60 | struct gui_quickscreen | ||
61 | { | ||
62 | struct option_select *left_option; | ||
63 | struct option_select *bottom_option; | ||
64 | struct option_select *right_option; | ||
65 | char * left_right_title; | ||
66 | quickscreen_callback *callback; | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * Initializes a quickscreen | ||
71 | * - qs : the quickscreen | ||
72 | * - left_option, bottom_option, right_option : a list of choices | ||
73 | * for each option | ||
74 | * - left_right_title : the 2nd line of the title | ||
75 | * on the left and on the right | ||
76 | * - callback : a callback function called each time the quickscreen | ||
77 | * gets modified | ||
78 | */ | ||
79 | void gui_quickscreen_init(struct gui_quickscreen * qs, | ||
80 | struct option_select *left_option, | ||
81 | struct option_select *bottom_option, | ||
82 | struct option_select *right_option, | ||
83 | char * left_right_title, | ||
84 | quickscreen_callback *callback); | ||
85 | /* | ||
86 | * Draws the quickscreen on a given screen | ||
87 | * - qs : the quickscreen | ||
88 | * - display : the screen to draw on | ||
89 | */ | ||
90 | void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display); | ||
91 | |||
92 | /* | ||
93 | * Does the actions associated to the given button if any | ||
94 | * - qs : the quickscreen | ||
95 | * - button : the key we are going to analyse | ||
96 | * returns : true if the button corresponded to an action, false otherwise | ||
97 | */ | ||
98 | bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button); | ||
99 | |||
100 | /* | ||
101 | * Draws the quickscreen on all available screens | ||
102 | * - qs : the quickscreen | ||
103 | */ | ||
104 | void gui_syncquickscreen_draw(struct gui_quickscreen * qs); | ||
105 | |||
106 | /* | ||
107 | * Runs the quickscreen on all available screens | ||
108 | * - qs : the quickscreen | ||
109 | * returns : true if usb was connected, false otherwise | ||
110 | */ | ||
111 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs); | ||
112 | |||
113 | #endif /*_GUI_QUICK_SCREEN_H_*/ | ||
114 | #endif /* CONFIG_KEYPAD */ | ||