diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-03-06 14:14:44 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-03-06 14:14:44 +0000 |
commit | 1fbdd913337cbf235ebe3a2cf52f73b661f3b1cf (patch) | |
tree | de142d611e1912ebb315025f506535008b71f51d /apps/gui/skin_engine/skin_parser.c | |
parent | f79b45d8bb30d80c453f4722b23de31db3b49bf0 (diff) | |
download | rockbox-1fbdd913337cbf235ebe3a2cf52f73b661f3b1cf.tar.gz rockbox-1fbdd913337cbf235ebe3a2cf52f73b661f3b1cf.zip |
skin: don't calculate id3->elapsed+state->ff_rewind_count each time. remove trailing spaces.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25045 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index b66af75cb5..059c3d779c 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -380,7 +380,7 @@ static const struct wps_tag all_tags[] = { | |||
380 | #endif | 380 | #endif |
381 | 381 | ||
382 | { WPS_TOKEN_SETTING, "St", WPS_REFRESH_DYNAMIC, | 382 | { WPS_TOKEN_SETTING, "St", WPS_REFRESH_DYNAMIC, |
383 | parse_setting_and_lang }, | 383 | parse_setting_and_lang }, |
384 | { WPS_TOKEN_TRANSLATEDSTRING, "Sx", WPS_REFRESH_STATIC, | 384 | { WPS_TOKEN_TRANSLATEDSTRING, "Sx", WPS_REFRESH_STATIC, |
385 | parse_setting_and_lang }, | 385 | parse_setting_and_lang }, |
386 | { WPS_TOKEN_LANG_IS_RTL , "Sr", WPS_REFRESH_STATIC, NULL }, | 386 | { WPS_TOKEN_LANG_IS_RTL , "Sr", WPS_REFRESH_STATIC, NULL }, |
@@ -388,8 +388,8 @@ static const struct wps_tag all_tags[] = { | |||
388 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, | 388 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, |
389 | { WPS_TOKEN_CURRENT_SCREEN, "cs", WPS_REFRESH_DYNAMIC, NULL }, | 389 | { WPS_TOKEN_CURRENT_SCREEN, "cs", WPS_REFRESH_DYNAMIC, NULL }, |
390 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, | 390 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, |
391 | 391 | ||
392 | 392 | ||
393 | /* Recording Tokens */ | 393 | /* Recording Tokens */ |
394 | { WPS_TOKEN_HAVE_RECORDING, "Rp", WPS_REFRESH_STATIC, NULL }, | 394 | { WPS_TOKEN_HAVE_RECORDING, "Rp", WPS_REFRESH_STATIC, NULL }, |
395 | #ifdef HAVE_RECORDING | 395 | #ifdef HAVE_RECORDING |
@@ -827,12 +827,12 @@ static int parse_playlistview_text(struct playlistviewer *viewer, | |||
827 | taglen = i; | 827 | taglen = i; |
828 | } | 828 | } |
829 | else | 829 | else |
830 | { | 830 | { |
831 | if (tag->parse_func) | 831 | if (tag->parse_func) |
832 | { | 832 | { |
833 | /* unsupported tag, reject */ | 833 | /* unsupported tag, reject */ |
834 | return -1; | 834 | return -1; |
835 | } | 835 | } |
836 | taglen = strlen(tag->name); | 836 | taglen = strlen(tag->name); |
837 | viewer->lines[line].tokens[viewer->lines[line].count++] = tag->type; | 837 | viewer->lines[line].tokens[viewer->lines[line].count++] = tag->type; |
838 | } | 838 | } |
@@ -857,7 +857,7 @@ static int parse_playlistview_text(struct playlistviewer *viewer, | |||
857 | } | 857 | } |
858 | return text - start; | 858 | return text - start; |
859 | } | 859 | } |
860 | 860 | ||
861 | 861 | ||
862 | static int parse_playlistview(const char *wps_bufptr, | 862 | static int parse_playlistview(const char *wps_bufptr, |
863 | struct wps_token *token, struct wps_data *wps_data) | 863 | struct wps_token *token, struct wps_data *wps_data) |
@@ -874,10 +874,10 @@ static int parse_playlistview(const char *wps_bufptr, | |||
874 | viewer->start_offset = atoi(ptr+1); | 874 | viewer->start_offset = atoi(ptr+1); |
875 | token->value.data = (void*)viewer; | 875 | token->value.data = (void*)viewer; |
876 | ptr = strchr(ptr+1, '|'); | 876 | ptr = strchr(ptr+1, '|'); |
877 | length = parse_playlistview_text(viewer, TRACK_HAS_INFO, ptr); | 877 | length = parse_playlistview_text(viewer, TRACK_HAS_INFO, ptr); |
878 | if (length < 0) | 878 | if (length < 0) |
879 | return WPS_ERROR_INVALID_PARAM; | 879 | return WPS_ERROR_INVALID_PARAM; |
880 | length = parse_playlistview_text(viewer, TRACK_HAS_NO_INFO, ptr+length); | 880 | length = parse_playlistview_text(viewer, TRACK_HAS_NO_INFO, ptr+length); |
881 | if (length < 0) | 881 | if (length < 0) |
882 | return WPS_ERROR_INVALID_PARAM; | 882 | return WPS_ERROR_INVALID_PARAM; |
883 | 883 | ||
@@ -909,8 +909,7 @@ static int parse_viewport(const char *wps_bufptr, | |||
909 | curr_line = NULL; | 909 | curr_line = NULL; |
910 | if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) | 910 | if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) |
911 | return WPS_ERROR_INVALID_PARAM; | 911 | return WPS_ERROR_INVALID_PARAM; |
912 | 912 | ||
913 | |||
914 | if (*ptr == 'i') | 913 | if (*ptr == 'i') |
915 | { | 914 | { |
916 | skin_vp->label = VP_INFO_LABEL; | 915 | skin_vp->label = VP_INFO_LABEL; |
@@ -940,7 +939,7 @@ static int parse_viewport(const char *wps_bufptr, | |||
940 | /* format: %V|x|y|width|height|font|fg_pattern|bg_pattern| */ | 939 | /* format: %V|x|y|width|height|font|fg_pattern|bg_pattern| */ |
941 | if (!(ptr = viewport_parse_viewport(vp, curr_screen, ptr, '|'))) | 940 | if (!(ptr = viewport_parse_viewport(vp, curr_screen, ptr, '|'))) |
942 | return WPS_ERROR_INVALID_PARAM; | 941 | return WPS_ERROR_INVALID_PARAM; |
943 | 942 | ||
944 | /* Check for trailing | */ | 943 | /* Check for trailing | */ |
945 | if (*ptr != '|') | 944 | if (*ptr != '|') |
946 | return WPS_ERROR_INVALID_PARAM; | 945 | return WPS_ERROR_INVALID_PARAM; |
@@ -975,9 +974,8 @@ static int parse_image_special(const char *wps_bufptr, | |||
975 | 974 | ||
976 | pos = strchr(wps_bufptr + 1, '|'); | 975 | pos = strchr(wps_bufptr + 1, '|'); |
977 | newline = strchr(wps_bufptr, '\n'); | 976 | newline = strchr(wps_bufptr, '\n'); |
978 | 977 | ||
979 | error = (pos > newline); | 978 | error = (pos > newline); |
980 | |||
981 | 979 | ||
982 | #if LCD_DEPTH > 1 | 980 | #if LCD_DEPTH > 1 |
983 | if (token->type == WPS_TOKEN_IMAGE_BACKDROP) | 981 | if (token->type == WPS_TOKEN_IMAGE_BACKDROP) |
@@ -1386,7 +1384,7 @@ static int parse_albumart_load(const char *wps_bufptr, | |||
1386 | aa->height = 0; | 1384 | aa->height = 0; |
1387 | else if (aa->height > LCD_HEIGHT) | 1385 | else if (aa->height > LCD_HEIGHT) |
1388 | aa->height = LCD_HEIGHT; | 1386 | aa->height = LCD_HEIGHT; |
1389 | 1387 | ||
1390 | if (swap_for_rtl) | 1388 | if (swap_for_rtl) |
1391 | aa->x = LCD_WIDTH - (aa->x + aa->width); | 1389 | aa->x = LCD_WIDTH - (aa->x + aa->width); |
1392 | 1390 | ||
@@ -1689,7 +1687,7 @@ static int check_feature_tag(const char *wps_bufptr, const int type) | |||
1689 | return 0; | 1687 | return 0; |
1690 | #else | 1688 | #else |
1691 | return find_false_branch(wps_bufptr); | 1689 | return find_false_branch(wps_bufptr); |
1692 | #endif | 1690 | #endif |
1693 | default: /* not a tag we care about, just don't skip */ | 1691 | default: /* not a tag we care about, just don't skip */ |
1694 | return 0; | 1692 | return 0; |
1695 | } | 1693 | } |
@@ -2083,8 +2081,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
2083 | if (wps_data->backdrop) | 2081 | if (wps_data->backdrop) |
2084 | { | 2082 | { |
2085 | bool needed = wps_data->backdrop[0] != '-'; | 2083 | bool needed = wps_data->backdrop[0] != '-'; |
2086 | wps_data->backdrop = skin_backdrop_load(wps_data->backdrop, | 2084 | wps_data->backdrop = skin_backdrop_load(wps_data->backdrop, |
2087 | bmpdir, curr_screen); | 2085 | bmpdir, curr_screen); |
2088 | if (!wps_data->backdrop && needed) | 2086 | if (!wps_data->backdrop && needed) |
2089 | retval = false; | 2087 | retval = false; |
2090 | } | 2088 | } |