1
0
Fork 0
forked from len0rd/rockbox

Fix the WPS to work properly with the statusbar for the previous change.. Side effect is it fixes FS#10721 where %pb didnt work

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23508 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2009-11-04 05:24:30 +00:00
parent a7d784b1d5
commit c812614a1d
4 changed files with 16 additions and 20 deletions

View file

@ -42,9 +42,8 @@ bool skin_update(struct gui_wps *gwps, unsigned int update_type);
* setup up the skin-data from a format-buffer (isfile = false) * setup up the skin-data from a format-buffer (isfile = false)
* or from a skinfile (isfile = true) * or from a skinfile (isfile = true)
*/ */
bool skin_data_load(struct wps_data *wps_data, bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
const char *buf, const char *buf, bool isfile);
bool isfile);
/* initial setup of wps_data */ /* initial setup of wps_data */

View file

@ -64,6 +64,9 @@
#define WPS_ERROR_INVALID_PARAM -1 #define WPS_ERROR_INVALID_PARAM -1
/* which screen are we parsing for? */
static enum screen_type curr_screen;
/* level of current conditional. /* level of current conditional.
-1 means we're not in a conditional. */ -1 means we're not in a conditional. */
static int level = -1; static int level = -1;
@ -519,11 +522,7 @@ static int parse_statusbar_enable(const char *wps_bufptr,
wps_data->wps_sb_tag = true; wps_data->wps_sb_tag = true;
wps_data->show_sb_on_wps = true; wps_data->show_sb_on_wps = true;
struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
if (default_vp->vp.y == 0) viewport_set_defaults(&default_vp->vp, curr_screen);
{
default_vp->vp.y = STATUSBAR_HEIGHT;
default_vp->vp.height -= STATUSBAR_HEIGHT;
}
return skip_end_of_line(wps_bufptr); return skip_end_of_line(wps_bufptr);
} }
@ -535,11 +534,7 @@ static int parse_statusbar_disable(const char *wps_bufptr,
wps_data->wps_sb_tag = true; wps_data->wps_sb_tag = true;
wps_data->show_sb_on_wps = false; wps_data->show_sb_on_wps = false;
struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
if (default_vp->vp.y == STATUSBAR_HEIGHT) viewport_set_fullscreen(&default_vp->vp, curr_screen);
{
default_vp->vp.y = 0;
default_vp->vp.height += STATUSBAR_HEIGHT;
}
return skip_end_of_line(wps_bufptr); return skip_end_of_line(wps_bufptr);
} }
@ -1865,9 +1860,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
/* to setup up the wps-data from a format-buffer (isfile = false) /* to setup up the wps-data from a format-buffer (isfile = false)
from a (wps-)file (isfile = true)*/ from a (wps-)file (isfile = true)*/
bool skin_data_load(struct wps_data *wps_data, bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
const char *buf, const char *buf, bool isfile)
bool isfile)
{ {
if (!wps_data || !buf) if (!wps_data || !buf)
@ -1886,7 +1880,8 @@ bool skin_data_load(struct wps_data *wps_data,
#endif #endif
skin_data_reset(wps_data); skin_data_reset(wps_data);
curr_screen = screen;
/* alloc default viewport, will be fixed up later */ /* alloc default viewport, will be fixed up later */
curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport));
if (!curr_vp) if (!curr_vp)
@ -1902,6 +1897,8 @@ bool skin_data_load(struct wps_data *wps_data,
curr_vp->pb = NULL; curr_vp->pb = NULL;
curr_vp->hidden_flags = 0; curr_vp->hidden_flags = 0;
curr_vp->lines = NULL; curr_vp->lines = NULL;
viewport_set_defaults(&curr_vp->vp, screen);
curr_line = NULL; curr_line = NULL;
if (!skin_start_new_line(curr_vp, 0)) if (!skin_start_new_line(curr_vp, 0))

View file

@ -51,7 +51,7 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
struct wps_data *data = sb_skin[screen].data; struct wps_data *data = sb_skin[screen].data;
int success; int success;
success = buf && skin_data_load(data, buf, isfile); success = buf && skin_data_load(screen, data, buf, isfile);
if (success) if (success)
{ /* hide the sb's default viewport because it has nasty effect with stuff { /* hide the sb's default viewport because it has nasty effect with stuff

View file

@ -127,7 +127,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
#endif /* __PCTOOL__ */ #endif /* __PCTOOL__ */
loaded_ok = buf && skin_data_load(gui_wps[screen].data, buf, isfile); loaded_ok = buf && skin_data_load(screen, gui_wps[screen].data, buf, isfile);
if (!loaded_ok) /* load the hardcoded default */ if (!loaded_ok) /* load the hardcoded default */
{ {
@ -151,7 +151,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
"%pb\n", "%pb\n",
#endif #endif
}; };
skin_data_load(gui_wps[screen].data, skin_buf[screen], false); skin_data_load(screen, gui_wps[screen].data, skin_buf[screen], false);
} }
#ifdef HAVE_REMOVE_LCD #ifdef HAVE_REMOVE_LCD
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN); gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);