summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-01-26 20:14:42 +0000
committerThomas Martitz <kugel@rockbox.org>2010-01-26 20:14:42 +0000
commit5629d551d710bd57a1cef129ce5a69b76cbbdd12 (patch)
tree1196849b9a02ebf39fa5d6c33df1db9334aeead2 /apps
parent7a73a9cd4e882ebbc37831160ec18d0f251f14bd (diff)
downloadrockbox-5629d551d710bd57a1cef129ce5a69b76cbbdd12.tar.gz
rockbox-5629d551d710bd57a1cef129ce5a69b76cbbdd12.zip
Accept the last patch FS#10797 with a few changes by me (fixing side effects and adding the new backdrop_hide() to the multi screen api). It changes the hide_bars parameter to mean hide_theme.
This makes plugins show the menu backdrop in their backdrop so that they don't look like crap if you have an sbs and look more integrated. I've test about all plugins and all work fine. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24335 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/backdrop.c13
-rw-r--r--apps/gui/backdrop.h4
-rw-r--r--apps/gui/viewport.c6
-rw-r--r--apps/gui/wps.c3
-rw-r--r--apps/menu.c14
-rw-r--r--apps/menu.h2
-rw-r--r--apps/plugin.h2
-rw-r--r--apps/plugins/pictureflow/pictureflow.c15
-rw-r--r--apps/screen_access.c2
-rw-r--r--apps/screen_access.h1
10 files changed, 45 insertions, 17 deletions
diff --git a/apps/gui/backdrop.c b/apps/gui/backdrop.c
index c220d06493..7e56dcb7db 100644
--- a/apps/gui/backdrop.c
+++ b/apps/gui/backdrop.c
@@ -124,6 +124,12 @@ void backdrop_show(enum backdrop_type bdrop)
124 show_skin_backdrop(); 124 show_skin_backdrop();
125} 125}
126 126
127void backdrop_hide(void)
128{
129 lcd_set_backdrop(NULL);
130}
131
132
127 133
128#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 134#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
129 135
@@ -201,4 +207,11 @@ void remote_backdrop_unload(enum backdrop_type bdrop)
201} 207}
202 208
203 209
210void remote_backdrop_hide(void)
211{
212 lcd_remote_set_backdrop(NULL);
213}
214
204#endif 215#endif
216
217
diff --git a/apps/gui/backdrop.h b/apps/gui/backdrop.h
index b37071b5d4..4083464cee 100644
--- a/apps/gui/backdrop.h
+++ b/apps/gui/backdrop.h
@@ -35,6 +35,7 @@ enum backdrop_type {
35bool backdrop_load(enum backdrop_type bdrop, const char*); 35bool backdrop_load(enum backdrop_type bdrop, const char*);
36void backdrop_unload(enum backdrop_type bdrop); 36void backdrop_unload(enum backdrop_type bdrop);
37void backdrop_show(enum backdrop_type bdrop); 37void backdrop_show(enum backdrop_type bdrop);
38void backdrop_hide(void);
38 39
39#else /* LCD_DEPTH <= 1 || __PCTOOL__ */ 40#else /* LCD_DEPTH <= 1 || __PCTOOL__ */
40 41
@@ -52,6 +53,7 @@ static inline void backdrop_show(enum backdrop_type bdrop)
52 (void)bdrop; 53 (void)bdrop;
53} 54}
54 55
56static inline void backdrop_hide(void) {}
55#endif 57#endif
56 58
57#if defined(HAVE_REMOTE_LCD) 59#if defined(HAVE_REMOTE_LCD)
@@ -60,6 +62,7 @@ static inline void backdrop_show(enum backdrop_type bdrop)
60bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename); 62bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename);
61void remote_backdrop_unload(enum backdrop_type bdrop); 63void remote_backdrop_unload(enum backdrop_type bdrop);
62void remote_backdrop_show(enum backdrop_type bdrop); 64void remote_backdrop_show(enum backdrop_type bdrop);
65void remote_backdrop_hide(void);
63#else 66#else
64static inline 67static inline
65bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename) 68bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename)
@@ -76,6 +79,7 @@ static inline void remote_backdrop_show(enum backdrop_type bdrop)
76{ 79{
77 (void)bdrop; 80 (void)bdrop;
78} 81}
82static inline void remote_backdrop_hide(void) {}
79#endif 83#endif
80#endif 84#endif
81 85
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 22eccc161f..3c5249cff9 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -89,6 +89,8 @@ static void toggle_theme(enum screen_type screen, bool force)
89 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, 89 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false,
90 do_sbs_update_callback); 90 do_sbs_update_callback);
91 91
92 screens[screen].backdrop_show(BACKDROP_MAIN);
93
92 /* remove the left overs from the previous screen. 94 /* remove the left overs from the previous screen.
93 * could cause a tiny flicker. Redo your screen code if that happens */ 95 * could cause a tiny flicker. Redo your screen code if that happens */
94 if (!was_enabled[screen] || force) 96 if (!was_enabled[screen] || force)
@@ -142,7 +144,11 @@ static void toggle_theme(enum screen_type screen, bool force)
142 else 144 else
143 { 145 {
144 FOR_NB_SCREENS(i) 146 FOR_NB_SCREENS(i)
147 {
148 screens[i].backdrop_hide();
145 screens[i].stop_scroll(); 149 screens[i].stop_scroll();
150 }
151
146#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 152#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
147 remove_event(LCD_EVENT_ACTIVATION, do_sbs_update_callback); 153 remove_event(LCD_EVENT_ACTIVATION, do_sbs_update_callback);
148#endif 154#endif
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 14fb848ebe..a5394981ae 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -611,6 +611,7 @@ static void gwps_enter_wps(void)
611 vp->bg_pattern = display->get_background(); 611 vp->bg_pattern = display->get_background();
612 } 612 }
613#endif 613#endif
614 display->backdrop_show(BACKDROP_SKIN_WPS);
614 skin_update(gwps, WPS_REFRESH_ALL); 615 skin_update(gwps, WPS_REFRESH_ALL);
615 } 616 }
616} 617}
@@ -1180,8 +1181,6 @@ long gui_wps_show(void)
1180 /* we remove the update delay since it's not very usable in the wps, 1181 /* we remove the update delay since it's not very usable in the wps,
1181 * e.g. during volume changing or ffwd/rewind */ 1182 * e.g. during volume changing or ffwd/rewind */
1182 sb_skin_set_update_delay(0); 1183 sb_skin_set_update_delay(0);
1183 FOR_NB_SCREENS(i)
1184 gui_wps[i].display->backdrop_show(BACKDROP_SKIN_WPS);
1185 wps_sync_data.do_full_update = update = false; 1184 wps_sync_data.do_full_update = update = false;
1186 gwps_enter_wps(); 1185 gwps_enter_wps();
1187 } 1186 }
diff --git a/apps/menu.c b/apps/menu.c
index 88f0f3c529..eb29b43f3b 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -335,7 +335,7 @@ void do_setting_from_menu(const struct menu_item_ex *temp,
335 335
336/* display a menu */ 336/* display a menu */
337int do_menu(const struct menu_item_ex *start_menu, int *start_selected, 337int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
338 struct viewport parent[NB_SCREENS], bool hide_bars) 338 struct viewport parent[NB_SCREENS], bool hide_theme)
339{ 339{
340 int selected = start_selected? *start_selected : 0; 340 int selected = start_selected? *start_selected : 0;
341 int action; 341 int action;
@@ -344,7 +344,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
344 int ret = 0, i; 344 int ret = 0, i;
345 bool redraw_lists; 345 bool redraw_lists;
346 FOR_NB_SCREENS(i) 346 FOR_NB_SCREENS(i)
347 viewportmanager_theme_enable(i, !hide_bars, NULL); 347 viewportmanager_theme_enable(i, !hide_theme, NULL);
348 348
349 const struct menu_item_ex *menu_stack[MAX_MENUS]; 349 const struct menu_item_ex *menu_stack[MAX_MENUS];
350 int menu_stack_selected_item[MAX_MENUS]; 350 int menu_stack_selected_item[MAX_MENUS];
@@ -363,7 +363,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
363 menu = &main_menu_; 363 menu = &main_menu_;
364 else menu = start_menu; 364 else menu = start_menu;
365 365
366 /* if hide_bars is true, assume parent has been fixed before passed into 366 /* if hide_theme is true, assume parent has been fixed before passed into
367 * this function, e.g. with viewport_set_defaults(parent, screen) */ 367 * this function, e.g. with viewport_set_defaults(parent, screen) */
368 init_menu_lists(menu, &lists, selected, true, parent); 368 init_menu_lists(menu, &lists, selected, true, parent);
369 vps = *(lists.parent); 369 vps = *(lists.parent);
@@ -373,7 +373,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
373 373
374 374
375#ifdef HAVE_BUTTONBAR 375#ifdef HAVE_BUTTONBAR
376 if (!hide_bars) 376 if (!hide_theme)
377 { 377 {
378 gui_buttonbar_set(&buttonbar, "<<<", "", ""); 378 gui_buttonbar_set(&buttonbar, "<<<", "", "");
379 gui_buttonbar_draw(&buttonbar); 379 gui_buttonbar_draw(&buttonbar);
@@ -382,7 +382,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
382 while (!done) 382 while (!done)
383 { 383 {
384 redraw_lists = false; 384 redraw_lists = false;
385 if (!hide_bars) 385 if (!hide_theme)
386 { 386 {
387#ifdef HAVE_BUTTONBAR 387#ifdef HAVE_BUTTONBAR
388 gui_buttonbar_draw(&buttonbar); 388 gui_buttonbar_draw(&buttonbar);
@@ -551,7 +551,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
551 screens[i].scroll_stop(&vps[i]); 551 screens[i].scroll_stop(&vps[i]);
552 } 552 }
553#ifdef HAVE_BUTTONBAR 553#ifdef HAVE_BUTTONBAR
554 if (!hide_bars) 554 if (!hide_theme)
555 { 555 {
556 gui_buttonbar_unset(&buttonbar); 556 gui_buttonbar_unset(&buttonbar);
557 gui_buttonbar_draw(&buttonbar); 557 gui_buttonbar_draw(&buttonbar);
@@ -653,7 +653,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
653 break; 653 break;
654 } 654 }
655#ifdef HAVE_BUTTONBAR 655#ifdef HAVE_BUTTONBAR
656 if (!hide_bars) 656 if (!hide_theme)
657 { 657 {
658 gui_buttonbar_set(&buttonbar, "<<<", "", ""); 658 gui_buttonbar_set(&buttonbar, "<<<", "", "");
659 gui_buttonbar_draw(&buttonbar); 659 gui_buttonbar_draw(&buttonbar);
diff --git a/apps/menu.h b/apps/menu.h
index b386b7ce4b..b5bab90981 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -121,7 +121,7 @@ void do_setting_from_menu(const struct menu_item_ex *temp,
121 If NULL it is ignored and the firs item starts selected 121 If NULL it is ignored and the firs item starts selected
122*/ 122*/
123int do_menu(const struct menu_item_ex *menu, int *start_selected, 123int do_menu(const struct menu_item_ex *menu, int *start_selected,
124 struct viewport parent[NB_SCREENS], bool hide_bars); 124 struct viewport parent[NB_SCREENS], bool hide_theme);
125 125
126/* In all the following macros the argument names are as follows: 126/* In all the following macros the argument names are as follows:
127 - name: The name for the variable (so it can be used in a MAKE_MENU() 127 - name: The name for the variable (so it can be used in a MAKE_MENU()
diff --git a/apps/plugin.h b/apps/plugin.h
index cf16eef94f..a7a6203e53 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -659,7 +659,7 @@ struct plugin_api {
659 659
660 /* menu */ 660 /* menu */
661 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected, 661 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected,
662 struct viewport parent[NB_SCREENS], bool hide_bars); 662 struct viewport parent[NB_SCREENS], bool hide_theme);
663 663
664 /* scroll bar */ 664 /* scroll bar */
665 struct gui_syncstatusbar *statusbars; 665 struct gui_syncstatusbar *statusbars;
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index eab1d0a00a..b3f81444bb 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -2019,6 +2019,7 @@ void update_scroll_animation(void)
2019void cleanup(void *parameter) 2019void cleanup(void *parameter)
2020{ 2020{
2021 (void) parameter; 2021 (void) parameter;
2022 int i;
2022#ifdef HAVE_ADJUSTABLE_CPU_FREQ 2023#ifdef HAVE_ADJUSTABLE_CPU_FREQ
2023 rb->cpu_boost(false); 2024 rb->cpu_boost(false);
2024#endif 2025#endif
@@ -2029,6 +2030,8 @@ void cleanup(void *parameter)
2029#ifdef USEGSLIB 2030#ifdef USEGSLIB
2030 grey_release(); 2031 grey_release();
2031#endif 2032#endif
2033 FOR_NB_SCREENS(i)
2034 rb->viewportmanager_theme_undo(i, false);
2032} 2035}
2033 2036
2034/** 2037/**
@@ -2076,7 +2079,7 @@ int settings_menu(void)
2076 }; 2079 };
2077 2080
2078 do { 2081 do {
2079 selection=rb->do_menu(&settings_menu,&selection, NULL, false); 2082 selection=rb->do_menu(&settings_menu,&selection, NULL, true);
2080 switch(selection) { 2083 switch(selection) {
2081 case 0: 2084 case 0:
2082 rb->set_bool("Show FPS", &show_fps); 2085 rb->set_bool("Show FPS", &show_fps);
@@ -2168,7 +2171,7 @@ int main_menu(void)
2168#endif 2171#endif
2169 "Settings", "Return", "Quit"); 2172 "Settings", "Return", "Quit");
2170 while (1) { 2173 while (1) {
2171 switch (rb->do_menu(&main_menu,&selection, NULL, false)) { 2174 switch (rb->do_menu(&main_menu,&selection, NULL, true)) {
2172 case PF_GOTO_WPS: /* WPS */ 2175 case PF_GOTO_WPS: /* WPS */
2173 return -2; 2176 return -2;
2174#if PF_PLAYBACK_CAPABLE 2177#if PF_PLAYBACK_CAPABLE
@@ -2732,11 +2735,11 @@ int main(void)
2732 2735
2733enum plugin_status plugin_start(const void *parameter) 2736enum plugin_status plugin_start(const void *parameter)
2734{ 2737{
2735 int ret; 2738 int ret, i;
2736 (void) parameter; 2739 (void) parameter;
2737#if LCD_DEPTH > 1 2740
2738 rb->lcd_set_backdrop(NULL); 2741 FOR_NB_SCREENS(i)
2739#endif 2742 rb->viewportmanager_theme_enable(i, false, NULL);
2740 /* Turn off backlight timeout */ 2743 /* Turn off backlight timeout */
2741 backlight_force_on(); /* backlight control in lib/helper.c */ 2744 backlight_force_on(); /* backlight control in lib/helper.c */
2742#ifdef HAVE_ADJUSTABLE_CPU_FREQ 2745#ifdef HAVE_ADJUSTABLE_CPU_FREQ
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 19ab77654e..8267ce3ecd 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -202,6 +202,7 @@ struct screen screens[NB_SCREENS] =
202 .backdrop_load=&backdrop_load, 202 .backdrop_load=&backdrop_load,
203 .backdrop_unload=&backdrop_unload, 203 .backdrop_unload=&backdrop_unload,
204 .backdrop_show=&backdrop_show, 204 .backdrop_show=&backdrop_show,
205 .backdrop_hide=&backdrop_hide,
205#ifdef HAVE_BUTTONBAR 206#ifdef HAVE_BUTTONBAR
206 .has_buttonbar=false, 207 .has_buttonbar=false,
207#endif 208#endif
@@ -288,6 +289,7 @@ struct screen screens[NB_SCREENS] =
288 .backdrop_load=&remote_backdrop_load, 289 .backdrop_load=&remote_backdrop_load,
289 .backdrop_unload=&remote_backdrop_unload, 290 .backdrop_unload=&remote_backdrop_unload,
290 .backdrop_show=&remote_backdrop_show, 291 .backdrop_show=&remote_backdrop_show,
292 .backdrop_hide=&remote_backdrop_hide,
291#ifdef HAVE_BUTTONBAR 293#ifdef HAVE_BUTTONBAR
292 .has_buttonbar=false, 294 .has_buttonbar=false,
293#endif 295#endif
diff --git a/apps/screen_access.h b/apps/screen_access.h
index be6247886e..396a0d0e88 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -150,6 +150,7 @@ struct screen
150 bool (*backdrop_load)(enum backdrop_type bdrop, const char* filename); 150 bool (*backdrop_load)(enum backdrop_type bdrop, const char* filename);
151 void (*backdrop_unload)(enum backdrop_type bdrop); 151 void (*backdrop_unload)(enum backdrop_type bdrop);
152 void (*backdrop_show)(enum backdrop_type bdrop); 152 void (*backdrop_show)(enum backdrop_type bdrop);
153 void (*backdrop_hide)(void);
153}; 154};
154 155
155#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) 156#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)