summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-04 09:16:52 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-04 09:16:52 +0000
commit49865b23f601e636c9a80b21826fc607f1964eb5 (patch)
treeeb7959fd8aa5c572842e8d295440348cb17fc3cf /utils/themeeditor/models/parsetreenode.cpp
parent2db08d41536b875f35b055f8e0bb3845b47a7ba3 (diff)
downloadrockbox-49865b23f601e636c9a80b21826fc607f1964eb5.tar.gz
rockbox-49865b23f601e636c9a80b21826fc607f1964eb5.tar.bz2
rockbox-49865b23f601e636c9a80b21826fc607f1964eb5.zip
Theme Editor: Began implementing code generation for movable viewports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27691 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 1349ba9ad6..8d1fcc7d1a 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -523,7 +523,7 @@ void ParseTreeNode::render(const RBRenderInfo& info)
return;
}
- rendered = new RBViewport(element, info);
+ rendered = new RBViewport(element, info, this);
for(int i = element->params_count; i < children.count(); i++)
children[i]->render(info, dynamic_cast<RBViewport*>(rendered));
@@ -1057,3 +1057,33 @@ double ParseTreeNode::findConditionalTime(ParseTreeNode *conditional,
conditional->children.count()).toInt();
return findBranchTime(conditional->children[child], info);
}
+
+void ParseTreeNode::modParam(QVariant value, int index)
+{
+ if(element)
+ {
+ if(index < 0 || index >= children.count())
+ return;
+ children[index]->modParam(value);
+ }
+ else if(param)
+ {
+ if(value.type() == QVariant::Double)
+ {
+ param->type = skin_tag_parameter::DECIMAL;
+ param->data.number = static_cast<int>(value.toDouble() * 10);
+ }
+ else if(value.type() == QVariant::String)
+ {
+ param->type = skin_tag_parameter::STRING;
+ free(param->data.text);
+ param->data.text = strdup(value.toString().toStdString().c_str());
+ }
+ else if(value.type() == QVariant::Int)
+ {
+ param->type = skin_tag_parameter::INTEGER;
+ param->data.number = value.toInt();
+ }
+
+ }
+}