From 4caa8326abd590eb01279dde3f4dc6611a9255c8 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 6 Sep 2010 13:33:49 +0000 Subject: 2 new touch region options... "settings_inc" and "settings_dec" which will increase or decrease most of the available settings. To use it put the config name of the setting as the next param after settings_inc... i.e %T(0, 0, 32, 32, settings_inc, repeat) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28009 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_parser.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (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 a486436816..3d796f8032 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -826,6 +826,9 @@ static const struct touchaction touchactions[] = { {"contextmenu", ACTION_STD_CONTEXT},{"quickscreen", ACTION_STD_QUICKSCREEN }, /* not really WPS specific, but no equivilant ACTION_STD_* */ {"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP}, + + /* generic settings changers */ + {"setting_inc", ACTION_SETTINGS_INC}, {"setting_dec", ACTION_SETTINGS_DEC}, /* WPS specific actions */ {"browse", ACTION_WPS_BROWSE }, @@ -888,6 +891,7 @@ static int parse_touchregion(struct skin_element *element, region->wvp = curr_vp; region->armed = false; region->reverse_bar = false; + region->extradata = NULL; action = element->params[4].data.text; strcpy(temp, action); @@ -922,6 +926,27 @@ static int parse_touchregion(struct skin_element *element, if (!strcmp(touchactions[i].s, action)) { region->action = touchactions[i].action; + if (region->action == ACTION_SETTINGS_INC || + region->action == ACTION_SETTINGS_DEC) + { + if (element->params_count < 6) + { + return WPS_ERROR_INVALID_PARAM; + } + else + { + char *name = element->params[5].data.text; + int j; + /* Find the setting */ + for (j=0; jextradata = &settings[j]; + } + } break; } } -- cgit v1.2.3