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
This commit is contained in:
Jonathan Gordon 2009-11-11 06:39:23 +00:00
parent 664dc90e71
commit 7c440bff32
5 changed files with 8 additions and 52 deletions

View file

@ -242,27 +242,6 @@ static void viewportmanager_ui_vp_changed(void *param)
screens[i].update(); 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 * (re)parse the UI vp from the settings
* - Returns * - Returns

View file

@ -89,23 +89,6 @@ void viewport_set_fullscreen(struct viewport *vp,
/* call this when a theme changed */ /* call this when a theme changed */
void viewportmanager_theme_changed(const int); 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 #ifdef HAVE_TOUCHSCREEN
bool viewport_point_within_vp(const struct viewport *vp, bool viewport_point_within_vp(const struct viewport *vp,
const int x, const int y); const int x, const int y);

View file

@ -684,10 +684,12 @@ static void draw_slider(void)
int i; int i;
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
{ {
struct viewport *vp = &(viewport_get_current_vp())[i]; struct viewport vp;
show_busy_slider(&screens[i], vp->x, viewport_set_defaults(&vp, i);
(vp->y+vp->height)-2*screens[i].getcharheight(), screens[i].set_viewport(&vp);
vp->width, 2*screens[i].getcharheight()-1); 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(); screens[i].update();
} }
} }

View file

@ -679,10 +679,9 @@ static const struct plugin_api rockbox_api = {
int plugin_load(const char* plugin, const void* parameter) int plugin_load(const char* plugin, const void* parameter)
{ {
int rc, i; int rc;
int oldbars; int oldbars;
struct plugin_header *hdr; struct plugin_header *hdr;
struct viewport plugin_vp[NB_SCREENS];
#ifdef SIMULATOR #ifdef SIMULATOR
void *pd; void *pd;
#else /* !SIMULATOR */ #else /* !SIMULATOR */
@ -789,11 +788,6 @@ int plugin_load(const char* plugin, const void* parameter)
oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL); 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(); cpucache_invalidate();
#ifdef HAVE_TOUCHSCREEN #ifdef HAVE_TOUCHSCREEN
@ -835,7 +829,6 @@ int plugin_load(const char* plugin, const void* parameter)
#endif #endif
viewportmanager_set_statusbar(oldbars); viewportmanager_set_statusbar(oldbars);
viewport_set_current_vp(NULL);
if (rc != PLUGIN_GOTO_WPS) if (rc != PLUGIN_GOTO_WPS)
{ {

View file

@ -1149,8 +1149,7 @@ bool set_int_ex(const unsigned char* string,
item.lang_id = -1; item.lang_id = -1;
item.cfg_vals = (char*)string; item.cfg_vals = (char*)string;
item.setting = (void *)variable; item.setting = (void *)variable;
return option_screen(&item, return option_screen(&item, NULL, false, NULL);
viewport_get_current_vp(), false, NULL);
} }