Changed all property & signal names to lowerCamelCase
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.cpp
index c3ca785..b37b4fb 100644 (file)
@@ -66,7 +66,7 @@ BaseHandle Create()
  * @param[in] attributes The attributes with which to perfrom this action.
  * @return true if action has been accepted by this control
  */
-const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibility-activated";
+const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibilityActivated";
 static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;
@@ -93,13 +93,13 @@ static bool DoAction( BaseObject* object, const std::string& actionName, const P
  * @return True if the signal was connected.
  * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
  */
-const char* SIGNAL_KEY_EVENT = "key-event";
-const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "key-input-focus-gained";
-const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "key-input-focus-lost";
+const char* SIGNAL_KEY_EVENT = "keyEvent";
+const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "keyInputFocusGained";
+const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "keyInputFocusLost";
 const char* SIGNAL_TAPPED = "tapped";
 const char* SIGNAL_PANNED = "panned";
 const char* SIGNAL_PINCHED = "pinched";
-const char* SIGNAL_LONG_PRESSED = "long-pressed";
+const char* SIGNAL_LONG_PRESSED = "longPressed";
 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::BaseHandle handle( object );
@@ -355,9 +355,9 @@ public:
 };
 
 // Properties registered without macro to use specific member variables.
-PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "style-name",      Toolkit::Control::Property::STYLE_NAME,      Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName",       Toolkit::Control::Property::STYLE_NAME,      Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
 PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "background",      Toolkit::Control::Property::BACKGROUND,      Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "key-input-focus", Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "keyInputFocus",   Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
 
 Toolkit::Control Control::New()
 {
@@ -406,24 +406,17 @@ void Control::SetBackgroundColor( const Vector4& color )
 
   if( mImpl->mBackgroundRenderer )
   {
-    Toolkit::ControlRenderer currentRenderer( mImpl->mBackgroundRenderer );
-    // if ResetRenderer returns false, we continue to use the current renderer with a new color set to it.
-    if( ! factory.ResetRenderer( mImpl->mBackgroundRenderer, color ) )
-    {
-      return;
-    }
-    // ResetRenderer returns true, a new renderer is created. Remove the current renderer and reset.
-    currentRenderer.RemoveAndReset( self );
+    factory.ResetRenderer( mImpl->mBackgroundRenderer, self, color );
   }
   else
   {
     mImpl->mBackgroundRenderer = factory.GetControlRenderer( color );
-  }
 
-  if( self.OnStage() )
-  {
-    mImpl->mBackgroundRenderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );
-    mImpl->mBackgroundRenderer.SetOnStage( self );
+    if( self.OnStage() )
+    {
+      mImpl->mBackgroundRenderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );
+      mImpl->mBackgroundRenderer.SetOnStage( self );
+    }
   }
 }
 
@@ -463,30 +456,23 @@ void Control::SetBackgroundImage( Image image )
 
   if(  mImpl->mBackgroundRenderer  )
   {
-    Toolkit::ControlRenderer currentRenderer( mImpl->mBackgroundRenderer );
-    // if ResetRenderer returns false, we continue to use the current renderer with a new image set to it.
-    if( ! factory.ResetRenderer( mImpl->mBackgroundRenderer, image )  )
-    {
-      return;
-    }
-    // ResetRenderer returns true, a new renderer is created. Remove the current renderer and reset.
-    currentRenderer.RemoveAndReset( self );
+    factory.ResetRenderer( mImpl->mBackgroundRenderer, self, image );
   }
   else
   {
     mImpl->mBackgroundRenderer = factory.GetControlRenderer( image );
-  }
 
-  if( self.OnStage() )
-  {
-    mImpl->mBackgroundRenderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );
-    mImpl->mBackgroundRenderer.SetOnStage( self );
+    if( self.OnStage() )
+    {
+      mImpl->mBackgroundRenderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );
+      mImpl->mBackgroundRenderer.SetOnStage( self );
+    }
   }
 }
 
 void Control::ClearBackground()
 {
-  Actor self(Self());
+  Actor self( Self() );
   mImpl->mBackgroundRenderer.RemoveAndReset( self );
 }
 
@@ -810,16 +796,6 @@ void Control::EmitKeyInputFocusSignal( bool focusGained )
 
 void Control::OnStageConnection( int depth )
 {
-  unsigned int controlRendererCount = Self().GetRendererCount();
-  for( unsigned int i(0); i<controlRendererCount; ++i )
-  {
-    Renderer controlRenderer = Self().GetRendererAt(i);
-    if( controlRenderer )
-    {
-      controlRenderer.SetDepthIndex( CONTENT_DEPTH_INDEX+depth );
-    }
-  }
-
   if( mImpl->mBackgroundRenderer)
   {
     mImpl->mBackgroundRenderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );