X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fbuilder%2Fbuilder-actor.cpp;h=c4538399201afcad5429dff444fd7e11923861d0;hp=e8e23e5042f232818343fb0318a9c9d02b61abff;hb=c67dcd03dc527baa8edcb6d4e8efcade2dde632b;hpb=fc1070b8e2cc96daf98d53b8db11edb3b8683a3e diff --git a/base/dali-toolkit/internal/builder/builder-actor.cpp b/base/dali-toolkit/internal/builder/builder-actor.cpp index e8e23e5..c453839 100644 --- a/base/dali-toolkit/internal/builder/builder-actor.cpp +++ b/base/dali-toolkit/internal/builder/builder-actor.cpp @@ -21,7 +21,8 @@ #include // INTERNAL INCLUDES -#include +#include +#include namespace Dali { @@ -33,12 +34,13 @@ namespace Internal { using namespace Dali::Scripting; +extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant ); /* * Handles special case actor configuration (anything thats not already a property) * */ -Actor SetupActor( const TreeNode& child, Actor& actor ) +Actor SetupActor( const TreeNode& child, Actor& actor, const Replacement& constant ) { DALI_ASSERT_ALWAYS( actor && "Empty actor handle" ); @@ -69,6 +71,32 @@ Actor SetupActor( const TreeNode& child, Actor& actor ) } } + // 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 ) + { + index = actor.RegisterProperty( key, value ); + } + else + { + actor.SetProperty( index, value ); + } + } + } + } + return actor; }