From bb618dbd84389a8625244e97c5f61addd7870810 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 28 Jul 2011 11:26:01 +0000 Subject: skin engine softlock support for touchscreens: Modify the %Tl() tag to add a new region 'lock' which will lock/unlock the wps/sbs from touches (hardware buttons still work) You can also specify a region to work when locked by prepending ^ to the action name (this is probably about to change though) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30218 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_parser.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'apps/gui/skin_engine/skin_parser.c') diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index df08fe6115..659d974130 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -1039,7 +1039,7 @@ static int parse_lasttouch(struct skin_element *element, struct touchaction {const char* s; int action;}; static const struct touchaction touchactions[] = { /* generic actions, convert to screen actions on use */ - {"none", ACTION_TOUCHSCREEN}, + {"none", ACTION_TOUCHSCREEN}, {"lock", ACTION_TOUCH_SOFTLOCK }, {"prev", ACTION_STD_PREV }, {"next", ACTION_STD_NEXT }, {"rwd", ACTION_STD_PREVREPEAT }, {"ffwd", ACTION_STD_NEXTREPEAT }, {"hotkey", ACTION_STD_HOTKEY}, {"select", ACTION_STD_OK }, @@ -1122,17 +1122,23 @@ static int parse_touchregion(struct skin_element *element, region->value = 0; region->last_press = 0xffff; region->press_length = PRESS; + region->allow_while_locked = false; action = element->params[p++].data.text; strcpy(temp, action); action = temp; - if (*action == '!') + switch (*action) { - region->reverse_bar = true; - action++; + case '!': + region->reverse_bar = true; + action++; + break; + case '^': + action++; + region->allow_while_locked = true; + break; } - if(!strcmp(pb_string, action)) region->action = ACTION_TOUCH_SCROLLBAR; else if(!strcmp(vol_string, action)) -- cgit v1.2.3