/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
using namespace Dali::Scripting;
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant );
+extern void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant );
/*
* Handles special case actor configuration (anything thats not already a property)
// we allow enums strings for parent-origin and anchor-point but as with the current json
// strings always succeed if they exist then check its not vector. If they are Vec3s then
// this has already been set as a generic property.
- if( !IsVector3( child, "parent-origin") )
+ if( !IsVector3( child, "parentOrigin") )
{
- if( OptionalVector3 v = constant.IsVector3( IsChild(child, "parent-origin") ) )
+ if( OptionalVector3 v = constant.IsVector3( IsChild(child, "parentOrigin") ) )
{
actor.SetParentOrigin( *v );
}
- else if( OptionalString origin = constant.IsString( IsChild(child, "parent-origin") ) )
+ else if( OptionalString origin = constant.IsString( IsChild(child, "parentOrigin") ) )
{
actor.SetParentOrigin( GetAnchorConstant(*origin) );
}
}
- if( !IsVector3(child, "anchor-point") )
+ if( !IsVector3(child, "anchorPoint") )
{
- if( OptionalVector3 v = constant.IsVector3( IsChild(child, "anchor-point") ) )
+ if( OptionalVector3 v = constant.IsVector3( IsChild(child, "anchorPoint") ) )
{
actor.SetAnchorPoint( *v );
}
- else if( OptionalString anchor = constant.IsString( IsChild(child, "anchor-point") ) )
+ else if( OptionalString anchor = constant.IsString( IsChild(child, "anchorPoint") ) )
{
actor.SetAnchorPoint( GetAnchorConstant(*anchor) );
}
}
- // Add custom properties
- if( OptionalChild customPropertiesChild = IsChild(child, "custom-properties") )
- {
- const TreeNode& customPropertiesNode = *customPropertiesChild;
- const TreeConstIter endIter = customPropertiesNode.CEnd();
- for( TreeConstIter iter = customPropertiesNode.CBegin(); endIter != iter; ++iter )
- {
- const TreeNode::KeyNodePair& keyChild = *iter;
- std::string key( keyChild.first );
-
- Property::Index index = actor.GetPropertyIndex( key );
- Property::Value value;
- if( SetPropertyFromNode( keyChild.second, value, constant ))
- {
- if( Property::INVALID_INDEX == index )
- {
- actor.RegisterProperty( key, value );
- }
- else
- {
- actor.SetProperty( index, value );
- }
- }
- }
- }
-
return actor;
}