summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-08 15:09:32 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-08 15:09:32 +0000
commit50356d8387383a62bad97b2d3ea5b5af8d06805a (patch)
tree44313ad4268bdd517306ccf2df039318e2863992
parent360ed994a3788d9cbdf95554cc6144bea22b2166 (diff)
downloadrockbox-50356d8387383a62bad97b2d3ea5b5af8d06805a.tar.gz
rockbox-50356d8387383a62bad97b2d3ea5b5af8d06805a.zip
The real reason to change the %C was to remove a very nasty hack!
%CL - load the AA %C - check if AA is avilable %Cd - display the AA git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26696 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_parser.c7
-rw-r--r--manual/appendix/wps_tags.tex3
-rw-r--r--utils/skinupdater/skinupdater.c21
-rw-r--r--utils/skinupdater/tag_table.c2
4 files changed, 21 insertions, 12 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index f5d49f9e22..293358bb0a 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -391,6 +391,7 @@ static const struct wps_tag all_tags[] = {
391#ifdef HAVE_ALBUMART 391#ifdef HAVE_ALBUMART
392 { WPS_NO_TOKEN, "Cl", 0, parse_albumart_load }, 392 { WPS_NO_TOKEN, "Cl", 0, parse_albumart_load },
393 { WPS_TOKEN_ALBUMART_DISPLAY, "Cd", WPS_REFRESH_STATIC, parse_albumart_display }, 393 { WPS_TOKEN_ALBUMART_DISPLAY, "Cd", WPS_REFRESH_STATIC, parse_albumart_display },
394 { WPS_TOKEN_ALBUMART_FOUND, "C", WPS_REFRESH_STATIC, NULL },
394#endif 395#endif
395 396
396 { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, 397 { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC,
@@ -1482,11 +1483,7 @@ static int parse_albumart_display(const char *wps_bufptr,
1482{ 1483{
1483 (void)wps_bufptr; 1484 (void)wps_bufptr;
1484 struct wps_token *prev = token-1; 1485 struct wps_token *prev = token-1;
1485 if ((wps_data->num_tokens >= 1) && (prev->type == WPS_TOKEN_CONDITIONAL)) 1486 if (wps_data->albumart)
1486 {
1487 token->type = WPS_TOKEN_ALBUMART_FOUND;
1488 }
1489 else if (wps_data->albumart)
1490 { 1487 {
1491 wps_data->albumart->vp = &curr_vp->vp; 1488 wps_data->albumart->vp = &curr_vp->vp;
1492 } 1489 }
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index 7b1c5cd907..a60c4d2b0b 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -389,7 +389,8 @@ follows.
389 & \config{y}: y coordinate\\ 389 & \config{y}: y coordinate\\
390 & \config{maxwidth}: Maximum height\\ 390 & \config{maxwidth}: Maximum height\\
391 & \config{maxheight}: Maximum width\\ 391 & \config{maxheight}: Maximum width\\
392 \config{\%Cd} & Display the album art as configured. This tag can also be used as a conditional.\\ 392 \config{\%Cd} & Display the album art as configured. \\
393 \config{\%C} & USe in a conditional to determine if an image is available. \\
393 \end{tagmap} 394 \end{tagmap}
394 395
395The picture will be rescaled, preserving aspect ratio to fit the given 396The picture will be rescaled, preserving aspect ratio to fit the given
diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c
index dd4d2f338b..e249996cd5 100644
--- a/utils/skinupdater/skinupdater.c
+++ b/utils/skinupdater/skinupdater.c
@@ -116,6 +116,12 @@ int parse_tag(FILE* out, const char* start, bool in_conditional)
116 fprintf(out, "%s", tag->name); 116 fprintf(out, "%s", tag->name);
117 return strlen(tag->name); 117 return strlen(tag->name);
118 } 118 }
119 if (!strcmp(tag->name, "C"))
120 {
121 fprintf(out, "Cd");
122 return 1;
123 }
124
119 fprintf(out, "%s", tag->name); 125 fprintf(out, "%s", tag->name);
120 len += strlen(tag->name); 126 len += strlen(tag->name);
121 start += len; 127 start += len;
@@ -190,10 +196,6 @@ int parse_tag(FILE* out, const char* start, bool in_conditional)
190 PUTCH(out, '('); 196 PUTCH(out, '(');
191 len += 1+dump_arg(out, start+1, 2, true); 197 len += 1+dump_arg(out, start+1, 2, true);
192 } 198 }
193 else if (MATCH("C"))
194 {
195 fprintf(out, "%%Cd");
196 }
197 else if (MATCH("Cl")) 199 else if (MATCH("Cl"))
198 { 200 {
199 int read; 201 int read;
@@ -365,7 +367,16 @@ top:
365 goto top; 367 goto top;
366 break; 368 break;
367 case '?': 369 case '?':
368 PUTCH(out, *in++); 370 if (in[1] == 'C' && in[2] == '<')
371 {
372 fprintf(out, "?C");
373 in += 2;
374 goto top;
375 }
376 else
377 {
378 PUTCH(out, *in++);
379 }
369 break; 380 break;
370 } 381 }
371 len = parse_tag(out, in, level>0); 382 len = parse_tag(out, in, level>0);
diff --git a/utils/skinupdater/tag_table.c b/utils/skinupdater/tag_table.c
index 96b237d80e..a1a5863de0 100644
--- a/utils/skinupdater/tag_table.c
+++ b/utils/skinupdater/tag_table.c
@@ -173,7 +173,7 @@ struct tag_info legal_tags[] =
173 173
174 { "Fl" , "IF"}, 174 { "Fl" , "IF"},
175 { "Cl" , "IISS"}, 175 { "Cl" , "IISS"},
176 { "C" , ""}, 176 { "C" , "important"},
177 177
178 { "Vd" , "S"}, 178 { "Vd" , "S"},
179 { "VI" , "S"}, 179 { "VI" , "S"},