From: Agnelo Vaz Date: Fri, 4 Nov 2016 11:53:39 +0000 (+0000) Subject: Revert "Image and NPatch visual GetProperty returns url" X-Git-Tag: dali_1.2.14~13^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=6bb8c18706bef7ba16c047b7152aba250bee7091;ds=sidebyside Revert "Image and NPatch visual GetProperty returns url" This reverts commit 4a0101828ec38e0cbdc450de769f11530044ea7f. Change-Id: I8bda8ac00f5aac6cdcc6ee87df2f76f6494a5278 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 779f808..4959ed9 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -662,19 +662,6 @@ int UtcDaliVisualGetPropertyMap5(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == true ); - // Test the properties.. - Property::Value imageValue = imageVisual.GetProperty( ImageVisual::Property::URL ); - DALI_TEST_CHECK( imageValue.Get() == TEST_IMAGE_FILE_NAME ); - - // Other Properties for Image Visual can be tested here once implemented in the Visual - - tet_infoline( "UtcDaliVisualGetPropertyMap5 Ensuring Property without a Getter is not problematic" ); - imageValue = imageVisual.GetProperty( ImageVisual::Property::DESIRED_HEIGHT ); - DALI_TEST_CHECK( imageValue.Get() != 30 ); - - - // Rest of test uses Image not an url ( legacy ) - // Get an image visual with an image handle, and test the default property values Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200)); imageVisual = factory.CreateVisual(image); @@ -720,6 +707,10 @@ int UtcDaliVisualGetPropertyMap5(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == false ); + // Test the properties. TODO: to be completed. + imageVisual.SetProperty( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); + Property::Value imageValue = imageVisual.GetProperty( ImageVisual::Property::URL ); + END_TEST; } @@ -728,13 +719,11 @@ int UtcDaliVisualGetPropertyMap6(void) ToolkitTestApplication application; tet_infoline( "UtcDaliVisualGetPropertyMap6: NPatchVisual" ); - bool BORDER_ONLY_SETTING = true; - VisualFactory factory = VisualFactory::Get(); Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); propertyMap.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); - propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, BORDER_ONLY_SETTING ); + propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true ); Visual::Base nPatchVisual = factory.CreateVisual( propertyMap ); Property::Map resultMap; @@ -753,19 +742,9 @@ int UtcDaliVisualGetPropertyMap6(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() ); - // Test the properties via Index. - nPatchVisual.SetProperty( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); // May not able to change URL in future using SetProperty + // Test the properties. TODO: to be completed. + nPatchVisual.SetProperty( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); Property::Value nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::URL ); - DALI_TEST_CHECK( nPatchValue.Get() == TEST_NPATCH_FILE_NAME ); - - nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::BORDER_ONLY ); - DALI_TEST_CHECK( nPatchValue.Get() == BORDER_ONLY_SETTING ); - - // Other Properties for N-Patch Visual can be tested here once implemented in the Visual - - tet_infoline( "UtcDaliVisualGetPropertyMap6 Ensuring Property without a Getter is not problematic" ); - nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::DESIRED_HEIGHT ); - DALI_TEST_CHECK( nPatchValue.Get() != 30 ); END_TEST; } diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 44d9810..742f068 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -700,27 +700,13 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const void ImageVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) { - // This is where specific Properties can be set. + // TODO } Dali::Property::Value ImageVisual::DoGetProperty( Dali::Property::Index index ) { - Dali::Property::Value value; - - switch( index ) - { - case Toolkit::ImageVisual::Property::URL: - { - value = mImageUrl; - break; - } - default: - { - break; - } - } - - return value; + // TODO + return Dali::Property::Value(); } void ImageVisual::OnSetTransform() diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 9daf0eb..a4cf8c0 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -448,32 +448,13 @@ void NPatchVisual::DoCreatePropertyMap( Property::Map& map ) const void NPatchVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) { - // This is where specific Properties can be set. + // TODO } Dali::Property::Value NPatchVisual::DoGetProperty( Dali::Property::Index index ) { - Dali::Property::Value value; - - switch( index ) - { - case Toolkit::ImageVisual::Property::URL: - { - value = mImageUrl; - break; - } - case Toolkit::ImageVisual::Property::BORDER_ONLY: - { - value = mBorderOnly; - break; - } - default: - { - break; - } - } - - return value; + // TODO + return Dali::Property::Value(); } void NPatchVisual::OnSetTransform()