summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-11-11 06:39:23 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-11-11 06:39:23 +0000
commit7c440bff3254250711e1768de2769dc68185fefd (patch)
treeda885d57a4bbc9db64994c37f7eb7d13a7f2353b /apps
parent664dc90e714837bec83153daa13ef39769705c78 (diff)
downloadrockbox-7c440bff3254250711e1768de2769dc68185fefd.tar.gz
rockbox-7c440bff3254250711e1768de2769dc68185fefd.zip
remove 3 bad viewport functions:
* viewport_set_current_vp() because if a screen wants to not use the user setting it shouldn't be dealing with the viewport manager at all (other than to disable the bars) * viewport_ui_vp_get_state() is unused (and not needed) * viewport_get_current_vp() because you should be using set_defaults() instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23606 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/viewport.c21
-rw-r--r--apps/gui/viewport.h17
-rw-r--r--apps/onplay.c10
-rw-r--r--apps/plugin.c9
-rw-r--r--apps/settings.c3
5 files changed, 8 insertions, 52 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 8e00ea3a71..0a2630cc9e 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -242,27 +242,6 @@ static void viewportmanager_ui_vp_changed(void *param)
242 screens[i].update(); 242 screens[i].update();
243} 243}
244 244
245void viewport_set_current_vp(struct viewport* vp)
246{
247 if (vp != NULL)
248 ui_vp_info.vp = vp;
249 else
250 ui_vp_info.vp = custom_vp;
251
252 /* must be done after the assignment above or event handler get old vps */
253 send_event(GUI_EVENT_THEME_CHANGED, NULL);
254}
255
256struct viewport* viewport_get_current_vp(void)
257{
258 return ui_vp_info.vp;
259}
260
261bool viewport_ui_vp_get_state(enum screen_type screen)
262{
263 return ui_vp_info.active[screen];
264}
265
266/* 245/*
267 * (re)parse the UI vp from the settings 246 * (re)parse the UI vp from the settings
268 * - Returns 247 * - Returns
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index 0e5ad30f35..54424339ca 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -89,23 +89,6 @@ void viewport_set_fullscreen(struct viewport *vp,
89/* call this when a theme changed */ 89/* call this when a theme changed */
90void viewportmanager_theme_changed(const int); 90void viewportmanager_theme_changed(const int);
91 91
92/*
93 * Returns a pointer to the current viewport
94 * - That could be the UI vp, or a viewport passed to do_menu() or the like
95 */
96struct viewport* viewport_get_current_vp(void);
97
98/*
99 * Set the UI vp pointer to a different one - NULL to reset to the UI vp
100 *
101 * This is needed since the UI viewport needs is kept in RAM.
102 */
103void viewport_set_current_vp(struct viewport* vp);
104
105/*
106 * returns true if the ui viewport is active on the screen
107 */
108bool viewport_ui_vp_get_state(const enum screen_type screen);
109#ifdef HAVE_TOUCHSCREEN 92#ifdef HAVE_TOUCHSCREEN
110bool viewport_point_within_vp(const struct viewport *vp, 93bool viewport_point_within_vp(const struct viewport *vp,
111 const int x, const int y); 94 const int x, const int y);
diff --git a/apps/onplay.c b/apps/onplay.c
index e3e686e964..47a21a9250 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -684,10 +684,12 @@ static void draw_slider(void)
684 int i; 684 int i;
685 FOR_NB_SCREENS(i) 685 FOR_NB_SCREENS(i)
686 { 686 {
687 struct viewport *vp = &(viewport_get_current_vp())[i]; 687 struct viewport vp;
688 show_busy_slider(&screens[i], vp->x, 688 viewport_set_defaults(&vp, i);
689 (vp->y+vp->height)-2*screens[i].getcharheight(), 689 screens[i].set_viewport(&vp);
690 vp->width, 2*screens[i].getcharheight()-1); 690 show_busy_slider(&screens[i], vp.x,
691 (vp.y+vp.height)-2*screens[i].getcharheight(),
692 vp.width, 2*screens[i].getcharheight()-1);
691 screens[i].update(); 693 screens[i].update();
692 } 694 }
693} 695}
diff --git a/apps/plugin.c b/apps/plugin.c
index b75bfe65bd..b0a57d6744 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -679,10 +679,9 @@ static const struct plugin_api rockbox_api = {
679 679
680int plugin_load(const char* plugin, const void* parameter) 680int plugin_load(const char* plugin, const void* parameter)
681{ 681{
682 int rc, i; 682 int rc;
683 int oldbars; 683 int oldbars;
684 struct plugin_header *hdr; 684 struct plugin_header *hdr;
685 struct viewport plugin_vp[NB_SCREENS];
686#ifdef SIMULATOR 685#ifdef SIMULATOR
687 void *pd; 686 void *pd;
688#else /* !SIMULATOR */ 687#else /* !SIMULATOR */
@@ -789,11 +788,6 @@ int plugin_load(const char* plugin, const void* parameter)
789 788
790 oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL); 789 oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
791 790
792 FOR_NB_SCREENS(i)
793 viewport_set_fullscreen(&plugin_vp[i], i);
794
795 viewport_set_current_vp(plugin_vp);
796
797 cpucache_invalidate(); 791 cpucache_invalidate();
798 792
799#ifdef HAVE_TOUCHSCREEN 793#ifdef HAVE_TOUCHSCREEN
@@ -835,7 +829,6 @@ int plugin_load(const char* plugin, const void* parameter)
835#endif 829#endif
836 830
837 viewportmanager_set_statusbar(oldbars); 831 viewportmanager_set_statusbar(oldbars);
838 viewport_set_current_vp(NULL);
839 832
840 if (rc != PLUGIN_GOTO_WPS) 833 if (rc != PLUGIN_GOTO_WPS)
841 { 834 {
diff --git a/apps/settings.c b/apps/settings.c
index 54fe4244f7..068613abcf 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1149,8 +1149,7 @@ bool set_int_ex(const unsigned char* string,
1149 item.lang_id = -1; 1149 item.lang_id = -1;
1150 item.cfg_vals = (char*)string; 1150 item.cfg_vals = (char*)string;
1151 item.setting = (void *)variable; 1151 item.setting = (void *)variable;
1152 return option_screen(&item, 1152 return option_screen(&item, NULL, false, NULL);
1153 viewport_get_current_vp(), false, NULL);
1154} 1153}
1155 1154
1156 1155