summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-11-04 05:24:30 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-11-04 05:24:30 +0000
commitc812614a1dd8453da438a153bf2ec4e62d1fa101 (patch)
tree0d765f69d8b4e4e76bfc673b446278448a7a73fe /apps/gui
parenta7d784b1d5912b68ca9d921961639fe948404811 (diff)
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
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_engine.h5
-rw-r--r--apps/gui/skin_engine/skin_parser.c25
-rw-r--r--apps/gui/statusbar-skinned.c2
-rw-r--r--apps/gui/wps.c4
4 files changed, 16 insertions, 20 deletions
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))
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index ba46253f5d..11805c83a8 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -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;
int success;
- success = buf && skin_data_load(data, buf, isfile);
+ success = buf && skin_data_load(screen, data, buf, isfile);
if (success)
{ /* hide the sb's default viewport because it has nasty effect with stuff
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 646f6b4003..4f162f452a 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -127,7 +127,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
#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 */
{
@@ -151,7 +151,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
"%pb\n",
#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
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);