diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-08-09 17:30:05 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-08-09 17:30:05 +0000 |
commit | dc4e90341ccf97d1451f46fa1bd4acde5e950298 (patch) | |
tree | bfed22e00dd47bc2bdb9acaf1676f4807b2a691f /apps/gui/skin_engine/wps_parser.c | |
parent | 9bd7b23e9980247e97e54a275769e5f1dd3b443e (diff) | |
download | rockbox-dc4e90341ccf97d1451f46fa1bd4acde5e950298.tar.gz rockbox-dc4e90341ccf97d1451f46fa1bd4acde5e950298.zip |
r22135 overwrote mcuelenaere's changes in r22068 to add slider-type regions for the touchscreen... so bring them back (spotted by kkurbjun)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22223 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/wps_parser.c')
-rw-r--r-- | apps/gui/skin_engine/wps_parser.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/apps/gui/skin_engine/wps_parser.c b/apps/gui/skin_engine/wps_parser.c index 3df2c5f0aa..9671d7c4dc 100644 --- a/apps/gui/skin_engine/wps_parser.c +++ b/apps/gui/skin_engine/wps_parser.c | |||
@@ -1093,6 +1093,8 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1093 | struct touchregion *region; | 1093 | struct touchregion *region; |
1094 | const char *ptr = wps_bufptr; | 1094 | const char *ptr = wps_bufptr; |
1095 | const char *action; | 1095 | const char *action; |
1096 | const char pb_string[] = "progressbar"; | ||
1097 | const char vol_string[] = "volume"; | ||
1096 | int x,y,w,h; | 1098 | int x,y,w,h; |
1097 | 1099 | ||
1098 | /* format: %T|x|y|width|height|action| | 1100 | /* format: %T|x|y|width|height|action| |
@@ -1132,28 +1134,41 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1132 | region->width = w; | 1134 | region->width = w; |
1133 | region->height = h; | 1135 | region->height = h; |
1134 | region->wvp = &wps_data->viewports[wps_data->num_viewports]; | 1136 | region->wvp = &wps_data->viewports[wps_data->num_viewports]; |
1135 | i = 0; | 1137 | |
1136 | if (*action == '&') | 1138 | if(!strncmp(pb_string, action, sizeof(pb_string)-1) |
1137 | { | 1139 | && *(action + sizeof(pb_string)-1) == '|') |
1138 | action++; | 1140 | region->type = WPS_TOUCHREGION_SCROLLBAR; |
1139 | region->repeat = true; | 1141 | else if(!strncmp(vol_string, action, sizeof(vol_string)-1) |
1140 | } | 1142 | && *(action + sizeof(vol_string)-1) == '|') |
1143 | region->type = WPS_TOUCHREGION_VOLUME; | ||
1141 | else | 1144 | else |
1142 | region->repeat = false; | ||
1143 | |||
1144 | imax = ARRAYLEN(touchactions); | ||
1145 | while ((region->action == ACTION_NONE) && | ||
1146 | (i < imax)) | ||
1147 | { | 1145 | { |
1148 | /* try to match with one of our touchregion screens */ | 1146 | region->type = WPS_TOUCHREGION_ACTION; |
1149 | int len = strlen(touchactions[i].s); | 1147 | |
1150 | if (!strncmp(touchactions[i].s, action, len) | 1148 | if (*action == '&') |
1151 | && *(action+len) == '|') | 1149 | { |
1152 | region->action = touchactions[i].action; | 1150 | action++; |
1153 | i++; | 1151 | region->repeat = true; |
1152 | } | ||
1153 | else | ||
1154 | region->repeat = false; | ||
1155 | |||
1156 | i = 0; | ||
1157 | imax = ARRAYLEN(touchactions); | ||
1158 | while ((region->action == ACTION_NONE) && | ||
1159 | (i < imax)) | ||
1160 | { | ||
1161 | /* try to match with one of our touchregion screens */ | ||
1162 | int len = strlen(touchactions[i].s); | ||
1163 | if (!strncmp(touchactions[i].s, action, len) | ||
1164 | && *(action+len) == '|') | ||
1165 | region->action = touchactions[i].action; | ||
1166 | i++; | ||
1167 | } | ||
1168 | if (region->action == ACTION_NONE) | ||
1169 | return WPS_ERROR_INVALID_PARAM; | ||
1154 | } | 1170 | } |
1155 | if (region->action == ACTION_NONE) | 1171 | |
1156 | return WPS_ERROR_INVALID_PARAM; | ||
1157 | wps_data->touchregion_count++; | 1172 | wps_data->touchregion_count++; |
1158 | return skip_end_of_line(wps_bufptr); | 1173 | return skip_end_of_line(wps_bufptr); |
1159 | } | 1174 | } |