+HandleIndex GetVisualProperty(
+ Internal::Control& controlImpl,
+ RegisteredVisualContainer& visuals,
+ const std::string& visualName,
+ Property::Key propertyKey )
+{
+#if defined(DEBUG_ENABLED)
+ std::ostringstream oss;
+ oss << "Control::GetHandleIndex(" << visualName << ", " << propertyKey << ")" << std::endl;
+ DALI_LOG_INFO( gLogFilter, Debug::General, oss.str().c_str() );
+#endif
+
+ // Find visualName in the control
+ RegisteredVisualContainer::Iterator iter;
+ for ( iter = visuals.Begin(); iter != visuals.End(); iter++ )
+ {
+ if ( (*iter)->visual.GetName() == visualName )
+ {
+ break;
+ }
+ }
+
+ // Does it's renderer have an associated property?
+ if( iter != visuals.End() )
+ {
+ Actor self = controlImpl.Self();
+ Property::Index index = DevelHandle::GetPropertyIndex( self, propertyKey );
+ if( index != Property::INVALID_INDEX )
+ {
+ // It's an actor property:
+ return HandleIndex( self, index );
+ }
+ else
+ {
+ // Check if it is a renderer property:
+ if( self.GetRendererCount() > 0 )
+ {
+ // @todo Need to use correct renderer index
+ Renderer renderer = self.GetRendererAt(0);
+ Property::Index index = DevelHandle::GetPropertyIndex( renderer, propertyKey );
+ if( index != Property::INVALID_INDEX )
+ {
+ // It's a renderer property:
+ return HandleIndex( renderer, index );
+ }
+ }
+ else
+ {
+ std::ostringstream oss;
+ oss << propertyKey;
+ DALI_LOG_WARNING( "Control::GetHandleIndex(%s, %s) No renderers\n", visualName.c_str(), oss.str().c_str() );
+ }
+ }
+ }
+ Handle handle;
+ return HandleIndex( handle, Property::INVALID_INDEX );
+}
+
+void SetDefaultTransform( Property::Map& propertyMap )
+{
+ propertyMap.Clear();
+ propertyMap
+ .Add( Toolkit::DevelVisual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
+ .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
+ .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
+ .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
+ .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO );
+}
+