forked from len0rd/rockbox
skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a single conditional.
Use these tags to stop having multiple conditionals.. e.g: OLD: %?C<%?Ia<something>> NEW: %?and(%C, %Ia)<something> Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
This commit is contained in:
parent
f1eedb80a2
commit
40ecdf6811
6 changed files with 83 additions and 27 deletions
|
|
@ -739,6 +739,16 @@ static int parse_setting_and_lang(struct skin_element *element,
|
|||
token->value.i = i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int parse_logical_andor(struct skin_element *element,
|
||||
struct wps_token *token,
|
||||
struct wps_data *wps_data)
|
||||
{
|
||||
(void)wps_data;
|
||||
token->value.data = PTRTOSKINOFFSET(skin_buffer, element);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int parse_logical_if(struct skin_element *element,
|
||||
struct wps_token *token,
|
||||
struct wps_data *wps_data)
|
||||
|
|
@ -1946,6 +1956,10 @@ static int skin_element_callback(struct skin_element* element, void* data)
|
|||
case SKIN_TOKEN_LOGICAL_IF:
|
||||
function = parse_logical_if;
|
||||
break;
|
||||
case SKIN_TOKEN_LOGICAL_AND:
|
||||
case SKIN_TOKEN_LOGICAL_OR:
|
||||
function = parse_logical_andor;
|
||||
break;
|
||||
case SKIN_TOKEN_SUBSTRING:
|
||||
function = parse_substring_tag;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue