From 58221fc38d6cc64d14ed6ac60642562baccb29c6 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Mon, 5 Oct 2009 20:22:02 +0000 Subject: Implement RTL as a viewport's bit-field git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22968 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-bitmap-common.c | 11 +---------- firmware/export/lcd.h | 3 +++ 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 1e2765f34f..0dafe092fc 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -27,15 +27,6 @@ * KIND, either express or implied. * ****************************************************************************/ -#ifdef BOOTLOADER -static int lang_is_rtl(void) -{ - return 0; -} -#else -#include "language.h" -#endif - #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ #define LCDFN(fn) lcd_ ## fn #define FBFN(fn) fb_ ## fn @@ -186,7 +177,7 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str, chars_in_str = utf8length((char *)str); LCDFN(getstringsize)(str, &w, &h); xpos = x * w / chars_in_str; - if (lang_is_rtl()) + if (current_vp->flags & VP_IS_RTL) xpos = current_vp->width - w - xpos; ypos = y * h; LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index a8253db656..ddfba2a8ac 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -26,12 +26,15 @@ #include "cpu.h" #include "config.h" +#define VP_IS_RTL 0x01 + struct viewport { int x; int y; int width; int height; #ifdef HAVE_LCD_BITMAP + int flags; int font; int drawmode; #endif -- cgit v1.2.3