From d9e5b67b71cf246c11da8a9083af21752ac7bd15 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 2 Feb 2006 20:42:56 +0000 Subject: Patch #1421422 - Backdrop image patch started by Linus, finished by me. Adds ability to set backdrop images for file browser and menus (store full-screen bitmaps in /.rockbox/backdrops/) and also the ability to set a full-screen background image in a WPS using the %X|filename.bmp| WPS tag. Currently only implemented for targets with colour LCDs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8536 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'apps/gui/gwps.c') diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index d7d436c089..00d7aaa507 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -52,7 +52,7 @@ #include "onplay.h" #include "abrepeat.h" #include "playback.h" - +#include "backdrop.h" #include "splash.h" #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" @@ -62,6 +62,11 @@ struct wps_state wps_state; struct gui_wps gui_wps[NB_SCREENS]; static struct wps_data wps_datas[NB_SCREENS]; +#ifdef HAVE_LCD_COLOR +bool wps_has_backdrop; +fb_data* old_backdrop; +#endif + bool keys_locked = false; /* change the path to the current played track */ @@ -102,6 +107,12 @@ long gui_wps_show(void) { gui_wps_set_margin(&gui_wps[i]); } +#if HAVE_LCD_COLOR + old_backdrop = lcd_get_backdrop(); + if (wps_has_backdrop) { + lcd_set_backdrop(&wps_backdrop[0][0]); + } +#endif #endif #ifdef AB_REPEAT_ENABLE @@ -224,8 +235,15 @@ long gui_wps_show(void) case WPS_CONTEXT: #ifdef WPS_RC_CONTEXT case WPS_RC_CONTEXT: +#endif +#ifdef HAVE_LCD_COLOR + lcd_set_backdrop(old_backdrop); #endif onplay(wps_state.id3->path, TREE_ATTR_MPA, CONTEXT_WPS); +#ifdef HAVE_LCD_COLOR + if (wps_has_backdrop) + lcd_set_backdrop(&wps_backdrop[0][0]); +#endif #ifdef HAVE_LCD_BITMAP FOR_NB_SCREENS(i) { @@ -510,8 +528,15 @@ long gui_wps_show(void) FOR_NB_SCREENS(i) gui_wps[i].display->stop_scroll(); +#ifdef HAVE_LCD_COLOR + lcd_set_backdrop(old_backdrop); +#endif if (main_menu()) return true; +#ifdef HAVE_LCD_COLOR + if (wps_has_backdrop) + lcd_set_backdrop(&wps_backdrop[0][0]); +#endif #ifdef HAVE_LCD_BITMAP FOR_NB_SCREENS(i) { @@ -539,9 +564,16 @@ long gui_wps_show(void) case WPS_QUICK: #ifdef WPS_RC_QUICK case WPS_RC_QUICK: +#endif +#ifdef HAVE_LCD_COLOR + lcd_set_backdrop(old_backdrop); #endif if (quick_screen_quick(button)) return SYS_USB_CONNECTED; +#ifdef HAVE_LCD_COLOR + if (wps_has_backdrop) + lcd_set_backdrop(&wps_backdrop[0][0]); +#endif #ifdef HAVE_LCD_BITMAP FOR_NB_SCREENS(i) { @@ -566,8 +598,15 @@ long gui_wps_show(void) || CONFIG_KEYPAD == IRIVER_H300_PAD case BUTTON_ON | BUTTON_UP: case BUTTON_ON | BUTTON_DOWN: +#ifdef HAVE_LCD_COLOR + lcd_set_backdrop(old_backdrop); +#endif if (2 == pitch_screen()) return SYS_USB_CONNECTED; +#ifdef HAVE_LCD_COLOR + if (wps_has_backdrop) + lcd_set_backdrop(&wps_backdrop[0][0]); +#endif restore = true; break; #endif @@ -981,4 +1020,7 @@ void gui_sync_wps_init(void) gui_wps_set_data(&gui_wps[i], &wps_datas[i]); gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); } +#ifdef HAVE_LCD_COLOR + wps_has_backdrop = false; +#endif } -- cgit v1.2.3