Updates following publication of devel-handle APIs 54/242154/1
authorDavid Steele <david.steele@samsung.com>
Mon, 24 Aug 2020 12:49:01 +0000 (13:49 +0100)
committerDavid Steele <david.steele@samsung.com>
Mon, 24 Aug 2020 13:11:37 +0000 (14:11 +0100)
Change-Id: I070abe62055a6574fcf98a96ab3e1140113256d4

automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp

index 6921dd3..e07933a 100644 (file)
@@ -20,7 +20,6 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-timer.h>
 #include <toolkit-event-thread-callback.h>
-#include <dali/devel-api/object/handle-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
@@ -750,7 +749,7 @@ int UtcDaliImageVisualAnimateMixColor(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR );
+  Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
   Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
 
@@ -1029,7 +1028,7 @@ int UtcDaliImageVisualAnimatePixelArea(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR );
+  Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
 
   tet_infoline("Test that the renderer has the mixColor property");
   DALI_TEST_CHECK( index != Property::INVALID_INDEX );
index 3476f89..ab94ef2 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali.h>
-#include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
@@ -254,7 +253,7 @@ int UtcDaliTransitionDataMap1P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
@@ -322,7 +321,7 @@ int UtcDaliTransitionDataMap2P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
@@ -394,7 +393,7 @@ int UtcDaliTransitionDataMap2Pb(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
@@ -590,7 +589,7 @@ int UtcDaliTransitionDataMap5P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
@@ -662,7 +661,7 @@ int UtcDaliTransitionDataMap6P(void)
   DALI_TEST_CHECK( anim );
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
   application.SendNotification();
   application.Render(0);
 
@@ -814,7 +813,7 @@ int UtcDaliTransitionDataMapN4(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
@@ -866,7 +865,7 @@ int UtcDaliTransitionDataMapN5(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
@@ -917,7 +916,7 @@ int UtcDaliTransitionDataMapN6(void)
   application.SendNotification();
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
index e41565d..9823516 100644 (file)
@@ -1775,8 +1775,8 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index borderColorIndex = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR );
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR );
+  Property::Index borderColorIndex = renderer.GetPropertyIndex( BorderVisual::Property::COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
 
   Animation animation = dummyImpl.CreateTransition( transition );
 
@@ -1843,7 +1843,7 @@ int UtcDaliVisualAnimateBorderVisual02(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::SIZE );
+  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::SIZE );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), 9.0f );
@@ -1887,7 +1887,7 @@ int UtcDaliVisualAnimateColorVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
 
   Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
@@ -1943,7 +1943,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
     Renderer renderer = actor.GetRendererAt(0);
-    Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+    Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR );
 
     tet_infoline("Test that the renderer has the Primitive mix color");
     DALI_TEST_CHECK( index != Property::INVALID_INDEX );
index ab65570..958dd2c 100755 (executable)
@@ -759,7 +759,7 @@ void Control::Impl::AddTransitions( Dali::Animation& animation,
       Actor child = mControlImpl.Self().FindChildByName( animator->objectName );
       if( child )
       {
-        Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey );
+        Property::Index propertyIndex = child.GetPropertyIndex( animator->propertyKey );
         if( propertyIndex != Property::INVALID_INDEX )
         {
           if( animator->animate == false )
index 229d12c..94376e6 100644 (file)
@@ -20,7 +20,6 @@
 
 // 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>
@@ -201,12 +200,12 @@ void BorderVisual::DoSetOnScene( Actor& actor )
 {
   InitializeRenderer();
 
-  mBorderColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor );
+  mBorderColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor );
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
-  mBorderSizeIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize );
+  mBorderSizeIndex = mImpl->mRenderer.RegisterProperty( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize );
 
   actor.AddRenderer( mImpl->mRenderer );
 
index 4107dcb..dce5255 100644 (file)
@@ -20,7 +20,6 @@
 
 // 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>
@@ -338,7 +337,7 @@ void ColorVisual::InitializeRenderer()
   // ColorVisual has it's own index key for mix color - use this instead
   // of using the new base index to avoid changing existing applications
   // String keys will get to this property.
-  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
+  mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
 
   mImpl->mRenderer.RegisterProperty( BLUR_RADIUS_NAME, mBlurRadius );
 
index 265dcd8..e17f701 100644 (file)
@@ -19,7 +19,6 @@
 #include "npatch-visual.h"
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/integration-api/debug.h>
@@ -671,8 +670,8 @@ void NPatchVisual::ApplyTextureAndUniforms()
                                  auxiliaryPixelData.GetHeight() );
     texture.Upload( auxiliaryPixelData );
     textureSet.SetTexture( 1, texture );
-    DevelHandle::RegisterProperty( mImpl->mRenderer, DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
-                                   AUXILIARY_IMAGE_ALPHA_NAME, mAuxiliaryImageAlpha );
+    mImpl->mRenderer.RegisterProperty( DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
+                                       AUXILIARY_IMAGE_ALPHA_NAME, mAuxiliaryImageAlpha );
   }
   mImpl->mRenderer.SetTextures( textureSet );
 
index 484f58f..449deb7 100644 (file)
@@ -22,7 +22,6 @@
 #include <dali/integration-api/debug.h>
 #include <dali/devel-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>
 
@@ -458,7 +457,7 @@ void PrimitiveVisual::InitializeRenderer()
   // Register transform properties
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 
-  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
+  mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
 }
 
 void PrimitiveVisual::UpdateShaderUniforms()
index c47cfca..885bc72 100755 (executable)
@@ -20,7 +20,6 @@
 
 // EXTERNAL HEADER
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
-#include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/integration-api/debug.h>
@@ -441,8 +440,7 @@ void Visual::Base::RegisterMixColor()
   // (Color and Primitive visuals will register their own and save to this index)
   if( mImpl->mMixColorIndex == Property::INVALID_INDEX )
   {
-    mImpl->mMixColorIndex = DevelHandle::RegisterProperty(
-      mImpl->mRenderer,
+    mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty(
       Toolkit::Visual::Property::MIX_COLOR,
       MIX_COLOR,
       Vector3(mImpl->mMixColor) );
@@ -556,13 +554,13 @@ Renderer Visual::Base::GetRenderer()
 
 Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
 {
-  Property::Index index = DevelHandle::GetPropertyIndex( mImpl->mRenderer, key );
+  Property::Index index = mImpl->mRenderer.GetPropertyIndex( key );
 
   if( index == Property::INVALID_INDEX )
   {
     // Is it a shader property?
     Shader shader = mImpl->mRenderer.GetShader();
-    index = DevelHandle::GetPropertyIndex( shader, key );
+    index = shader.GetPropertyIndex( key );
     if( index != Property::INVALID_INDEX )
     {
       // Yes - we should register it in the Renderer so it can be set / animated
@@ -580,7 +578,7 @@ Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
         // Leave keyIndex as INVALID_KEY - it can still be registered against the string key.
       }
       Property::Value value = shader.GetProperty( index );
-      index = DevelHandle::RegisterProperty( mImpl->mRenderer, keyIndex, keyName, value );
+      index = mImpl->mRenderer.RegisterProperty( keyIndex, keyName, value );
     }
   }
   return index;