diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-10-29 03:27:13 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-10-29 03:27:13 +0000 |
commit | 0aa035d73e20af65bb77798d3ada44af405507f1 (patch) | |
tree | dcdf47da2499896cbf1a9801cfa531c59f704fff /apps | |
parent | c4079e0b12bcef176fc8eaaa6ef17b465e15b730 (diff) | |
download | rockbox-0aa035d73e20af65bb77798d3ada44af405507f1.tar.gz rockbox-0aa035d73e20af65bb77798d3ada44af405507f1.zip |
* code police on a macro which has no reason for being
* add the TOKEN_RTC_PRESENT value to the skin debugger listing
* Allow the width and height of a viewport to be negative values (so width -50 means extend to 50pixels inside from the right edge)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23393 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/skin_engine/wps_debug.c | 5 | ||||
-rw-r--r-- | apps/gui/viewport.c | 28 |
2 files changed, 21 insertions, 12 deletions
diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c index e06ce00219..86f929ad23 100644 --- a/apps/gui/skin_engine/wps_debug.c +++ b/apps/gui/skin_engine/wps_debug.c | |||
@@ -159,7 +159,10 @@ static char *get_token_desc(struct wps_token *token, char *buf, | |||
159 | case WPS_TOKEN_PLAYBACK_STATUS: | 159 | case WPS_TOKEN_PLAYBACK_STATUS: |
160 | snprintf(buf, bufsize, "mode playback"); | 160 | snprintf(buf, bufsize, "mode playback"); |
161 | break; | 161 | break; |
162 | 162 | ||
163 | case WPS_TOKEN_RTC_PRESENT: | ||
164 | snprintf(buf, bufsize, "rtc: present?"); | ||
165 | break; | ||
163 | case WPS_TOKEN_RTC_DAY_OF_MONTH: | 166 | case WPS_TOKEN_RTC_DAY_OF_MONTH: |
164 | snprintf(buf, bufsize, "rtc: day of month (01..31)"); | 167 | snprintf(buf, bufsize, "rtc: day of month (01..31)"); |
165 | break; | 168 | break; |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 9bf0e80179..b5696842e3 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -31,17 +31,9 @@ | |||
31 | 31 | ||
32 | /*some short cuts for fg/bg/line selector handling */ | 32 | /*some short cuts for fg/bg/line selector handling */ |
33 | #ifdef HAVE_LCD_COLOR | 33 | #ifdef HAVE_LCD_COLOR |
34 | #define LINE_SEL_FROM_SETTINGS(vp) \ | ||
35 | do { \ | ||
36 | vp->lss_pattern = global_settings.lss_color; \ | ||
37 | vp->lse_pattern = global_settings.lse_color; \ | ||
38 | vp->lst_pattern = global_settings.lst_color; \ | ||
39 | } while (0) | ||
40 | #define FG_FALLBACK global_settings.fg_color | 34 | #define FG_FALLBACK global_settings.fg_color |
41 | #define BG_FALLBACK global_settings.bg_color | 35 | #define BG_FALLBACK global_settings.bg_color |
42 | #else | 36 | #else |
43 | /* mono/greyscale doesn't have most of the above */ | ||
44 | #define LINE_SEL_FROM_SETTINGS(vp) | ||
45 | #define FG_FALLBACK LCD_DEFAULT_FG | 37 | #define FG_FALLBACK LCD_DEFAULT_FG |
46 | #define BG_FALLBACK LCD_DEFAULT_BG | 38 | #define BG_FALLBACK LCD_DEFAULT_BG |
47 | #endif | 39 | #endif |
@@ -145,7 +137,11 @@ void viewport_set_fullscreen(struct viewport *vp, | |||
145 | { | 137 | { |
146 | vp->fg_pattern = FG_FALLBACK; | 138 | vp->fg_pattern = FG_FALLBACK; |
147 | vp->bg_pattern = BG_FALLBACK; | 139 | vp->bg_pattern = BG_FALLBACK; |
148 | LINE_SEL_FROM_SETTINGS(vp); | 140 | #ifdef HAVE_LCD_COLOR |
141 | vp->lss_pattern = global_settings.lss_color; | ||
142 | vp->lse_pattern = global_settings.lse_color; | ||
143 | vp->lst_pattern = global_settings.lst_color; | ||
144 | #endif | ||
149 | } | 145 | } |
150 | #endif | 146 | #endif |
151 | 147 | ||
@@ -450,11 +446,17 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
450 | vp->x += screens[screen].lcdwidth; | 446 | vp->x += screens[screen].lcdwidth; |
451 | if (vp->y < 0) | 447 | if (vp->y < 0) |
452 | vp->y += screens[screen].lcdheight; | 448 | vp->y += screens[screen].lcdheight; |
453 | /* fix defaults */ | 449 | |
450 | /* fix defaults, | ||
451 | * and negative width/height which means "extend to edge minus value */ | ||
454 | if (!LIST_VALUE_PARSED(set, PL_WIDTH)) | 452 | if (!LIST_VALUE_PARSED(set, PL_WIDTH)) |
455 | vp->width = screens[screen].lcdwidth - vp->x; | 453 | vp->width = screens[screen].lcdwidth - vp->x; |
454 | else if (vp->width < 0) | ||
455 | vp->width = (vp->width + screens[screen].lcdwidth) - vp->x; | ||
456 | if (!LIST_VALUE_PARSED(set, PL_HEIGHT)) | 456 | if (!LIST_VALUE_PARSED(set, PL_HEIGHT)) |
457 | vp->height = screens[screen].lcdheight - vp->y; | 457 | vp->height = screens[screen].lcdheight - vp->y; |
458 | else if (vp->height < 0) | ||
459 | vp->height = (vp->height + screens[screen].lcdheight) - vp->y; | ||
458 | 460 | ||
459 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | 461 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) |
460 | if (!LIST_VALUE_PARSED(set, PL_FG)) | 462 | if (!LIST_VALUE_PARSED(set, PL_FG)) |
@@ -463,7 +465,11 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
463 | vp->bg_pattern = BG_FALLBACK; | 465 | vp->bg_pattern = BG_FALLBACK; |
464 | #endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */ | 466 | #endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */ |
465 | 467 | ||
466 | LINE_SEL_FROM_SETTINGS(vp); | 468 | #ifdef HAVE_LCD_COLOR |
469 | vp->lss_pattern = global_settings.lss_color; | ||
470 | vp->lse_pattern = global_settings.lse_color; | ||
471 | vp->lst_pattern = global_settings.lst_color; | ||
472 | #endif | ||
467 | 473 | ||
468 | /* Validate the viewport dimensions - we know that the numbers are | 474 | /* Validate the viewport dimensions - we know that the numbers are |
469 | non-negative integers, ignore bars and assume the viewport takes them | 475 | non-negative integers, ignore bars and assume the viewport takes them |