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 | |
parent | b75a414167a4aff96a9baf0dd96e7ac2b5d689d5 (diff) | |
download | rockbox-863d239aa2d1585a13b5610d1a8619d5fb9e3554.tar.gz rockbox-863d239aa2d1585a13b5610d1a8619d5fb9e3554.zip |
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')
-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, | |||
243 | } | 243 | } |
244 | id->label = label; | 244 | id->label = label; |
245 | id->offset = 0; | 245 | id->offset = 0; |
246 | id->token = NULL; | ||
246 | img->using_preloaded_icons = false; | 247 | img->using_preloaded_icons = false; |
247 | if (!strcmp(img->bm.data, "__list_icons__")) | 248 | if (!strcmp(img->bm.data, "__list_icons__")) |
248 | { | 249 | { |
@@ -253,19 +254,21 @@ static int parse_image_display(struct skin_element *element, | |||
253 | 254 | ||
254 | if (element->params_count > 1) | 255 | if (element->params_count > 1) |
255 | { | 256 | { |
256 | id->token = element->params[1].data.code->data; | 257 | if (element->params[1].type == CODE) |
258 | id->token = element->params[1].data.code->data; | ||
259 | /* specify a number. 1 being the first subimage (i.e top) NOT 0 */ | ||
260 | else if (element->params[1].type == INTEGER) | ||
261 | id->subimage = element->params[1].data.number - 1; | ||
257 | if (element->params_count > 2) | 262 | if (element->params_count > 2) |
258 | id->offset = element->params[2].data.number; | 263 | id->offset = element->params[2].data.number; |
259 | } | 264 | } |
260 | else | 265 | else |
261 | { | 266 | { |
262 | id->token = NULL; | ||
263 | if ((subimage = get_image_id(sublabel)) != -1) | 267 | if ((subimage = get_image_id(sublabel)) != -1) |
264 | { | 268 | { |
265 | if (subimage >= img->num_subimages) | 269 | if (subimage >= img->num_subimages) |
266 | return WPS_ERROR_INVALID_PARAM; | 270 | return WPS_ERROR_INVALID_PARAM; |
267 | id->subimage = subimage; | 271 | id->subimage = subimage; |
268 | token->value.i = label | (subimage << 8); | ||
269 | } else { | 272 | } else { |
270 | id->subimage = 0; | 273 | id->subimage = 0; |
271 | } | 274 | } |