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/select.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/select.h')
-rw-r--r-- | apps/gui/select.h | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/apps/gui/select.h b/apps/gui/select.h index bc14af4a24..2799d80043 100644 --- a/apps/gui/select.h +++ b/apps/gui/select.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define _GUI_SELECT_H_ | 21 | #define _GUI_SELECT_H_ |
22 | #include "screen_access.h" | 22 | #include "screen_access.h" |
23 | #include "settings.h" | 23 | #include "settings.h" |
24 | #include "option_select.h" | ||
24 | 25 | ||
25 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 26 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ |
26 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | 27 | (CONFIG_KEYPAD == IRIVER_H300_PAD) |
@@ -83,19 +84,7 @@ struct gui_select | |||
83 | { | 84 | { |
84 | bool canceled; | 85 | bool canceled; |
85 | bool validated; | 86 | bool validated; |
86 | const char * title; | 87 | struct option_select options; |
87 | int min_value; | ||
88 | int max_value; | ||
89 | int step; | ||
90 | int option; | ||
91 | const char * extra_string; | ||
92 | /* In the case the option is a number */ | ||
93 | void (*formatter)(char* dest, | ||
94 | int dest_length, | ||
95 | int variable, | ||
96 | const char* unit); | ||
97 | const struct opt_items * items; | ||
98 | bool limit_loop; | ||
99 | }; | 88 | }; |
100 | 89 | ||
101 | /* | 90 | /* |
@@ -116,10 +105,7 @@ extern void gui_select_init_numeric(struct gui_select * select, | |||
116 | int max_value, | 105 | int max_value, |
117 | int step, | 106 | int step, |
118 | const char * unit, | 107 | const char * unit, |
119 | void (*formatter)(char* dest, | 108 | option_formatter *formatter); |
120 | int dest_length, | ||
121 | int variable, | ||
122 | const char* unit)); | ||
123 | 109 | ||
124 | 110 | ||
125 | /* | 111 | /* |
@@ -140,13 +126,15 @@ extern void gui_select_init_items(struct gui_select * select, | |||
140 | * Selects the next value | 126 | * Selects the next value |
141 | * - select : the select struct | 127 | * - select : the select struct |
142 | */ | 128 | */ |
143 | extern void gui_select_next(struct gui_select * select); | 129 | #define gui_select_next(select) \ |
130 | option_select_next(&(select->options)) | ||
144 | 131 | ||
145 | /* | 132 | /* |
146 | * Selects the previous value | 133 | * Selects the previous value |
147 | * - select : the select struct | 134 | * - select : the select struct |
148 | */ | 135 | */ |
149 | extern void gui_select_prev(struct gui_select * select); | 136 | #define gui_select_prev(select) \ |
137 | option_select_prev(&(select->options)) | ||
150 | 138 | ||
151 | /* | 139 | /* |
152 | * Draws the select on the given screen | 140 | * Draws the select on the given screen |
@@ -159,9 +147,8 @@ extern void gui_select_draw(struct gui_select * select, struct screen * display) | |||
159 | * Returns the selected value | 147 | * Returns the selected value |
160 | * - select : the select struct | 148 | * - select : the select struct |
161 | */ | 149 | */ |
162 | #define gui_select_get_selected(select) \ | 150 | #define gui_select_get_selected(_sel_) \ |
163 | (select)->option | 151 | option_select_get_selected(&((_sel_)->options)) |
164 | |||
165 | /* | 152 | /* |
166 | * Cancels the select | 153 | * Cancels the select |
167 | * - select : the select struct | 154 | * - select : the select struct |
@@ -199,7 +186,7 @@ extern void gui_select_draw(struct gui_select * select, struct screen * display) | |||
199 | * - false : continues to go to max/min when reaching min/max | 186 | * - false : continues to go to max/min when reaching min/max |
200 | */ | 187 | */ |
201 | #define gui_select_limit_loop(select, loop) \ | 188 | #define gui_select_limit_loop(select, loop) \ |
202 | (select)->limit_loop=loop | 189 | option_select_limit_loop(&((select)->options), loop) |
203 | 190 | ||
204 | /* | 191 | /* |
205 | * Draws the select on all the screens | 192 | * Draws the select on all the screens |