summaryrefslogtreecommitdiffstats
path: root/apps/screen_access.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-11-08 10:09:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-11-08 10:09:33 +0000
commitf19f3efb078b2947638f6f7a7f209de44daf78b3 (patch)
tree46ddfc7234b2de6e848d5bcd7630821d91a84f37 /apps/screen_access.c
parent452a3ce2742949e184d6bc9c9b1f7985dae3e874 (diff)
downloadrockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.tar.gz
rockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.tar.bz2
rockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.zip
Redo r30826 (and hopefully not reintroduce font issues) which cleans up the font API. FONT_UI is deprecated, use screens[screen].getuifont() instead (and .setuifont() to set it after a font has been loaded)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30932 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/screen_access.c')
-rw-r--r--apps/screen_access.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 01fdebe0db..f07b906fda 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -77,6 +77,24 @@ void screen_helper_setfont(int font)
#endif
}
+int screen_helper_getuifont(void)
+{
+#ifdef HAVE_LCD_BITMAP
+ return global_status.font_id[SCREEN_MAIN];
+#else
+ return FONT_SYSFIXED;
+#endif
+}
+
+void screen_helper_setuifont(int font)
+{
+#ifdef HAVE_LCD_BITMAP
+ global_status.font_id[SCREEN_MAIN] = font;
+#else
+ (void)font;
+#endif
+}
+
#if NB_SCREENS == 2
static int screen_helper_remote_getcharwidth(void)
{
@@ -116,6 +134,23 @@ void screen_helper_remote_setfont(int font)
font = global_status.font_id[SCREEN_REMOTE];
lcd_remote_setfont(font);
}
+
+int screen_helper_remote_getuifont(void)
+{
+#ifdef HAVE_LCD_BITMAP
+ return global_status.font_id[SCREEN_REMOTE];
+#else
+ return FONT_SYSFIXED;
+#endif
+}
+
+void screen_helper_remote_setuifont(int font)
+{
+#ifdef HAVE_LCD_BITMAP
+ global_status.font_id[SCREEN_REMOTE] = font;
+#endif
+}
+
#endif
struct screen screens[NB_SCREENS] =
@@ -147,7 +182,8 @@ struct screen screens[NB_SCREENS] =
.getstringsize=&lcd_getstringsize,
#ifdef HAVE_LCD_BITMAP
.setfont=screen_helper_setfont,
- .getfont=&lcd_getfont,
+ .getuifont=screen_helper_getuifont,
+ .setuifont=screen_helper_setuifont,
.mono_bitmap=&lcd_mono_bitmap,
.mono_bitmap_part=&lcd_mono_bitmap_part,
.set_drawmode=&lcd_set_drawmode,
@@ -246,8 +282,9 @@ struct screen screens[NB_SCREENS] =
.getheight=&lcd_remote_getheight,
.getstringsize=&lcd_remote_getstringsize,
#if 1 /* all remote LCDs are bitmapped so far */
- .setfont=screen_helper_setfont,
- .getfont=&lcd_remote_getfont,
+ .setfont=screen_helper_remote_setfont,
+ .getuifont=screen_helper_remote_getuifont,
+ .setuifont=screen_helper_remote_setuifont,
.mono_bitmap=&lcd_remote_mono_bitmap,
.mono_bitmap_part=&lcd_remote_mono_bitmap_part,
.bitmap=(screen_bitmap_func*)&lcd_remote_bitmap,