RTL support in menus

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22945 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-05 11:43:38 +00:00
parent f06c98fec8
commit 6d80565b1b
11 changed files with 127 additions and 19 deletions

View file

@ -27,6 +27,7 @@
* KIND, either express or implied.
*
****************************************************************************/
#include "language.h"
#ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */
#define LCDFN(fn) lcd_ ## fn
@ -170,11 +171,16 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
int style, int offset)
{
int xpos, ypos, w, h;
unsigned long chars_in_str;
LCDFN(scroll_stop_line)(current_vp, y);
if(!str || !str[0])
return;
chars_in_str = utf8length((char *)str);
LCDFN(getstringsize)(str, &w, &h);
xpos = x * w / utf8length((char *)str);
xpos = x * w / chars_in_str;
if (lang_is_rtl())
xpos = current_vp->width - w - xpos;
ypos = y * h;
LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset);
}