summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h6
-rw-r--r--apps/plugins/jpeg.c26
3 files changed, 31 insertions, 5 deletions
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 = {
450 wheel_status, 450 wheel_status,
451 wheel_send_events, 451 wheel_send_events,
452#endif 452#endif
453 453#if LCD_DEPTH > 1
454 lcd_get_backdrop,
455#endif
454 /* new stuff at the end, sort into place next time 456 /* new stuff at the end, sort into place next time
455 the API gets incompatible */ 457 the API gets incompatible */
456 458
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 @@
110#define PLUGIN_MAGIC 0x526F634B /* RocK */ 110#define PLUGIN_MAGIC 0x526F634B /* RocK */
111 111
112/* increase this every time the api struct changes */ 112/* increase this every time the api struct changes */
113#define PLUGIN_API_VERSION 38 113#define PLUGIN_API_VERSION 39
114 114
115/* update this to latest version if a change to the api struct breaks 115/* update this to latest version if a change to the api struct breaks
116 backwards compatibility (and please take the opportunity to sort in any 116 backwards compatibility (and please take the opportunity to sort in any
@@ -564,7 +564,9 @@ struct plugin_api {
564 int (*wheel_status)(void); 564 int (*wheel_status)(void);
565 void (*wheel_send_events)(bool send); 565 void (*wheel_send_events)(bool send);
566#endif 566#endif
567 567#if LCD_DEPTH > 1
568 fb_data* (*lcd_get_backdrop)(void);
569#endif
568 /* new stuff at the end, sort into place next time 570 /* new stuff at the end, sort into place next time
569 the API gets incompatible */ 571 the API gets incompatible */
570 572
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 */
183static int immediate_ata_off = false; /* power down disk after loading */ 183static int immediate_ata_off = false; /* power down disk after loading */
184#endif 184#endif
185static int button_timeout = HZ*5; 185static int button_timeout = HZ*5;
186#if LCD_DEPTH > 1
187fb_data* old_backdrop;
188#endif
186 189
187/**************** begin JPEG code ********************/ 190/**************** begin JPEG code ********************/
188 191
@@ -2103,6 +2106,16 @@ void cleanup(void *parameter)
2103 2106
2104int show_menu(void) /* return 1 to quit */ 2107int show_menu(void) /* return 1 to quit */
2105{ 2108{
2109#if LCD_DEPTH > 1
2110 rb->lcd_set_backdrop(old_backdrop);
2111#ifdef HAVE_LCD_COLOR
2112 rb->lcd_set_foreground(rb->global_settings->fg_color);
2113 rb->lcd_set_background(rb->global_settings->bg_color);
2114#else
2115 rb->lcd_set_foreground(LCD_BLACK);
2116 rb->lcd_set_background(LCD_WHITE);
2117#endif
2118#endif
2106 int m; 2119 int m;
2107 int result; 2120 int result;
2108 static const struct menu_item items[] = { 2121 static const struct menu_item items[] = {
@@ -2191,7 +2204,11 @@ int show_menu(void) /* return 1 to quit */
2191 } 2204 }
2192 } 2205 }
2193#endif 2206#endif
2194 2207#if LCD_DEPTH > 1
2208 rb->lcd_set_backdrop(NULL);
2209 rb->lcd_set_foreground(LCD_WHITE);
2210 rb->lcd_set_background(LCD_BLACK);
2211#endif
2195 rb->lcd_clear_display(); 2212 rb->lcd_clear_display();
2196 rb->menu_exit(m); 2213 rb->menu_exit(m);
2197 return 0; 2214 return 0;
@@ -2352,6 +2369,7 @@ int scroll_bmp(struct t_disp* pdisp)
2352#endif 2369#endif
2353 if (show_menu() == 1) 2370 if (show_menu() == 1)
2354 return PLUGIN_OK; 2371 return PLUGIN_OK;
2372
2355#ifdef USEGSLIB 2373#ifdef USEGSLIB
2356 gray_show(true); /* switch on grayscale overlay */ 2374 gray_show(true); /* switch on grayscale overlay */
2357#else 2375#else
@@ -2676,9 +2694,10 @@ int load_and_show(char* filename)
2676 2694
2677 if(!running_slideshow) 2695 if(!running_slideshow)
2678 { 2696 {
2679#ifdef HAVE_LCD_COLOR 2697#if LCD_DEPTH > 1
2680 rb->lcd_set_foreground(LCD_WHITE); 2698 rb->lcd_set_foreground(LCD_WHITE);
2681 rb->lcd_set_background(LCD_BLACK); 2699 rb->lcd_set_background(LCD_BLACK);
2700 rb->lcd_set_backdrop(NULL);
2682#endif 2701#endif
2683 2702
2684 rb->lcd_clear_display(); 2703 rb->lcd_clear_display();
@@ -2838,6 +2857,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2838 int grayscales; 2857 int grayscales;
2839 long graysize; /* helper */ 2858 long graysize; /* helper */
2840#endif 2859#endif
2860#if LCD_DEPTH > 1
2861 old_backdrop = rb->lcd_get_backdrop();
2862#endif
2841 2863
2842 if(!parameter) return PLUGIN_ERROR; 2864 if(!parameter) return PLUGIN_ERROR;
2843 2865