diff options
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 2 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 17 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 26 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 2 |
4 files changed, 29 insertions, 18 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 913bdcfbc4..aa2184a407 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -217,7 +217,7 @@ void draw_progressbar(struct gui_wps *gwps, struct skin_viewport* skin_viewport, | |||
217 | else if (pb->type == SKIN_TOKEN_SETTINGBAR) | 217 | else if (pb->type == SKIN_TOKEN_SETTINGBAR) |
218 | { | 218 | { |
219 | int val, count; | 219 | int val, count; |
220 | get_setting_info_for_bar(pb->setting, &count, &val); | 220 | get_setting_info_for_bar(pb->setting, pb->setting_offset, &count, &val); |
221 | length = count - 1; | 221 | length = count - 1; |
222 | end = val; | 222 | end = val; |
223 | } | 223 | } |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 39029f79c6..ac68b0dcba 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -960,6 +960,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
960 | struct viewport *vp = &curr_vp->vp; | 960 | struct viewport *vp = &curr_vp->vp; |
961 | struct skin_tag_parameter *param = get_param(element, 0); | 961 | struct skin_tag_parameter *param = get_param(element, 0); |
962 | int curr_param = 0; | 962 | int curr_param = 0; |
963 | int setting_offset = 0; | ||
963 | char *image_filename = NULL; | 964 | char *image_filename = NULL; |
964 | #ifdef HAVE_TOUCHSCREEN | 965 | #ifdef HAVE_TOUCHSCREEN |
965 | bool suppress_touchregion = false; | 966 | bool suppress_touchregion = false; |
@@ -1082,7 +1083,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1082 | enum | 1083 | enum |
1083 | { | 1084 | { |
1084 | eINVERT = 0, eNOFILL, eNOBORDER, eNOBAR, eSLIDER, eIMAGE, | 1085 | eINVERT = 0, eNOFILL, eNOBORDER, eNOBAR, eSLIDER, eIMAGE, |
1085 | eBACKDROP, eVERTICAL, eHORIZONTAL, eNOTOUCH, eSETTING, | 1086 | eBACKDROP, eVERTICAL, eHORIZONTAL, eNOTOUCH, eSETTING, eSETTING_OFFSET, |
1086 | e_PB_TAG_COUNT | 1087 | e_PB_TAG_COUNT |
1087 | }; | 1088 | }; |
1088 | 1089 | ||
@@ -1090,7 +1091,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1090 | [eNOFILL] = "nofill", [eNOBORDER] = "noborder", [eNOBAR] = "nobar", | 1091 | [eNOFILL] = "nofill", [eNOBORDER] = "noborder", [eNOBAR] = "nobar", |
1091 | [eSLIDER] = "slider", [eIMAGE] = "image", [eBACKDROP] = "backdrop", | 1092 | [eSLIDER] = "slider", [eIMAGE] = "image", [eBACKDROP] = "backdrop", |
1092 | [eVERTICAL] = "vertical", [eHORIZONTAL] = "horizontal", | 1093 | [eVERTICAL] = "vertical", [eHORIZONTAL] = "horizontal", |
1093 | [eNOTOUCH] = "notouch", [eSETTING] = "setting", [e_PB_TAG_COUNT] = NULL}; | 1094 | [eNOTOUCH] = "notouch", [eSETTING] = "setting", [eSETTING_OFFSET] = "soffset", [e_PB_TAG_COUNT] = NULL}; |
1094 | int pb_op; | 1095 | int pb_op; |
1095 | 1096 | ||
1096 | while (curr_param < element->params_count) | 1097 | while (curr_param < element->params_count) |
@@ -1158,6 +1159,15 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1158 | else if (pb_op == eNOTOUCH) | 1159 | else if (pb_op == eNOTOUCH) |
1159 | suppress_touchregion = true; | 1160 | suppress_touchregion = true; |
1160 | #endif | 1161 | #endif |
1162 | else if (token->type == SKIN_TOKEN_SETTING && pb_op == eSETTING_OFFSET) | ||
1163 | { | ||
1164 | if (curr_param+1 < element->params_count) | ||
1165 | { | ||
1166 | curr_param++; | ||
1167 | param++; | ||
1168 | setting_offset = param->data.number; | ||
1169 | } | ||
1170 | } | ||
1161 | else if (token->type == SKIN_TOKEN_SETTING && pb_op == eSETTING) | 1171 | else if (token->type == SKIN_TOKEN_SETTING && pb_op == eSETTING) |
1162 | { | 1172 | { |
1163 | if (curr_param+1 < element->params_count) | 1173 | if (curr_param+1 < element->params_count) |
@@ -1169,6 +1179,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1169 | pb->setting = find_setting_by_cfgname(text); | 1179 | pb->setting = find_setting_by_cfgname(text); |
1170 | if (!pb->setting) | 1180 | if (!pb->setting) |
1171 | return WPS_ERROR_INVALID_PARAM; | 1181 | return WPS_ERROR_INVALID_PARAM; |
1182 | pb->setting_offset = setting_offset; | ||
1172 | #endif | 1183 | #endif |
1173 | } | 1184 | } |
1174 | } | 1185 | } |
@@ -1223,7 +1234,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1223 | else if (token->type == SKIN_TOKEN_LIST_NEEDS_SCROLLBAR) | 1234 | else if (token->type == SKIN_TOKEN_LIST_NEEDS_SCROLLBAR) |
1224 | token->type = SKIN_TOKEN_LIST_SCROLLBAR; | 1235 | token->type = SKIN_TOKEN_LIST_SCROLLBAR; |
1225 | else if (token->type == SKIN_TOKEN_SETTING) | 1236 | else if (token->type == SKIN_TOKEN_SETTING) |
1226 | token->type = SKIN_TOKEN_SETTINGBAR; | 1237 | token->type = SKIN_TOKEN_SETTINGBAR; |
1227 | pb->type = token->type; | 1238 | pb->type = token->type; |
1228 | 1239 | ||
1229 | #ifdef HAVE_TOUCHSCREEN | 1240 | #ifdef HAVE_TOUCHSCREEN |
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index b952709562..cd2f5b6cd2 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include <stdio.h> | 23 | #include <stdio.h> |
24 | #include "action.h" | 24 | #include "action.h" |
@@ -80,7 +80,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
80 | regions = SKINOFFSETTOPTR(skin_buffer, regions->next); | 80 | regions = SKINOFFSETTOPTR(skin_buffer, regions->next); |
81 | continue; | 81 | continue; |
82 | } | 82 | } |
83 | if (data->touchscreen_locked && | 83 | if (data->touchscreen_locked && |
84 | (r->action != ACTION_TOUCH_SOFTLOCK && !r->allow_while_locked)) | 84 | (r->action != ACTION_TOUCH_SOFTLOCK && !r->allow_while_locked)) |
85 | { | 85 | { |
86 | regions = SKINOFFSETTOPTR(skin_buffer, regions->next); | 86 | regions = SKINOFFSETTOPTR(skin_buffer, regions->next); |
@@ -143,7 +143,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
143 | r->last_press = current_tick; | 143 | r->last_press = current_tick; |
144 | break; | 144 | break; |
145 | default: | 145 | default: |
146 | if (r->armed && ((repeated && needs_repeat) || | 146 | if (r->armed && ((repeated && needs_repeat) || |
147 | (released && !needs_repeat))) | 147 | (released && !needs_repeat))) |
148 | { | 148 | { |
149 | returncode = r->action; | 149 | returncode = r->action; |
@@ -166,7 +166,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
166 | skin_disarm_touchregions(gwps); | 166 | skin_disarm_touchregions(gwps); |
167 | if (temp && temp->press_length == LONG_PRESS) | 167 | if (temp && temp->press_length == LONG_PRESS) |
168 | temp->armed = false; | 168 | temp->armed = false; |
169 | 169 | ||
170 | if (returncode != ACTION_NONE) | 170 | if (returncode != ACTION_NONE) |
171 | { | 171 | { |
172 | if (global_settings.party_mode) | 172 | if (global_settings.party_mode) |
@@ -227,9 +227,9 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
227 | case ACTION_SETTINGS_INC: | 227 | case ACTION_SETTINGS_INC: |
228 | case ACTION_SETTINGS_DEC: | 228 | case ACTION_SETTINGS_DEC: |
229 | { | 229 | { |
230 | const struct settings_list *setting = | 230 | const struct settings_list *setting = |
231 | temp->setting_data.setting; | 231 | temp->setting_data.setting; |
232 | option_select_next_val(setting, | 232 | option_select_next_val(setting, |
233 | returncode == ACTION_SETTINGS_DEC, | 233 | returncode == ACTION_SETTINGS_DEC, |
234 | true); | 234 | true); |
235 | returncode = ACTION_REDRAW; | 235 | returncode = ACTION_REDRAW; |
@@ -245,7 +245,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
245 | case F_T_CUSTOM: | 245 | case F_T_CUSTOM: |
246 | s->custom_setting | 246 | s->custom_setting |
247 | ->load_from_cfg(s->setting, SKINOFFSETTOPTR(skin_buffer, data->value.text)); | 247 | ->load_from_cfg(s->setting, SKINOFFSETTOPTR(skin_buffer, data->value.text)); |
248 | break; | 248 | break; |
249 | case F_T_INT: | 249 | case F_T_INT: |
250 | case F_T_UINT: | 250 | case F_T_UINT: |
251 | *(int*)s->setting = data->value.number; | 251 | *(int*)s->setting = data->value.number; |
@@ -287,7 +287,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
287 | break; | 287 | break; |
288 | case ACTION_TOUCH_SHUFFLE: /* toggle shuffle mode */ | 288 | case ACTION_TOUCH_SHUFFLE: /* toggle shuffle mode */ |
289 | { | 289 | { |
290 | global_settings.playlist_shuffle = | 290 | global_settings.playlist_shuffle = |
291 | !global_settings.playlist_shuffle; | 291 | !global_settings.playlist_shuffle; |
292 | replaygain_update(); | 292 | replaygain_update(); |
293 | if (global_settings.playlist_shuffle) | 293 | if (global_settings.playlist_shuffle) |
@@ -299,7 +299,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
299 | break; | 299 | break; |
300 | case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */ | 300 | case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */ |
301 | { | 301 | { |
302 | const struct settings_list *rep_setting = | 302 | const struct settings_list *rep_setting = |
303 | find_setting(&global_settings.repeat_mode); | 303 | find_setting(&global_settings.repeat_mode); |
304 | option_select_next_val(rep_setting, false, true); | 304 | option_select_next_val(rep_setting, false, true); |
305 | audio_flush_and_reload_tracks(); | 305 | audio_flush_and_reload_tracks(); |
@@ -307,15 +307,15 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
307 | } | 307 | } |
308 | break; | 308 | break; |
309 | case ACTION_TOUCH_SETTING: | 309 | case ACTION_TOUCH_SETTING: |
310 | { | 310 | { |
311 | struct progressbar *bar = | 311 | struct progressbar *bar = |
312 | SKINOFFSETTOPTR(skin_buffer, temp->bar); | 312 | SKINOFFSETTOPTR(skin_buffer, temp->bar); |
313 | if (bar && edge_offset) | 313 | if (bar && edge_offset) |
314 | { | 314 | { |
315 | int val, count; | 315 | int val, count; |
316 | get_setting_info_for_bar(bar->setting, &count, &val); | 316 | get_setting_info_for_bar(bar->setting, bar->setting_offset, &count, &val); |
317 | val = *edge_offset * count / 1000; | 317 | val = *edge_offset * count / 1000; |
318 | update_setting_value_from_touch(bar->setting, val); | 318 | update_setting_value_from_touch(bar->setting, bar->setting_offset, val); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | break; | 321 | break; |
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index 8ad8325e66..6e20ed8da9 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h | |||
@@ -132,9 +132,9 @@ struct progressbar { | |||
132 | bool nobar; | 132 | bool nobar; |
133 | OFFSETTYPE(struct gui_img *) slider; | 133 | OFFSETTYPE(struct gui_img *) slider; |
134 | bool horizontal; | 134 | bool horizontal; |
135 | char setting_offset; | ||
135 | OFFSETTYPE(struct gui_img *) backdrop; | 136 | OFFSETTYPE(struct gui_img *) backdrop; |
136 | const struct settings_list *setting; | 137 | const struct settings_list *setting; |
137 | |||
138 | }; | 138 | }; |
139 | 139 | ||
140 | struct draw_rectangle { | 140 | struct draw_rectangle { |