summaryrefslogtreecommitdiffstats
path: root/apps/gui/wps_engine/wps_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps_engine/wps_parser.c')
-rw-r--r--apps/gui/wps_engine/wps_parser.c55
1 files changed, 35 insertions, 20 deletions
diff --git a/apps/gui/wps_engine/wps_parser.c b/apps/gui/wps_engine/wps_parser.c
index 15acc1401d..91c63059b0 100644
--- a/apps/gui/wps_engine/wps_parser.c
+++ b/apps/gui/wps_engine/wps_parser.c
@@ -1173,6 +1173,8 @@ static int parse_touchregion(const char *wps_bufptr,
struct touchregion *region;
const char *ptr = wps_bufptr;
const char *action;
+ const char pb_string[] = "progressbar";
+ const char vol_string[] = "volume";
int x,y,w,h;
/* format: %T|x|y|width|height|action|
@@ -1203,7 +1205,7 @@ static int parse_touchregion(const char *wps_bufptr,
/* Check there is a terminating | */
if (*ptr != '|')
return WPS_ERROR_INVALID_PARAM;
-
+
/* should probably do some bounds checking here with the viewport... but later */
region = &wps_data->touchregion[wps_data->touchregion_count];
region->action = ACTION_NONE;
@@ -1212,28 +1214,41 @@ static int parse_touchregion(const char *wps_bufptr,
region->width = w;
region->height = h;
region->wvp = &wps_data->viewports[wps_data->num_viewports];
- i = 0;
- if (*action == '&')
- {
- action++;
- region->repeat = true;
- }
- else
- region->repeat = false;
- imax = ARRAYLEN(touchactions);
- while ((region->action == ACTION_NONE) &&
- (i < imax))
+ if(!strncmp(pb_string, action, sizeof(pb_string)-1)
+ && *(action + sizeof(pb_string)-1) == '|')
+ region->type = WPS_TOUCHREGION_SCROLLBAR;
+ else if(!strncmp(vol_string, action, sizeof(vol_string)-1)
+ && *(action + sizeof(vol_string)-1) == '|')
+ region->type = WPS_TOUCHREGION_VOLUME;
+ else
{
- /* try to match with one of our touchregion screens */
- int len = strlen(touchactions[i].s);
- if (!strncmp(touchactions[i].s, action, len)
- && *(action+len) == '|')
- region->action = touchactions[i].action;
- i++;
+ region->type = WPS_TOUCHREGION_ACTION;
+
+ if (*action == '&')
+ {
+ action++;
+ region->repeat = true;
+ }
+ else
+ region->repeat = false;
+
+ i = 0;
+ imax = ARRAYLEN(touchactions);
+ while ((region->action == ACTION_NONE) &&
+ (i < imax))
+ {
+ /* try to match with one of our touchregion screens */
+ int len = strlen(touchactions[i].s);
+ if (!strncmp(touchactions[i].s, action, len)
+ && *(action+len) == '|')
+ region->action = touchactions[i].action;
+ i++;
+ }
+ if (region->action == ACTION_NONE)
+ return WPS_ERROR_INVALID_PARAM;
}
- if (region->action == ACTION_NONE)
- return WPS_ERROR_INVALID_PARAM;
+
wps_data->touchregion_count++;
return skip_end_of_line(wps_bufptr);
}