diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-12-09 07:25:46 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-12-09 07:25:46 +0000 |
commit | b2eb44ce0eb24632a46b0ea8c8c46a8f2ba35e24 (patch) | |
tree | ff3c0e14e9a53c08749ee1f233a5b1e887d3561a /apps/gui/wps.c | |
parent | 85aad9b3972208b0e34ba0241ebb5314118ae05e (diff) | |
download | rockbox-b2eb44ce0eb24632a46b0ea8c8c46a8f2ba35e24.tar.gz rockbox-b2eb44ce0eb24632a46b0ea8c8c46a8f2ba35e24.zip |
FS#10824 - viewport/statusbar API rework.
Hopefully the only user visible changes are:
- fm and recording screens go by the statusbar setting (sbs or inbuilt)
- plugins go back to using the theme as they should for menus and lists
- splash screens might get cut a bit... entirely theme and splash dependant.. if there is a problematic one we can look at it later.
- hopefully nothing more than very minor screen flickerings... let me know exactly where they are so they can be fixed
New GUI screen rules:
* Screens assume that the theme (sbs+ui viewport+ maybe background image) are always enabled. They may be disabled on a per display basis, but MUST be re-enabled on exit
* Screens must not be coded in a way that requires a statusbar of any type.. the inbuilt bar will be removed shortly.
ALWAYS RESPECT THE USERS SETTINGS unless the screen requires the full display to fit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r-- | apps/gui/wps.c | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 757160a586..e500f1c2d9 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -88,9 +88,6 @@ static struct wps_sync_data wps_sync_data = { .do_full_update = false | |||
88 | static void wps_state_init(void); | 88 | static void wps_state_init(void); |
89 | static void track_changed_callback(void *param); | 89 | static void track_changed_callback(void *param); |
90 | static void nextid3available_callback(void* param); | 90 | static void nextid3available_callback(void* param); |
91 | #ifdef HAVE_LCD_BITMAP | ||
92 | static void statusbar_toggle_handler(void *data); | ||
93 | #endif | ||
94 | 91 | ||
95 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" | 92 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" |
96 | #ifdef HAVE_REMOTE_LCD | 93 | #ifdef HAVE_REMOTE_LCD |
@@ -562,24 +559,21 @@ static void wps_lcd_activation_hook(void *param) | |||
562 | 559 | ||
563 | static void gwps_leave_wps(void) | 560 | static void gwps_leave_wps(void) |
564 | { | 561 | { |
565 | int i, oldbars = VP_SB_HIDE_ALL; | 562 | int i; |
566 | 563 | ||
567 | FOR_NB_SCREENS(i) | 564 | FOR_NB_SCREENS(i) |
568 | { | 565 | { |
569 | gui_wps[i].display->stop_scroll(); | 566 | gui_wps[i].display->stop_scroll(); |
570 | gui_wps[i].display->backdrop_show(BACKDROP_MAIN); | 567 | gui_wps[i].display->backdrop_show(BACKDROP_MAIN); |
571 | if (statusbar_position(i) != STATUSBAR_OFF) | 568 | viewportmanager_theme_undo(i); |
572 | oldbars |= VP_SB_ONSCREEN(i); | ||
573 | } | 569 | } |
574 | 570 | ||
575 | viewportmanager_set_statusbar(oldbars); | ||
576 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | 571 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
577 | /* Play safe and unregister the hook */ | 572 | /* Play safe and unregister the hook */ |
578 | remove_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook); | 573 | remove_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook); |
579 | #endif | 574 | #endif |
580 | /* unhandle statusbar update delay */ | 575 | /* unhandle statusbar update delay */ |
581 | sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY); | 576 | sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY); |
582 | send_event(GUI_EVENT_REFRESH, NULL); | ||
583 | } | 577 | } |
584 | 578 | ||
585 | /* | 579 | /* |
@@ -591,6 +585,14 @@ static void gwps_enter_wps(void) | |||
591 | { | 585 | { |
592 | struct gui_wps *gwps = &gui_wps[i]; | 586 | struct gui_wps *gwps = &gui_wps[i]; |
593 | struct screen *display = gwps->display; | 587 | struct screen *display = gwps->display; |
588 | #ifdef HAVE_LCD_BITMAP | ||
589 | bool draw = false; | ||
590 | if (gui_wps[i].data->wps_sb_tag) | ||
591 | draw = gui_wps[i].data->show_sb_on_wps; | ||
592 | else if (statusbar_position(i) != STATUSBAR_OFF) | ||
593 | draw = true; | ||
594 | #endif | ||
595 | viewportmanager_theme_enable(i, draw, NULL); | ||
594 | 596 | ||
595 | display->stop_scroll(); | 597 | display->stop_scroll(); |
596 | /* Update the values in the first (default) viewport - in case the user | 598 | /* Update the values in the first (default) viewport - in case the user |
@@ -725,8 +727,6 @@ long gui_wps_show(void) | |||
725 | #ifdef HAVE_LCD_CHARCELLS | 727 | #ifdef HAVE_LCD_CHARCELLS |
726 | status_set_audio(true); | 728 | status_set_audio(true); |
727 | status_set_param(false); | 729 | status_set_param(false); |
728 | #else | ||
729 | statusbar_toggle_handler(NULL); | ||
730 | #endif | 730 | #endif |
731 | 731 | ||
732 | #ifdef AB_REPEAT_ENABLE | 732 | #ifdef AB_REPEAT_ENABLE |
@@ -734,7 +734,7 @@ long gui_wps_show(void) | |||
734 | ab_reset_markers(); | 734 | ab_reset_markers(); |
735 | #endif | 735 | #endif |
736 | wps_state_init(); | 736 | wps_state_init(); |
737 | 737 | ||
738 | while ( 1 ) | 738 | while ( 1 ) |
739 | { | 739 | { |
740 | bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; | 740 | bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; |
@@ -1176,8 +1176,8 @@ long gui_wps_show(void) | |||
1176 | sb_skin_set_update_delay(0); | 1176 | sb_skin_set_update_delay(0); |
1177 | FOR_NB_SCREENS(i) | 1177 | FOR_NB_SCREENS(i) |
1178 | gui_wps[i].display->backdrop_show(BACKDROP_SKIN_WPS); | 1178 | gui_wps[i].display->backdrop_show(BACKDROP_SKIN_WPS); |
1179 | send_event(GUI_EVENT_REFRESH, gwps_enter_wps); | ||
1180 | wps_sync_data.do_full_update = update = false; | 1179 | wps_sync_data.do_full_update = update = false; |
1180 | gwps_enter_wps(); | ||
1181 | } | 1181 | } |
1182 | else if (wps_sync_data.do_full_update || update) | 1182 | else if (wps_sync_data.do_full_update || update) |
1183 | { | 1183 | { |
@@ -1271,33 +1271,6 @@ static void wps_state_init(void) | |||
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | 1273 | ||
1274 | #ifdef HAVE_LCD_BITMAP | ||
1275 | static void statusbar_toggle_handler(void *data) | ||
1276 | { | ||
1277 | (void)data; | ||
1278 | int i; | ||
1279 | |||
1280 | int *wpsbars = &wps_sync_data.statusbars; | ||
1281 | *wpsbars = VP_SB_HIDE_ALL; | ||
1282 | FOR_NB_SCREENS(i) | ||
1283 | { /* fix viewports if needed */ | ||
1284 | skin_statusbar_changed(&gui_wps[i]); | ||
1285 | |||
1286 | bool draw = false; | ||
1287 | |||
1288 | /* fix up gui_wps::statusbars, so that the viewportmanager accepts it*/ | ||
1289 | if (gui_wps[i].data->wps_sb_tag) | ||
1290 | draw = gui_wps[i].data->show_sb_on_wps; | ||
1291 | else if (statusbar_position(i) != STATUSBAR_OFF) | ||
1292 | draw = true; | ||
1293 | if (draw) | ||
1294 | *wpsbars |= | ||
1295 | (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i)); | ||
1296 | } | ||
1297 | } | ||
1298 | #endif | ||
1299 | |||
1300 | |||
1301 | void gui_sync_wps_init(void) | 1274 | void gui_sync_wps_init(void) |
1302 | { | 1275 | { |
1303 | int i; | 1276 | int i; |
@@ -1315,11 +1288,7 @@ void gui_sync_wps_init(void) | |||
1315 | gui_wps[i].display->backdrop_unload(BACKDROP_SKIN_WPS); | 1288 | gui_wps[i].display->backdrop_unload(BACKDROP_SKIN_WPS); |
1316 | /* must point to the same struct for both screens */ | 1289 | /* must point to the same struct for both screens */ |
1317 | gui_wps[i].sync_data = &wps_sync_data; | 1290 | gui_wps[i].sync_data = &wps_sync_data; |
1318 | gui_wps[i].sync_data->statusbars = VP_SB_ALLSCREENS; | ||
1319 | } | 1291 | } |
1320 | #ifdef HAVE_LCD_BITMAP | ||
1321 | add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler); | ||
1322 | #endif | ||
1323 | } | 1292 | } |
1324 | 1293 | ||
1325 | 1294 | ||