RTL: Cosmetic changes, no functional change - Rename constants

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23117 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-11 20:15:22 +00:00
parent 891c446302
commit d5b076b64a
9 changed files with 14 additions and 21 deletions

View file

@ -177,7 +177,7 @@ static void draw_screen(struct screen *display, char *title,
/* Draw title string */ /* Draw title string */
set_drawinfo(display, DRMODE_SOLID, text_color, background_color); set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
vp.flags |= VP_FLAG_CENTER_ALIGN; vp.flags |= VP_FLAG_ALIGN_CENTER;
display->getstringsize(title, NULL, &y); display->getstringsize(title, NULL, &y);
display->putsxy(0, MARGIN_TOP, title); display->putsxy(0, MARGIN_TOP, title);
@ -257,7 +257,7 @@ static void draw_screen(struct screen *display, char *title,
display->putsxy(text_x, text_top, buf); display->putsxy(text_x, text_top, buf);
/* Draw color value */ /* Draw color value */
snprintf(buf, 3, "%02d", rgb->rgb_val[i]); snprintf(buf, 3, "%02d", rgb->rgb_val[i]);
vp.flags |= VP_FLAG_IS_RTL; vp.flags |= VP_FLAG_ALIGN_RIGHT;
display->putsxy(text_x, text_top, buf); display->putsxy(text_x, text_top, buf);
/* Draw scrollbar */ /* Draw scrollbar */
@ -278,7 +278,7 @@ static void draw_screen(struct screen *display, char *title,
/* Format RGB: #rrggbb */ /* Format RGB: #rrggbb */
snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE), snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE),
rgb->red, rgb->green, rgb->blue); rgb->red, rgb->green, rgb->blue);
vp.flags |= VP_FLAG_CENTER_ALIGN; vp.flags |= VP_FLAG_ALIGN_CENTER;
if (display->depth >= 16) if (display->depth >= 16)
{ {
/* Display color swatch on color screens only */ /* Display color swatch on color screens only */

View file

@ -706,7 +706,7 @@ static int parse_viewport(const char *wps_bufptr,
if (!(ptr = viewport_parse_viewport(vp, screen, ptr, '|'))) if (!(ptr = viewport_parse_viewport(vp, screen, ptr, '|')))
return WPS_ERROR_INVALID_PARAM; return WPS_ERROR_INVALID_PARAM;
vp->flags &= ~VP_FLAG_IS_RTL; /* ignore rright-to-left languages */ vp->flags &= ~VP_FLAG_ALIGN_RIGHT; /* ignore right-to-left languages */
/* Check for trailing | */ /* Check for trailing | */
if (*ptr != '|') if (*ptr != '|')
return WPS_ERROR_INVALID_PARAM; return WPS_ERROR_INVALID_PARAM;

View file

@ -147,7 +147,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
if (vp.height > screen->lcdheight) if (vp.height > screen->lcdheight)
vp.height = screen->lcdheight; vp.height = screen->lcdheight;
vp.flags |= VP_FLAG_CENTER_ALIGN; vp.flags |= VP_FLAG_ALIGN_CENTER;
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
if (screen->depth > 1) if (screen->depth > 1)
{ {

View file

@ -175,7 +175,7 @@ static void gui_statusbar_init(struct gui_statusbar * bar)
#define GET_RECT(vp, vals,display) do { \ #define GET_RECT(vp, vals,display) do { \
viewport_set_fullscreen(&(vp), (display)->screen_type); \ viewport_set_fullscreen(&(vp), (display)->screen_type); \
(vp).flags &= ~VP_FLAG_IS_RTL; \ (vp).flags &= ~VP_FLAG_ALIGN_RIGHT; \
(vp).height = STATUSBAR_HEIGHT; \ (vp).height = STATUSBAR_HEIGHT; \
(vp).x = STATUSBAR_X_POS; \ (vp).x = STATUSBAR_X_POS; \
if ((vals) != STATUSBAR_BOTTOM) \ if ((vals) != STATUSBAR_BOTTOM) \

View file

@ -369,7 +369,7 @@ static void set_default_align_flags(struct viewport *vp)
vp->flags &= ~VP_FLAG_ALIGNMENT_MASK; vp->flags &= ~VP_FLAG_ALIGNMENT_MASK;
#ifndef __PCTOOL__ #ifndef __PCTOOL__
if (UNLIKELY(lang_is_rtl())) if (UNLIKELY(lang_is_rtl()))
vp->flags |= VP_FLAG_IS_RTL; vp->flags |= VP_FLAG_ALIGN_RIGHT;
#endif #endif
} }

View file

@ -109,14 +109,7 @@ int lang_load(const char *filename)
retcode = 3; retcode = 3;
} }
close(fd); close(fd);
if (retcode) lang_options = retcode ? 0 : lang_header[3];
{
lang_options = 0;
}
else
{
lang_options = lang_header[3];
}
return retcode; return retcode;
} }

View file

@ -268,7 +268,7 @@ int time_screen(void* ignored)
menu[i] = clock[i]; menu[i] = clock[i];
/* force time to be drawn centered */ /* force time to be drawn centered */
clock[i].flags |= VP_FLAG_CENTER_ALIGN; clock[i].flags |= VP_FLAG_ALIGN_CENTER;
font_h = font_get(clock[i].font)->height; font_h = font_get(clock[i].font)->height;
if (nb_lines > 3) if (nb_lines > 3)

View file

@ -92,7 +92,7 @@ static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str)
LCDFN(getstringsize)(str, &w, NULL); LCDFN(getstringsize)(str, &w, NULL);
/* center takes precedence */ /* center takes precedence */
if (vp_flags & VP_FLAG_CENTER_ALIGN) if (vp_flags & VP_FLAG_ALIGN_CENTER)
x = ((current_vp->width - w)/ 2) + x; x = ((current_vp->width - w)/ 2) + x;
else else
x = current_vp->width - w - x; x = current_vp->width - w - x;

View file

@ -26,13 +26,13 @@
#include "cpu.h" #include "cpu.h"
#include "config.h" #include "config.h"
#define VP_FLAG_IS_RTL 0x01 #define VP_FLAG_ALIGN_RIGHT 0x01
#define VP_FLAG_CENTER_ALIGN 0x02 #define VP_FLAG_ALIGN_CENTER 0x02
#define VP_FLAG_ALIGNMENT_MASK \ #define VP_FLAG_ALIGNMENT_MASK \
(VP_FLAG_IS_RTL|VP_FLAG_CENTER_ALIGN) (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER)
#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_IS_RTL) #define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
struct viewport { struct viewport {
int x; int x;