summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-05 20:22:02 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-05 20:22:02 +0000
commit58221fc38d6cc64d14ed6ac60642562baccb29c6 (patch)
tree3b53c4fa588488a29c9300eac62f9c322cc6a5e4 /firmware
parentbe25469b9b481d8f40aeb12aa6de84e1efdc0e68 (diff)
downloadrockbox-58221fc38d6cc64d14ed6ac60642562baccb29c6.tar.gz
rockbox-58221fc38d6cc64d14ed6ac60642562baccb29c6.zip
Implement RTL as a viewport's bit-field
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22968 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-bitmap-common.c11
-rw-r--r--firmware/export/lcd.h3
2 files changed, 4 insertions, 10 deletions
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 @@
27 * KIND, either express or implied. 27 * KIND, either express or implied.
28 * 28 *
29 ****************************************************************************/ 29 ****************************************************************************/
30#ifdef BOOTLOADER
31static int lang_is_rtl(void)
32{
33 return 0;
34}
35#else
36#include "language.h"
37#endif
38
39#ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ 30#ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */
40#define LCDFN(fn) lcd_ ## fn 31#define LCDFN(fn) lcd_ ## fn
41#define FBFN(fn) fb_ ## fn 32#define FBFN(fn) fb_ ## fn
@@ -186,7 +177,7 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
186 chars_in_str = utf8length((char *)str); 177 chars_in_str = utf8length((char *)str);
187 LCDFN(getstringsize)(str, &w, &h); 178 LCDFN(getstringsize)(str, &w, &h);
188 xpos = x * w / chars_in_str; 179 xpos = x * w / chars_in_str;
189 if (lang_is_rtl()) 180 if (current_vp->flags & VP_IS_RTL)
190 xpos = current_vp->width - w - xpos; 181 xpos = current_vp->width - w - xpos;
191 ypos = y * h; 182 ypos = y * h;
192 LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); 183 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 @@
26#include "cpu.h" 26#include "cpu.h"
27#include "config.h" 27#include "config.h"
28 28
29#define VP_IS_RTL 0x01
30
29struct viewport { 31struct viewport {
30 int x; 32 int x;
31 int y; 33 int y;
32 int width; 34 int width;
33 int height; 35 int height;
34#ifdef HAVE_LCD_BITMAP 36#ifdef HAVE_LCD_BITMAP
37 int flags;
35 int font; 38 int font;
36 int drawmode; 39 int drawmode;
37#endif 40#endif