From 4764ee04c9c6432ad3cada25a8e87be056815815 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 6 Aug 2009 00:14:40 +0000 Subject: Add backdrop functions to the multiscreen api and add a enum backdrop_type parameter for different backdrops (main, wps), symplifying calls and removing dozens of #ifdefs (stubs added for non-backdrop displays that can't do backdrops). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22176 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/backdrop.h | 59 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 12 deletions(-) (limited to 'apps/gui/backdrop.h') diff --git a/apps/gui/backdrop.h b/apps/gui/backdrop.h index dc9805f07b..f3ef1d7686 100644 --- a/apps/gui/backdrop.h +++ b/apps/gui/backdrop.h @@ -22,27 +22,62 @@ #ifndef _BACKDROP_H #define _BACKDROP_H +enum backdrop_type { + BACKDROP_MAIN, + BACKDROP_SKIN_WPS, +}; + #if LCD_DEPTH > 1 #include "lcd.h" #include "bmp.h" -bool load_main_backdrop(const char* filename); -bool load_wps_backdrop(const char* filename); +bool backdrop_load(enum backdrop_type bdrop, const char*); +void backdrop_unload(enum backdrop_type bdrop); +void backdrop_show(enum backdrop_type bdrop); + +#else /* LCD_DEPTH > 1 */ + +static inline +bool backdrop_load(enum backdrop_type bdrop, const char* filename) +{ + (void)filename; (void)bdrop; return true; +} -void unload_main_backdrop(void); -void unload_wps_backdrop(void); +static inline void backdrop_unload(enum backdrop_type bdrop) +{ + (void)bdrop; +} +static inline void backdrop_show(enum backdrop_type bdrop) +{ + (void)bdrop; +} -void show_main_backdrop(void); -void show_wps_backdrop(void); +#endif + +#if defined(HAVE_REMOTE_LCD) +/* no main backdrop, stubs! */ +#if LCD_REMOTE_DEPTH > 1 +bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename); +void remote_backdropunload(enum backdrop_type bdrop); +void remote_backdrop_show(enum backdrop_type bdrop); +#else +static inline +bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename) +{ + (void)filename; (void)bdrop; return true; +} -#endif /* LCD_DEPTH > 1 */ +static inline void remote_backdrop_unload(enum backdrop_type bdrop) +{ + (void)bdrop; +} -#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 -bool load_remote_wps_backdrop(const char* filename); -void unload_remote_wps_backdrop(void); -void show_remote_wps_backdrop(void); -void show_remote_main_backdrop(void); /* only clears the wps backdrop */ +static inline void remote_backdrop_show(enum backdrop_type bdrop) +{ + (void)bdrop; +} +#endif #endif #endif /* _BACKDROP_H */ -- cgit v1.2.3