Remove deprecated APIs in Tizen 3.0 75/194475/6
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 5 Dec 2018 01:44:05 +0000 (10:44 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 31 Dec 2018 01:58:33 +0000 (10:58 +0900)
- Changed deprecated APIs of dali-core and dali-toolkit

Change-Id: I8e6858cf5415e47362e95e8e7482771ae8307666
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
examples/item-view/item-view-example.cpp
examples/primitive-shapes/primitive-shapes-example.cpp
examples/renderer-stencil/renderer-stencil-example.cpp
examples/text-fonts/text-fonts-example.cpp
examples/text-label/text-label-example.cpp
examples/text-memory-profiling/text-memory-profiling-example.cpp
examples/text-scrolling/text-scrolling-example.cpp

index 6172a73..21edf36 100644 (file)
@@ -356,7 +356,7 @@ public:
       }
       case GRID_LAYOUT:
       {
-        stage.GetRootLayer().SetBehavior(Layer::LAYER_2D);
+        stage.GetRootLayer().SetBehavior(Layer::LAYER_UI);
         break;
       }
     }
index 29112a3..346869c 100644 (file)
@@ -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 );
 
index f3aec24..a8f50f8 100644 (file)
@@ -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 );
 
index 1519b87..cd20814 100644 (file)
@@ -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 );
index 63f1c36..d8c15a8 100644 (file)
@@ -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<Vector4>( 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<Vector2>( 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<Vector2>( 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;
           }
 
index eae8319..bdc9ca5 100644 (file)
@@ -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 <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
-        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 <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
-        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 <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
-        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 <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
-        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;
       }
index 6b3f047..e1e9d94 100644 (file)
@@ -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 );