forked from len0rd/rockbox
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
This commit is contained in:
parent
3183aeabac
commit
5652b2528d
3 changed files with 31 additions and 5 deletions
|
@ -450,7 +450,9 @@ static const struct plugin_api rockbox_api = {
|
||||||
wheel_status,
|
wheel_status,
|
||||||
wheel_send_events,
|
wheel_send_events,
|
||||||
#endif
|
#endif
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
|
lcd_get_backdrop,
|
||||||
|
#endif
|
||||||
/* new stuff at the end, sort into place next time
|
/* new stuff at the end, sort into place next time
|
||||||
the API gets incompatible */
|
the API gets incompatible */
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||||
|
|
||||||
/* increase this every time the api struct changes */
|
/* 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
|
/* update this to latest version if a change to the api struct breaks
|
||||||
backwards compatibility (and please take the opportunity to sort in any
|
backwards compatibility (and please take the opportunity to sort in any
|
||||||
|
@ -564,7 +564,9 @@ struct plugin_api {
|
||||||
int (*wheel_status)(void);
|
int (*wheel_status)(void);
|
||||||
void (*wheel_send_events)(bool send);
|
void (*wheel_send_events)(bool send);
|
||||||
#endif
|
#endif
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
|
fb_data* (*lcd_get_backdrop)(void);
|
||||||
|
#endif
|
||||||
/* new stuff at the end, sort into place next time
|
/* new stuff at the end, sort into place next time
|
||||||
the API gets incompatible */
|
the API gets incompatible */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
static int immediate_ata_off = false; /* power down disk after loading */
|
||||||
#endif
|
#endif
|
||||||
static int button_timeout = HZ*5;
|
static int button_timeout = HZ*5;
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
|
fb_data* old_backdrop;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**************** begin JPEG code ********************/
|
/**************** begin JPEG code ********************/
|
||||||
|
|
||||||
|
@ -2103,6 +2106,16 @@ void cleanup(void *parameter)
|
||||||
|
|
||||||
int show_menu(void) /* return 1 to quit */
|
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 m;
|
||||||
int result;
|
int result;
|
||||||
static const struct menu_item items[] = {
|
static const struct menu_item items[] = {
|
||||||
|
@ -2191,7 +2204,11 @@ int show_menu(void) /* return 1 to quit */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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->lcd_clear_display();
|
||||||
rb->menu_exit(m);
|
rb->menu_exit(m);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2352,6 +2369,7 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
#endif
|
#endif
|
||||||
if (show_menu() == 1)
|
if (show_menu() == 1)
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
|
|
||||||
#ifdef USEGSLIB
|
#ifdef USEGSLIB
|
||||||
gray_show(true); /* switch on grayscale overlay */
|
gray_show(true); /* switch on grayscale overlay */
|
||||||
#else
|
#else
|
||||||
|
@ -2676,9 +2694,10 @@ int load_and_show(char* filename)
|
||||||
|
|
||||||
if(!running_slideshow)
|
if(!running_slideshow)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LCD_COLOR
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_foreground(LCD_WHITE);
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
rb->lcd_set_background(LCD_BLACK);
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
|
@ -2838,6 +2857,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
int grayscales;
|
int grayscales;
|
||||||
long graysize; /* helper */
|
long graysize; /* helper */
|
||||||
#endif
|
#endif
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
|
old_backdrop = rb->lcd_get_backdrop();
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!parameter) return PLUGIN_ERROR;
|
if(!parameter) return PLUGIN_ERROR;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue