From 73b1e30bb04d87144c4106ff7a9457507d191491 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 4 Oct 2022 23:22:21 +0100 Subject: skin engine: Reduce scope of internal wps_data struct A bunch of public API calls take a wps_data struct argument, but that's an internal type that doesn't have a direct getter. Instead the skin engine provides a gui_wps struct as a way to refer to a particular skin instance. Use that instead of wps_data in the public API. Change-Id: I13e1aa8df7f08ccfb789bb728d493ac8d7de1a9b --- apps/gui/skin_engine/skin_touchsupport.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/gui/skin_engine/skin_touchsupport.c') diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index eba6b82f5b..77ab30d675 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c @@ -35,8 +35,9 @@ #include "dsp_misc.h" /** Disarms all touchregions. */ -void skin_disarm_touchregions(struct wps_data *data) +void skin_disarm_touchregions(struct gui_wps *gwps) { + struct wps_data *data = gwps->data; char* skin_buffer = get_skin_buffer(data); struct skin_token_list *regions = SKINOFFSETTOPTR(skin_buffer, data->touchregions); while (regions) @@ -52,8 +53,9 @@ void skin_disarm_touchregions(struct wps_data *data) * egde_offset is a percentage value for the position of the touch * inside the bar for regions which arnt WPS_TOUCHREGION_ACTION type. */ -int skin_get_touchaction(struct wps_data *data, int* edge_offset) +int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) { + struct wps_data *data = gwps->data; int returncode = ACTION_NONE; short x,y; short vx, vy; @@ -161,7 +163,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset) /* On release, all regions are disarmed. */ if (released) - skin_disarm_touchregions(data); + skin_disarm_touchregions(gwps); if (temp && temp->press_length == LONG_PRESS) temp->armed = false; -- cgit v1.2.3