+ SetProperties(node, handle, constant);
+ }
+ ApplySignals(root, node, handle);
+ ApplyStylesByActor(root, node, handle, constant);
+}
+
+void Builder::RecordStyle(StylePtr style,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& replacements)
+{
+ // With repeated calls, accumulate inherited states, visuals and properties
+ // but override any with same name
+
+ for(TreeNode::ConstIterator iter = node.CBegin(); iter != node.CEnd(); ++iter)
+ {
+ const TreeNode::KeyNodePair& keyValue = *iter;
+ std::string key(keyValue.first);
+ if(key == KEYNAME_STATES)
+ {
+ const TreeNode& states = keyValue.second;
+ if(states.GetType() != TreeNode::OBJECT)
+ {
+ DALI_LOG_WARNING("RecordStyle() Node \"%s\" is not a JSON object\n", key.c_str());
+ continue;
+ }
+
+ for(TreeNode::ConstIterator iter = states.CBegin(); iter != states.CEnd(); ++iter)
+ {
+ const TreeNode& stateNode = (*iter).second;
+ const char* stateName = stateNode.GetName();
+ if(stateNode.GetType() != TreeNode::OBJECT)
+ {
+ DALI_LOG_WARNING("RecordStyle() Node \"%s\" is not a JSON object\n", stateName);
+ continue;
+ }
+
+ StylePtr* stylePtr = style->subStates.Find(stateName);
+ if(stylePtr)
+ {
+ StylePtr style(*stylePtr);
+ RecordStyle(style, stateNode, handle, replacements);
+ }
+ else
+ {
+ StylePtr subState = Style::New();
+ RecordStyle(subState, stateNode, handle, replacements);
+ style->subStates.Add(stateName, subState);
+ }
+ }
+ }
+ else if(key == KEYNAME_VISUALS)
+ {
+ for(TreeNode::ConstIterator iter = keyValue.second.CBegin(); iter != keyValue.second.CEnd(); ++iter)
+ {
+ // Each key in this table should be a property name matching a visual.
+ const TreeNode::KeyNodePair& visual = *iter;
+ Dali::Property::Value property(Property::MAP);
+ if(DeterminePropertyFromNode(visual.second, Property::MAP, property, replacements))
+ {
+ Property::Map* mapPtr = style->visuals.Find(visual.first);
+ if(mapPtr)
+ {
+ // Override existing visuals
+ mapPtr->Clear();
+ mapPtr->Merge(*property.GetMap());
+ }
+ else
+ {
+ Property::Map* map = property.GetMap();
+ if(map)
+ {
+ style->visuals.Add(visual.first, *map);
+ }
+ }
+ }
+ }
+ }
+ else if(key == KEYNAME_ENTRY_TRANSITION)