diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-03-06 00:29:46 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-03-06 00:29:46 +0000 |
commit | a9b5f4d810903996d868b0fcdcf9859cf3f47d7d (patch) | |
tree | 4acbdcace28f00451d5b5c9687cc53c6f997886c /apps/gui/statusbar.c | |
parent | 43ed678b4645a48cf2072ab72c93e730f4d329ff (diff) | |
download | rockbox-a9b5f4d810903996d868b0fcdcf9859cf3f47d7d.tar.gz rockbox-a9b5f4d810903996d868b0fcdcf9859cf3f47d7d.zip |
cleanup statusbar+base skin relationship...
* remove the "custom" option from the statusbar setting. if a sbs file is set then statusbar setting is ignored, no other user visible change there.
* new tag, %wi - use to draw the inbuilt statusbar in the current viewport
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25038 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 4710ebac42..bc5570ee4e 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -184,7 +184,7 @@ static void gui_statusbar_init(struct gui_statusbar * bar) | |||
184 | (vp).y = (display)->lcdheight - STATUSBAR_HEIGHT; \ | 184 | (vp).y = (display)->lcdheight - STATUSBAR_HEIGHT; \ |
185 | } while(0) | 185 | } while(0) |
186 | 186 | ||
187 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | 187 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct viewport *vp) |
188 | { | 188 | { |
189 | struct screen * display = bar->display; | 189 | struct screen * display = bar->display; |
190 | 190 | ||
@@ -194,6 +194,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
194 | #ifdef HAVE_LCD_CHARCELLS | 194 | #ifdef HAVE_LCD_CHARCELLS |
195 | int val; | 195 | int val; |
196 | (void)force_redraw; /* The Player always has "redraw" */ | 196 | (void)force_redraw; /* The Player always has "redraw" */ |
197 | (void)vp; | ||
197 | #endif /* HAVE_LCD_CHARCELLS */ | 198 | #endif /* HAVE_LCD_CHARCELLS */ |
198 | 199 | ||
199 | bar->info.battlevel = battery_level(); | 200 | bar->info.battlevel = battery_level(); |
@@ -277,10 +278,16 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
277 | #endif | 278 | #endif |
278 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) | 279 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) |
279 | { | 280 | { |
280 | struct viewport vp; | 281 | if (vp == NULL) |
281 | 282 | { | |
282 | GET_RECT(vp,statusbar_position(display->screen_type),display); | 283 | struct viewport viewport; |
283 | display->set_viewport(&vp); | 284 | GET_RECT(viewport,statusbar_position(display->screen_type),display); |
285 | display->set_viewport(&viewport); | ||
286 | } | ||
287 | else | ||
288 | { | ||
289 | display->set_viewport(vp); | ||
290 | } | ||
284 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 291 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
285 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); | 292 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); |
286 | display->set_drawmode(DRMODE_SOLID); | 293 | display->set_drawmode(DRMODE_SOLID); |
@@ -823,30 +830,10 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, | |||
823 | #endif /* HAVE_LCD_BITMAP */ | 830 | #endif /* HAVE_LCD_BITMAP */ |
824 | int i; | 831 | int i; |
825 | FOR_NB_SCREENS(i) { | 832 | FOR_NB_SCREENS(i) { |
826 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw ); | 833 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw, NULL ); |
827 | } | 834 | } |
828 | } | 835 | } |
829 | 836 | ||
830 | #ifdef HAVE_LCD_BITMAP | ||
831 | void gui_statusbar_changed( enum screen_type screen, | ||
832 | enum statusbar_values old) | ||
833 | { | ||
834 | /* clear and update the statusbar area to remove old parts */ | ||
835 | enum statusbar_values bar = statusbar_position(screen); | ||
836 | |||
837 | struct screen *display = &screens[screen]; | ||
838 | struct viewport vp; | ||
839 | |||
840 | if (old != STATUSBAR_OFF && old != bar) | ||
841 | { | ||
842 | GET_RECT(vp, old, display); | ||
843 | display->set_viewport(&vp); | ||
844 | display->clear_viewport(); | ||
845 | display->update_viewport(); | ||
846 | display->set_viewport(NULL); | ||
847 | } | ||
848 | } | ||
849 | #endif | ||
850 | 837 | ||
851 | #ifdef HAVE_REMOTE_LCD | 838 | #ifdef HAVE_REMOTE_LCD |
852 | enum statusbar_values statusbar_position(int screen) | 839 | enum statusbar_values statusbar_position(int screen) |