diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-07 03:44:11 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-07 03:44:11 +0000 |
commit | 5b0521c9aadee11886e2c92df7d768d5e76063a6 (patch) | |
tree | a6fc72ca29627bb53276c05a5606a559f78bae83 /apps/gui/viewport.c | |
parent | 53b619c6e80c9efc6993c23ff7b1035e8e101834 (diff) | |
download | rockbox-5b0521c9aadee11886e2c92df7d768d5e76063a6.tar.gz rockbox-5b0521c9aadee11886e2c92df7d768d5e76063a6.zip |
Changeover to the new skin format. SkinBreakingChange in the wiki has the runown of the changes.
Major changes are paramerterised tags now use %tag(param,param), colours are removed from the %V() tag, %Vi gets a required (but can be -) label as its first param).
utils/skinupdater/ has a program to update individual skins, and a perl script to update a whole zip.
Themesite will be unusable for the time being (you should be able to upload new themes once it updates checkwps though).
I obviously havnt tested every updated wps in this change so let me know if one doesnt load
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26641 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r-- | apps/gui/viewport.c | 77 |
1 files changed, 33 insertions, 44 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index a100d56cd5..8731015c79 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -376,6 +376,34 @@ void viewport_set_defaults(struct viewport *vp, | |||
376 | 376 | ||
377 | 377 | ||
378 | #ifdef HAVE_LCD_BITMAP | 378 | #ifdef HAVE_LCD_BITMAP |
379 | |||
380 | int get_viewport_default_colour(enum screen_type screen, bool fgcolour) | ||
381 | { | ||
382 | (void)screen; | ||
383 | int colour; | ||
384 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
385 | if (fgcolour) | ||
386 | { | ||
387 | #if (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
388 | if (screen == SCREEN_REMOTE) | ||
389 | colour = REMOTE_FG_FALLBACK; | ||
390 | else | ||
391 | #endif | ||
392 | colour = global_settings.fg_color; | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | #if (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
397 | if (screen == SCREEN_REMOTE) | ||
398 | colour = REMOTE_BG_FALLBACK; | ||
399 | else | ||
400 | #endif | ||
401 | colour = global_settings.bg_color; | ||
402 | } | ||
403 | #endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */ | ||
404 | return colour; | ||
405 | } | ||
406 | |||
379 | const char* viewport_parse_viewport(struct viewport *vp, | 407 | const char* viewport_parse_viewport(struct viewport *vp, |
380 | enum screen_type screen, | 408 | enum screen_type screen, |
381 | const char *bufptr, | 409 | const char *bufptr, |
@@ -383,7 +411,6 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
383 | { | 411 | { |
384 | /* parse the list to the viewport struct */ | 412 | /* parse the list to the viewport struct */ |
385 | const char *ptr = bufptr; | 413 | const char *ptr = bufptr; |
386 | int depth; | ||
387 | uint32_t set = 0; | 414 | uint32_t set = 0; |
388 | 415 | ||
389 | enum { | 416 | enum { |
@@ -392,33 +419,11 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
392 | PL_WIDTH, | 419 | PL_WIDTH, |
393 | PL_HEIGHT, | 420 | PL_HEIGHT, |
394 | PL_FONT, | 421 | PL_FONT, |
395 | PL_FG, | ||
396 | PL_BG, | ||
397 | }; | 422 | }; |
398 | 423 | ||
399 | /* Work out the depth of this display */ | 424 | if (!(ptr = parse_list("ddddd", &set, separator, ptr, |
400 | depth = screens[screen].depth; | 425 | &vp->x, &vp->y, &vp->width, &vp->height, &vp->font))) |
401 | #if (LCD_DEPTH == 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 1) | 426 | return NULL; |
402 | if (depth == 1) | ||
403 | { | ||
404 | if (!(ptr = parse_list("ddddd", &set, separator, ptr, | ||
405 | &vp->x, &vp->y, &vp->width, &vp->height, &vp->font))) | ||
406 | return NULL; | ||
407 | } | ||
408 | else | ||
409 | #endif | ||
410 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
411 | if (depth >= 2) | ||
412 | { | ||
413 | if (!(ptr = parse_list(ARG_STRING(depth), &set, separator, ptr, | ||
414 | &vp->x, &vp->y, &vp->width, &vp->height, &vp->font, | ||
415 | &vp->fg_pattern,&vp->bg_pattern))) | ||
416 | return NULL; | ||
417 | } | ||
418 | else | ||
419 | #endif | ||
420 | {} | ||
421 | #undef ARG_STRING | ||
422 | 427 | ||
423 | /* X and Y *must* be set */ | 428 | /* X and Y *must* be set */ |
424 | if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) | 429 | if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) |
@@ -441,24 +446,8 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
441 | vp->height = (vp->height + screens[screen].lcdheight) - vp->y; | 446 | vp->height = (vp->height + screens[screen].lcdheight) - vp->y; |
442 | 447 | ||
443 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | 448 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) |
444 | if (!LIST_VALUE_PARSED(set, PL_FG)) | 449 | vp->fg_pattern = get_viewport_default_colour(screen, true); |
445 | { | 450 | vp->bg_pattern = get_viewport_default_colour(screen, false); |
446 | #if (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
447 | if (screen == SCREEN_REMOTE) | ||
448 | vp->fg_pattern = REMOTE_FG_FALLBACK; | ||
449 | else | ||
450 | #endif | ||
451 | vp->fg_pattern = FG_FALLBACK; | ||
452 | } | ||
453 | if (!LIST_VALUE_PARSED(set, PL_BG)) | ||
454 | { | ||
455 | #if (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | ||
456 | if (screen == SCREEN_REMOTE) | ||
457 | vp->bg_pattern = REMOTE_BG_FALLBACK; | ||
458 | else | ||
459 | #endif | ||
460 | vp->bg_pattern = BG_FALLBACK; | ||
461 | } | ||
462 | #endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */ | 451 | #endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */ |
463 | 452 | ||
464 | #ifdef HAVE_LCD_COLOR | 453 | #ifdef HAVE_LCD_COLOR |