diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2012-12-03 20:43:58 +1100 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2012-12-09 17:11:19 +1100 |
commit | 685cf5900825b10c952f36301abbbd9968567435 (patch) | |
tree | 41cdfed9e5a2943c80ac0d4ffe09c45519a3ecf3 /apps/gui/skin_engine/skin_parser.c | |
parent | 1fbdc280d7e4b4ffb7ec8dccbfd1c1fc67f1c123 (diff) | |
download | rockbox-685cf5900825b10c952f36301abbbd9968567435.tar.gz rockbox-685cf5900825b10c952f36301abbbd9968567435.zip |
9 segment bitmap drawing:
Use %x9(id) to draw an image in the whole current viewport using the
9 segment drawer (which draws the corners as normal and *tiles*
the middle segments to the needed width/height).
Future work is to make it scale instead of tile
Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 93f310df56..94adaf3116 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -344,6 +344,9 @@ static int parse_image_display(struct skin_element *element, | |||
344 | token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; | 344 | token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; |
345 | } | 345 | } |
346 | 346 | ||
347 | if (token->type == SKIN_TOKEN_IMAGE_DISPLAY_9SEGMENT) | ||
348 | img->is_9_segment = true; | ||
349 | |||
347 | if (element->params_count > 1) | 350 | if (element->params_count > 1) |
348 | { | 351 | { |
349 | if (get_param(element, 1)->type == CODE) | 352 | if (get_param(element, 1)->type == CODE) |
@@ -417,6 +420,7 @@ static int parse_image_load(struct skin_element *element, | |||
417 | img->display = -1; | 420 | img->display = -1; |
418 | img->using_preloaded_icons = false; | 421 | img->using_preloaded_icons = false; |
419 | img->buflib_handle = -1; | 422 | img->buflib_handle = -1; |
423 | img->is_9_segment = false; | ||
420 | 424 | ||
421 | /* save current viewport */ | 425 | /* save current viewport */ |
422 | img->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp); | 426 | img->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp); |
@@ -2181,6 +2185,7 @@ static int skin_element_callback(struct skin_element* element, void* data) | |||
2181 | token->value.data = get_param(element, 0)->data.text; | 2185 | token->value.data = get_param(element, 0)->data.text; |
2182 | break; | 2186 | break; |
2183 | case SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY: | 2187 | case SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY: |
2188 | case SKIN_TOKEN_IMAGE_DISPLAY_9SEGMENT: | ||
2184 | function = parse_image_display; | 2189 | function = parse_image_display; |
2185 | break; | 2190 | break; |
2186 | case SKIN_TOKEN_IMAGE_PRELOAD: | 2191 | case SKIN_TOKEN_IMAGE_PRELOAD: |