diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-04 23:22:21 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-11-15 14:20:31 +0000 |
commit | 73b1e30bb04d87144c4106ff7a9457507d191491 (patch) | |
tree | 377a307a2ba7f3065fa60cf316c20c01d03a2725 /apps/gui/skin_engine/skin_touchsupport.c | |
parent | 45bd4c7220280e3eafdd2722cc17c8db8617b676 (diff) | |
download | rockbox-73b1e30bb04d87144c4106ff7a9457507d191491.tar.gz rockbox-73b1e30bb04d87144c4106ff7a9457507d191491.zip |
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
Diffstat (limited to 'apps/gui/skin_engine/skin_touchsupport.c')
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 @@ | |||
35 | #include "dsp_misc.h" | 35 | #include "dsp_misc.h" |
36 | 36 | ||
37 | /** Disarms all touchregions. */ | 37 | /** Disarms all touchregions. */ |
38 | void skin_disarm_touchregions(struct wps_data *data) | 38 | void skin_disarm_touchregions(struct gui_wps *gwps) |
39 | { | 39 | { |
40 | struct wps_data *data = gwps->data; | ||
40 | char* skin_buffer = get_skin_buffer(data); | 41 | char* skin_buffer = get_skin_buffer(data); |
41 | struct skin_token_list *regions = SKINOFFSETTOPTR(skin_buffer, data->touchregions); | 42 | struct skin_token_list *regions = SKINOFFSETTOPTR(skin_buffer, data->touchregions); |
42 | while (regions) | 43 | while (regions) |
@@ -52,8 +53,9 @@ void skin_disarm_touchregions(struct wps_data *data) | |||
52 | * egde_offset is a percentage value for the position of the touch | 53 | * egde_offset is a percentage value for the position of the touch |
53 | * inside the bar for regions which arnt WPS_TOUCHREGION_ACTION type. | 54 | * inside the bar for regions which arnt WPS_TOUCHREGION_ACTION type. |
54 | */ | 55 | */ |
55 | int skin_get_touchaction(struct wps_data *data, int* edge_offset) | 56 | int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) |
56 | { | 57 | { |
58 | struct wps_data *data = gwps->data; | ||
57 | int returncode = ACTION_NONE; | 59 | int returncode = ACTION_NONE; |
58 | short x,y; | 60 | short x,y; |
59 | short vx, vy; | 61 | short vx, vy; |
@@ -161,7 +163,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset) | |||
161 | 163 | ||
162 | /* On release, all regions are disarmed. */ | 164 | /* On release, all regions are disarmed. */ |
163 | if (released) | 165 | if (released) |
164 | skin_disarm_touchregions(data); | 166 | skin_disarm_touchregions(gwps); |
165 | if (temp && temp->press_length == LONG_PRESS) | 167 | if (temp && temp->press_length == LONG_PRESS) |
166 | temp->armed = false; | 168 | temp->armed = false; |
167 | 169 | ||