From: Kimmo Hoikka Date: Wed, 8 Jul 2015 14:40:03 +0000 (+0100) Subject: Remove UNSIGNED_INTEGER property type (removed from core) X-Git-Tag: dali_1.0.49~27^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=738d8f6dec864b75dd25632c3a853422e2ffa757 Remove UNSIGNED_INTEGER property type (removed from core) Change-Id: I9874eeaeb95b59e4486265951184558e48efc72f --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index daac903..1180731 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp @@ -867,17 +867,11 @@ int UtcDaliControlImplOnStyleChangeN(void) Control dummy = Control::New(); Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy ); - // test that style manager is being used, passing an empty handle throws exception - try - { - Dali::Toolkit::StyleManager styleManager; - controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE ); - tet_result(TET_FAIL); - } - catch (DaliException &exception) - { - tet_result(TET_PASS); - } + // test that style manager is being used, passing an empty handle does nothing but does not crash either + Dali::Toolkit::StyleManager styleManager; + controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE ); + // no crash so test passes + tet_result(TET_PASS); END_TEST; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp index 9c1e054..14d183b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp @@ -595,18 +595,18 @@ int UtcDaliTableViewSetGetProperty(void) // Test "rows" property DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS ); - tableView.SetProperty( TableView::Property::ROWS, 4u ); + tableView.SetProperty( TableView::Property::ROWS, 4 ); DALI_TEST_CHECK( tableView.GetRows() == 4u ); - DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get() == 4u ); + DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get() == 4 ); // Test "columns" property DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS ); - tableView.SetProperty( TableView::Property::COLUMNS, 5u ); + tableView.SetProperty( TableView::Property::COLUMNS, 5 ); DALI_TEST_CHECK( tableView.GetColumns() == 5u ); - DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get() == 5u ); + DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get() == 5 ); // Test "cell-padding" property DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 7e6b21e..1c3f5f1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -72,7 +72,7 @@ const char* const PROPERTY_NAME_SELECTION_HIGHLIGHT_COLOR = "selectio const char* const PROPERTY_NAME_DECORATION_BOUNDING_BOX = "decoration-bounding-box"; const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS = "input-method-settings"; -const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; +const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f ); const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color. @@ -268,7 +268,7 @@ int UtcDaliTextFieldSetPropertyP(void) DALI_TEST_CHECK( field ); // Check defaults. - DALI_TEST_EQUALS( field.GetProperty( TextField::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION ); + DALI_TEST_EQUALS( field.GetProperty( TextField::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION ); DALI_TEST_EQUALS( field.GetProperty( TextField::Property::TEXT ), std::string(""), TEST_LOCATION ); DALI_TEST_EQUALS( field.GetProperty( TextField::Property::PLACEHOLDER_TEXT ), std::string(""), TEST_LOCATION ); DALI_TEST_EQUALS( field.GetProperty( TextField::Property::PLACEHOLDER_TEXT_FOCUSED ), std::string(""), TEST_LOCATION ); @@ -294,7 +294,7 @@ int UtcDaliTextFieldSetPropertyP(void) // Check the render backend property. field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS ); - DALI_TEST_EQUALS( field.GetProperty( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); + DALI_TEST_EQUALS( field.GetProperty( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); // Check text property. field.SetProperty( TextField::Property::TEXT, "Setting Text" ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 21b3c8b..f295b33 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -51,7 +51,7 @@ const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underline-enabled"; const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underline-color"; const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underline-height"; -const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; +const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; } // namespace @@ -162,7 +162,7 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) DALI_TEST_CHECK( label ); // Check defaults - DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::TEXT ), std::string(""), TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION ); @@ -178,7 +178,7 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::UNDERLINE_HEIGHT ), 0.0f, TEST_LOCATION ); label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS ); - DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); // Check that text can be correctly reset label.SetProperty( TextLabel::Property::TEXT, "Setting Text" ); diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 0371491..07ca895 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -124,11 +124,6 @@ std::string PropertyValueToString( const Property::Value& value ) ret = ToString( value.Get() ); break; } - case Property::UNSIGNED_INTEGER: - { - ret = ToString( value.Get() ); - break; - } case Property::VECTOR2: { ret = ToString( value.Get() ); diff --git a/dali-toolkit/internal/builder/builder-set-property.cpp b/dali-toolkit/internal/builder/builder-set-property.cpp index a1ed104..12f602c 100644 --- a/dali-toolkit/internal/builder/builder-set-property.cpp +++ b/dali-toolkit/internal/builder/builder-set-property.cpp @@ -208,15 +208,6 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V } break; } - case Property::UNSIGNED_INTEGER: - { - if( OptionalUnsignedInt v = replacer.IsUnsignedInteger( node) ) - { - value = *v; - done = true; - } - break; - } case Property::VECTOR2: { if( OptionalVector2 v = replacer.IsVector2(node) ) diff --git a/dali-toolkit/internal/builder/replacement.cpp b/dali-toolkit/internal/builder/replacement.cpp index 49e7365..446a014 100644 --- a/dali-toolkit/internal/builder/replacement.cpp +++ b/dali-toolkit/internal/builder/replacement.cpp @@ -321,27 +321,6 @@ OptionalInteger Replacement::IsInteger( const TreeNode & node ) const return ret; } -OptionalUnsignedInt Replacement::IsUnsignedInteger( const TreeNode & node ) const -{ - OptionalUnsignedInt ret; - if( OptionalString replace = HasFullReplacement( node ) ) - { - Property::Value value = GetFullReplacement( *replace ); - if( Property::UNSIGNED_INTEGER == value.GetType() ) - { - ret = value.Get(); - } - } - else - { - if ( OptionalInteger i = ::IsInteger( node ) ) - { - ret = OptionalUnsignedInt(static_cast(*i) ); - } - } - return ret; -} - OptionalVector2 Replacement::IsVector2( const TreeNode & node ) const { OptionalVector2 ret; diff --git a/dali-toolkit/internal/builder/replacement.h b/dali-toolkit/internal/builder/replacement.h index 358c21c..3c4d829 100644 --- a/dali-toolkit/internal/builder/replacement.h +++ b/dali-toolkit/internal/builder/replacement.h @@ -102,13 +102,6 @@ public: * @param node The TreeNode to check * @return Optional value */ - OptionalUnsignedInt IsUnsignedInteger( const TreeNode & node ) const; - - /* @brief Check node for a type - * - * @param node The TreeNode to check - * @return Optional value - */ OptionalVector2 IsVector2( const TreeNode & node ) const; /* @brief Check node for a type diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp index af57a7f..a9b9aa9 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp @@ -322,7 +322,7 @@ Geometry BubbleEmitter::CreateGeometry( unsigned int numOfPatch ) vertices.SetData( &vertexData[0] ); Property::Map indexFormat; - indexFormat["indices"] = Property::UNSIGNED_INTEGER; + indexFormat["indices"] = Property::INTEGER; PropertyBuffer indices = PropertyBuffer::New( indexFormat, numIndex ); indices.SetData( &indexData[0] ); diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index d278eb4..89eb96e 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -102,7 +102,7 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) unsigned int indexData[18] = { 0,3,1,0,2,3,4,7,5,4,6,7,8,11,9,8,10,11 }; Property::Map indexFormat; - indexFormat["indices"] = Property::UNSIGNED_INTEGER; + indexFormat["indices"] = Property::INTEGER; PropertyBuffer indices = PropertyBuffer::New( indexFormat, 18u ); indices.SetData( indexData ); diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index 0be26cd..ae35484 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -142,11 +142,11 @@ BaseHandle Create() // Setup properties, signals and actions using the type-registry. DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TableView, Toolkit::Control, Create ); -DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "rows", UNSIGNED_INTEGER, ROWS ) -DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns", UNSIGNED_INTEGER, COLUMNS ) -DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cell-padding", VECTOR2, CELL_PADDING ) -DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-rows", MAP, LAYOUT_ROWS ) -DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-columns", MAP, LAYOUT_COLUMNS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "rows", INTEGER, ROWS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns", INTEGER, COLUMNS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cell-padding", VECTOR2, CELL_PADDING ) +DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-rows", MAP, LAYOUT_ROWS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-columns", MAP, LAYOUT_COLUMNS ) DALI_TYPE_REGISTRATION_END() @@ -877,17 +877,25 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr { case Toolkit::TableView::Property::ROWS: { - if( value.Get() != tableViewImpl.GetRows() ) + int rows = 0; + if( value.Get( rows ) && rows >= 0 ) { - tableViewImpl.Resize( value.Get(), tableViewImpl.GetColumns() ); + if( static_cast(rows) != tableViewImpl.GetRows() ) + { + tableViewImpl.Resize( rows, tableViewImpl.GetColumns() ); + } } break; } case Toolkit::TableView::Property::COLUMNS: { - if( value.Get() != tableViewImpl.GetColumns() ) + int columns = 0; + if( value.Get( columns ) && columns >= 0 ) { - tableViewImpl.Resize( tableViewImpl.GetRows(), value.Get() ); + if( static_cast( columns ) != tableViewImpl.GetColumns() ) + { + tableViewImpl.Resize( tableViewImpl.GetRows(), value.Get() ); + } } break; } @@ -923,12 +931,12 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde { case Toolkit::TableView::Property::ROWS: { - value = tableViewImpl.GetRows(); + value = static_cast( tableViewImpl.GetRows() ); break; } case Toolkit::TableView::Property::COLUMNS: { - value = tableViewImpl.GetColumns(); + value = static_cast( tableViewImpl.GetColumns() ); break; } case Toolkit::TableView::Property::CELL_PADDING: diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 43867b4..a22cc90 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -281,7 +281,7 @@ struct Decorator::Impl : public ConnectionTracker mNotifyEndOfScroll( false ) { mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2; - mQuadIndexFormat[ "indices" ] = Property::UNSIGNED_INTEGER; + mQuadIndexFormat[ "indices" ] = Property::INTEGER; mHighlightMaterial = Material::New( Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ) ); } diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index 9d34fd2..a9810c9 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -104,7 +104,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2; mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2; - mQuadIndexFormat[ "indices" ] = Property::UNSIGNED_INTEGER; + mQuadIndexFormat[ "indices" ] = Property::INTEGER; } void AddGlyphs( const std::vector& positions, diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index c0c71ea..74eabcb 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -239,7 +239,7 @@ Actor CreateBackground( Actor parent, const Vector4& color, Image image = Image( //Create the index buffer Property::Map indexFormat; - indexFormat["indices"] = Property::UNSIGNED_INTEGER; + indexFormat["indices"] = Property::INTEGER; PropertyBuffer indexBuffer = PropertyBuffer::New( indexFormat, 6u ); indexBuffer.SetData(gQuadIndex); @@ -900,7 +900,7 @@ void Control::OnControlChildRemove( Actor& child ) void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) { // By default the control is only interested in theme (not font) changes - if( change == StyleChange::THEME_CHANGE ) + if( styleManager && change == StyleChange::THEME_CHANGE ) { GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); } diff --git a/plugins/dali-script-v8/src/object/property-value-wrapper.cpp b/plugins/dali-script-v8/src/object/property-value-wrapper.cpp index c58d991..0b70084 100644 --- a/plugins/dali-script-v8/src/object/property-value-wrapper.cpp +++ b/plugins/dali-script-v8/src/object/property-value-wrapper.cpp @@ -481,7 +481,6 @@ bool IsPrimitive( const Dali::Property::Value &value ) { case Dali::Property::BOOLEAN: case Dali::Property::INTEGER: - case Dali::Property::UNSIGNED_INTEGER: case Dali::Property::STRING: case Dali::Property::FLOAT: { @@ -516,11 +515,6 @@ v8::Local CreateJavaScriptPrimitive( v8::Isolate* isolate, const Dal v8Value = v8::Integer::New( isolate, value.Get()); break; } - case Dali::Property::UNSIGNED_INTEGER: - { - v8Value = v8::Integer::New( isolate, value.Get()); - break; - } case Dali::Property::STRING: { std::string string = value.Get< std::string >(); @@ -683,14 +677,6 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i } break; } - case Dali::Property::UNSIGNED_INTEGER: - { - if( v8Value->IsUint32() ) - { - daliPropertyValue = Dali::Property::Value( v8Value->Uint32Value() );//static_cast( V8Utils::GetNumberValue( isolate, v8Value) )); - } - break; - } case Dali::Property::STRING: { if( V8Utils::IsStringPrimitiveOrObject( v8Value) ) diff --git a/plugins/dali-script-v8/src/utils/v8-utils.cpp b/plugins/dali-script-v8/src/utils/v8-utils.cpp index 697b9dd..3466198 100644 --- a/plugins/dali-script-v8/src/utils/v8-utils.cpp +++ b/plugins/dali-script-v8/src/utils/v8-utils.cpp @@ -422,18 +422,12 @@ Property::Value GetPropertyValueFromObject( bool& found, v8::Isolate* isolate, c v8::Local v = value->ToNumber(); return Dali::Property::Value(static_cast(v->Value())); } - else if( value->IsInt32() ) + else if( value->IsInt32() || value->IsUint32() ) { found = true; v8::Local v = value->ToInt32(); return Dali::Property::Value(static_cast(v->Value())); } - else if ( value->IsUint32() ) - { - found = true; - v8::Local v = value->ToUint32(); - return Dali::Property::Value(static_cast(v->Value())); - } return daliPropertyValue; } @@ -894,11 +888,6 @@ void CreatePropertyMap( v8::Isolate* isolate, const Property::Map& map, v8::Loca v8Value = v8::Integer::New( isolate, value.Get()); break; } - case Dali::Property::UNSIGNED_INTEGER: - { - v8Value = v8::Integer::New( isolate, value.Get()); - break; - } case Dali::Property::STRING: { std::string string = value.Get< std::string >();