diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-09-13 12:24:14 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-09-13 12:24:14 +0000 |
commit | 541dd6fda5ae93073a0b9c499f62af2cf46f3529 (patch) | |
tree | 2c14fe844b52f7a5c20f4fe1cb28ca8dd72cb6f4 /apps/gui/skin_engine | |
parent | 894c8091088f7554bc89bf0e1dca38acbdfde4d5 (diff) | |
download | rockbox-541dd6fda5ae93073a0b9c499f62af2cf46f3529.tar.gz rockbox-541dd6fda5ae93073a0b9c499f62af2cf46f3529.zip |
Remove some trailing whitespaces in in the skin engine files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22694 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r-- | apps/gui/skin_engine/skin_buffer.c | 16 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 66 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 114 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 6 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_debug.c | 22 |
5 files changed, 112 insertions, 112 deletions
diff --git a/apps/gui/skin_engine/skin_buffer.c b/apps/gui/skin_engine/skin_buffer.c index 1a81f55ea8..3ad2efc634 100644 --- a/apps/gui/skin_engine/skin_buffer.c +++ b/apps/gui/skin_engine/skin_buffer.c | |||
@@ -34,14 +34,14 @@ | |||
34 | /* skin buffer management. | 34 | /* skin buffer management. |
35 | * This module is used to allocate space in a single global skin buffer for | 35 | * This module is used to allocate space in a single global skin buffer for |
36 | * tokens for both/all screens. | 36 | * tokens for both/all screens. |
37 | * | 37 | * |
38 | * This is mostly just copy/paste from firmware/buffer.c | 38 | * This is mostly just copy/paste from firmware/buffer.c |
39 | * | 39 | * |
40 | * | 40 | * |
41 | * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration, | 41 | * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration, |
42 | * both screens can use the whole buffer as they need; it's not split | 42 | * both screens can use the whole buffer as they need; it's not split |
43 | * between screens | 43 | * between screens |
44 | * | 44 | * |
45 | * Buffer can be allocated from either "end" of the global buffer. | 45 | * Buffer can be allocated from either "end" of the global buffer. |
46 | * items with unknown sizes get allocated from the start (0->) (data) | 46 | * items with unknown sizes get allocated from the start (0->) (data) |
47 | * items with known sizes get allocated from the end (<-buf_size) (tokens) | 47 | * items with known sizes get allocated from the end (<-buf_size) (tokens) |
@@ -49,7 +49,7 @@ | |||
49 | * |tokens skin1|images skin2|---SPACE---|data skin2|data skin1| | 49 | * |tokens skin1|images skin2|---SPACE---|data skin2|data skin1| |
50 | * Make sure to never start allocating from the beginning before letting us know | 50 | * Make sure to never start allocating from the beginning before letting us know |
51 | * how much was used. and RESPECT THE buf_free RETURN VALUES! | 51 | * how much was used. and RESPECT THE buf_free RETURN VALUES! |
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | 54 | ||
55 | 55 | ||
@@ -71,7 +71,7 @@ | |||
71 | 71 | ||
72 | #ifdef HAVE_LCD_CHARCELLS | 72 | #ifdef HAVE_LCD_CHARCELLS |
73 | #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \ | 73 | #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \ |
74 | (WPS_MAX_TOKENS * sizeof(struct wps_token)) | 74 | (WPS_MAX_TOKENS * sizeof(struct wps_token)) |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | static unsigned char buffer[SKIN_BUFFER_SIZE]; | 77 | static unsigned char buffer[SKIN_BUFFER_SIZE]; |
@@ -87,7 +87,7 @@ void skin_buffer_init(void) | |||
87 | if (buffer == NULL) | 87 | if (buffer == NULL) |
88 | { | 88 | { |
89 | buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ | 89 | buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ |
90 | 90 | ||
91 | buffer = buffer_alloc(buf_size); | 91 | buffer = buffer_alloc(buf_size); |
92 | buffer_front = buffer; | 92 | buffer_front = buffer; |
93 | buffer_back = bufer + buf_size; | 93 | buffer_back = bufer + buf_size; |
@@ -124,16 +124,16 @@ void* skin_buffer_alloc(size_t size) | |||
124 | buffer_back -= size; | 124 | buffer_back -= size; |
125 | /* 32-bit aligned */ | 125 | /* 32-bit aligned */ |
126 | buffer_back = (void *)(((unsigned long)buffer_back) & ~3); | 126 | buffer_back = (void *)(((unsigned long)buffer_back) & ~3); |
127 | 127 | ||
128 | memset(buffer_back, 0, size); | 128 | memset(buffer_back, 0, size); |
129 | return buffer_back; | 129 | return buffer_back; |
130 | } | 130 | } |
131 | 131 | ||
132 | /* Get a pointer to the skin buffer and the count of how much is free | 132 | /* Get a pointer to the skin buffer and the count of how much is free |
133 | * used to do your own buffer management. | 133 | * used to do your own buffer management. |
134 | * Any memory used will be overwritten next time wps_buffer_alloc() | 134 | * Any memory used will be overwritten next time wps_buffer_alloc() |
135 | * is called unless skin_buffer_increment() is called first | 135 | * is called unless skin_buffer_increment() is called first |
136 | * | 136 | * |
137 | * This is from the start of the buffer, it is YOUR responsility to make | 137 | * This is from the start of the buffer, it is YOUR responsility to make |
138 | * sure you dont ever use more then *freespace, and bear in mind this will only | 138 | * sure you dont ever use more then *freespace, and bear in mind this will only |
139 | * be valid untill skin_buffer_alloc() is next called... | 139 | * be valid untill skin_buffer_alloc() is next called... |
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 14e0bce0a9..e24ab66393 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -120,14 +120,14 @@ bool gui_wps_display(struct gui_wps *gwps) | |||
120 | bool skin_update(struct gui_wps *gwps, unsigned int update_type) | 120 | bool skin_update(struct gui_wps *gwps, unsigned int update_type) |
121 | { | 121 | { |
122 | bool retval; | 122 | bool retval; |
123 | /* This maybe shouldnt be here, but while the skin is only used to | 123 | /* This maybe shouldnt be here, but while the skin is only used to |
124 | * display the music screen this is better than whereever we are being | 124 | * display the music screen this is better than whereever we are being |
125 | * called from. This is also safe for skined screen which dont use the id3 */ | 125 | * called from. This is also safe for skined screen which dont use the id3 */ |
126 | struct mp3entry *id3 = gwps->state->id3; | 126 | struct mp3entry *id3 = gwps->state->id3; |
127 | bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false); | 127 | bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false); |
128 | gwps->state->do_full_update = cuesheet_update || gwps->state->do_full_update; | 128 | gwps->state->do_full_update = cuesheet_update || gwps->state->do_full_update; |
129 | 129 | ||
130 | retval = skin_redraw(gwps, gwps->state->do_full_update ? | 130 | retval = skin_redraw(gwps, gwps->state->do_full_update ? |
131 | WPS_REFRESH_ALL : update_type); | 131 | WPS_REFRESH_ALL : update_type); |
132 | return retval; | 132 | return retval; |
133 | } | 133 | } |
@@ -161,7 +161,7 @@ void skin_statusbar_changed(struct gui_wps *skin) | |||
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | } | 165 | } |
166 | 166 | ||
167 | static void draw_progressbar(struct gui_wps *gwps, | 167 | static void draw_progressbar(struct gui_wps *gwps, |
@@ -226,7 +226,7 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima | |||
226 | #if LCD_DEPTH > 1 | 226 | #if LCD_DEPTH > 1 |
227 | if(img->bm.format == FORMAT_MONO) { | 227 | if(img->bm.format == FORMAT_MONO) { |
228 | #endif | 228 | #endif |
229 | display->mono_bitmap_part(img->bm.data, | 229 | display->mono_bitmap_part(img->bm.data, |
230 | 0, img->subimage_height * subimage, | 230 | 0, img->subimage_height * subimage, |
231 | img->bm.width, img->x, | 231 | img->bm.width, img->x, |
232 | img->y, img->bm.width, | 232 | img->y, img->bm.width, |
@@ -235,8 +235,8 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima | |||
235 | } else { | 235 | } else { |
236 | display->transparent_bitmap_part((fb_data *)img->bm.data, | 236 | display->transparent_bitmap_part((fb_data *)img->bm.data, |
237 | 0, img->subimage_height * subimage, | 237 | 0, img->subimage_height * subimage, |
238 | STRIDE(display->screen_type, | 238 | STRIDE(display->screen_type, |
239 | img->bm.width, img->bm.height), | 239 | img->bm.width, img->bm.height), |
240 | img->x, img->y, img->bm.width, | 240 | img->x, img->y, img->bm.width, |
241 | img->subimage_height); | 241 | img->subimage_height); |
242 | } | 242 | } |
@@ -268,14 +268,14 @@ static void wps_display_images(struct gui_wps *gwps, struct viewport* vp) | |||
268 | } | 268 | } |
269 | list = list->next; | 269 | list = list->next; |
270 | } | 270 | } |
271 | #ifdef HAVE_ALBUMART | 271 | #ifdef HAVE_ALBUMART |
272 | /* now draw the AA */ | 272 | /* now draw the AA */ |
273 | if (data->albumart && data->albumart->vp == vp && data->albumart->draw) | 273 | if (data->albumart && data->albumart->vp == vp && data->albumart->draw) |
274 | { | 274 | { |
275 | draw_album_art(gwps, audio_current_aa_hid(), false); | 275 | draw_album_art(gwps, audio_current_aa_hid(), false); |
276 | } | 276 | } |
277 | #endif | 277 | #endif |
278 | 278 | ||
279 | display->set_drawmode(DRMODE_SOLID); | 279 | display->set_drawmode(DRMODE_SOLID); |
280 | } | 280 | } |
281 | 281 | ||
@@ -352,14 +352,14 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size) | |||
352 | { | 352 | { |
353 | softchar = false; | 353 | softchar = false; |
354 | memset(progress_pattern, 0, sizeof(progress_pattern)); | 354 | memset(progress_pattern, 0, sizeof(progress_pattern)); |
355 | 355 | ||
356 | if ((digit = timestr[time_idx])) | 356 | if ((digit = timestr[time_idx])) |
357 | { | 357 | { |
358 | softchar = true; | 358 | softchar = true; |
359 | digit -= '0'; | 359 | digit -= '0'; |
360 | 360 | ||
361 | if (timestr[time_idx + 1] == ':') /* ones, left aligned */ | 361 | if (timestr[time_idx + 1] == ':') /* ones, left aligned */ |
362 | { | 362 | { |
363 | memcpy(progress_pattern, numbers[digit], 4); | 363 | memcpy(progress_pattern, numbers[digit], 4); |
364 | time_idx += 2; | 364 | time_idx += 2; |
365 | } | 365 | } |
@@ -498,8 +498,8 @@ struct gui_img* find_image(char label, struct wps_data *data) | |||
498 | list = list->next; | 498 | list = list->next; |
499 | } | 499 | } |
500 | return NULL; | 500 | return NULL; |
501 | } | 501 | } |
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | struct skin_viewport* find_viewport(char label, struct wps_data *data) | 504 | struct skin_viewport* find_viewport(char label, struct wps_data *data) |
505 | { | 505 | { |
@@ -512,9 +512,9 @@ struct skin_viewport* find_viewport(char label, struct wps_data *data) | |||
512 | list = list->next; | 512 | list = list->next; |
513 | } | 513 | } |
514 | return NULL; | 514 | return NULL; |
515 | } | 515 | } |
516 | 516 | ||
517 | 517 | ||
518 | /* Read a (sub)line to the given alignment format buffer. | 518 | /* Read a (sub)line to the given alignment format buffer. |
519 | linebuf is the buffer where the data is actually stored. | 519 | linebuf is the buffer where the data is actually stored. |
520 | align is the alignment format that'll be used to display the text. | 520 | align is the alignment format that'll be used to display the text. |
@@ -617,7 +617,7 @@ static bool get_line(struct gui_wps *gwps, | |||
617 | struct skin_token_list *list = data->viewports; | 617 | struct skin_token_list *list = data->viewports; |
618 | while (list) | 618 | while (list) |
619 | { | 619 | { |
620 | struct skin_viewport *vp = | 620 | struct skin_viewport *vp = |
621 | (struct skin_viewport *)list->token->value.data; | 621 | (struct skin_viewport *)list->token->value.data; |
622 | if (vp->label == label) | 622 | if (vp->label == label) |
623 | { | 623 | { |
@@ -859,7 +859,7 @@ static void write_line(struct screen *display, | |||
859 | ypos = (line * string_height); | 859 | ypos = (line * string_height); |
860 | 860 | ||
861 | 861 | ||
862 | if (scroll && ((left_width > scroll_width) || | 862 | if (scroll && ((left_width > scroll_width) || |
863 | (center_width > scroll_width) || | 863 | (center_width > scroll_width) || |
864 | (right_width > scroll_width))) | 864 | (right_width > scroll_width))) |
865 | { | 865 | { |
@@ -911,7 +911,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
911 | 911 | ||
912 | if (!id3) | 912 | if (!id3) |
913 | return false; | 913 | return false; |
914 | 914 | ||
915 | unsigned flags; | 915 | unsigned flags; |
916 | char linebuf[MAX_PATH]; | 916 | char linebuf[MAX_PATH]; |
917 | 917 | ||
@@ -919,8 +919,8 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
919 | align.left = NULL; | 919 | align.left = NULL; |
920 | align.center = NULL; | 920 | align.center = NULL; |
921 | align.right = NULL; | 921 | align.right = NULL; |
922 | 922 | ||
923 | 923 | ||
924 | struct skin_token_list *viewport_list; | 924 | struct skin_token_list *viewport_list; |
925 | 925 | ||
926 | bool update_line, new_subline_refresh; | 926 | bool update_line, new_subline_refresh; |
@@ -942,14 +942,14 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
942 | if (refresh_mode == WPS_REFRESH_ALL) | 942 | if (refresh_mode == WPS_REFRESH_ALL) |
943 | { | 943 | { |
944 | struct skin_line *line; | 944 | struct skin_line *line; |
945 | 945 | ||
946 | display->set_viewport(&find_viewport(VP_DEFAULT_LABEL, data)->vp); | 946 | display->set_viewport(&find_viewport(VP_DEFAULT_LABEL, data)->vp); |
947 | display->clear_viewport(); | 947 | display->clear_viewport(); |
948 | 948 | ||
949 | for (viewport_list = data->viewports; | 949 | for (viewport_list = data->viewports; |
950 | viewport_list; viewport_list = viewport_list->next) | 950 | viewport_list; viewport_list = viewport_list->next) |
951 | { | 951 | { |
952 | struct skin_viewport *skin_viewport = | 952 | struct skin_viewport *skin_viewport = |
953 | (struct skin_viewport *)viewport_list->token->value.data; | 953 | (struct skin_viewport *)viewport_list->token->value.data; |
954 | for(line = skin_viewport->lines; line; line = line->next) | 954 | for(line = skin_viewport->lines; line; line = line->next) |
955 | { | 955 | { |
@@ -968,10 +968,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
968 | #endif | 968 | #endif |
969 | 969 | ||
970 | /* disable any viewports which are conditionally displayed */ | 970 | /* disable any viewports which are conditionally displayed */ |
971 | for (viewport_list = data->viewports; | 971 | for (viewport_list = data->viewports; |
972 | viewport_list; viewport_list = viewport_list->next) | 972 | viewport_list; viewport_list = viewport_list->next) |
973 | { | 973 | { |
974 | struct skin_viewport *skin_viewport = | 974 | struct skin_viewport *skin_viewport = |
975 | (struct skin_viewport *)viewport_list->token->value.data; | 975 | (struct skin_viewport *)viewport_list->token->value.data; |
976 | if (skin_viewport->hidden_flags&VP_DRAW_HIDEABLE) | 976 | if (skin_viewport->hidden_flags&VP_DRAW_HIDEABLE) |
977 | { | 977 | { |
@@ -982,10 +982,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
982 | } | 982 | } |
983 | } | 983 | } |
984 | int viewport_count = 0; | 984 | int viewport_count = 0; |
985 | for (viewport_list = data->viewports; | 985 | for (viewport_list = data->viewports; |
986 | viewport_list; viewport_list = viewport_list->next, viewport_count++) | 986 | viewport_list; viewport_list = viewport_list->next, viewport_count++) |
987 | { | 987 | { |
988 | struct skin_viewport *skin_viewport = | 988 | struct skin_viewport *skin_viewport = |
989 | (struct skin_viewport *)viewport_list->token->value.data; | 989 | (struct skin_viewport *)viewport_list->token->value.data; |
990 | unsigned vp_refresh_mode = refresh_mode; | 990 | unsigned vp_refresh_mode = refresh_mode; |
991 | display->set_viewport(&skin_viewport->vp); | 991 | display->set_viewport(&skin_viewport->vp); |
@@ -995,7 +995,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
995 | struct skin_token_list *imglist = data->images; | 995 | struct skin_token_list *imglist = data->images; |
996 | while (imglist) | 996 | while (imglist) |
997 | { | 997 | { |
998 | struct gui_img *img = (struct gui_img *)imglist->token->value.data; | 998 | struct gui_img *img = (struct gui_img *)imglist->token->value.data; |
999 | img->display = -1; | 999 | img->display = -1; |
1000 | imglist = imglist->next; | 1000 | imglist = imglist->next; |
1001 | } | 1001 | } |
@@ -1019,11 +1019,11 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
1019 | { | 1019 | { |
1020 | display->clear_viewport(); | 1020 | display->clear_viewport(); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | /* loop over the lines for this viewport */ | 1023 | /* loop over the lines for this viewport */ |
1024 | struct skin_line *line; | 1024 | struct skin_line *line; |
1025 | int line_count = 0; | 1025 | int line_count = 0; |
1026 | 1026 | ||
1027 | for (line = skin_viewport->lines; line; line = line->next, line_count++) | 1027 | for (line = skin_viewport->lines; line; line = line->next, line_count++) |
1028 | { | 1028 | { |
1029 | struct skin_subline *subline; | 1029 | struct skin_subline *subline; |
@@ -1082,7 +1082,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) | |||
1082 | } | 1082 | } |
1083 | #endif | 1083 | #endif |
1084 | 1084 | ||
1085 | if (update_line && | 1085 | if (update_line && |
1086 | /* conditionals clear the line which means if the %Vd is put into the default | 1086 | /* conditionals clear the line which means if the %Vd is put into the default |
1087 | viewport there will be a blank line. | 1087 | viewport there will be a blank line. |
1088 | To get around this we dont allow any actual drawing to happen in the | 1088 | To get around this we dont allow any actual drawing to happen in the |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 5f5128533f..7d37e1972c 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -134,7 +134,7 @@ static int parse_dir_level(const char *wps_bufptr, | |||
134 | struct wps_token *token, struct wps_data *wps_data); | 134 | struct wps_token *token, struct wps_data *wps_data); |
135 | static int parse_setting(const char *wps_bufptr, | 135 | static int parse_setting(const char *wps_bufptr, |
136 | struct wps_token *token, struct wps_data *wps_data); | 136 | struct wps_token *token, struct wps_data *wps_data); |
137 | 137 | ||
138 | #ifdef HAVE_LCD_BITMAP | 138 | #ifdef HAVE_LCD_BITMAP |
139 | static int parse_viewport_display(const char *wps_bufptr, | 139 | static int parse_viewport_display(const char *wps_bufptr, |
140 | struct wps_token *token, struct wps_data *wps_data); | 140 | struct wps_token *token, struct wps_data *wps_data); |
@@ -170,7 +170,7 @@ static int fulline_tag_not_supported(const char *wps_bufptr, | |||
170 | return skip_end_of_line(wps_bufptr); | 170 | return skip_end_of_line(wps_bufptr); |
171 | } | 171 | } |
172 | #define parse_touchregion fulline_tag_not_supported | 172 | #define parse_touchregion fulline_tag_not_supported |
173 | #endif | 173 | #endif |
174 | #ifdef CONFIG_RTC | 174 | #ifdef CONFIG_RTC |
175 | #define WPS_RTC_REFRESH WPS_REFRESH_DYNAMIC | 175 | #define WPS_RTC_REFRESH WPS_REFRESH_DYNAMIC |
176 | #else | 176 | #else |
@@ -287,7 +287,7 @@ static const struct wps_tag all_tags[] = { | |||
287 | 287 | ||
288 | { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL }, | 288 | { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL }, |
289 | { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, | 289 | { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, |
290 | { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, | 290 | { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, |
291 | parse_timeout }, | 291 | parse_timeout }, |
292 | 292 | ||
293 | #ifdef HAVE_LCD_BITMAP | 293 | #ifdef HAVE_LCD_BITMAP |
@@ -340,7 +340,7 @@ static const struct wps_tag all_tags[] = { | |||
340 | { WPS_TOKEN_ALBUMART_DISPLAY, "C", WPS_REFRESH_STATIC, parse_albumart_display }, | 340 | { WPS_TOKEN_ALBUMART_DISPLAY, "C", WPS_REFRESH_STATIC, parse_albumart_display }, |
341 | #endif | 341 | #endif |
342 | 342 | ||
343 | { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, | 343 | { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, |
344 | parse_viewport_display }, | 344 | parse_viewport_display }, |
345 | { WPS_NO_TOKEN, "V", 0, parse_viewport }, | 345 | { WPS_NO_TOKEN, "V", 0, parse_viewport }, |
346 | 346 | ||
@@ -350,16 +350,16 @@ static const struct wps_tag all_tags[] = { | |||
350 | #endif | 350 | #endif |
351 | 351 | ||
352 | { WPS_TOKEN_SETTING, "St", WPS_REFRESH_DYNAMIC, parse_setting }, | 352 | { WPS_TOKEN_SETTING, "St", WPS_REFRESH_DYNAMIC, parse_setting }, |
353 | 353 | ||
354 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, | 354 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, |
355 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, | 355 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, |
356 | 356 | ||
357 | { WPS_TOKEN_UNKNOWN, "", 0, NULL } | 357 | { WPS_TOKEN_UNKNOWN, "", 0, NULL } |
358 | /* the array MUST end with an empty string (first char is \0) */ | 358 | /* the array MUST end with an empty string (first char is \0) */ |
359 | }; | 359 | }; |
360 | 360 | ||
361 | 361 | ||
362 | /* add a skin_token_list item to the list chain. ALWAYS appended because some of the | 362 | /* add a skin_token_list item to the list chain. ALWAYS appended because some of the |
363 | * chains require the order to be kept. | 363 | * chains require the order to be kept. |
364 | */ | 364 | */ |
365 | static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_list *item) | 365 | static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_list *item) |
@@ -371,9 +371,9 @@ static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_lis | |||
371 | struct skin_token_list *t = *list; | 371 | struct skin_token_list *t = *list; |
372 | while (t->next) | 372 | while (t->next) |
373 | t = t->next; | 373 | t = t->next; |
374 | t->next = item; | 374 | t->next = item; |
375 | } | 375 | } |
376 | } | 376 | } |
377 | /* create and init a new wpsll item. | 377 | /* create and init a new wpsll item. |
378 | * passing NULL to token will alloc a new one. | 378 | * passing NULL to token will alloc a new one. |
379 | * You should only pass NULL for the token when the token type (table above) | 379 | * You should only pass NULL for the token when the token type (table above) |
@@ -392,7 +392,7 @@ static struct skin_token_list *new_skin_token_list_item(struct wps_token *token, | |||
392 | if (token_data) | 392 | if (token_data) |
393 | llitem->token->value.data = token_data; | 393 | llitem->token->value.data = token_data; |
394 | return llitem; | 394 | return llitem; |
395 | } | 395 | } |
396 | 396 | ||
397 | /* Returns the number of chars that should be skipped to jump | 397 | /* Returns the number of chars that should be skipped to jump |
398 | immediately after the first eol, i.e. to the start of the next line */ | 398 | immediately after the first eol, i.e. to the start of the next line */ |
@@ -414,10 +414,10 @@ static bool skin_start_new_subline(struct skin_line *line, int curr_token) | |||
414 | 414 | ||
415 | subline->first_token_idx = curr_token; | 415 | subline->first_token_idx = curr_token; |
416 | subline->next = NULL; | 416 | subline->next = NULL; |
417 | 417 | ||
418 | subline->line_type = 0; | 418 | subline->line_type = 0; |
419 | subline->time_mult = 0; | 419 | subline->time_mult = 0; |
420 | 420 | ||
421 | line->curr_subline->last_token_idx = curr_token-1; | 421 | line->curr_subline->last_token_idx = curr_token-1; |
422 | line->curr_subline->next = subline; | 422 | line->curr_subline->next = subline; |
423 | line->curr_subline = subline; | 423 | line->curr_subline = subline; |
@@ -430,19 +430,19 @@ static bool skin_start_new_line(struct skin_viewport *vp, int curr_token) | |||
430 | struct skin_subline *subline = NULL; | 430 | struct skin_subline *subline = NULL; |
431 | if (!line) | 431 | if (!line) |
432 | return false; | 432 | return false; |
433 | 433 | ||
434 | /* init the subline */ | 434 | /* init the subline */ |
435 | subline = &line->sublines; | 435 | subline = &line->sublines; |
436 | subline->first_token_idx = curr_token; | 436 | subline->first_token_idx = curr_token; |
437 | subline->next = NULL; | 437 | subline->next = NULL; |
438 | subline->line_type = 0; | 438 | subline->line_type = 0; |
439 | subline->time_mult = 0; | 439 | subline->time_mult = 0; |
440 | 440 | ||
441 | /* init the new line */ | 441 | /* init the new line */ |
442 | line->curr_subline = &line->sublines; | 442 | line->curr_subline = &line->sublines; |
443 | line->next = NULL; | 443 | line->next = NULL; |
444 | line->subline_expire_time = 0; | 444 | line->subline_expire_time = 0; |
445 | 445 | ||
446 | /* connect to curr_line and vp pointers. | 446 | /* connect to curr_line and vp pointers. |
447 | * 1) close the previous lines subline | 447 | * 1) close the previous lines subline |
448 | * 2) connect to vp pointer | 448 | * 2) connect to vp pointer |
@@ -567,9 +567,9 @@ static int parse_image_load(const char *wps_bufptr, | |||
567 | const char *newline; | 567 | const char *newline; |
568 | int x,y; | 568 | int x,y; |
569 | struct gui_img *img; | 569 | struct gui_img *img; |
570 | 570 | ||
571 | /* format: %x|n|filename.bmp|x|y| | 571 | /* format: %x|n|filename.bmp|x|y| |
572 | or %xl|n|filename.bmp|x|y| | 572 | or %xl|n|filename.bmp|x|y| |
573 | or %xl|n|filename.bmp|x|y|num_subimages| | 573 | or %xl|n|filename.bmp|x|y|num_subimages| |
574 | */ | 574 | */ |
575 | 575 | ||
@@ -653,14 +653,14 @@ static int parse_viewport(const char *wps_bufptr, | |||
653 | (void)token; /* Kill warnings */ | 653 | (void)token; /* Kill warnings */ |
654 | const char *ptr = wps_bufptr; | 654 | const char *ptr = wps_bufptr; |
655 | 655 | ||
656 | const int screen = | 656 | const int screen = |
657 | #ifdef HAVE_REMOTE_LCD | 657 | #ifdef HAVE_REMOTE_LCD |
658 | wps_data->remote_wps ? SCREEN_REMOTE : | 658 | wps_data->remote_wps ? SCREEN_REMOTE : |
659 | #endif | 659 | #endif |
660 | SCREEN_MAIN; | 660 | SCREEN_MAIN; |
661 | 661 | ||
662 | struct skin_viewport *skin_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); | 662 | struct skin_viewport *skin_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); |
663 | 663 | ||
664 | /* check for the optional letter to signify its a hideable viewport */ | 664 | /* check for the optional letter to signify its a hideable viewport */ |
665 | /* %Vl|<label>|<rest of tags>| */ | 665 | /* %Vl|<label>|<rest of tags>| */ |
666 | skin_vp->hidden_flags = 0; | 666 | skin_vp->hidden_flags = 0; |
@@ -694,7 +694,7 @@ static int parse_viewport(const char *wps_bufptr, | |||
694 | } | 694 | } |
695 | if (*ptr != '|') | 695 | if (*ptr != '|') |
696 | return WPS_ERROR_INVALID_PARAM; | 696 | return WPS_ERROR_INVALID_PARAM; |
697 | 697 | ||
698 | ptr++; | 698 | ptr++; |
699 | struct viewport *vp = &skin_vp->vp; | 699 | struct viewport *vp = &skin_vp->vp; |
700 | /* format: %V|x|y|width|height|font|fg_pattern|bg_pattern| */ | 700 | /* format: %V|x|y|width|height|font|fg_pattern|bg_pattern| */ |
@@ -711,7 +711,7 @@ static int parse_viewport(const char *wps_bufptr, | |||
711 | if (!list) | 711 | if (!list) |
712 | return WPS_ERROR_INVALID_PARAM; | 712 | return WPS_ERROR_INVALID_PARAM; |
713 | add_to_ll_chain(&wps_data->viewports, list); | 713 | add_to_ll_chain(&wps_data->viewports, list); |
714 | curr_vp = skin_vp; | 714 | curr_vp = skin_vp; |
715 | /* Skip the rest of the line */ | 715 | /* Skip the rest of the line */ |
716 | return skip_end_of_line(wps_bufptr); | 716 | return skip_end_of_line(wps_bufptr); |
717 | } | 717 | } |
@@ -863,14 +863,14 @@ static int parse_progressbar(const char *wps_bufptr, | |||
863 | const char *ptr = wps_bufptr; | 863 | const char *ptr = wps_bufptr; |
864 | struct progressbar *pb = skin_buffer_alloc(sizeof(struct progressbar)); | 864 | struct progressbar *pb = skin_buffer_alloc(sizeof(struct progressbar)); |
865 | struct skin_token_list *item = new_skin_token_list_item(token, pb); | 865 | struct skin_token_list *item = new_skin_token_list_item(token, pb); |
866 | 866 | ||
867 | if (!pb || !item) | 867 | if (!pb || !item) |
868 | return WPS_ERROR_INVALID_PARAM; | 868 | return WPS_ERROR_INVALID_PARAM; |
869 | 869 | ||
870 | struct viewport *vp = &curr_vp->vp; | 870 | struct viewport *vp = &curr_vp->vp; |
871 | #ifndef __PCTOOL__ | 871 | #ifndef __PCTOOL__ |
872 | int font_height = font_get(vp->font)->height; | 872 | int font_height = font_get(vp->font)->height; |
873 | #else | 873 | #else |
874 | int font_height = 8; | 874 | int font_height = 8; |
875 | #endif | 875 | #endif |
876 | /* we need to know what line number (viewport relative) this pb is, | 876 | /* we need to know what line number (viewport relative) this pb is, |
@@ -884,7 +884,7 @@ static int parse_progressbar(const char *wps_bufptr, | |||
884 | } | 884 | } |
885 | pb->have_bitmap_pb = false; | 885 | pb->have_bitmap_pb = false; |
886 | pb->bm.data = NULL; /* no bitmap specified */ | 886 | pb->bm.data = NULL; /* no bitmap specified */ |
887 | 887 | ||
888 | if (*wps_bufptr != '|') /* regular old style */ | 888 | if (*wps_bufptr != '|') /* regular old style */ |
889 | { | 889 | { |
890 | pb->x = 0; | 890 | pb->x = 0; |
@@ -897,7 +897,7 @@ static int parse_progressbar(const char *wps_bufptr, | |||
897 | return 0; | 897 | return 0; |
898 | } | 898 | } |
899 | ptr = wps_bufptr + 1; | 899 | ptr = wps_bufptr + 1; |
900 | 900 | ||
901 | if (!(ptr = parse_list("sdddd", &set, '|', ptr, &filename, | 901 | if (!(ptr = parse_list("sdddd", &set, '|', ptr, &filename, |
902 | &x, &y, &width, &height))) | 902 | &x, &y, &width, &height))) |
903 | return WPS_ERROR_INVALID_PARAM; | 903 | return WPS_ERROR_INVALID_PARAM; |
@@ -1136,7 +1136,7 @@ static int parse_albumart_display(const char *wps_bufptr, | |||
1136 | #endif /* HAVE_ALBUMART */ | 1136 | #endif /* HAVE_ALBUMART */ |
1137 | 1137 | ||
1138 | #ifdef HAVE_TOUCHSCREEN | 1138 | #ifdef HAVE_TOUCHSCREEN |
1139 | 1139 | ||
1140 | struct touchaction {char* s; int action;}; | 1140 | struct touchaction {char* s; int action;}; |
1141 | static struct touchaction touchactions[] = { | 1141 | static struct touchaction touchactions[] = { |
1142 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, | 1142 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, |
@@ -1158,7 +1158,7 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1158 | const char pb_string[] = "progressbar"; | 1158 | const char pb_string[] = "progressbar"; |
1159 | const char vol_string[] = "volume"; | 1159 | const char vol_string[] = "volume"; |
1160 | int x,y,w,h; | 1160 | int x,y,w,h; |
1161 | 1161 | ||
1162 | /* format: %T|x|y|width|height|action| | 1162 | /* format: %T|x|y|width|height|action| |
1163 | * if action starts with & the area must be held to happen | 1163 | * if action starts with & the area must be held to happen |
1164 | * action is one of: | 1164 | * action is one of: |
@@ -1189,11 +1189,11 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1189 | /* Check there is a terminating | */ | 1189 | /* Check there is a terminating | */ |
1190 | if (*ptr != '|') | 1190 | if (*ptr != '|') |
1191 | return WPS_ERROR_INVALID_PARAM; | 1191 | return WPS_ERROR_INVALID_PARAM; |
1192 | 1192 | ||
1193 | region = skin_buffer_alloc(sizeof(struct touchregion)); | 1193 | region = skin_buffer_alloc(sizeof(struct touchregion)); |
1194 | if (!region) | 1194 | if (!region) |
1195 | return WPS_ERROR_INVALID_PARAM; | 1195 | return WPS_ERROR_INVALID_PARAM; |
1196 | 1196 | ||
1197 | /* should probably do some bounds checking here with the viewport... but later */ | 1197 | /* should probably do some bounds checking here with the viewport... but later */ |
1198 | region->action = ACTION_NONE; | 1198 | region->action = ACTION_NONE; |
1199 | region->x = x; | 1199 | region->x = x; |
@@ -1201,7 +1201,7 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1201 | region->width = w; | 1201 | region->width = w; |
1202 | region->height = h; | 1202 | region->height = h; |
1203 | region->wvp = curr_vp; | 1203 | region->wvp = curr_vp; |
1204 | 1204 | ||
1205 | if(!strncmp(pb_string, action, sizeof(pb_string)-1) | 1205 | if(!strncmp(pb_string, action, sizeof(pb_string)-1) |
1206 | && *(action + sizeof(pb_string)-1) == '|') | 1206 | && *(action + sizeof(pb_string)-1) == '|') |
1207 | region->type = WPS_TOUCHREGION_SCROLLBAR; | 1207 | region->type = WPS_TOUCHREGION_SCROLLBAR; |
@@ -1222,7 +1222,7 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1222 | 1222 | ||
1223 | i = 0; | 1223 | i = 0; |
1224 | imax = ARRAYLEN(touchactions); | 1224 | imax = ARRAYLEN(touchactions); |
1225 | while ((region->action == ACTION_NONE) && | 1225 | while ((region->action == ACTION_NONE) && |
1226 | (i < imax)) | 1226 | (i < imax)) |
1227 | { | 1227 | { |
1228 | /* try to match with one of our touchregion screens */ | 1228 | /* try to match with one of our touchregion screens */ |
@@ -1239,9 +1239,9 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1239 | if (!item) | 1239 | if (!item) |
1240 | return WPS_ERROR_INVALID_PARAM; | 1240 | return WPS_ERROR_INVALID_PARAM; |
1241 | add_to_ll_chain(&wps_data->touchregions, item); | 1241 | add_to_ll_chain(&wps_data->touchregions, item); |
1242 | return skip_end_of_line(wps_bufptr); | 1242 | return skip_end_of_line(wps_bufptr); |
1243 | } | 1243 | } |
1244 | #endif | 1244 | #endif |
1245 | 1245 | ||
1246 | /* Parse a generic token from the given string. Return the length read */ | 1246 | /* Parse a generic token from the given string. Return the length read */ |
1247 | static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) | 1247 | static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) |
@@ -1318,7 +1318,7 @@ static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) | |||
1318 | data is the pointer to the structure where the parsed WPS should be stored. | 1318 | data is the pointer to the structure where the parsed WPS should be stored. |
1319 | It is initialised. | 1319 | It is initialised. |
1320 | wps_bufptr points to the string containing the WPS tags */ | 1320 | wps_bufptr points to the string containing the WPS tags */ |
1321 | #define TOKEN_BLOCK_SIZE 128 | 1321 | #define TOKEN_BLOCK_SIZE 128 |
1322 | static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | 1322 | static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) |
1323 | { | 1323 | { |
1324 | if (!data || !wps_bufptr || !*wps_bufptr) | 1324 | if (!data || !wps_bufptr || !*wps_bufptr) |
@@ -1329,8 +1329,8 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1329 | size_t buf_free = 0; | 1329 | size_t buf_free = 0; |
1330 | line_number = 1; | 1330 | line_number = 1; |
1331 | level = -1; | 1331 | level = -1; |
1332 | 1332 | ||
1333 | /* allocate enough RAM for a reasonable skin, grow as needed. | 1333 | /* allocate enough RAM for a reasonable skin, grow as needed. |
1334 | * Free any used RAM before loading the images to be 100% RAM efficient */ | 1334 | * Free any used RAM before loading the images to be 100% RAM efficient */ |
1335 | data->tokens = (struct wps_token *)skin_buffer_grab(&buf_free); | 1335 | data->tokens = (struct wps_token *)skin_buffer_grab(&buf_free); |
1336 | if (sizeof(struct wps_token)*max_tokens >= buf_free) | 1336 | if (sizeof(struct wps_token)*max_tokens >= buf_free) |
@@ -1354,7 +1354,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1354 | skin_buffer_increment(needed, false); | 1354 | skin_buffer_increment(needed, false); |
1355 | max_tokens += extra_tokens; | 1355 | max_tokens += extra_tokens; |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | switch(*wps_bufptr++) | 1358 | switch(*wps_bufptr++) |
1359 | { | 1359 | { |
1360 | 1360 | ||
@@ -1468,7 +1468,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1468 | data->num_tokens++; | 1468 | data->num_tokens++; |
1469 | 1469 | ||
1470 | if (!skin_start_new_line(curr_vp, data->num_tokens)) | 1470 | if (!skin_start_new_line(curr_vp, data->num_tokens)) |
1471 | { | 1471 | { |
1472 | fail = PARSE_FAIL_LIMITS_EXCEEDED; | 1472 | fail = PARSE_FAIL_LIMITS_EXCEEDED; |
1473 | break; | 1473 | break; |
1474 | } | 1474 | } |
@@ -1500,7 +1500,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1500 | str = (char*)list->token->value.data; | 1500 | str = (char*)list->token->value.data; |
1501 | found = (strlen(str) == len && | 1501 | found = (strlen(str) == len && |
1502 | strncmp(string_start, str, len) == 0); | 1502 | strncmp(string_start, str, len) == 0); |
1503 | if (found) | 1503 | if (found) |
1504 | break; /* break here because the list item is | 1504 | break; /* break here because the list item is |
1505 | used if its found */ | 1505 | used if its found */ |
1506 | list = list->next; | 1506 | list = list->next; |
@@ -1518,7 +1518,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1518 | break; | 1518 | break; |
1519 | } | 1519 | } |
1520 | strlcpy(str, string_start, len+1); | 1520 | strlcpy(str, string_start, len+1); |
1521 | struct skin_token_list *item = | 1521 | struct skin_token_list *item = |
1522 | new_skin_token_list_item(&data->tokens[data->num_tokens], str); | 1522 | new_skin_token_list_item(&data->tokens[data->num_tokens], str); |
1523 | if(!item) | 1523 | if(!item) |
1524 | { | 1524 | { |
@@ -1541,7 +1541,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1541 | 1541 | ||
1542 | if (!fail && level >= 0) /* there are unclosed conditionals */ | 1542 | if (!fail && level >= 0) /* there are unclosed conditionals */ |
1543 | fail = PARSE_FAIL_UNCLOSED_COND; | 1543 | fail = PARSE_FAIL_UNCLOSED_COND; |
1544 | 1544 | ||
1545 | if (*wps_bufptr && !fail) | 1545 | if (*wps_bufptr && !fail) |
1546 | /* one of the limits of the while loop was exceeded */ | 1546 | /* one of the limits of the while loop was exceeded */ |
1547 | fail = PARSE_FAIL_LIMITS_EXCEEDED; | 1547 | fail = PARSE_FAIL_LIMITS_EXCEEDED; |
@@ -1550,9 +1550,9 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1550 | curr_line->curr_subline->last_token_idx = data->num_tokens; | 1550 | curr_line->curr_subline->last_token_idx = data->num_tokens; |
1551 | data->tokens[data->num_tokens++].type = WPS_NO_TOKEN; | 1551 | data->tokens[data->num_tokens++].type = WPS_NO_TOKEN; |
1552 | /* freeup unused tokens */ | 1552 | /* freeup unused tokens */ |
1553 | skin_buffer_free_from_front(sizeof(struct wps_token) | 1553 | skin_buffer_free_from_front(sizeof(struct wps_token) |
1554 | * (max_tokens - data->num_tokens)); | 1554 | * (max_tokens - data->num_tokens)); |
1555 | 1555 | ||
1556 | #if defined(DEBUG) || defined(SIMULATOR) | 1556 | #if defined(DEBUG) || defined(SIMULATOR) |
1557 | if (debug) | 1557 | if (debug) |
1558 | print_debug_info(data, fail, line_number); | 1558 | print_debug_info(data, fail, line_number); |
@@ -1583,7 +1583,7 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char | |||
1583 | char img_path[MAX_PATH]; | 1583 | char img_path[MAX_PATH]; |
1584 | get_image_filename(bitmap->data, bmpdir, | 1584 | get_image_filename(bitmap->data, bmpdir, |
1585 | img_path, sizeof(img_path)); | 1585 | img_path, sizeof(img_path)); |
1586 | 1586 | ||
1587 | /* load the image */ | 1587 | /* load the image */ |
1588 | int format; | 1588 | int format; |
1589 | #ifdef HAVE_REMOTE_LCD | 1589 | #ifdef HAVE_REMOTE_LCD |
@@ -1592,7 +1592,7 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char | |||
1592 | else | 1592 | else |
1593 | #endif | 1593 | #endif |
1594 | format = FORMAT_ANY|FORMAT_TRANSPARENT; | 1594 | format = FORMAT_ANY|FORMAT_TRANSPARENT; |
1595 | 1595 | ||
1596 | size_t max_buf; | 1596 | size_t max_buf; |
1597 | char* imgbuf = (char*)skin_buffer_grab(&max_buf); | 1597 | char* imgbuf = (char*)skin_buffer_grab(&max_buf); |
1598 | bitmap->data = imgbuf; | 1598 | bitmap->data = imgbuf; |
@@ -1625,7 +1625,7 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
1625 | pb->have_bitmap_pb = load_skin_bmp(wps_data, &pb->bm, bmpdir); | 1625 | pb->have_bitmap_pb = load_skin_bmp(wps_data, &pb->bm, bmpdir); |
1626 | } | 1626 | } |
1627 | list = list->next; | 1627 | list = list->next; |
1628 | } | 1628 | } |
1629 | /* regular images */ | 1629 | /* regular images */ |
1630 | list = wps_data->images; | 1630 | list = wps_data->images; |
1631 | while (list) | 1631 | while (list) |
@@ -1669,7 +1669,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1669 | const char *buf, | 1669 | const char *buf, |
1670 | bool isfile) | 1670 | bool isfile) |
1671 | { | 1671 | { |
1672 | 1672 | ||
1673 | if (!wps_data || !buf) | 1673 | if (!wps_data || !buf) |
1674 | return false; | 1674 | return false; |
1675 | #ifdef HAVE_ALBUMART | 1675 | #ifdef HAVE_ALBUMART |
@@ -1686,7 +1686,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1686 | #endif | 1686 | #endif |
1687 | 1687 | ||
1688 | wps_reset(wps_data); | 1688 | wps_reset(wps_data); |
1689 | 1689 | ||
1690 | curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); | 1690 | curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); |
1691 | if (!curr_vp) | 1691 | if (!curr_vp) |
1692 | return false; | 1692 | return false; |
@@ -1694,7 +1694,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1694 | if (!list) | 1694 | if (!list) |
1695 | return false; | 1695 | return false; |
1696 | add_to_ll_chain(&wps_data->viewports, list); | 1696 | add_to_ll_chain(&wps_data->viewports, list); |
1697 | 1697 | ||
1698 | 1698 | ||
1699 | /* Initialise the first (default) viewport */ | 1699 | /* Initialise the first (default) viewport */ |
1700 | curr_vp->label = VP_DEFAULT_LABEL; | 1700 | curr_vp->label = VP_DEFAULT_LABEL; |
@@ -1704,17 +1704,17 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1704 | curr_vp->pb = NULL; | 1704 | curr_vp->pb = NULL; |
1705 | curr_vp->hidden_flags = 0; | 1705 | curr_vp->hidden_flags = 0; |
1706 | curr_vp->lines = NULL; | 1706 | curr_vp->lines = NULL; |
1707 | 1707 | ||
1708 | curr_line = NULL; | 1708 | curr_line = NULL; |
1709 | if (!skin_start_new_line(curr_vp, 0)) | 1709 | if (!skin_start_new_line(curr_vp, 0)) |
1710 | return false; | 1710 | return false; |
1711 | 1711 | ||
1712 | switch (statusbar_position(display->screen_type)) | 1712 | switch (statusbar_position(display->screen_type)) |
1713 | { | 1713 | { |
1714 | case STATUSBAR_OFF: | 1714 | case STATUSBAR_OFF: |
1715 | curr_vp->vp.y = 0; | 1715 | curr_vp->vp.y = 0; |
1716 | break; | 1716 | break; |
1717 | case STATUSBAR_TOP: | 1717 | case STATUSBAR_TOP: |
1718 | curr_vp->vp.y = STATUSBAR_HEIGHT; | 1718 | curr_vp->vp.y = STATUSBAR_HEIGHT; |
1719 | curr_vp->vp.height -= STATUSBAR_HEIGHT; | 1719 | curr_vp->vp.height -= STATUSBAR_HEIGHT; |
1720 | break; | 1720 | break; |
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index deab0eaf60..7f83da0451 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -465,7 +465,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
465 | int mode = 1; | 465 | int mode = 1; |
466 | if (status == AUDIO_STATUS_PLAY) | 466 | if (status == AUDIO_STATUS_PLAY) |
467 | mode = 2; | 467 | mode = 2; |
468 | if (is_wps_fading() || | 468 | if (is_wps_fading() || |
469 | (status & AUDIO_STATUS_PAUSE && !status_get_ffmode())) | 469 | (status & AUDIO_STATUS_PAUSE && !status_get_ffmode())) |
470 | mode = 3; | 470 | mode = 3; |
471 | if (status_get_ffmode() == STATUS_FASTFORWARD) | 471 | if (status_get_ffmode() == STATUS_FASTFORWARD) |
@@ -486,7 +486,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
486 | *intval = global_settings.repeat_mode + 1; | 486 | *intval = global_settings.repeat_mode + 1; |
487 | snprintf(buf, buf_size, "%d", global_settings.repeat_mode); | 487 | snprintf(buf, buf_size, "%d", global_settings.repeat_mode); |
488 | return buf; | 488 | return buf; |
489 | 489 | ||
490 | case WPS_TOKEN_RTC_PRESENT: | 490 | case WPS_TOKEN_RTC_PRESENT: |
491 | #if CONFIG_RTC | 491 | #if CONFIG_RTC |
492 | return "c"; | 492 | return "c"; |
@@ -744,7 +744,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
744 | return NULL; | 744 | return NULL; |
745 | #endif | 745 | #endif |
746 | case WPS_TOKEN_BUTTON_VOLUME: | 746 | case WPS_TOKEN_BUTTON_VOLUME: |
747 | if (data->button_time_volume && | 747 | if (data->button_time_volume && |
748 | TIME_BEFORE(current_tick, data->button_time_volume + | 748 | TIME_BEFORE(current_tick, data->button_time_volume + |
749 | token->value.i * TIMEOUT_UNIT)) | 749 | token->value.i * TIMEOUT_UNIT)) |
750 | return "v"; | 750 | return "v"; |
diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c index e27d276302..f23dd692f8 100644 --- a/apps/gui/skin_engine/wps_debug.c +++ b/apps/gui/skin_engine/wps_debug.c | |||
@@ -48,7 +48,7 @@ static char *next_str(bool next) { | |||
48 | static char *get_token_desc(struct wps_token *token, char *buf, | 48 | static char *get_token_desc(struct wps_token *token, char *buf, |
49 | int bufsize, struct wps_data *data) | 49 | int bufsize, struct wps_data *data) |
50 | { | 50 | { |
51 | #ifndef HAVE_LCD_BITMAP | 51 | #ifndef HAVE_LCD_BITMAP |
52 | (void)data; /* kill charcell warning */ | 52 | (void)data; /* kill charcell warning */ |
53 | #endif | 53 | #endif |
54 | bool next = token->next; | 54 | bool next = token->next; |
@@ -66,7 +66,7 @@ static char *get_token_desc(struct wps_token *token, char *buf, | |||
66 | case WPS_TOKEN_CHARACTER: | 66 | case WPS_TOKEN_CHARACTER: |
67 | if (token->value.c == '\n') | 67 | if (token->value.c == '\n') |
68 | snprintf(buf, bufsize, "Character '\\n'"); | 68 | snprintf(buf, bufsize, "Character '\\n'"); |
69 | else | 69 | else |
70 | snprintf(buf, bufsize, "Character '%c'", | 70 | snprintf(buf, bufsize, "Character '%c'", |
71 | token->value.c); | 71 | token->value.c); |
72 | break; | 72 | break; |
@@ -471,16 +471,16 @@ static void dump_skin(struct wps_data *data) | |||
471 | int indent = 0; | 471 | int indent = 0; |
472 | char buf[64]; | 472 | char buf[64]; |
473 | int i, j; | 473 | int i, j; |
474 | 474 | ||
475 | struct skin_token_list *viewport_list; | 475 | struct skin_token_list *viewport_list; |
476 | for (viewport_list = data->viewports; | 476 | for (viewport_list = data->viewports; |
477 | viewport_list; viewport_list = viewport_list->next) | 477 | viewport_list; viewport_list = viewport_list->next) |
478 | { | 478 | { |
479 | struct skin_viewport *skin_viewport = | 479 | struct skin_viewport *skin_viewport = |
480 | (struct skin_viewport *)viewport_list->token->value.data; | 480 | (struct skin_viewport *)viewport_list->token->value.data; |
481 | indent = 0; | 481 | indent = 0; |
482 | DEBUGF("Viewport: '%c'\n", skin_viewport->label); | 482 | DEBUGF("Viewport: '%c'\n", skin_viewport->label); |
483 | struct skin_line *line; | 483 | struct skin_line *line; |
484 | for (line = skin_viewport->lines; line; line = line->next) | 484 | for (line = skin_viewport->lines; line; line = line->next) |
485 | { | 485 | { |
486 | struct skin_subline *subline; | 486 | struct skin_subline *subline; |
@@ -529,7 +529,7 @@ static void dump_skin(struct wps_data *data) | |||
529 | } | 529 | } |
530 | } | 530 | } |
531 | } | 531 | } |
532 | } | 532 | } |
533 | #endif | 533 | #endif |
534 | 534 | ||
535 | void print_debug_info(struct wps_data *data, enum wps_parse_error fail, int line) | 535 | void print_debug_info(struct wps_data *data, enum wps_parse_error fail, int line) |
@@ -555,7 +555,7 @@ void print_debug_info(struct wps_data *data, enum wps_parse_error fail, int line | |||
555 | { | 555 | { |
556 | case PARSE_OK: | 556 | case PARSE_OK: |
557 | break; | 557 | break; |
558 | 558 | ||
559 | case PARSE_FAIL_UNCLOSED_COND: | 559 | case PARSE_FAIL_UNCLOSED_COND: |
560 | DEBUGF("ERR: Unclosed conditional"); | 560 | DEBUGF("ERR: Unclosed conditional"); |
561 | break; | 561 | break; |
@@ -580,7 +580,7 @@ void print_debug_info(struct wps_data *data, enum wps_parse_error fail, int line | |||
580 | get_token_desc(&data->tokens[data->num_tokens], buf, sizeof(buf), data) | 580 | get_token_desc(&data->tokens[data->num_tokens], buf, sizeof(buf), data) |
581 | ); | 581 | ); |
582 | break; | 582 | break; |
583 | 583 | ||
584 | case PARSE_FAIL_LIMITS_EXCEEDED: | 584 | case PARSE_FAIL_LIMITS_EXCEEDED: |
585 | DEBUGF("ERR: Limits exceeded"); | 585 | DEBUGF("ERR: Limits exceeded"); |
586 | break; | 586 | break; |
@@ -595,6 +595,6 @@ void debug_skin_usage(void) | |||
595 | DEBUGF("Skin buffer usage: %lu/%lu\n", (unsigned long)skin_buffer_usage(), | 595 | DEBUGF("Skin buffer usage: %lu/%lu\n", (unsigned long)skin_buffer_usage(), |
596 | (unsigned long)(skin_buffer_usage() + skin_buffer_freespace())); | 596 | (unsigned long)(skin_buffer_usage() + skin_buffer_freespace())); |
597 | } | 597 | } |
598 | 598 | ||
599 | 599 | ||
600 | #endif /* DEBUG || SIMULATOR */ | 600 | #endif /* DEBUG || SIMULATOR */ |