diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/skin_engine/skin_engine.h | 5 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 25 | ||||
-rw-r--r-- | apps/gui/statusbar-skinned.c | 2 | ||||
-rw-r--r-- | apps/gui/wps.c | 4 |
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); | |||
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 | */ |
45 | bool skin_data_load(struct wps_data *wps_data, | 45 | bool 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? */ | ||
68 | static 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. */ |
69 | static int level = -1; | 72 | static 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)*/ |
1868 | bool skin_data_load(struct wps_data *wps_data, | 1863 | bool 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)) |
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) | |||
51 | struct wps_data *data = sb_skin[screen].data; | 51 | struct wps_data *data = sb_skin[screen].data; |
52 | 52 | ||
53 | int success; | 53 | int success; |
54 | success = buf && skin_data_load(data, buf, isfile); | 54 | success = buf && skin_data_load(screen, data, buf, isfile); |
55 | 55 | ||
56 | if (success) | 56 | if (success) |
57 | { /* hide the sb's default viewport because it has nasty effect with stuff | 57 | { /* 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) | |||
127 | 127 | ||
128 | #endif /* __PCTOOL__ */ | 128 | #endif /* __PCTOOL__ */ |
129 | 129 | ||
130 | loaded_ok = buf && skin_data_load(gui_wps[screen].data, buf, isfile); | 130 | loaded_ok = buf && skin_data_load(screen, gui_wps[screen].data, buf, isfile); |
131 | 131 | ||
132 | if (!loaded_ok) /* load the hardcoded default */ | 132 | if (!loaded_ok) /* load the hardcoded default */ |
133 | { | 133 | { |
@@ -151,7 +151,7 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile) | |||
151 | "%pb\n", | 151 | "%pb\n", |
152 | #endif | 152 | #endif |
153 | }; | 153 | }; |
154 | skin_data_load(gui_wps[screen].data, skin_buf[screen], false); | 154 | skin_data_load(screen, gui_wps[screen].data, skin_buf[screen], false); |
155 | } | 155 | } |
156 | #ifdef HAVE_REMOVE_LCD | 156 | #ifdef HAVE_REMOVE_LCD |
157 | gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN); | 157 | gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN); |