Revert public API changes. Handle methods. 84/98184/5
authorVictor Cebollada <v.cebollada@samsung.com>
Wed, 16 Nov 2016 09:53:59 +0000 (09:53 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Wed, 30 Nov 2016 07:08:28 +0000 (07:08 +0000)
* Use the Handle functions from the devel API.

Change-Id: Ie6ed2079d31941d31624720657e5c1d09406565e
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/public-api/controls/control-impl.cpp

index 8fdf936..c0f7982 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali.h>
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
@@ -252,7 +253,7 @@ int UtcDaliTransitionDataMap1P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
   application.SendNotification();
   application.Render(0);
 
@@ -315,7 +316,7 @@ int UtcDaliTransitionDataMap2P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
   application.SendNotification();
   application.Render(0);
 
@@ -569,7 +570,7 @@ int UtcDaliTransitionDataMapN4(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = renderer.GetPropertyIndex(ColorVisual::Property::MIX_COLOR);
+  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
@@ -620,7 +621,7 @@ int UtcDaliTransitionDataMapN5(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = renderer.GetPropertyIndex(ColorVisual::Property::MIX_COLOR);
+  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
@@ -671,7 +672,7 @@ int UtcDaliTransitionDataMapN6(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = renderer.GetPropertyIndex(ColorVisual::Property::MIX_COLOR);
+  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
index 6e9f11f..82d6d58 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/public-api/rendering/shader.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/public-api/rendering/shader.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
@@ -1041,7 +1042,7 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::COLOR );
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), Color::WHITE );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), Color::WHITE );
@@ -1088,7 +1089,7 @@ int UtcDaliVisualAnimateBorderVisual02(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::SIZE );
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::SIZE );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), 9.0f );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), 9.0f );
@@ -1132,7 +1133,7 @@ int UtcDaliVisualAnimateColorVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), Color::WHITE );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), Color::WHITE );
@@ -1182,7 +1183,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR );
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
 
   // The property isn't registered on the renderer, it's instead registered on the shader.
   DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
 
   // The property isn't registered on the renderer, it's instead registered on the shader.
   DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
index ba376ce..ac5cf01 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/devel-api/object/handle-devel.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/border-visual-properties.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/border-visual-properties.h>
@@ -162,12 +163,12 @@ void BorderVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
 
 {
   InitializeRenderer();
 
-  mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor );
+  mBorderColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor );
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
-  mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize );
+  mBorderSizeIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize );
 
   actor.AddRenderer( mImpl->mRenderer );
 }
 
   actor.AddRenderer( mImpl->mRenderer );
 }
index b6d5c6c..781fdf7 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/devel-api/object/handle-devel.h>
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
@@ -143,7 +144,7 @@ void ColorVisual::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME, mMixColor );
+  mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME, mMixColor );
   if( mMixColor.a < 1.f )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   if( mMixColor.a < 1.f )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
index f3c8125..43c69cc 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/common/constants.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 
@@ -458,7 +459,7 @@ void PrimitiveVisual::UpdateShaderUniforms()
   mShader.RegisterProperty( STAGE_OFFSET_UNIFORM_NAME, Vector2( width, height ) / 2.0f );
   mShader.RegisterProperty( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
   mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
   mShader.RegisterProperty( STAGE_OFFSET_UNIFORM_NAME, Vector2( width, height ) / 2.0f );
   mShader.RegisterProperty( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
   mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
-  mShader.RegisterProperty( Toolkit::PrimitiveVisual::Property::MIX_COLOR, COLOR_UNIFORM_NAME, mColor );
+  DevelHandle::RegisterProperty( mShader, Toolkit::PrimitiveVisual::Property::MIX_COLOR, COLOR_UNIFORM_NAME, mColor );
   mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions );
 }
 
   mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions );
 }
 
index 02bbf97..c731c0d 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/devel-api/common/owner-container.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
@@ -134,7 +135,7 @@ HandleIndex GetVisualProperty(
   if( iter != visuals.End() )
   {
     Actor self = controlImpl.Self();
   if( iter != visuals.End() )
   {
     Actor self = controlImpl.Self();
-    Property::Index index = self.GetPropertyIndex( propertyKey );
+    Property::Index index = DevelHandle::GetPropertyIndex( self, propertyKey );
     if( index != Property::INVALID_INDEX )
     {
       // It's an actor property:
     if( index != Property::INVALID_INDEX )
     {
       // It's an actor property:
@@ -147,7 +148,7 @@ HandleIndex GetVisualProperty(
       {
         // @todo Need to use correct renderer index
         Renderer renderer = self.GetRendererAt(0);
       {
         // @todo Need to use correct renderer index
         Renderer renderer = self.GetRendererAt(0);
-        Property::Index index = renderer.GetPropertyIndex( propertyKey );
+        Property::Index index = DevelHandle::GetPropertyIndex( renderer, propertyKey );
         if( index != Property::INVALID_INDEX )
         {
           // It's a renderer property:
         if( index != Property::INVALID_INDEX )
         {
           // It's a renderer property:
@@ -866,7 +867,7 @@ Dali::Animation Control::CreateTransition( const Toolkit::TransitionData& handle
       Actor child = Self().FindChildByName( animator->objectName );
       if( child )
       {
       Actor child = Self().FindChildByName( animator->objectName );
       if( child )
       {
-        Property::Index propertyIndex = child.GetPropertyIndex( animator->propertyKey );
+        Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey );
         handleIndex = HandleIndex( child, propertyIndex );
       }
       else
         handleIndex = HandleIndex( child, propertyIndex );
       }
       else