summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
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/skin_engine
parenta7d784b1d5912b68ca9d921961639fe948404811 (diff)
downloadrockbox-c812614a1dd8453da438a153bf2ec4e62d1fa101.tar.gz
rockbox-c812614a1dd8453da438a153bf2ec4e62d1fa101.zip
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/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_engine.h5
-rw-r--r--apps/gui/skin_engine/skin_parser.c25
2 files changed, 13 insertions, 17 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);
42 * setup up the skin-data from a format-buffer (isfile = false) 42 * setup up the skin-data from a format-buffer (isfile = false)
43 * or from a skinfile (isfile = true) 43 * or from a skinfile (isfile = true)
44 */ 44 */
45bool skin_data_load(struct wps_data *wps_data, 45bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
46 const char *buf, 46 const char *buf, bool isfile);
47 bool isfile);
48 47
49 48
50/* initial setup of wps_data */ 49/* 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 @@
64 64
65#define WPS_ERROR_INVALID_PARAM -1 65#define WPS_ERROR_INVALID_PARAM -1
66 66
67/* which screen are we parsing for? */
68static enum screen_type curr_screen;
69
67/* level of current conditional. 70/* level of current conditional.
68 -1 means we're not in a conditional. */ 71 -1 means we're not in a conditional. */
69static int level = -1; 72static int level = -1;
@@ -519,11 +522,7 @@ static int parse_statusbar_enable(const char *wps_bufptr,
519 wps_data->wps_sb_tag = true; 522 wps_data->wps_sb_tag = true;
520 wps_data->show_sb_on_wps = true; 523 wps_data->show_sb_on_wps = true;
521 struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); 524 struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
522 if (default_vp->vp.y == 0) 525 viewport_set_defaults(&default_vp->vp, curr_screen);
523 {
524 default_vp->vp.y = STATUSBAR_HEIGHT;
525 default_vp->vp.height -= STATUSBAR_HEIGHT;
526 }
527 return skip_end_of_line(wps_bufptr); 526 return skip_end_of_line(wps_bufptr);
528} 527}
529 528
@@ -535,11 +534,7 @@ static int parse_statusbar_disable(const char *wps_bufptr,
535 wps_data->wps_sb_tag = true; 534 wps_data->wps_sb_tag = true;
536 wps_data->show_sb_on_wps = false; 535 wps_data->show_sb_on_wps = false;
537 struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data); 536 struct skin_viewport *default_vp = find_viewport(VP_DEFAULT_LABEL, wps_data);
538 if (default_vp->vp.y == STATUSBAR_HEIGHT) 537 viewport_set_fullscreen(&default_vp->vp, curr_screen);
539 {
540 default_vp->vp.y = 0;
541 default_vp->vp.height += STATUSBAR_HEIGHT;
542 }
543 return skip_end_of_line(wps_bufptr); 538 return skip_end_of_line(wps_bufptr);
544} 539}
545 540
@@ -1865,9 +1860,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
1865 1860
1866/* to setup up the wps-data from a format-buffer (isfile = false) 1861/* to setup up the wps-data from a format-buffer (isfile = false)
1867 from a (wps-)file (isfile = true)*/ 1862 from a (wps-)file (isfile = true)*/
1868bool skin_data_load(struct wps_data *wps_data, 1863bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
1869 const char *buf, 1864 const char *buf, bool isfile)
1870 bool isfile)
1871{ 1865{
1872 1866
1873 if (!wps_data || !buf) 1867 if (!wps_data || !buf)
@@ -1886,7 +1880,8 @@ bool skin_data_load(struct wps_data *wps_data,
1886#endif 1880#endif
1887 1881
1888 skin_data_reset(wps_data); 1882 skin_data_reset(wps_data);
1889 1883 curr_screen = screen;
1884
1890 /* alloc default viewport, will be fixed up later */ 1885 /* alloc default viewport, will be fixed up later */
1891 curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); 1886 curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport));
1892 if (!curr_vp) 1887 if (!curr_vp)
@@ -1902,6 +1897,8 @@ bool skin_data_load(struct wps_data *wps_data,
1902 curr_vp->pb = NULL; 1897 curr_vp->pb = NULL;
1903 curr_vp->hidden_flags = 0; 1898 curr_vp->hidden_flags = 0;
1904 curr_vp->lines = NULL; 1899 curr_vp->lines = NULL;
1900
1901 viewport_set_defaults(&curr_vp->vp, screen);
1905 1902
1906 curr_line = NULL; 1903 curr_line = NULL;
1907 if (!skin_start_new_line(curr_vp, 0)) 1904 if (!skin_start_new_line(curr_vp, 0))