From acee675a5e67635e812a2d325a0f450d3409d53a Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 20 Dec 2013 23:34:28 +0100 Subject: [PATCH] lcd-charcell: Add set_drawmode() wrapper to multi-screen API. Change-Id: Idb6477aca8b19cb346ba2c2f5b91074e4679b0dd --- apps/screen_access.c | 13 +++++++++++-- apps/screen_access.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/screen_access.c b/apps/screen_access.c index dd8b16e3fd..7f44cf5305 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c @@ -91,6 +91,15 @@ static void screen_helper_setuifont(int font) } #endif +static void screen_helper_set_drawmode(int mode) +{ +#ifdef HAVE_LCD_BITMAP + lcd_set_drawmode(mode); +#else + (void) mode; +#endif +} + #if NB_SCREENS == 2 static int screen_helper_remote_getcharwidth(void) { @@ -172,6 +181,7 @@ struct screen screens[NB_SCREENS] = #elif defined(HAVE_REMOTE_LCD) .has_disk_led=true, #endif + .set_drawmode=&screen_helper_set_drawmode, .set_viewport=&lcd_set_viewport, .getwidth=&lcd_getwidth, .getheight=&lcd_getheight, @@ -182,7 +192,6 @@ struct screen screens[NB_SCREENS] = .setuifont=screen_helper_setuifont, .mono_bitmap=&lcd_mono_bitmap, .mono_bitmap_part=&lcd_mono_bitmap_part, - .set_drawmode=&lcd_set_drawmode, .bitmap=(screen_bitmap_func*)&lcd_bitmap, .bitmap_part=(screen_bitmap_part_func*)&lcd_bitmap_part, #if LCD_DEPTH <= 2 @@ -284,6 +293,7 @@ struct screen screens[NB_SCREENS] = .getcharwidth=screen_helper_remote_getcharwidth, .getcharheight=screen_helper_remote_getcharheight, .has_disk_led=false, + .set_drawmode=&lcd_remote_set_drawmode, .set_viewport=&lcd_remote_set_viewport, .getwidth=&lcd_remote_getwidth, .getheight=&lcd_remote_getheight, @@ -296,7 +306,6 @@ struct screen screens[NB_SCREENS] = .mono_bitmap_part=&lcd_remote_mono_bitmap_part, .bitmap=(screen_bitmap_func*)&lcd_remote_bitmap, .bitmap_part=(screen_bitmap_part_func*)&lcd_remote_bitmap_part, - .set_drawmode=&lcd_remote_set_drawmode, #if LCD_REMOTE_DEPTH <= 2 /* No transparency yet for grayscale and mono lcd */ .transparent_bitmap=(screen_bitmap_func*)&lcd_remote_bitmap, diff --git a/apps/screen_access.h b/apps/screen_access.h index d5bcd7e095..26c9977bf2 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h @@ -66,6 +66,7 @@ struct screen #ifdef HAVE_BUTTONBAR bool has_buttonbar; #endif + void (*set_drawmode)(int mode); void (*set_viewport)(struct viewport* vp); int (*getwidth)(void); int (*getheight)(void); @@ -101,7 +102,6 @@ struct screen void (*bmp)(const struct bitmap *bm, int x, int y); void (*bmp_part)(const struct bitmap* bm, int src_x, int src_y, int x, int y, int width, int height); - void (*set_drawmode)(int mode); #if defined(HAVE_LCD_COLOR) && defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1 unsigned (*color_to_native)(unsigned color); #endif