diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-08-14 11:17:49 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-08-14 11:17:49 +0000 |
commit | 863d239aa2d1585a13b5610d1a8619d5fb9e3554 (patch) | |
tree | a305e81d9b444408e5dc32353f254321c94e5699 /apps/gui | |
parent | b75a414167a4aff96a9baf0dd96e7ac2b5d689d5 (diff) |
Change %xd to allow for a number to be used to specify the subimage. i.e %xd(Ac) can now we written as %xd(A, 3). subimage count start at 1 so a=1, b=2 etc.
Also adds the possibility to specify a set of params which a tag can have (i.e a tag or a integer)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27812 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 39eefc69e0..90c5938e23 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -243,6 +243,7 @@ static int parse_image_display(struct skin_element *element, } id->label = label; id->offset = 0; + id->token = NULL; img->using_preloaded_icons = false; if (!strcmp(img->bm.data, "__list_icons__")) { @@ -253,19 +254,21 @@ static int parse_image_display(struct skin_element *element, if (element->params_count > 1) { - id->token = element->params[1].data.code->data; + if (element->params[1].type == CODE) + id->token = element->params[1].data.code->data; + /* specify a number. 1 being the first subimage (i.e top) NOT 0 */ + else if (element->params[1].type == INTEGER) + id->subimage = element->params[1].data.number - 1; if (element->params_count > 2) id->offset = element->params[2].data.number; } else { - id->token = NULL; if ((subimage = get_image_id(sublabel)) != -1) { if (subimage >= img->num_subimages) return WPS_ERROR_INVALID_PARAM; id->subimage = subimage; - token->value.i = label | (subimage << 8); } else { id->subimage = 0; } |