From ddf213d6be29c945105fdeba076ba7ce98acd9ba Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 18 Nov 2016 16:40:18 +0000 Subject: [PATCH] Removed Visual::Base::SetProperty and GetProperty Removed the base class methods and all derived methods, except for text visual, which uses DoSetProperty internally. Change-Id: I6105f7d1efd0b6b81da09749c86e7334a78e5182 Signed-off-by: David Steele --- .../src/dali-toolkit-internal/CMakeLists.txt | 1 - .../src/dali-toolkit-internal/utc-Dali-Visuals.cpp | 123 --------------------- .../src/dali-toolkit/utc-Dali-Visual.cpp | 72 ++++-------- .../devel-api/visual-factory/visual-base.cpp | 10 -- .../devel-api/visual-factory/visual-base.h | 17 --- .../internal/visuals/border/border-visual.cpp | 11 -- .../internal/visuals/border/border-visual.h | 10 -- .../internal/visuals/color/color-visual.cpp | 21 ---- dali-toolkit/internal/visuals/color/color-visual.h | 10 -- .../internal/visuals/gradient/gradient-visual.cpp | 11 -- .../internal/visuals/gradient/gradient-visual.h | 10 -- .../internal/visuals/image/batch-image-visual.cpp | 11 -- .../internal/visuals/image/batch-image-visual.h | 10 -- .../internal/visuals/image/image-visual.cpp | 11 -- dali-toolkit/internal/visuals/image/image-visual.h | 10 -- dali-toolkit/internal/visuals/mesh/mesh-visual.cpp | 11 -- dali-toolkit/internal/visuals/mesh/mesh-visual.h | 10 -- .../internal/visuals/npatch/npatch-visual.cpp | 11 -- .../internal/visuals/npatch/npatch-visual.h | 10 -- .../visuals/primitive/primitive-visual.cpp | 11 -- .../internal/visuals/primitive/primitive-visual.h | 10 -- dali-toolkit/internal/visuals/svg/svg-visual.cpp | 11 -- dali-toolkit/internal/visuals/svg/svg-visual.h | 10 -- dali-toolkit/internal/visuals/text/text-visual.cpp | 75 ------------- dali-toolkit/internal/visuals/text/text-visual.h | 18 ++- dali-toolkit/internal/visuals/visual-base-impl.cpp | 51 --------- dali-toolkit/internal/visuals/visual-base-impl.h | 18 --- .../visuals/wireframe/wireframe-visual.cpp | 11 -- .../internal/visuals/wireframe/wireframe-visual.h | 10 -- 29 files changed, 31 insertions(+), 574 deletions(-) delete mode 100644 automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals.cpp diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index 99ee1db..a4a8ae7 100644 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -19,7 +19,6 @@ SET(TC_SOURCES utc-Dali-Text-Layout.cpp utc-Dali-Text-Controller.cpp utc-Dali-VisualFactoryResolveUrl.cpp - utc-Dali-Visuals.cpp utc-Dali-Text-Markup.cpp utc-Dali-Text-Typesetter.cpp utc-Dali-Text-ViewModel.cpp diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals.cpp deleted file mode 100644 index b8ccf57..0000000 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -using namespace Dali::Toolkit::Internal; - -namespace -{ - -class DummyWireframeVisual : public WireframeVisual -{ -public: - - DummyWireframeVisual( VisualFactoryCache& factoryCache ) - : WireframeVisual( factoryCache ) - {} - - virtual ~DummyWireframeVisual() - {} - - void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) - { - WireframeVisual::DoSetProperty( index, propertyValue ); - } - - Dali::Property::Value DoGetProperty( Dali::Property::Index index ) - { - return WireframeVisual::DoGetProperty( index ); - } -}; - -} // namespace - -int UtcDaliWireframeVisual(void) -{ - // The goal of this test case is to cover the WireframeVisual::DoSetProperty() and - // WireframeVisual::DoGetProperty() which are unreachable from the public API. - - tet_infoline( " UtcDaliWireframeVisual" ); - - VisualFactoryCache* visualFactoryCache = new VisualFactoryCache(); - - DummyWireframeVisual visual( *visualFactoryCache ); - - visual.DoSetProperty( Dali::Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::WIREFRAME ); - Dali::Property::Value value = visual.DoGetProperty( Dali::Toolkit::Visual::Property::TYPE ); - - tet_result(TET_PASS); - END_TEST; -} - -int UtcDaliTextVisual(void) -{ - tet_infoline(" UtcDaliTextVisual"); - ToolkitTestApplication application; - - Stage stage = Stage::GetCurrent(); - - Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); - control.SetParentOrigin( ParentOrigin::CENTER ); - - Dali::Property::Map map; - map[ Dali::Toolkit::Visual::Property::TYPE ] = Dali::Toolkit::DevelVisual::TEXT; - map[ Dali::Toolkit::TextVisual::Property::ENABLE_MARKUP ] = true; - std::string markupText( "Hello world" ); - map[ Dali::Toolkit::TextVisual::Property::TEXT ] = markupText; - map[ Dali::Toolkit::TextVisual::Property::TEXT_COLOR ] = Dali::Vector4( 0.25f, 0.25f, 0.5f, 1.f ); - map[ Dali::Toolkit::TextVisual::Property::FONT_FAMILY ] = "TizenSansRegular"; - map[ Dali::Toolkit::TextVisual::Property::POINT_SIZE ] = 30.f; - map[ Dali::Toolkit::TextVisual::Property::HORIZONTAL_ALIGNMENT ] = "CENTER"; - map[ Dali::Toolkit::TextVisual::Property::VERTICAL_ALIGNMENT ] = "CENTER"; - - control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map ); - - stage.Add( control ); - - try - { - application.SendNotification(); - application.Render(); - } - catch( ... ) - { - tet_result(TET_FAIL); - } - - // The renderer should be removed. - control.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - control.SetSize( 1.f, 0.f ); - - application.SendNotification(); - application.Render(); - - DALI_TEST_EQUALS( 0u, control.GetRendererCount(), TEST_LOCATION ); - - tet_result(TET_PASS); - END_TEST; -} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 14e8a19..a902858 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -363,10 +363,6 @@ int UtcDaliVisualGetPropertyMap1(void) DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::CYAN ); - // Test the properties. TODO: to be completed. - colorVisual.SetProperty( ColorVisual::Property::MIX_COLOR, Color::RED ); - Property::Value value = colorVisual.GetProperty( ColorVisual::Property::MIX_COLOR ); - END_TEST; } @@ -417,9 +413,6 @@ int UtcDaliVisualGetPropertyMap2(void) DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == 10.f ); - // Test the properties. TODO: to be completed. - borderVisual.SetProperty( BorderVisual::Property::COLOR, Color::RED ); - Property::Value value = borderVisual.GetProperty( BorderVisual::Property::COLOR ); END_TEST; } @@ -488,10 +481,6 @@ int UtcDaliVisualGetPropertyMap3(void) DALI_TEST_EQUALS( colorArray->GetElementAt(0).Get(), Color::RED , Math::MACHINE_EPSILON_100, TEST_LOCATION ); DALI_TEST_EQUALS( colorArray->GetElementAt(1).Get(), Color::GREEN , Math::MACHINE_EPSILON_100, TEST_LOCATION ); - // Test the properties. TODO: to be completed. - gradientVisual.SetProperty( GradientVisual::Property::STOP_COLOR, Color::RED ); - Property::Value gradientValue = gradientVisual.GetProperty( GradientVisual::Property::STOP_COLOR ); - END_TEST; } @@ -747,10 +736,6 @@ int UtcDaliVisualGetPropertyMap7(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == TEST_SVG_FILE_NAME ); - // Test the properties. TODO: to be completed. - svgVisual.SetProperty( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ); - Property::Value svgValue = svgVisual.GetProperty( ImageVisual::Property::URL ); - END_TEST; } @@ -799,11 +784,7 @@ int UtcDaliVisualGetPropertyMap8(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), Vector3( 5.0f, 10.0f, 15.0f), Math::MACHINE_EPSILON_100, TEST_LOCATION ); - // Test the properties. TODO: to be completed. - meshVisual.SetProperty( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME ); - Property::Value meshValue = meshVisual.GetProperty( MeshVisual::Property::OBJECT_URL ); - - END_TEST; + END_TEST; } //Primitive shape visual @@ -890,10 +871,6 @@ int UtcDaliVisualGetPropertyMap9(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), Vector3( 5.0f, 10.0f, 15.0f), Math::MACHINE_EPSILON_100, TEST_LOCATION ); - // Test the properties. TODO: to be completed. - primitiveVisual.SetProperty( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); - Property::Value primitiveValue = primitiveVisual.GetProperty( PrimitiveVisual::Property::SHAPE ); - END_TEST; } @@ -933,10 +910,6 @@ int UtcDaliVisualGetPropertyMapBatchImageVisual(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 30 ); - // Test the properties. TODO: to be completed. - batchImageVisual.SetProperty( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - Property::Value primitiveValue = batchImageVisual.GetProperty( ImageVisual::Property::URL ); - END_TEST; } @@ -1256,9 +1229,6 @@ int UtcDaliVisualWireframeVisual(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == Visual::WIREFRAME ); - // Test the properties. TODO: to be completed. - Property::Value primitiveValue = visual.GetProperty( Visual::Property::TYPE ); - END_TEST; } @@ -1273,33 +1243,35 @@ int UtcDaliVisualGetTransform(void) propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE); Visual::Base colorVisual = factory.CreateVisual( propertyMap ); - Dali::Property::Map map; - Dali::Property::Value transformProperty = colorVisual.GetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM ); - transformProperty.Get(map); + Dali::Property::Map visualMap; + colorVisual.CreatePropertyMap( visualMap ); + Property::Value* value = visualMap.Find( Dali::Toolkit::Visual::DevelProperty::TRANSFORM ); + Dali::Property::Map* map = value->GetMap(); + DALI_TEST_CHECK( map ); //Test default values { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET ); DALI_TEST_CHECK( typeValue ); DALI_TEST_CHECK( typeValue->Get() == Vector2(0.0f,0.0f) ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE ); DALI_TEST_CHECK( typeValue ); DALI_TEST_CHECK( typeValue->Get() == Vector2(1.0f,1.0f) ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE ); DALI_TEST_CHECK( typeValue ); DALI_TEST_CHECK( typeValue->Get() == Vector4(0.0f,0.0f,0.0f,0.0f) ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN ); DALI_TEST_CHECK( typeValue ); DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get() == Toolkit::Align::CENTER ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT ); DALI_TEST_CHECK( typeValue ); DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get() == Toolkit::Align::CENTER ); } @@ -1316,34 +1288,36 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis transform.Insert( Visual::DevelProperty::Transform::Property::ORIGIN, "TOP_BEGIN" ); transform.Insert( Visual::DevelProperty::Transform::Property::ANCHOR_POINT, Toolkit::Align::BOTTOM_END ); - visual.SetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM, transform ); + visual.SetTransformAndSize( transform, Vector2(100, 100) ); - Dali::Property::Map map; - Dali::Property::Value transformProperty = visual.GetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM ); - transformProperty.Get(map); + Dali::Property::Map visualMap; + visual.CreatePropertyMap( visualMap ); + Property::Value* value = visualMap.Find( Dali::Toolkit::Visual::DevelProperty::TRANSFORM ); + Dali::Property::Map* map = value->GetMap(); + DALI_TEST_CHECK( map ); { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET ); DALI_TEST_CHECK( typeValue ); DALI_TEST_EQUALS( typeValue->Get(),Vector2(10.0f,10.0f), TEST_LOCATION ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE ); DALI_TEST_CHECK( typeValue ); DALI_TEST_EQUALS( typeValue->Get(), Vector2(0.2f,0.2f), TEST_LOCATION ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE ); DALI_TEST_CHECK( typeValue ); DALI_TEST_EQUALS( typeValue->Get(), Vector4(1.0f,1.0f,0.0f,0.0f), TEST_LOCATION ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN ); DALI_TEST_CHECK( typeValue ); DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get(), Toolkit::Align::TOP_BEGIN, TEST_LOCATION ); } { - Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT ); + Property::Value* typeValue = map->Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT ); DALI_TEST_CHECK( typeValue ); DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get(), Toolkit::Align::BOTTOM_END, TEST_LOCATION ); } @@ -1381,7 +1355,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET, Vector2(20.0f, 20.0f) ); transform.Insert( Visual::DevelProperty::Transform::Property::SIZE, Vector2(100.0f, 100.0f) ); transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE, Vector4(0.0f, 0.0f, 1.0f,1.0f) ); - visual.SetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM, transform ); + visual.SetTransformAndSize( transform, Vector2(100, 100) ); application.SendNotification(); application.Render(0); diff --git a/dali-toolkit/devel-api/visual-factory/visual-base.cpp b/dali-toolkit/devel-api/visual-factory/visual-base.cpp index 790a3e7..4454e98 100644 --- a/dali-toolkit/devel-api/visual-factory/visual-base.cpp +++ b/dali-toolkit/devel-api/visual-factory/visual-base.cpp @@ -91,16 +91,6 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const GetImplementation( *this ).CreatePropertyMap( map ); } -void Visual::Base::SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - GetImplementation( *this ).SetProperty( index, propertyValue ); -} - -Dali::Property::Value Visual::Base::GetProperty( Dali::Property::Index index ) -{ - return GetImplementation( *this ).GetProperty( index ); -} - } // namespace Toolkit } // namespace Dali diff --git a/dali-toolkit/devel-api/visual-factory/visual-base.h b/dali-toolkit/devel-api/visual-factory/visual-base.h index 8b0f576..9e9fc64 100644 --- a/dali-toolkit/devel-api/visual-factory/visual-base.h +++ b/dali-toolkit/devel-api/visual-factory/visual-base.h @@ -181,23 +181,6 @@ public: */ void CreatePropertyMap( Dali::Property::Map& map ) const; - /** - * @brief Sets the value of an existing property. - * - * @param [in] index The index of the property. - * @param [in] propertyValue The new value of the property. - */ - void SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @brief Retrieves a property value. - * - * @param [in] index The index of the property. - * - * @return The property value. - */ - Dali::Property::Value GetProperty( Dali::Property::Index index ); - public: // Not intended for application developers explicit DALI_INTERNAL Base(Internal::Visual::Base *impl); diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index 3286712..eecaa30 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -181,17 +181,6 @@ void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::BorderVisual::Property::ANTI_ALIASING, mAntiAliasing ); } -void BorderVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value BorderVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void BorderVisual::OnSetTransform() { if( mImpl->mRenderer ) diff --git a/dali-toolkit/internal/visuals/border/border-visual.h b/dali-toolkit/internal/visuals/border/border-visual.h index f982561..4016fd8 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.h +++ b/dali-toolkit/internal/visuals/border/border-visual.h @@ -90,16 +90,6 @@ protected: virtual void DoCreatePropertyMap( Property::Map& map ) const; /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - - /** * @copydoc Visual::Base::OnSetTransform */ virtual void OnSetTransform(); diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index 0d5ad54..1a56968 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -117,27 +117,6 @@ void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mMixColor ); } -void ColorVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO - /* David Steele comented : - - Some things to bear in mind: - - We currently keep a copy of the mix color in the ColorVisual object, which is then used to instantiate the registered property on the renderer. - - The user can get the renderer and animate the mixColor property (it's registered, so is automatically a scene-graph property). - - The GetProperty method will have to read from the renderer, or from the cached value in the Visual, and the SetProperty will have to write to cache and to the renderer if present. - */ -} - -Dali::Property::Value ColorVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void ColorVisual::OnSetTransform() { if( mImpl->mRenderer ) diff --git a/dali-toolkit/internal/visuals/color/color-visual.h b/dali-toolkit/internal/visuals/color/color-visual.h index a8214ea..ebe2768 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.h +++ b/dali-toolkit/internal/visuals/color/color-visual.h @@ -64,16 +64,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp index bc354e5..75155d7 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp @@ -317,17 +317,6 @@ void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const } } -void GradientVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value GradientVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void GradientVisual::InitializeRenderer() { Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY ); diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.h b/dali-toolkit/internal/visuals/gradient/gradient-visual.h index 351e772..6248f0f 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.h +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.h @@ -99,16 +99,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp index b46048a..0f6fa29 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp @@ -238,17 +238,6 @@ void BatchImageVisual::DoCreatePropertyMap( Property::Map& map ) const } } -void BatchImageVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value BatchImageVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - Shader BatchImageVisual::GetBatchShader( VisualFactoryCache& factoryCache ) { Shader shader = factoryCache.GetShader( VisualFactoryCache::BATCH_IMAGE_SHADER ); diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.h b/dali-toolkit/internal/visuals/image/batch-image-visual.h index 60209d3..4e8614f 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.h +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.h @@ -59,16 +59,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index ab6d1b6..4977be9 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -699,17 +699,6 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV ); } -void ImageVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value ImageVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void ImageVisual::OnSetTransform() { if( mImpl->mRenderer ) diff --git a/dali-toolkit/internal/visuals/image/image-visual.h b/dali-toolkit/internal/visuals/image/image-visual.h index de25d60..e34d011 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.h +++ b/dali-toolkit/internal/visuals/image/image-visual.h @@ -116,16 +116,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp index f0ba67b..73c7d69 100644 --- a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp +++ b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp @@ -449,17 +449,6 @@ void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::MeshVisual::Property::LIGHT_POSITION, mLightPosition ); } -void MeshVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value MeshVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void MeshVisual::InitializeRenderer() { //Try to load the geometry from the file. diff --git a/dali-toolkit/internal/visuals/mesh/mesh-visual.h b/dali-toolkit/internal/visuals/mesh/mesh-visual.h index 75b4a86..8a9010c 100644 --- a/dali-toolkit/internal/visuals/mesh/mesh-visual.h +++ b/dali-toolkit/internal/visuals/mesh/mesh-visual.h @@ -74,16 +74,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 60fdf58..aab7b67 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -309,17 +309,6 @@ void NPatchVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly ); } -void NPatchVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value NPatchVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache ) : Visual::Base( factoryCache ), mLoader( factoryCache.GetNPatchLoader() ), diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.h b/dali-toolkit/internal/visuals/npatch/npatch-visual.h index 1059a7e..91972aa 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.h +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.h @@ -87,16 +87,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index f4a3fe5..ebb4480 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -418,17 +418,6 @@ void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::PrimitiveVisual::Property::LIGHT_POSITION, mLightPosition ); } -void PrimitiveVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value PrimitiveVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void PrimitiveVisual::OnSetTransform() { if( mImpl->mRenderer ) diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.h b/dali-toolkit/internal/visuals/primitive/primitive-visual.h index deda8d3..006440a 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.h +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.h @@ -121,16 +121,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index df53192..a3878bf 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -140,17 +140,6 @@ void SvgVisual::DoCreatePropertyMap( Property::Map& map ) const } } -void SvgVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value SvgVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void SvgVisual::ParseFromUrl( const std::string& imageUrl ) { mImageUrl = imageUrl; diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.h b/dali-toolkit/internal/visuals/svg/svg-visual.h index 43ac1f4..2dc5226 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.h +++ b/dali-toolkit/internal/visuals/svg/svg-visual.h @@ -76,16 +76,6 @@ public: // from Visual */ virtual void DoCreatePropertyMap( Property::Map& map ) const; - /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - protected: /** diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index b67617a..cd0a1ba 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -361,81 +361,6 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert } } -Dali::Property::Value TextVisual::DoGetProperty( Dali::Property::Index index ) -{ - Dali::Property::Value value; - - switch( index ) - { - case Toolkit::TextVisual::Property::TEXT: - { - std::string text; - mController->GetText( text ); - value = text; - break; - } - case Toolkit::TextVisual::Property::FONT_FAMILY: - { - value = mController->GetDefaultFontFamily(); - break; - } - case Toolkit::TextVisual::Property::FONT_STYLE: - { - GetFontStyleProperty( mController, value, Text::FontStyle::DEFAULT ); - break; - } - case Toolkit::TextVisual::Property::POINT_SIZE: - { - value = mController->GetDefaultPointSize(); - break; - } - case Toolkit::TextVisual::Property::MULTI_LINE: - { - value = mController->IsMultiLineEnabled(); - break; - } - case Toolkit::TextVisual::Property::HORIZONTAL_ALIGNMENT: - { - const char* name = Scripting::GetEnumerationName< Toolkit::Text::Layout::HorizontalAlignment >( mController->GetHorizontalAlignment(), - HORIZONTAL_ALIGNMENT_STRING_TABLE, - HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ); - if( name ) - { - value = std::string( name ); - } - break; - } - case Toolkit::TextVisual::Property::VERTICAL_ALIGNMENT: - { - const char* name = Scripting::GetEnumerationName< Toolkit::Text::Layout::VerticalAlignment >( mController->GetVerticalAlignment(), - VERTICAL_ALIGNMENT_STRING_TABLE, - VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ); - if( name ) - { - value = std::string( name ); - } - break; - } - case Toolkit::TextVisual::Property::TEXT_COLOR: - { - value = mController->GetDefaultColor(); - break; - } - case Toolkit::TextVisual::Property::ENABLE_MARKUP: - { - value = mController->IsMarkupProcessorEnabled(); - break; - } - default: - { - // Should not arrive here. - DALI_ASSERT_DEBUG( false ); - } - } - - return value; -} - void TextVisual::OnSetTransform() { CreateRenderer(); diff --git a/dali-toolkit/internal/visuals/text/text-visual.h b/dali-toolkit/internal/visuals/text/text-visual.h index 777729b..3e3791e 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.h +++ b/dali-toolkit/internal/visuals/text/text-visual.h @@ -124,16 +124,6 @@ protected: virtual void DoSetOffStage( Actor& actor ); /** - *@copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - - /** * @copydoc Visual::Base::OnSetTransform */ virtual void OnSetTransform(); @@ -141,6 +131,14 @@ protected: private: /** + * Set the individual property to the given value + * @param[in] index The index key used to reference this value within the initial + * property map. + * @param[in] propertyValue The value to set + */ + void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); + + /** * @brief Creates the text's renderer. */ void CreateRenderer(); diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 12b6b35..a32b8e5 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -204,57 +204,6 @@ bool Visual::Base::IsFromCache() const return mImpl->mFlags & Impl::IS_FROM_CACHE; } -void Visual::Base::SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - DALI_ASSERT_ALWAYS( ( index > Property::INVALID_INDEX ) && - ( index > VISUAL_PROPERTY_BASE_START_INDEX ) && // Change the type of visual is not allowed. - "Property index is out of bounds" ); - - if( index < VISUAL_PROPERTY_START_INDEX ) - { - if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM ) - { - Property::Map* transformMap = propertyValue.GetMap(); - if( transformMap ) - { - SetTransformAndSize( *transformMap, mImpl->mControlSize ); - } - } - - // TODO set the properties of the visual base. - } - else - { - DoSetProperty( index, propertyValue ); - } -} - -Dali::Property::Value Visual::Base::GetProperty( Dali::Property::Index index ) -{ - DALI_ASSERT_ALWAYS( ( index > Property::INVALID_INDEX ) && - ( index >= VISUAL_PROPERTY_BASE_START_INDEX ) && - "Property index is out of bounds" ); - - Dali::Property::Value value; - - if( index < VISUAL_PROPERTY_START_INDEX ) - { - if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM ) - { - Property::Map map; - mImpl->mTransform.GetPropertyMap( map ); - return map; - } - // TODO retrieve the properties of the visual base. - } - else - { - value = DoGetProperty( index ); - } - - return value; -} - } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/visuals/visual-base-impl.h b/dali-toolkit/internal/visuals/visual-base-impl.h index cb0c7be..1c7039b 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-impl.h @@ -221,24 +221,6 @@ protected: */ bool IsFromCache() const; -protected: - /** - * @brief Called by SetProperty(). To be overriden by derived clases in order to set properties. - * - * @param [in] index The index of the property. - * @param [in] propertyValue The new value of the property. - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) = 0; - - /** - * @brief Called by GetProperty(). To be overriden by derived classes in order to retrieve properties. - * - * @param [in] index The index of the property. - * - * @return The property value. - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ) = 0; - private: // Undefined diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp index 396f13b..b0e1f7b 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp @@ -109,17 +109,6 @@ void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::VisualProperty::TYPE, Toolkit::Visual::WIREFRAME ); } -void WireframeVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) -{ - // TODO -} - -Dali::Property::Value WireframeVisual::DoGetProperty( Dali::Property::Index index ) -{ - // TODO - return Dali::Property::Value(); -} - void WireframeVisual::InitializeRenderer() { Shader shader = mFactoryCache.GetShader( VisualFactoryCache::WIREFRAME_SHADER ); diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h index 19cbc46..d35beb3 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h @@ -81,16 +81,6 @@ protected: virtual void DoCreatePropertyMap( Property::Map& map ) const; /** - * @copydoc Visual::Base::DoSetProperty - */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); - - /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - - /** * @copydoc Visual::Base::OnSetTransform */ virtual void OnSetTransform(); -- 2.7.4