From: Seoyeon Kim Date: Wed, 5 Dec 2018 01:44:05 +0000 (+0900) Subject: Remove deprecated APIs in Tizen 3.0 X-Git-Tag: dali_1.4.1~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F194475%2F6;p=platform%2Fcore%2Fuifw%2Fdali-demo.git Remove deprecated APIs in Tizen 3.0 - Changed deprecated APIs of dali-core and dali-toolkit Change-Id: I8e6858cf5415e47362e95e8e7482771ae8307666 Signed-off-by: Seoyeon Kim --- diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 6172a73..21edf36 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -356,7 +356,7 @@ public: } case GRID_LAYOUT: { - stage.GetRootLayer().SetBehavior(Layer::LAYER_2D); + stage.GetRootLayer().SetBehavior(Layer::LAYER_UI); break; } } diff --git a/examples/primitive-shapes/primitive-shapes-example.cpp b/examples/primitive-shapes/primitive-shapes-example.cpp index 29112a3..346869c 100644 --- a/examples/primitive-shapes/primitive-shapes-example.cpp +++ b/examples/primitive-shapes/primitive-shapes-example.cpp @@ -95,7 +95,7 @@ public: layer.SetParentOrigin( ParentOrigin::CENTER ); layer.SetAnchorPoint( AnchorPoint::CENTER ); layer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - layer.SetBehavior( Layer::LAYER_2D ); //We use a 2D layer as this is closer to UI work than full 3D scene creation. + layer.SetBehavior( Layer::LAYER_UI ); //We use a 2D layer as this is closer to UI work than full 3D scene creation. layer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so. stage.Add( layer ); diff --git a/examples/renderer-stencil/renderer-stencil-example.cpp b/examples/renderer-stencil/renderer-stencil-example.cpp index f3aec24..a8f50f8 100644 --- a/examples/renderer-stencil/renderer-stencil-example.cpp +++ b/examples/renderer-stencil/renderer-stencil-example.cpp @@ -158,7 +158,7 @@ private: layer.SetAnchorPoint( AnchorPoint::CENTER ); // Set the parent origin to a small percentage below the center (so the demo will scale for different resolutions). layer.SetParentOrigin( Vector3( 0.5f, 0.58f, 0.5f ) ); - layer.SetBehavior( Layer::LAYER_2D ); + layer.SetBehavior( Layer::LAYER_UI ); layer.SetDepthTestDisabled( false ); stage.Add( layer ); diff --git a/examples/text-fonts/text-fonts-example.cpp b/examples/text-fonts/text-fonts-example.cpp index 1519b87..cd20814 100644 --- a/examples/text-fonts/text-fonts-example.cpp +++ b/examples/text-fonts/text-fonts-example.cpp @@ -80,8 +80,10 @@ public: } else { - textLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.3f, 0.3f ) ); - textLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::BLACK ); + shadowMap.Insert( "offset", Vector2( 0.3f, 0.3f ) ); + textLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE ); } textLabel.SetBackgroundColor( color ); diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp index 63f1c36..d8c15a8 100644 --- a/examples/text-label/text-label-example.cpp +++ b/examples/text-label/text-label-example.cpp @@ -365,7 +365,7 @@ public: case SHADOW : { Vector2 shadowOffset( SHADOW_OFFSET ); // Will be set to zeros if color already set - Property::Value value = mLabel.GetProperty( TextLabel::Property::SHADOW_COLOR ); + Property::Value value = mLabel.GetProperty( TextLabel::Property::SHADOW ); Vector4 currentShadowColor; value.Get( currentShadowColor ); @@ -697,13 +697,19 @@ public: } case KEY_S: // Shadow color { - if( Color::BLACK == mLabel.GetProperty( TextLabel::Property::SHADOW_COLOR ) ) + Property::Value value = mLabel.GetProperty( TextLabel::Property::SHADOW ); + Vector4 shadowColor; + value.Get( shadowColor ); + Property::Map shadowMap; + if( Color::BLACK == shadowColor ) { - mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::RED ); + shadowMap.Insert( "color", Color::RED ); + mLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); } else { - mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + shadowMap.Insert( "color", Color::BLACK ); + mLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); } break; } @@ -715,12 +721,26 @@ public: } case KEY_PLUS: // Increase shadow offset { - mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, mLabel.GetProperty( TextLabel::Property::SHADOW_OFFSET ) + Vector2( 1.0f, 1.0f ) ); + Property::Value value = mLabel.GetProperty( TextLabel::Property::SHADOW ); + Vector2 shadowOffset; + value.Get( shadowOffset ); + shadowOffset += Vector2( 1.0f, 1.0f ); + + Property::Map shadowMap; + shadowMap.Insert( "offset", shadowOffset ); + mLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case KEY_MINUS: // Decrease shadow offset { - mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, mLabel.GetProperty( TextLabel::Property::SHADOW_OFFSET ) - Vector2( 1.0f, 1.0f ) ); + Property::Value value = mLabel.GetProperty( TextLabel::Property::SHADOW ); + Vector2 shadowOffset; + value.Get( shadowOffset ); + shadowOffset -= Vector2( 1.0f, 1.0f ); + + Property::Map shadowMap; + shadowMap.Insert( "offset", shadowOffset ); + mLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } diff --git a/examples/text-memory-profiling/text-memory-profiling-example.cpp b/examples/text-memory-profiling/text-memory-profiling-example.cpp index eae8319..bdc9ca5 100644 --- a/examples/text-memory-profiling/text-memory-profiling-example.cpp +++ b/examples/text-memory-profiling/text-memory-profiling-example.cpp @@ -102,7 +102,9 @@ public: label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK ); label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f ); - label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::YELLOW ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::YELLOW ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true ); Vector2 stageSize = Stage::GetCurrent().GetSize(); @@ -113,55 +115,73 @@ public: case SINGLE_COLOR_TEXT: { label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) ); + + shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case SINGLE_COLOR_TEXT_WITH_STYLE: { label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) ); + + shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case SINGLE_COLOR_TEXT_WITH_EMOJI: { label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) ); + + shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case SINGLE_COLOR_TEXT_WITH_STYLE_EMOJI: { label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) ); + + shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case MULTI_COLOR_TEXT: { label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) ); + + shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case MULTI_COLOR_TEXT_WITH_STYLE: { label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) ); + + shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case MULTI_COLOR_TEXT_WITH_EMOJI: { label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) ); + + shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case MULTI_COLOR_TEXT_WITH_STYLE_EMOJI: { label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) ); + + shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); break; } case SMALL_TEXT_IN_LARGE_TEXT_LABEL: { label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); - label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) ); + + shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) ); + label.SetProperty( TextLabel::Property::SHADOW, shadowMap ); label.SetSize(stageSize.x, stageSize.y * 0.25f); // Set the text label in larger size break; } diff --git a/examples/text-scrolling/text-scrolling-example.cpp b/examples/text-scrolling/text-scrolling-example.cpp index 6b3f047..e1e9d94 100644 --- a/examples/text-scrolling/text-scrolling-example.cpp +++ b/examples/text-scrolling/text-scrolling-example.cpp @@ -174,15 +174,16 @@ public: scrollLargeButton.ClickedSignal().Connect( this, &TextScrollingExample::OnButtonClickedLarge ); CreateLabel( mLargeLabel, "A Quick Brown Fox Jumps Over The Lazy Dog", boxB, false ,scrollLargeButton ); - CreateBox( "boxC", boxC, desktop, SCROLLING_BOX_SIZE ); boxC.SetPosition( 0.0f, -300.0f, 1.0f ); Toolkit::PushButton scrollSmallButton = Toolkit::PushButton::New(); scrollSmallButton.ClickedSignal().Connect( this, &TextScrollingExample::OnButtonClickedSmall ); CreateLabel( mSmallLabel, "Hello Text", boxC , true, scrollSmallButton ); mSmallLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK ); - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) ); - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::CYAN ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::CYAN ); + shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) ); + mSmallLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); CreateBox( "boxD", boxD, desktop, SCROLLING_BOX_SIZE ); boxD.SetPosition( 0.0f, -200.0f, 1.0f ); @@ -320,7 +321,9 @@ public: mToggleColor = true; } - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::BLACK ); + mSmallLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); mSmallLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color ); mRtlLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color ); mLargeLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color );