summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-07-28 11:26:01 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-07-28 11:26:01 +0000
commitbb618dbd84389a8625244e97c5f61addd7870810 (patch)
treebffbb1d02597b1a732429c0fbbdcf1173dc60d87 /apps/gui/skin_engine/skin_parser.c
parentb9f32302736031725a3885db2612b14af69c4dd5 (diff)
downloadrockbox-bb618dbd84389a8625244e97c5f61addd7870810.tar.gz
rockbox-bb618dbd84389a8625244e97c5f61addd7870810.zip
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
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c16
1 files changed, 11 insertions, 5 deletions
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,
1039struct touchaction {const char* s; int action;}; 1039struct touchaction {const char* s; int action;};
1040static const struct touchaction touchactions[] = { 1040static const struct touchaction touchactions[] = {
1041 /* generic actions, convert to screen actions on use */ 1041 /* generic actions, convert to screen actions on use */
1042 {"none", ACTION_TOUCHSCREEN}, 1042 {"none", ACTION_TOUCHSCREEN}, {"lock", ACTION_TOUCH_SOFTLOCK },
1043 {"prev", ACTION_STD_PREV }, {"next", ACTION_STD_NEXT }, 1043 {"prev", ACTION_STD_PREV }, {"next", ACTION_STD_NEXT },
1044 {"rwd", ACTION_STD_PREVREPEAT }, {"ffwd", ACTION_STD_NEXTREPEAT }, 1044 {"rwd", ACTION_STD_PREVREPEAT }, {"ffwd", ACTION_STD_NEXTREPEAT },
1045 {"hotkey", ACTION_STD_HOTKEY}, {"select", ACTION_STD_OK }, 1045 {"hotkey", ACTION_STD_HOTKEY}, {"select", ACTION_STD_OK },
@@ -1122,17 +1122,23 @@ static int parse_touchregion(struct skin_element *element,
1122 region->value = 0; 1122 region->value = 0;
1123 region->last_press = 0xffff; 1123 region->last_press = 0xffff;
1124 region->press_length = PRESS; 1124 region->press_length = PRESS;
1125 region->allow_while_locked = false;
1125 action = element->params[p++].data.text; 1126 action = element->params[p++].data.text;
1126 1127
1127 strcpy(temp, action); 1128 strcpy(temp, action);
1128 action = temp; 1129 action = temp;
1129 1130
1130 if (*action == '!') 1131 switch (*action)
1131 { 1132 {
1132 region->reverse_bar = true; 1133 case '!':
1133 action++; 1134 region->reverse_bar = true;
1135 action++;
1136 break;
1137 case '^':
1138 action++;
1139 region->allow_while_locked = true;
1140 break;
1134 } 1141 }
1135
1136 if(!strcmp(pb_string, action)) 1142 if(!strcmp(pb_string, action))
1137 region->action = ACTION_TOUCH_SCROLLBAR; 1143 region->action = ACTION_TOUCH_SCROLLBAR;
1138 else if(!strcmp(vol_string, action)) 1144 else if(!strcmp(vol_string, action))