forked from len0rd/rockbox
SKIN BREAK: %pb, %bl and %pv (bar types) changed so the image is the last param instead of the first. skin updater, skins and manual all updated.
NEW PARSER: add an 'N' param type which will accept any number of strings, will cause very big problems if this isnt the last param for a tag. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26727 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
20b9020adc
commit
9ac4b44610
57 changed files with 87 additions and 64 deletions
|
|
@ -130,10 +130,26 @@ int parse_tag(FILE* out, const char* start, bool in_conditional)
|
|||
{
|
||||
if (*start == '|')
|
||||
{
|
||||
int i=0;
|
||||
char filename[128];
|
||||
len++; start++;
|
||||
PUTCH(out, '(');
|
||||
/* |file|x|y|width|height| -> (x,y,width,height,file) */
|
||||
while (start[i] != '|')
|
||||
{
|
||||
filename[i] = start[i];
|
||||
i++;
|
||||
}
|
||||
filename[i] = '\0';
|
||||
len +=i+1;
|
||||
start += i+1;
|
||||
/* TODO: need to verify that we are actually using the long form... */
|
||||
len += dump_arg(out, start, 5, true);
|
||||
len += dump_arg(out, start, 4, false);
|
||||
if (i>0)
|
||||
{
|
||||
fprintf(out, ",%s", filename);
|
||||
}
|
||||
PUTCH(out, ')');
|
||||
}
|
||||
}
|
||||
else if (MATCH("d") || MATCH("D") || MATCH("mv") || MATCH("pS") || MATCH("pE") || MATCH("t") || MATCH("Tl"))
|
||||
|
|
|
|||
|
|
@ -543,7 +543,8 @@ int skin_parse_tag(struct skin_element* element, char** document)
|
|||
element->params[i].type = NUMERIC;
|
||||
element->params[i].data.numeric = scan_int(&cursor);
|
||||
}
|
||||
else if(tolower(*tag_args) == 's' || tolower(*tag_args) == 'f')
|
||||
else if(tolower(*tag_args) == 'n' ||
|
||||
tolower(*tag_args) == 's' || tolower(*tag_args) == 'f')
|
||||
{
|
||||
/* Scanning a string argument */
|
||||
element->params[i].type = STRING;
|
||||
|
|
@ -576,7 +577,8 @@ int skin_parse_tag(struct skin_element* element, char** document)
|
|||
cursor++;
|
||||
}
|
||||
|
||||
tag_args++;
|
||||
if (*tag_args != 'N')
|
||||
tag_args++;
|
||||
|
||||
/* Checking for the optional bar */
|
||||
if(*tag_args == '|')
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "tag_table.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define BAR_PARAMS "*|IIIIN"
|
||||
/* The tag definition table */
|
||||
struct tag_info legal_tags[] =
|
||||
{
|
||||
|
|
@ -33,7 +33,7 @@ struct tag_info legal_tags[] =
|
|||
{ SKIN_TOKEN_ALIGN_RIGHT_RTL, "aR", "" },
|
||||
{ SKIN_TOKEN_ALIGN_LANGDIRECTION, "ax", "" },
|
||||
|
||||
{ SKIN_TOKEN_BATTERY_PERCENT, "bl" , "*fIIII" },
|
||||
{ SKIN_TOKEN_BATTERY_PERCENT, "bl" , BAR_PARAMS },
|
||||
{ SKIN_TOKEN_BATTERY_VOLTS, "bv", "" },
|
||||
{ SKIN_TOKEN_BATTERY_TIME, "bt", "" },
|
||||
{ SKIN_TOKEN_BATTERY_SLEEPTIME, "bs", "" },
|
||||
|
|
@ -124,8 +124,8 @@ struct tag_info legal_tags[] =
|
|||
|
||||
{ SKIN_TOKEN_PEAKMETER, "pm", "" },
|
||||
{ SKIN_TOKEN_PLAYER_PROGRESSBAR, "pf", "" },
|
||||
{ SKIN_TOKEN_PROGRESSBAR, "pb" , "*fIIII" },
|
||||
{ SKIN_TOKEN_VOLUME, "pv" , "*fIIII" },
|
||||
{ SKIN_TOKEN_PROGRESSBAR, "pb" , BAR_PARAMS },
|
||||
{ SKIN_TOKEN_VOLUME, "pv" , BAR_PARAMS },
|
||||
|
||||
{ SKIN_TOKEN_TRACK_ELAPSED_PERCENT, "px", "" },
|
||||
{ SKIN_TOKEN_TRACK_TIME_ELAPSED, "pc", "" },
|
||||
|
|
|
|||
|
|
@ -263,6 +263,7 @@ enum skin_token_type {
|
|||
* F - Required file name
|
||||
* f - Nullable file name
|
||||
* C - Required skin code
|
||||
* N - any amount of strings.. must be the last param in the list
|
||||
* Any nullable parameter may be replaced in the WPS file
|
||||
* with a '-'. To specify that parameters may be left off
|
||||
* altogether, place a '|' in the parameter string. For
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue