From: Victor Cebollada Date: Wed, 16 Nov 2016 09:53:59 +0000 (+0000) Subject: Revert public API changes. Handle methods. X-Git-Tag: dali_1.2.17~3^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=ce4bae9bcaabc3b38d016e7ef36cc55357087bc0 Revert public API changes. Handle methods. * Use the Handle functions from the devel API. Change-Id: Ie6ed2079d31941d31624720657e5c1d09406565e Signed-off-by: Victor Cebollada --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp index 8fdf936..c0f7982 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ int UtcDaliTransitionDataMap1P(void) 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); @@ -315,7 +316,7 @@ int UtcDaliTransitionDataMap2P(void) 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); @@ -569,7 +570,7 @@ int UtcDaliTransitionDataMapN4(void) 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(mixColorIdx), Color::RED, 0.001, TEST_LOCATION); @@ -620,7 +621,7 @@ int UtcDaliTransitionDataMapN5(void) 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(mixColorIdx), Color::RED, 0.001, TEST_LOCATION); @@ -671,7 +672,7 @@ int UtcDaliTransitionDataMapN6(void) 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(mixColorIdx), Color::RED, 0.001, TEST_LOCATION); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 6e9f11f..82d6d58 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1041,7 +1042,7 @@ int UtcDaliVisualAnimateBorderVisual01(void) 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 ); @@ -1088,7 +1089,7 @@ int UtcDaliVisualAnimateBorderVisual02(void) 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 ); @@ -1132,7 +1133,7 @@ int UtcDaliVisualAnimateColorVisual(void) 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 ); @@ -1182,7 +1183,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) 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 ); diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index ba376ce..ac5cf01 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -162,12 +163,12 @@ void BorderVisual::DoSetOnStage( Actor& actor ) { 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 ); } - 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 ); } diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index b6d5c6c..781fdf7 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include //INTERNAL INCLUDES #include @@ -143,7 +144,7 @@ void ColorVisual::InitializeRenderer() 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 ); diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index f3c8125..43c69cc 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -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( 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 ); } diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 02bbf97..c731c0d 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -134,7 +135,7 @@ HandleIndex GetVisualProperty( 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: @@ -147,7 +148,7 @@ HandleIndex GetVisualProperty( { // @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: @@ -866,7 +867,7 @@ Dali::Animation Control::CreateTransition( const Toolkit::TransitionData& handle 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