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/wps.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/wps.c')
-rw-r--r-- | apps/gui/wps.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 05a64370ac..430746cc8d 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -156,11 +156,12 @@ static bool update_onvol_change(enum screen_type screen) | |||
156 | 156 | ||
157 | 157 | ||
158 | #ifdef HAVE_TOUCHSCREEN | 158 | #ifdef HAVE_TOUCHSCREEN |
159 | static int skintouch_to_wps(struct wps_data *data) | 159 | static int skintouch_to_wps(void) |
160 | { | 160 | { |
161 | int offset = 0; | 161 | int offset = 0; |
162 | struct wps_state *gstate = get_wps_state(); | 162 | struct wps_state *gstate = get_wps_state(); |
163 | int button = skin_get_touchaction(data, &offset); | 163 | struct gui_wps *gwps = skin_get_gwps(WPS, SCREEN_MAIN); |
164 | int button = skin_get_touchaction(gwps, &offset); | ||
164 | switch (button) | 165 | switch (button) |
165 | { | 166 | { |
166 | case ACTION_STD_PREV: | 167 | case ACTION_STD_PREV: |
@@ -327,7 +328,7 @@ static bool ffwd_rew(int button, bool seek_from_end) | |||
327 | button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,TIMEOUT_BLOCK); | 328 | button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,TIMEOUT_BLOCK); |
328 | #ifdef HAVE_TOUCHSCREEN | 329 | #ifdef HAVE_TOUCHSCREEN |
329 | if (button == ACTION_TOUCHSCREEN) | 330 | if (button == ACTION_TOUCHSCREEN) |
330 | button = skintouch_to_wps(skin_get_gwps(WPS, SCREEN_MAIN)->data); | 331 | button = skintouch_to_wps(); |
331 | #endif | 332 | #endif |
332 | if (button != ACTION_WPS_SEEKFWD | 333 | if (button != ACTION_WPS_SEEKFWD |
333 | && button != ACTION_WPS_SEEKBACK | 334 | && button != ACTION_WPS_SEEKBACK |
@@ -517,12 +518,12 @@ static void gwps_leave_wps(void) | |||
517 | { | 518 | { |
518 | FOR_NB_SCREENS(i) | 519 | FOR_NB_SCREENS(i) |
519 | { | 520 | { |
520 | skin_get_gwps(WPS, i)->display->scroll_stop(); | 521 | struct gui_wps *gwps = skin_get_gwps(WPS, i); |
522 | gwps->display->scroll_stop(); | ||
521 | #ifdef HAVE_BACKDROP_IMAGE | 523 | #ifdef HAVE_BACKDROP_IMAGE |
522 | skin_backdrop_show(sb_get_backdrop(i)); | 524 | skin_backdrop_show(sb_get_backdrop(i)); |
523 | #endif | 525 | #endif |
524 | viewportmanager_theme_undo(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data)); | 526 | viewportmanager_theme_undo(i, skin_has_sbs(gwps)); |
525 | |||
526 | } | 527 | } |
527 | 528 | ||
528 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | 529 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
@@ -547,7 +548,7 @@ static void gwps_enter_wps(void) | |||
547 | gwps = skin_get_gwps(WPS, i); | 548 | gwps = skin_get_gwps(WPS, i); |
548 | display = gwps->display; | 549 | display = gwps->display; |
549 | display->scroll_stop(); | 550 | display->scroll_stop(); |
550 | viewportmanager_theme_enable(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data), NULL); | 551 | viewportmanager_theme_enable(i, skin_has_sbs(gwps), NULL); |
551 | 552 | ||
552 | /* Update the values in the first (default) viewport - in case the user | 553 | /* Update the values in the first (default) viewport - in case the user |
553 | has modified the statusbar or colour settings */ | 554 | has modified the statusbar or colour settings */ |
@@ -574,7 +575,7 @@ static void gwps_enter_wps(void) | |||
574 | } | 575 | } |
575 | #ifdef HAVE_TOUCHSCREEN | 576 | #ifdef HAVE_TOUCHSCREEN |
576 | gwps = skin_get_gwps(WPS, SCREEN_MAIN); | 577 | gwps = skin_get_gwps(WPS, SCREEN_MAIN); |
577 | skin_disarm_touchregions(gwps->data); | 578 | skin_disarm_touchregions(gwps); |
578 | if (gwps->data->touchregions < 0) | 579 | if (gwps->data->touchregions < 0) |
579 | touchscreen_set_mode(TOUCHSCREEN_BUTTON); | 580 | touchscreen_set_mode(TOUCHSCREEN_BUTTON); |
580 | #endif | 581 | #endif |
@@ -655,7 +656,7 @@ long gui_wps_show(void) | |||
655 | exit = true; | 656 | exit = true; |
656 | #ifdef HAVE_TOUCHSCREEN | 657 | #ifdef HAVE_TOUCHSCREEN |
657 | if (button == ACTION_TOUCHSCREEN) | 658 | if (button == ACTION_TOUCHSCREEN) |
658 | button = skintouch_to_wps(skin_get_gwps(WPS, SCREEN_MAIN)->data); | 659 | button = skintouch_to_wps(); |
659 | #endif | 660 | #endif |
660 | /* The iPods/X5/M5 use a single button for the A-B mode markers, | 661 | /* The iPods/X5/M5 use a single button for the A-B mode markers, |
661 | defined as ACTION_WPSAB_SINGLE in their config files. */ | 662 | defined as ACTION_WPSAB_SINGLE in their config files. */ |