From b2eb44ce0eb24632a46b0ea8c8c46a8f2ba35e24 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 9 Dec 2009 07:25:46 +0000 Subject: 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 --- apps/recorder/keyboard.c | 8 ++++---- apps/recorder/radio.c | 24 ++++++++---------------- apps/recorder/recording.c | 15 +++------------ 3 files changed, 15 insertions(+), 32 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index e6d31cb450..4d59a85bb1 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -291,10 +291,10 @@ int kbd_input(char* text, int buflen) unsigned char morse_code = 0; int morse_tick = 0; #endif - int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL); FOR_NB_SCREENS(l) { struct keyboard_parameters *pm = ¶m[l]; + viewportmanager_theme_enable(l, false, NULL); #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 96 struct screen *sc = &screens[l]; @@ -1126,9 +1126,9 @@ int kbd_input(char* text, int buflen) #endif /* HAVE_MORSE_INPUT && KBD_TOGGLE_INPUT */ FOR_NB_SCREENS(l) + { screens[l].setfont(FONT_UI); - viewportmanager_set_statusbar(oldbars); - send_event(GUI_EVENT_REFRESH, NULL); - + viewportmanager_theme_undo(l); + } return ret; } diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 87614aec15..d49b94d434 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -494,7 +494,6 @@ int radio_screen(void) int button_timeout = current_tick + (2*HZ); #endif struct viewport vp[NB_SCREENS]; - int oldbars = 0, fmbars = VP_SB_ALLSCREENS; #ifdef HAVE_BUTTONBAR struct gui_buttonbar buttonbar; gui_buttonbar_init(&buttonbar); @@ -505,9 +504,6 @@ int radio_screen(void) in_screen = true; /* always display status bar in radio screen for now */ - FOR_NB_SCREENS(i) - fmbars |= VP_SB_IGNORE_SETTING(i); - oldbars = viewportmanager_set_statusbar(fmbars); FOR_NB_SCREENS(i) { viewport_set_defaults(&vp[i], i); @@ -761,14 +757,14 @@ int radio_screen(void) break; case ACTION_FM_MENU: - viewportmanager_set_statusbar(oldbars); FOR_NB_SCREENS(i) + { screens[i].scroll_stop(&vp[i]); + } radio_menu(); curr_preset = find_preset(curr_freq); - viewportmanager_set_statusbar(fmbars); FOR_NB_SCREENS(i) - { + { screens[i].set_viewport(&vp[i]); screens[i].clear_viewport(); screens[i].update_viewport(); @@ -798,9 +794,7 @@ int radio_screen(void) break; } - viewportmanager_set_statusbar(oldbars); handle_radio_presets(); - viewportmanager_set_statusbar(fmbars); FOR_NB_SCREENS(i) { screens[i].set_viewport(&vp[i]); @@ -932,12 +926,9 @@ int radio_screen(void) FOR_NB_SCREENS(i) { screens[i].set_viewport(&vp[i]); - peak_meter_screen(&screens[i],0, - STATUSBAR_HEIGHT + fh*(top_of_screen + 4), - fh); - screens[i].update_rect(0, - STATUSBAR_HEIGHT + fh*(top_of_screen + 4), - screens[i].getwidth(), fh); + peak_meter_screen(&screens[i],0, fh*(top_of_screen + 4),fh); + screens[i].update_rect(0, fh*(top_of_screen + 4), + screens[i].getwidth(), fh); screens[i].set_viewport(NULL); } } @@ -1134,8 +1125,9 @@ int radio_screen(void) cpu_idle_mode(false); #endif FOR_NB_SCREENS(i) + { screens[i].scroll_stop(&vp[i]); - viewportmanager_set_statusbar(oldbars); + } in_screen = false; #if CONFIG_CODEC != SWCODEC return have_recorded; diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 17c10f7328..0d1ada73f6 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -1019,7 +1019,6 @@ bool recording_screen(bool no_source) int peak_l, peak_r; int balance = 0; #endif - int oldbars, recbars = VP_SB_ALLSCREENS; int i; int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */ int pm_y[NB_SCREENS]; /* peakmeter y pos */ @@ -1081,9 +1080,6 @@ bool recording_screen(bool no_source) #endif /* viewport init and calculations that only needs to be done once */ - FOR_NB_SCREENS(i) - recbars |= VP_SB_IGNORE_SETTING(i); - oldbars = viewportmanager_set_statusbar(recbars); FOR_NB_SCREENS(i) { struct viewport *v; @@ -1122,6 +1118,9 @@ bool recording_screen(bool no_source) /* init the bottom list */ gui_synclist_init(&lists, reclist_get_name, NULL, false, 1, vp_list); gui_synclist_set_title(&lists, NULL, Icon_NOICON); + + + send_event(GUI_EVENT_ACTIONUPDATE, (void*)1); /* force a redraw */ /* start of the loop: we stay in this loop until user quits recscreen */ while(done <= 0) @@ -1576,7 +1575,6 @@ bool recording_screen(bool no_source) /* led is restored at begin of loop / end of function */ led(false); #endif - viewportmanager_set_statusbar(oldbars); if (recording_menu(no_source)) { done = 1; @@ -1590,7 +1588,6 @@ bool recording_screen(bool no_source) done = -1; /* the init is now done at the beginning of the loop */ } - viewportmanager_set_statusbar(recbars); } break; @@ -1602,7 +1599,6 @@ bool recording_screen(bool no_source) /* led is restored at begin of loop / end of function */ led(false); #endif - viewportmanager_set_statusbar(oldbars); if (f2_rec_screen()) { rec_status |= RCSTAT_HAVE_RECORDED; @@ -1610,7 +1606,6 @@ bool recording_screen(bool no_source) } else update_countdown = 0; /* Update immediately */ - viewportmanager_set_statusbar(recbars); } break; @@ -1626,7 +1621,6 @@ bool recording_screen(bool no_source) /* led is restored at begin of loop / end of function */ led(false); #endif - viewportmanager_set_statusbar(oldbars); if (f3_rec_screen()) { rec_status |= RCSTAT_HAVE_RECORDED; @@ -1634,7 +1628,6 @@ bool recording_screen(bool no_source) } else update_countdown = 0; /* Update immediately */ - viewportmanager_set_statusbar(recbars); } break; #endif /* CONFIG_KEYPAD == RECORDER_PAD */ @@ -1920,8 +1913,6 @@ rec_abort: FOR_NB_SCREENS(i) screens[i].setfont(FONT_UI); - viewportmanager_set_statusbar(oldbars); - send_event(GUI_EVENT_REFRESH, NULL); /* if the directory was created or recording happened, make sure the browser is updated */ -- cgit v1.2.3