summaryrefslogtreecommitdiffstats
path: root/utils/skinupdater/skinupdater.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-02 09:51:03 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-02 09:51:03 +0000
commit57ad6f9b039f810880f46c1b447955a3c3df4842 (patch)
tree3a230d7357a7bd2c1f21b2005b3fad66366be655 /utils/skinupdater/skinupdater.c
parentff2d224ae7b15a7e651f57211605c69dbb946ce8 (diff)
downloadrockbox-57ad6f9b039f810880f46c1b447955a3c3df4842.tar.gz
rockbox-57ad6f9b039f810880f46c1b447955a3c3df4842.tar.bz2
rockbox-57ad6f9b039f810880f46c1b447955a3c3df4842.zip
change the %Cl tag to be cleaner. it it now %Cl(x, y, width, height [, xalign][, yalign])
d,i,s modifiers are no longer supported (were there for origional compatability) and +,- modifiers are not supported anymore either. Legal values for xalign are: l,c,r (left, center, right) Legal values for xalign are: t,c,b (top, center, bottom) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26475 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/skinupdater/skinupdater.c')
-rw-r--r--utils/skinupdater/skinupdater.c73
1 files changed, 72 insertions, 1 deletions
diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c
index 537c53ffbd..6577b77e6a 100644
--- a/utils/skinupdater/skinupdater.c
+++ b/utils/skinupdater/skinupdater.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
+#include <ctype.h>
#include "tag_table.h"
#define PUTCH(out, c) fprintf(out, "%c", c)
@@ -191,8 +192,78 @@ int parse_tag(FILE* out, const char* start, bool in_conditional)
}
else if (MATCH("Cl"))
{
+ int read;
+ char xalign = '\0', yalign = '\0';
PUTCH(out, '(');
- len += 1+dump_arg(out, start+1, 4, true);
+ read = 1+dump_arg(out, start+1, 2, false);
+ len += read;
+ start += read;
+ switch (tolower(*start))
+ {
+ case 'l':
+ case 'c':
+ case 'r':
+ case '+':
+ case '-':
+ xalign = *start;
+ len++;
+ start++;
+ break;
+ case 'd':
+ case 'D':
+ case 'i':
+ case 'I':
+ case 's':
+ case 'S':
+ len++;
+ start++;
+ break;
+ }
+ PUTCH(out,',');
+ read = dump_arg(out, start, 1, false);
+ len += read;
+ start += read;
+ switch (tolower(*start))
+ {
+ case 't':
+ case 'c':
+ case 'b':
+ case '+':
+ case '-':
+ yalign = *start;
+ len++;
+ start++;
+ break;
+ case 'd':
+ case 'D':
+ case 'i':
+ case 'I':
+ case 's':
+ case 'S':
+ len++;
+ start++;
+ break;
+ }
+ PUTCH(out,',');
+ read = dump_arg(out, start, 1, false);
+ if (xalign)
+ {
+ if (xalign == '-')
+ xalign = 'l';
+ if (xalign == '+')
+ xalign = 'r';
+ fprintf(out, ",%c", xalign);
+ }
+ if (yalign)
+ {
+ if (yalign == '-')
+ yalign = 't';
+ if (yalign == '+')
+ yalign = 'b';
+ fprintf(out, ",%s%c", xalign?"":"-,", yalign);
+ }
+ PUTCH(out, ')');
+ len += read;
}
else if (MATCH("Vd") || MATCH("VI"))
{