skin engine: Remove touchregion argument from skin_get_touchaction

Nobody uses the argument, and it exposes internals unnecessarily.

Change-Id: I376dc75db99ed89671175f906980526a23be70f6
This commit is contained in:
Aidan MacDonald 2022-10-04 23:06:34 +01:00
parent 56389b21b1
commit 06f0465158
5 changed files with 5 additions and 13 deletions

View file

@ -40,12 +40,10 @@ enum skinnable_screens {
struct skin_stats; struct skin_stats;
struct skin_viewport; struct skin_viewport;
struct touchregion;
struct wps_data; struct wps_data;
#ifdef HAVE_TOUCHSCREEN #ifdef HAVE_TOUCHSCREEN
int skin_get_touchaction(struct wps_data *data, int* edge_offset, int skin_get_touchaction(struct wps_data *data, int* edge_offset);
struct touchregion **retregion);
void skin_disarm_touchregions(struct wps_data *data); void skin_disarm_touchregions(struct wps_data *data);
#endif #endif

View file

@ -52,8 +52,7 @@ void skin_disarm_touchregions(struct wps_data *data)
* egde_offset is a percentage value for the position of the touch * egde_offset is a percentage value for the position of the touch
* inside the bar for regions which arnt WPS_TOUCHREGION_ACTION type. * 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 wps_data *data, int* edge_offset)
struct touchregion **retregion)
{ {
int returncode = ACTION_NONE; int returncode = ACTION_NONE;
short x,y; short x,y;
@ -163,8 +162,6 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
/* On release, all regions are disarmed. */ /* On release, all regions are disarmed. */
if (released) if (released)
skin_disarm_touchregions(data); skin_disarm_touchregions(data);
if (retregion && temp)
*retregion = temp;
if (temp && temp->press_length == LONG_PRESS) if (temp && temp->press_length == LONG_PRESS)
temp->armed = false; temp->armed = false;

View file

@ -307,7 +307,6 @@ void sb_bypass_touchregions(bool enable)
int sb_touch_to_button(int context) int sb_touch_to_button(int context)
{ {
struct touchregion *region;
static int last_context = -1; static int last_context = -1;
int button, offset; int button, offset;
if (bypass_sb_touchregions) if (bypass_sb_touchregions)
@ -317,7 +316,7 @@ int sb_touch_to_button(int context)
skin_disarm_touchregions(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data); skin_disarm_touchregions(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data);
last_context = context; last_context = context;
button = skin_get_touchaction(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data, button = skin_get_touchaction(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data,
&offset, &region); &offset);
switch (button) switch (button)
{ {

View file

@ -159,9 +159,8 @@ static bool update_onvol_change(enum screen_type screen)
static int skintouch_to_wps(struct wps_data *data) static int skintouch_to_wps(struct wps_data *data)
{ {
int offset = 0; int offset = 0;
struct touchregion *region;
struct wps_state *gstate = get_wps_state(); struct wps_state *gstate = get_wps_state();
int button = skin_get_touchaction(data, &offset, &region); int button = skin_get_touchaction(data, &offset);
switch (button) switch (button)
{ {
case ACTION_STD_PREV: case ACTION_STD_PREV:

View file

@ -96,11 +96,10 @@ int fms_do_button_loop(bool update_screen)
int button = skin_wait_for_action(FM_SCREEN, CONTEXT_FM|ALLOW_SOFTLOCK, int button = skin_wait_for_action(FM_SCREEN, CONTEXT_FM|ALLOW_SOFTLOCK,
update_screen ? TIMEOUT_NOBLOCK : HZ/5); update_screen ? TIMEOUT_NOBLOCK : HZ/5);
#ifdef HAVE_TOUCHSCREEN #ifdef HAVE_TOUCHSCREEN
struct touchregion *region;
int offset; int offset;
if (button == ACTION_TOUCHSCREEN) if (button == ACTION_TOUCHSCREEN)
button = skin_get_touchaction(skin_get_gwps(FM_SCREEN, SCREEN_MAIN)->data, button = skin_get_touchaction(skin_get_gwps(FM_SCREEN, SCREEN_MAIN)->data,
&offset, &region); &offset);
switch (button) switch (button)
{ {
case ACTION_WPS_STOP: case ACTION_WPS_STOP: