summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-03-17 01:56:20 +0000
committerThomas Martitz <kugel@rockbox.org>2009-03-17 01:56:20 +0000
commitaad712d39f3cdeb95a22e56edb805554dd0a90e1 (patch)
treea309359b8bd9b8938cc52fe2c9979b692421dc2b
parent680990912c98b6414401c614839fb061e8d9fcee (diff)
downloadrockbox-aad712d39f3cdeb95a22e56edb805554dd0a90e1.tar.gz
rockbox-aad712d39f3cdeb95a22e56edb805554dd0a90e1.zip
Some style changes, move gwps_leave_wps a bit down; add a #define for restoration after 1 second and rename the one for instant restoration
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20330 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 4dc463be35..6d40ef08c2 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -65,23 +65,8 @@
65#include "viewport.h" 65#include "viewport.h"
66#include "pcmbuf.h" 66#include "pcmbuf.h"
67 67
68#define GWPS_INSTANT_RESTORE 0 68#define RESTORE_WPS_INSTANTLY 0l
69 69#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
70static void gwps_leave_wps(void)
71{
72 int oldbars = VP_SB_HIDE_ALL;
73
74 if (global_settings.statusbar)
75 oldbars = VP_SB_ALLSCREENS;
76
77 viewportmanager_set_statusbar(oldbars);
78#if LCD_DEPTH > 1
79 show_main_backdrop();
80#endif
81#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
82 show_remote_main_backdrop();
83#endif
84}
85 70
86static int wpsbars; 71static int wpsbars;
87/* currently only one wps_state is needed */ 72/* currently only one wps_state is needed */
@@ -185,6 +170,22 @@ void gwps_fix_statusbars(void)
185} 170}
186 171
187 172
173static void gwps_leave_wps(void)
174{
175 int oldbars = VP_SB_HIDE_ALL;
176
177 if (global_settings.statusbar)
178 oldbars = VP_SB_ALLSCREENS;
179
180 viewportmanager_set_statusbar(oldbars);
181#if LCD_DEPTH > 1
182 show_main_backdrop();
183#endif
184#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
185 show_remote_main_backdrop();
186#endif
187}
188
188/* The WPS can be left in two ways: 189/* The WPS can be left in two ways:
189 * a) call a function, which draws over the wps. In this case, the wps 190 * a) call a function, which draws over the wps. In this case, the wps
190 * will be still active (i.e. the below function didn't return) 191 * will be still active (i.e. the below function didn't return)
@@ -198,7 +199,7 @@ long gui_wps_show(void)
198{ 199{
199 long button = 0; 200 long button = 0;
200 bool restore = false; 201 bool restore = false;
201 long restoretimer = GWPS_INSTANT_RESTORE; /* timer to delay screen redraw temporarily */ 202 long restoretimer = RESTORE_WPS_INSTANTLY; /* timer to delay screen redraw temporarily */
202 bool exit = false; 203 bool exit = false;
203 bool bookmark = false; 204 bool bookmark = false;
204 bool update_track = false; 205 bool update_track = false;
@@ -396,7 +397,7 @@ long gui_wps_show(void)
396 } 397 }
397 if (res) { 398 if (res) {
398 restore = true; 399 restore = true;
399 restoretimer = current_tick + HZ; 400 restoretimer = RESTORE_WPS_NEXT_SECOND;
400 } 401 }
401 } 402 }
402 break; 403 break;
@@ -416,7 +417,7 @@ long gui_wps_show(void)
416 } 417 }
417 if (res) { 418 if (res) {
418 restore = true; 419 restore = true;
419 restoretimer = current_tick + HZ; 420 restoretimer = RESTORE_WPS_NEXT_SECOND;
420 } 421 }
421 } 422 }
422 break; 423 break;
@@ -680,7 +681,7 @@ long gui_wps_show(void)
680 } 681 }
681 682
682 if (restore && 683 if (restore &&
683 ((restoretimer == GWPS_INSTANT_RESTORE) || 684 ((restoretimer == RESTORE_WPS_INSTANTLY) ||
684 TIME_AFTER(restore, current_tick))) 685 TIME_AFTER(restore, current_tick)))
685 { 686 {
686 /* restore wps backrops and statusbars */ 687 /* restore wps backrops and statusbars */
@@ -692,7 +693,7 @@ long gui_wps_show(void)
692#endif 693#endif
693 viewportmanager_set_statusbar(wpsbars); 694 viewportmanager_set_statusbar(wpsbars);
694 restore = false; 695 restore = false;
695 restoretimer = GWPS_INSTANT_RESTORE; 696 restoretimer = RESTORE_WPS_INSTANTLY;
696 if (gui_wps_display()) { 697 if (gui_wps_display()) {
697 exit = true; 698 exit = true;
698 } 699 }