summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-01 18:31:58 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-01 18:31:58 +0000
commit47cd8786ba46a0d0d1c0f931363ca36181e8547e (patch)
treeef56cb497b62ea748eff1c8d5a8fa0e4471aa0cf /utils
parent27d529e18691b4a3a32669fe631ce96ff717872f (diff)
Theme Editor: Made the viewport tag a top-level child under VIEWPORT elements in the parse tree
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26450 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/parsetreenode.cpp9
-rw-r--r--utils/themeeditor/skin_parser.c18
2 files changed, 22 insertions, 5 deletions
diff --git a/utils/themeeditor/parsetreenode.cpp b/utils/themeeditor/parsetreenode.cpp
index a93295f357..3f8936a54c 100644
--- a/utils/themeeditor/parsetreenode.cpp
+++ b/utils/themeeditor/parsetreenode.cpp
@@ -67,10 +67,13 @@ ParseTreeNode::ParseTreeNode(struct skin_element* data, ParseTreeNode* parent)
case VIEWPORT:
case LINE:
- for(struct skin_element* current = data->children[0]; current;
- current = current->next)
+ for(int i = 0; i < data->children_count; i++)
{
- children.append(new ParseTreeNode(current, this));
+ for(struct skin_element* current = data->children[i]; current;
+ current = current->next)
+ {
+ children.append(new ParseTreeNode(current, this));
+ }
}
break;
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c
index 4f7acf90fb..9fd9001790 100644
--- a/utils/themeeditor/skin_parser.c
+++ b/utils/themeeditor/skin_parser.c
@@ -98,7 +98,6 @@ struct skin_element* skin_parse_viewport(char** document)
retval = skin_alloc_element();
retval->type = VIEWPORT;
- retval->children = skin_alloc_children(1);
retval->children_count = 1;
retval->line = skin_line;
@@ -109,6 +108,21 @@ struct skin_element* skin_parse_viewport(char** document)
int sublines = 0; /* Flag for parsing sublines */
+ /* Parsing out the viewport tag if there is one */
+ if(check_viewport(cursor))
+ {
+ retval->children_count = 2;
+ retval->children = skin_alloc_children(2);
+ retval->children[0] = skin_alloc_element();
+ skin_parse_tag(retval->children[0], &cursor);
+ }
+ else
+ {
+ retval->children_count = 1;
+ retval->children = skin_alloc_children(1);
+ }
+
+
while(*cursor != '\0' && !(check_viewport(cursor) && cursor != *document))
{
@@ -182,7 +196,7 @@ struct skin_element* skin_parse_viewport(char** document)
*document = cursor;
- retval->children[0] = root;
+ retval->children[retval->children_count - 1] = root;
return retval;
}