summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-11 20:15:22 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-11 20:15:22 +0000
commitd5b076b64a8a3abd55fca0e9db7b13c6024bdfa3 (patch)
tree59ceb57c1f2633b8fd8f6458463499bc776a7930
parent891c446302d341d2e8f6f2da54343589bf46d0e4 (diff)
downloadrockbox-d5b076b64a8a3abd55fca0e9db7b13c6024bdfa3.tar.gz
rockbox-d5b076b64a8a3abd55fca0e9db7b13c6024bdfa3.zip
RTL: Cosmetic changes, no functional change - Rename constants
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23117 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/color_picker.c6
-rw-r--r--apps/gui/skin_engine/skin_parser.c2
-rw-r--r--apps/gui/splash.c2
-rw-r--r--apps/gui/statusbar.c2
-rw-r--r--apps/gui/viewport.c2
-rw-r--r--apps/language.c9
-rw-r--r--apps/menus/time_menu.c2
-rw-r--r--firmware/drivers/lcd-bitmap-common.c2
-rw-r--r--firmware/export/lcd.h8
9 files changed, 14 insertions, 21 deletions
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c
index 75c0612292..09d861245a 100644
--- a/apps/gui/color_picker.c
+++ b/apps/gui/color_picker.c
@@ -177,7 +177,7 @@ static void draw_screen(struct screen *display, char *title,
177 177
178 /* Draw title string */ 178 /* Draw title string */
179 set_drawinfo(display, DRMODE_SOLID, text_color, background_color); 179 set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
180 vp.flags |= VP_FLAG_CENTER_ALIGN; 180 vp.flags |= VP_FLAG_ALIGN_CENTER;
181 display->getstringsize(title, NULL, &y); 181 display->getstringsize(title, NULL, &y);
182 display->putsxy(0, MARGIN_TOP, title); 182 display->putsxy(0, MARGIN_TOP, title);
183 183
@@ -257,7 +257,7 @@ static void draw_screen(struct screen *display, char *title,
257 display->putsxy(text_x, text_top, buf); 257 display->putsxy(text_x, text_top, buf);
258 /* Draw color value */ 258 /* Draw color value */
259 snprintf(buf, 3, "%02d", rgb->rgb_val[i]); 259 snprintf(buf, 3, "%02d", rgb->rgb_val[i]);
260 vp.flags |= VP_FLAG_IS_RTL; 260 vp.flags |= VP_FLAG_ALIGN_RIGHT;
261 display->putsxy(text_x, text_top, buf); 261 display->putsxy(text_x, text_top, buf);
262 262
263 /* Draw scrollbar */ 263 /* Draw scrollbar */
@@ -278,7 +278,7 @@ static void draw_screen(struct screen *display, char *title,
278 /* Format RGB: #rrggbb */ 278 /* Format RGB: #rrggbb */
279 snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE), 279 snprintf(buf, sizeof(buf), str(LANG_COLOR_RGB_VALUE),
280 rgb->red, rgb->green, rgb->blue); 280 rgb->red, rgb->green, rgb->blue);
281 vp.flags |= VP_FLAG_CENTER_ALIGN; 281 vp.flags |= VP_FLAG_ALIGN_CENTER;
282 if (display->depth >= 16) 282 if (display->depth >= 16)
283 { 283 {
284 /* Display color swatch on color screens only */ 284 /* Display color swatch on color screens only */
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index e7c9f4fb52..bd6199c5e9 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -706,7 +706,7 @@ static int parse_viewport(const char *wps_bufptr,
706 if (!(ptr = viewport_parse_viewport(vp, screen, ptr, '|'))) 706 if (!(ptr = viewport_parse_viewport(vp, screen, ptr, '|')))
707 return WPS_ERROR_INVALID_PARAM; 707 return WPS_ERROR_INVALID_PARAM;
708 708
709 vp->flags &= ~VP_FLAG_IS_RTL; /* ignore rright-to-left languages */ 709 vp->flags &= ~VP_FLAG_ALIGN_RIGHT; /* ignore right-to-left languages */
710 /* Check for trailing | */ 710 /* Check for trailing | */
711 if (*ptr != '|') 711 if (*ptr != '|')
712 return WPS_ERROR_INVALID_PARAM; 712 return WPS_ERROR_INVALID_PARAM;
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index aaa259c09d..4ddd22aba2 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -147,7 +147,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
147 if (vp.height > screen->lcdheight) 147 if (vp.height > screen->lcdheight)
148 vp.height = screen->lcdheight; 148 vp.height = screen->lcdheight;
149 149
150 vp.flags |= VP_FLAG_CENTER_ALIGN; 150 vp.flags |= VP_FLAG_ALIGN_CENTER;
151#if LCD_DEPTH > 1 151#if LCD_DEPTH > 1
152 if (screen->depth > 1) 152 if (screen->depth > 1)
153 { 153 {
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 8275165178..5aac200157 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -175,7 +175,7 @@ static void gui_statusbar_init(struct gui_statusbar * bar)
175 175
176#define GET_RECT(vp, vals,display) do { \ 176#define GET_RECT(vp, vals,display) do { \
177 viewport_set_fullscreen(&(vp), (display)->screen_type); \ 177 viewport_set_fullscreen(&(vp), (display)->screen_type); \
178 (vp).flags &= ~VP_FLAG_IS_RTL; \ 178 (vp).flags &= ~VP_FLAG_ALIGN_RIGHT; \
179 (vp).height = STATUSBAR_HEIGHT; \ 179 (vp).height = STATUSBAR_HEIGHT; \
180 (vp).x = STATUSBAR_X_POS; \ 180 (vp).x = STATUSBAR_X_POS; \
181 if ((vals) != STATUSBAR_BOTTOM) \ 181 if ((vals) != STATUSBAR_BOTTOM) \
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index d5f45b3382..fdd06bdc46 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -369,7 +369,7 @@ static void set_default_align_flags(struct viewport *vp)
369 vp->flags &= ~VP_FLAG_ALIGNMENT_MASK; 369 vp->flags &= ~VP_FLAG_ALIGNMENT_MASK;
370#ifndef __PCTOOL__ 370#ifndef __PCTOOL__
371 if (UNLIKELY(lang_is_rtl())) 371 if (UNLIKELY(lang_is_rtl()))
372 vp->flags |= VP_FLAG_IS_RTL; 372 vp->flags |= VP_FLAG_ALIGN_RIGHT;
373#endif 373#endif
374} 374}
375 375
diff --git a/apps/language.c b/apps/language.c
index fef8cd0a04..cdcfbe19b2 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -109,14 +109,7 @@ int lang_load(const char *filename)
109 retcode = 3; 109 retcode = 3;
110 } 110 }
111 close(fd); 111 close(fd);
112 if (retcode) 112 lang_options = retcode ? 0 : lang_header[3];
113 {
114 lang_options = 0;
115 }
116 else
117 {
118 lang_options = lang_header[3];
119 }
120 return retcode; 113 return retcode;
121} 114}
122 115
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index bc08374ba0..cb31c33fc9 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -268,7 +268,7 @@ int time_screen(void* ignored)
268 268
269 menu[i] = clock[i]; 269 menu[i] = clock[i];
270 /* force time to be drawn centered */ 270 /* force time to be drawn centered */
271 clock[i].flags |= VP_FLAG_CENTER_ALIGN; 271 clock[i].flags |= VP_FLAG_ALIGN_CENTER;
272 272
273 font_h = font_get(clock[i].font)->height; 273 font_h = font_get(clock[i].font)->height;
274 if (nb_lines > 3) 274 if (nb_lines > 3)
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 5bf4706c59..042500cce8 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -92,7 +92,7 @@ static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str)
92 92
93 LCDFN(getstringsize)(str, &w, NULL); 93 LCDFN(getstringsize)(str, &w, NULL);
94 /* center takes precedence */ 94 /* center takes precedence */
95 if (vp_flags & VP_FLAG_CENTER_ALIGN) 95 if (vp_flags & VP_FLAG_ALIGN_CENTER)
96 x = ((current_vp->width - w)/ 2) + x; 96 x = ((current_vp->width - w)/ 2) + x;
97 else 97 else
98 x = current_vp->width - w - x; 98 x = current_vp->width - w - x;
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 463714ff03..bf1680fad2 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -26,13 +26,13 @@
26#include "cpu.h" 26#include "cpu.h"
27#include "config.h" 27#include "config.h"
28 28
29#define VP_FLAG_IS_RTL 0x01 29#define VP_FLAG_ALIGN_RIGHT 0x01
30#define VP_FLAG_CENTER_ALIGN 0x02 30#define VP_FLAG_ALIGN_CENTER 0x02
31 31
32#define VP_FLAG_ALIGNMENT_MASK \ 32#define VP_FLAG_ALIGNMENT_MASK \
33 (VP_FLAG_IS_RTL|VP_FLAG_CENTER_ALIGN) 33 (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER)
34 34
35#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_IS_RTL) 35#define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
36 36
37struct viewport { 37struct viewport {
38 int x; 38 int x;