forked from len0rd/rockbox
Theme Editor: Began implementing code generation for movable viewports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27691 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2db08d4153
commit
49865b23f6
12 changed files with 104 additions and 23 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue