Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
index 7d2962a..dab5447 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -114,11 +114,7 @@ public:
     Stage stage = Stage::GetCurrent();
 
     // Respond to key events if not handled
-    Toolkit::KeyInputFocusManager keyInputFocusManager = Toolkit::KeyInputFocusManager::Get();
-    if( keyInputFocusManager )
-    {
-      keyInputFocusManager.UnhandledKeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
-    }
+    stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
 
     // Creates a default view with a default tool bar.
     // The view is added to the stage.
@@ -137,8 +133,8 @@ public:
     mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) );
 
     mItemView = Toolkit::ItemView::New( *this );
-    mItemView.SetParentOrigin( ParentOrigin::CENTER );
-    mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+    mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+    mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
     mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
     // Use a grid layout for tests
@@ -184,10 +180,10 @@ public:
     const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
 
     Toolkit::Popup popup = Toolkit::Popup::New();
-    popup.SetName( "popup" );
-    popup.SetParentOrigin( ParentOrigin::CENTER );
-    popup.SetAnchorPoint( AnchorPoint::CENTER );
-    popup.SetSize( POPUP_WIDTH_DP, 0.0f );
+    popup.SetProperty( Dali::Actor::Property::NAME, "popup" );
+    popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+    popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+    popup.SetProperty( Actor::Property::SIZE, Vector2( POPUP_WIDTH_DP, 0.0f ) );
     popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false );
 
     popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched );
@@ -198,14 +194,14 @@ public:
 
   bool OnButtonClicked( Toolkit::Button button )
   {
-    if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
+    if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_1CELL_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
-      table.SetName( "TABLEVIEW_BUTTON_1CELL_ID" );
+      table.SetProperty( Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID" );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
       Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
@@ -216,11 +212,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3CELL_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -245,11 +241,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3X3CELL_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 3 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -309,11 +305,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED1_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -324,7 +320,7 @@ public:
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -337,7 +333,7 @@ public:
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
         backing.Add( text );
@@ -349,7 +345,7 @@ public:
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
         backing.Add( text );
@@ -360,11 +356,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED2_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -376,8 +372,8 @@ public:
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -390,8 +386,8 @@ public:
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -404,8 +400,8 @@ public:
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -418,11 +414,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT1_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -432,12 +428,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 100.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -452,8 +448,8 @@ public:
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -465,12 +461,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 100.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -484,11 +480,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT2_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -500,8 +496,8 @@ public:
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -513,7 +509,7 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 200.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
@@ -521,8 +517,8 @@ public:
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
 
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         backing.Add( text );
 
         table.Add( backing );
@@ -533,8 +529,8 @@ public:
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -548,11 +544,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL1_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
@@ -565,12 +561,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 100.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -582,12 +578,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 200.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -599,12 +595,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 300.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 300.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -618,11 +614,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL2_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
@@ -635,12 +631,12 @@ public:
         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
         backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
-        backing.SetSize( 0.0f, 100.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 100.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -652,12 +648,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 200.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -671,11 +667,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL3_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
 
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
@@ -690,8 +686,8 @@ public:
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -703,12 +699,12 @@ public:
       {
         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
-        backing.SetSize( 0.0f, 200.0f );
+        backing.SetProperty( Actor::Property::SIZE, Vector2( 0.0f, 200.0f ) );
 
         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
+        text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -721,11 +717,11 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -734,29 +730,29 @@ public:
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+      image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
 
       mPopup.Add( image );
 
       StagePopup( mPopup );
     }
-    else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
+    else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
     {
       mPopup = CreatePopup();
       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
 
       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
+      image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
 
       mPopup.Add( image );
 
@@ -799,7 +795,7 @@ public: // From ItemFactory
   virtual Actor NewItem(unsigned int itemId)
   {
     Toolkit::PushButton popupButton = Toolkit::PushButton::New();
-    popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
+    popupButton.SetProperty( Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
     popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
     popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
@@ -823,19 +819,10 @@ private:
 
 };
 
-void RunTest( Application& application )
-{
-  SizeNegotiationController test( application );
-
-  application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
 int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
-  RunTest( application );
-
+  SizeNegotiationController test( application );
+  application.MainLoop();
   return 0;
 }