From 7c440bff3254250711e1768de2769dc68185fefd Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 11 Nov 2009 06:39:23 +0000 Subject: [PATCH] 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 --- apps/gui/viewport.c | 21 --------------------- apps/gui/viewport.h | 17 ----------------- apps/onplay.c | 10 ++++++---- apps/plugin.c | 9 +-------- apps/settings.c | 3 +-- 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) screens[i].update(); } -void viewport_set_current_vp(struct viewport* vp) -{ - if (vp != NULL) - ui_vp_info.vp = vp; - else - ui_vp_info.vp = custom_vp; - - /* must be done after the assignment above or event handler get old vps */ - send_event(GUI_EVENT_THEME_CHANGED, NULL); -} - -struct viewport* viewport_get_current_vp(void) -{ - return ui_vp_info.vp; -} - -bool viewport_ui_vp_get_state(enum screen_type screen) -{ - return ui_vp_info.active[screen]; -} - /* * (re)parse the UI vp from the settings * - 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, /* call this when a theme changed */ void viewportmanager_theme_changed(const int); -/* - * Returns a pointer to the current viewport - * - That could be the UI vp, or a viewport passed to do_menu() or the like - */ -struct viewport* viewport_get_current_vp(void); - -/* - * Set the UI vp pointer to a different one - NULL to reset to the UI vp - * - * This is needed since the UI viewport needs is kept in RAM. - */ -void viewport_set_current_vp(struct viewport* vp); - -/* - * returns true if the ui viewport is active on the screen - */ -bool viewport_ui_vp_get_state(const enum screen_type screen); #ifdef HAVE_TOUCHSCREEN bool viewport_point_within_vp(const struct viewport *vp, 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) int i; FOR_NB_SCREENS(i) { - struct viewport *vp = &(viewport_get_current_vp())[i]; - show_busy_slider(&screens[i], vp->x, - (vp->y+vp->height)-2*screens[i].getcharheight(), - vp->width, 2*screens[i].getcharheight()-1); + struct viewport vp; + viewport_set_defaults(&vp, i); + screens[i].set_viewport(&vp); + show_busy_slider(&screens[i], vp.x, + (vp.y+vp.height)-2*screens[i].getcharheight(), + vp.width, 2*screens[i].getcharheight()-1); screens[i].update(); } } 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 = { int plugin_load(const char* plugin, const void* parameter) { - int rc, i; + int rc; int oldbars; struct plugin_header *hdr; - struct viewport plugin_vp[NB_SCREENS]; #ifdef SIMULATOR void *pd; #else /* !SIMULATOR */ @@ -789,11 +788,6 @@ int plugin_load(const char* plugin, const void* parameter) oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL); - FOR_NB_SCREENS(i) - viewport_set_fullscreen(&plugin_vp[i], i); - - viewport_set_current_vp(plugin_vp); - cpucache_invalidate(); #ifdef HAVE_TOUCHSCREEN @@ -835,7 +829,6 @@ int plugin_load(const char* plugin, const void* parameter) #endif viewportmanager_set_statusbar(oldbars); - viewport_set_current_vp(NULL); if (rc != PLUGIN_GOTO_WPS) { 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, item.lang_id = -1; item.cfg_vals = (char*)string; item.setting = (void *)variable; - return option_screen(&item, - viewport_get_current_vp(), false, NULL); + return option_screen(&item, NULL, false, NULL); }