From c812614a1dd8453da438a153bf2ec4e62d1fa101 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 4 Nov 2009 05:24:30 +0000 Subject: 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 --- apps/gui/skin_engine/skin_engine.h | 5 ++--- apps/gui/skin_engine/skin_parser.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 17 deletions(-) (limited to 'apps/gui/skin_engine') diff --git a/apps/gui/skin_engine/skin_engine.h b/apps/gui/skin_engine/skin_engine.h index 704a7851c2..f095f53470 100644 --- a/apps/gui/skin_engine/skin_engine.h +++ b/apps/gui/skin_engine/skin_engine.h @@ -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) * or from a skinfile (isfile = true) */ -bool skin_data_load(struct wps_data *wps_data, - const char *buf, - bool isfile); +bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, + const char *buf, bool isfile); /* initial setup of wps_data */ diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index a72dcb8f02..3585907182 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -64,6 +64,9 @@ #define WPS_ERROR_INVALID_PARAM -1 +/* which screen are we parsing for? */ +static enum screen_type curr_screen; + /* level of current conditional. -1 means we're not in a conditional. */ 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->show_sb_on_wps = true; struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); - if (default_vp->vp.y == 0) - { - default_vp->vp.y = STATUSBAR_HEIGHT; - default_vp->vp.height -= STATUSBAR_HEIGHT; - } + viewport_set_defaults(&default_vp->vp, curr_screen); 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->show_sb_on_wps = false; struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); - if (default_vp->vp.y == STATUSBAR_HEIGHT) - { - default_vp->vp.y = 0; - default_vp->vp.height += STATUSBAR_HEIGHT; - } + viewport_set_fullscreen(&default_vp->vp, curr_screen); 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) from a (wps-)file (isfile = true)*/ -bool skin_data_load(struct wps_data *wps_data, - const char *buf, - bool isfile) +bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, + const char *buf, bool isfile) { if (!wps_data || !buf) @@ -1886,7 +1880,8 @@ bool skin_data_load(struct wps_data *wps_data, #endif skin_data_reset(wps_data); - + curr_screen = screen; + /* alloc default viewport, will be fixed up later */ curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); if (!curr_vp) @@ -1902,6 +1897,8 @@ bool skin_data_load(struct wps_data *wps_data, curr_vp->pb = NULL; curr_vp->hidden_flags = 0; curr_vp->lines = NULL; + + viewport_set_defaults(&curr_vp->vp, screen); curr_line = NULL; if (!skin_start_new_line(curr_vp, 0)) -- cgit v1.2.3