From 3646c313679c4bd16c9eec98c2e35c7a7bf5c961 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Tue, 8 Jan 2008 01:22:14 +0000 Subject: Add the viewport functions to the screens API, including a new getfont() function to return the font used by the current viewport. A change to the screens API makes the plugin API incompatible, so we bump version and sort. Also commit the test_viewports plugin (not built by default). This is some more of FS#8385. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16022 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-16bit.c | 5 +++++ firmware/drivers/lcd-1bit-vert.c | 5 +++++ firmware/drivers/lcd-2bit-horz.c | 5 +++++ firmware/drivers/lcd-2bit-vert.c | 5 +++++ firmware/drivers/lcd-remote-1bit-v.c | 5 +++++ firmware/drivers/lcd-remote-2bit-vi.c | 5 +++++ firmware/export/lcd-remote.h | 1 + firmware/export/lcd.h | 1 + 8 files changed, 32 insertions(+) (limited to 'firmware') diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index cc5a6c5ab7..2a766d4006 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c @@ -190,6 +190,11 @@ void lcd_setfont(int newfont) current_vp->font = newfont; } +int lcd_getfont(void) +{ + return current_vp->font; +} + int lcd_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index 5c651a9613..7c9cd26e2a 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c @@ -122,6 +122,11 @@ void lcd_setfont(int newfont) current_vp->font = newfont; } +int lcd_getfont(void) +{ + return current_vp->font; +} + int lcd_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c index 1ee0addba4..195885c072 100644 --- a/firmware/drivers/lcd-2bit-horz.c +++ b/firmware/drivers/lcd-2bit-horz.c @@ -172,6 +172,11 @@ void lcd_setfont(int newfont) current_vp->font = newfont; } +int lcd_getfont(void) +{ + return current_vp->font; +} + int lcd_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c index 2341ddb3df..cb532b7aaf 100644 --- a/firmware/drivers/lcd-2bit-vert.c +++ b/firmware/drivers/lcd-2bit-vert.c @@ -175,6 +175,11 @@ void lcd_setfont(int newfont) current_vp->font = newfont; } +int lcd_getfont(void) +{ + return current_vp->font; +} + int lcd_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/drivers/lcd-remote-1bit-v.c b/firmware/drivers/lcd-remote-1bit-v.c index a33648b76a..20c6f6655c 100644 --- a/firmware/drivers/lcd-remote-1bit-v.c +++ b/firmware/drivers/lcd-remote-1bit-v.c @@ -117,6 +117,11 @@ void lcd_remote_setfont(int newfont) current_vp->font = newfont; } +int lcd_remote_getfont(void) +{ + return current_vp->font; +} + int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/drivers/lcd-remote-2bit-vi.c b/firmware/drivers/lcd-remote-2bit-vi.c index 9ab98c69aa..9f70e95195 100644 --- a/firmware/drivers/lcd-remote-2bit-vi.c +++ b/firmware/drivers/lcd-remote-2bit-vi.c @@ -174,6 +174,11 @@ void lcd_remote_setfont(int newfont) current_vp->font = newfont; } +int lcd_remote_getfont(void) +{ + return current_vp->font; +} + int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h) { return font_getstringsize(str, w, h, current_vp->font); diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 34c40e52c1..cdd48e5fa3 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -149,6 +149,7 @@ extern int lcd_remote_getymargin(void); extern int lcd_remote_getwidth(void); extern int lcd_remote_getheight(void); extern void lcd_remote_setfont(int font); +extern int lcd_remote_getfont(void); extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); /* low level drawing function pointer arrays */ diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 276dcdfedc..57c9b1d3b8 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -372,6 +372,7 @@ extern void lcd_set_flip(bool yesno); extern void lcd_set_drawmode(int mode); extern int lcd_get_drawmode(void); extern void lcd_setfont(int font); +extern int lcd_getfont(void); extern void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); -- cgit v1.2.3