diff options
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index f860e27bf9..3a613d0a67 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "icon.h" | 26 | #include "icon.h" |
27 | #include "screen_access.h" | 27 | #include "screen_access.h" |
28 | #include "skin_engine/skin_engine.h" | 28 | #include "skin_engine/skin_engine.h" |
29 | #include "line.h" | ||
29 | 30 | ||
30 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width | 31 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width |
31 | 32 | ||
@@ -85,6 +86,26 @@ typedef int list_speak_item(int selected_item, void * data); | |||
85 | * selected item, negative value for default coloring. | 86 | * selected item, negative value for default coloring. |
86 | */ | 87 | */ |
87 | typedef int list_get_color(int selected_item, void * data); | 88 | typedef int list_get_color(int selected_item, void * data); |
89 | |||
90 | struct list_selection_color | ||
91 | { | ||
92 | /* text color, in native lcd format | ||
93 | * (convert with LCD_RGBPACK() if necessary) */ | ||
94 | unsigned text_color; | ||
95 | /* only STYLE_GRADIENT supported set line_color & line_end_color the same | ||
96 | * for solid color, in native | ||
97 | * lcd format (convert with LCD_RGBPACK() if necessary) */ | ||
98 | unsigned line_color; | ||
99 | unsigned line_end_color; | ||
100 | /* viewport foreground and background, in native | ||
101 | * lcd format (convert with LCD_RGBPACK() if necessary) */ | ||
102 | unsigned fg_color; | ||
103 | unsigned bg_color; | ||
104 | /* To enable: | ||
105 | * call gui_synclist_set_sel_color(gui_synclist*, list_selection_color*) | ||
106 | * If using the default viewport you should call | ||
107 | * gui_synclist_set_sel_color(gui_synclist*, NULL) when finished */ | ||
108 | }; | ||
88 | #endif | 109 | #endif |
89 | 110 | ||
90 | struct gui_synclist | 111 | struct gui_synclist |
@@ -120,6 +141,7 @@ struct gui_synclist | |||
120 | #ifdef HAVE_LCD_COLOR | 141 | #ifdef HAVE_LCD_COLOR |
121 | int title_color; | 142 | int title_color; |
122 | list_get_color *callback_get_item_color; | 143 | list_get_color *callback_get_item_color; |
144 | struct list_selection_color *selection_color; | ||
123 | #endif | 145 | #endif |
124 | struct viewport *parent[NB_SCREENS]; | 146 | struct viewport *parent[NB_SCREENS]; |
125 | }; | 147 | }; |
@@ -146,6 +168,7 @@ extern void gui_synclist_set_voice_callback(struct gui_synclist * lists, list_sp | |||
146 | extern void gui_synclist_set_viewport_defaults(struct viewport *vp, enum screen_type screen); | 168 | extern void gui_synclist_set_viewport_defaults(struct viewport *vp, enum screen_type screen); |
147 | #ifdef HAVE_LCD_COLOR | 169 | #ifdef HAVE_LCD_COLOR |
148 | extern void gui_synclist_set_color_callback(struct gui_synclist * lists, list_get_color color_callback); | 170 | extern void gui_synclist_set_color_callback(struct gui_synclist * lists, list_get_color color_callback); |
171 | extern void gui_synclist_set_sel_color(struct gui_synclist * lists, struct list_selection_color *list_sel_color); | ||
149 | #endif | 172 | #endif |
150 | extern void gui_synclist_speak_item(struct gui_synclist * lists); | 173 | extern void gui_synclist_speak_item(struct gui_synclist * lists); |
151 | extern int gui_synclist_get_nb_items(struct gui_synclist * lists); | 174 | extern int gui_synclist_get_nb_items(struct gui_synclist * lists); |
@@ -232,6 +255,8 @@ struct simplelist_info { | |||
232 | int selection_size; /* list selection size, usually 1 */ | 255 | int selection_size; /* list selection size, usually 1 */ |
233 | bool hide_selection; | 256 | bool hide_selection; |
234 | bool scroll_all; | 257 | bool scroll_all; |
258 | bool hide_theme; | ||
259 | bool speak_onshow; /* list speaks first item or 'empty list' */ | ||
235 | int timeout; | 260 | int timeout; |
236 | int selection; /* the item to select when the list is first displayed */ | 261 | int selection; /* the item to select when the list is first displayed */ |
237 | /* when the list is exited, this will be set to the | 262 | /* when the list is exited, this will be set to the |
@@ -248,6 +273,7 @@ struct simplelist_info { | |||
248 | list_speak_item *get_talk; /* can be NULL to not speak */ | 273 | list_speak_item *get_talk; /* can be NULL to not speak */ |
249 | #ifdef HAVE_LCD_COLOR | 274 | #ifdef HAVE_LCD_COLOR |
250 | list_get_color *get_color; | 275 | list_get_color *get_color; |
276 | struct list_selection_color *selection_color; | ||
251 | #endif | 277 | #endif |
252 | void *callback_data; /* data for callbacks */ | 278 | void *callback_data; /* data for callbacks */ |
253 | }; | 279 | }; |
@@ -275,12 +301,15 @@ void simplelist_addline(const char *fmt, ...); | |||
275 | info.selection_size = 1; | 301 | info.selection_size = 1; |
276 | info.hide_selection = false; | 302 | info.hide_selection = false; |
277 | info.scroll_all = false; | 303 | info.scroll_all = false; |
304 | info.hide_theme = false; | ||
305 | info.speak_onshow = true; | ||
278 | info.action_callback = NULL; | 306 | info.action_callback = NULL; |
279 | info.title_icon = Icon_NOICON; | 307 | info.title_icon = Icon_NOICON; |
280 | info.get_icon = NULL; | 308 | info.get_icon = NULL; |
281 | info.get_name = NULL; | 309 | info.get_name = NULL; |
282 | info.get_voice = NULL; | 310 | info.get_voice = NULL; |
283 | info.get_color = NULL; | 311 | info.get_color = NULL; |
312 | info.list_selection_color = NULL; | ||
284 | info.timeout = HZ/10; | 313 | info.timeout = HZ/10; |
285 | info.selection = 0; | 314 | info.selection = 0; |
286 | */ | 315 | */ |