From 5652b2528d59b77e804f72d4f7c9854275e05b5a Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Thu, 7 Dec 2006 17:23:52 +0000 Subject: Always use a black backgound while displaying images in jpegviewer, and use the usual foreground/background colors and backdrop in the jpegviewer menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11684 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 4 +++- apps/plugin.h | 6 ++++-- apps/plugins/jpeg.c | 26 ++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/plugin.c b/apps/plugin.c index b129493471..9739df4661 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -450,7 +450,9 @@ static const struct plugin_api rockbox_api = { wheel_status, wheel_send_events, #endif - +#if LCD_DEPTH > 1 + lcd_get_backdrop, +#endif /* new stuff at the end, sort into place next time the API gets incompatible */ diff --git a/apps/plugin.h b/apps/plugin.h index 68841e8698..5b5215f9e9 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -110,7 +110,7 @@ #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 38 +#define PLUGIN_API_VERSION 39 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any @@ -564,7 +564,9 @@ struct plugin_api { int (*wheel_status)(void); void (*wheel_send_events)(bool send); #endif - +#if LCD_DEPTH > 1 + fb_data* (*lcd_get_backdrop)(void); +#endif /* new stuff at the end, sort into place next time the API gets incompatible */ diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index 878c94408e..f36bdd1bb3 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -183,6 +183,9 @@ static int running_slideshow = false; /* loading image because of slideshw */ static int immediate_ata_off = false; /* power down disk after loading */ #endif static int button_timeout = HZ*5; +#if LCD_DEPTH > 1 +fb_data* old_backdrop; +#endif /**************** begin JPEG code ********************/ @@ -2103,6 +2106,16 @@ void cleanup(void *parameter) int show_menu(void) /* return 1 to quit */ { +#if LCD_DEPTH > 1 + rb->lcd_set_backdrop(old_backdrop); +#ifdef HAVE_LCD_COLOR + rb->lcd_set_foreground(rb->global_settings->fg_color); + rb->lcd_set_background(rb->global_settings->bg_color); +#else + rb->lcd_set_foreground(LCD_BLACK); + rb->lcd_set_background(LCD_WHITE); +#endif +#endif int m; int result; static const struct menu_item items[] = { @@ -2191,7 +2204,11 @@ int show_menu(void) /* return 1 to quit */ } } #endif - +#if LCD_DEPTH > 1 + rb->lcd_set_backdrop(NULL); + rb->lcd_set_foreground(LCD_WHITE); + rb->lcd_set_background(LCD_BLACK); +#endif rb->lcd_clear_display(); rb->menu_exit(m); return 0; @@ -2352,6 +2369,7 @@ int scroll_bmp(struct t_disp* pdisp) #endif if (show_menu() == 1) return PLUGIN_OK; + #ifdef USEGSLIB gray_show(true); /* switch on grayscale overlay */ #else @@ -2676,9 +2694,10 @@ int load_and_show(char* filename) if(!running_slideshow) { -#ifdef HAVE_LCD_COLOR +#if LCD_DEPTH > 1 rb->lcd_set_foreground(LCD_WHITE); rb->lcd_set_background(LCD_BLACK); + rb->lcd_set_backdrop(NULL); #endif rb->lcd_clear_display(); @@ -2838,6 +2857,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) int grayscales; long graysize; /* helper */ #endif +#if LCD_DEPTH > 1 + old_backdrop = rb->lcd_get_backdrop(); +#endif if(!parameter) return PLUGIN_ERROR; -- cgit v1.2.3