summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-02-21 00:34:58 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-02-21 00:34:58 +1100
commit9c21258e2cd7904ff0933f8a9bb4c5bc428c23cc (patch)
tree6b30ab474345e3975a4c74e79058be15d44b5622
parent43fc2a51d982c12b92b18ecba820b264212a3208 (diff)
downloadrockbox-9c21258e2cd7904ff0933f8a9bb4c5bc428c23cc.tar.gz
rockbox-9c21258e2cd7904ff0933f8a9bb4c5bc428c23cc.tar.bz2
rockbox-9c21258e2cd7904ff0933f8a9bb4c5bc428c23cc.zip
skin engine: Add 'touch' command to the %vs() tag
%vs(label, touch, -) will reset the timeout for the variable without changing the variables value. Change-Id: Idba03f454a82ac7460bb53a4de3aa6903656c585
-rw-r--r--apps/gui/skin_engine/skin_parser.c10
-rw-r--r--lib/skin_parser/tag_table.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 0be88f4e69..8409f0ed8b 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1179,7 +1179,10 @@ static int parse_skinvar( struct skin_element *element,
if (!data)
return WPS_ERROR_INVALID_PARAM;
data->var = PTRTOSKINOFFSET(skin_buffer, var);
- data->newval = get_param(element, 2)->data.number;
+ if (!isdefault(get_param(element, 2)))
+ data->newval = get_param(element, 2)->data.number;
+ else if (strcmp(get_param_text(element, 1), "touch"))
+ return WPS_ERROR_INVALID_PARAM;
data->max = 0;
if (!strcmp(get_param_text(element, 1), "set"))
data->direct = true;
@@ -1192,6 +1195,11 @@ static int parse_skinvar( struct skin_element *element,
data->direct = false;
data->newval *= -1;
}
+ else if (!strcmp(get_param_text(element, 1), "touch"))
+ {
+ data->direct = false;
+ data->newval = 0;
+ }
if (element->params_count > 3)
data->max = get_param(element, 3)->data.number;
token->value.data = PTRTOSKINOFFSET(skin_buffer, data);
diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c
index 1ddef71a24..d10b319dcf 100644
--- a/lib/skin_parser/tag_table.c
+++ b/lib/skin_parser/tag_table.c
@@ -236,7 +236,7 @@ static const struct tag_info legal_tags[] =
{ SKIN_TOKEN_REC_HOURS, "Rh" , "", SKIN_REFRESH_DYNAMIC },
/* Skin variables */
- { SKIN_TOKEN_VAR_SET, "vs", "SSI|I", SKIN_REFRESH_DYNAMIC },
+ { SKIN_TOKEN_VAR_SET, "vs", "SSi|I", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_VAR_GETVAL, "vg", "S", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_VAR_TIMEOUT, "vl", "S|D", SKIN_REFRESH_DYNAMIC },