Merge "Add a TextEditor property to limit input to maximum characters" into devel...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / page-turn-view / page-turn-view-impl.cpp
index 6cb28d6..4cba4af 100644 (file)
@@ -388,14 +388,14 @@ void PageTurnView::OnInitialize()
   for( int i = 0; i < NUMBER_OF_CACHED_PAGES; i++ )
   {
     mPages.push_back( Page() );
-    mPages[i].actor.SetSize( mPageSize );
+    mPages[i].actor.SetProperty( Actor::Property::SIZE, mPageSize );
     Self().Add( mPages[i].actor );
   }
 
   // create the layer for turning pages
   mTurningPageLayer = Layer::New();
   mTurningPageLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
-  mTurningPageLayer.SetBehavior(Layer::LAYER_3D);
+  mTurningPageLayer.SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
   mTurningPageLayer.Raise();
 
   // Set control size and the parent origin of page layers
@@ -408,7 +408,7 @@ void PageTurnView::OnInitialize()
   for( int i = 0; i < NUMBER_OF_CACHED_PAGES_EACH_SIDE; i++ )
   {
     AddPage( i );
-    mPages[i].actor.SetZ( -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
+    mPages[i].actor.SetProperty( Actor::Property::POSITION_Z,  -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
   }
   mPages[0].actor.SetProperty( Actor::Property::VISIBLE,true);
 
@@ -456,14 +456,14 @@ void PageTurnView::SetupShadowView()
 
   mShadowPlaneBackground = Actor::New();
   mShadowPlaneBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
-  mShadowPlaneBackground.SetSize( mControlSize );
+  mShadowPlaneBackground.SetProperty( Actor::Property::SIZE, mControlSize );
   Self().Add( mShadowPlaneBackground );
   mShadowView.SetShadowPlaneBackground( mShadowPlaneBackground );
 
   mPointLight = Actor::New();
   mPointLight.SetProperty( Actor::Property::ANCHOR_POINT, origin );
   mPointLight.SetProperty( Actor::Property::PARENT_ORIGIN, origin );
-  mPointLight.SetPosition( 0.f, 0.f, mPageSize.width*POINT_LIGHT_HEIGHT_RATIO );
+  mPointLight.SetProperty( Actor::Property::POSITION, Vector3( 0.f, 0.f, mPageSize.width*POINT_LIGHT_HEIGHT_RATIO ));
   Self().Add( mPointLight );
   mShadowView.SetPointLight( mPointLight );
 
@@ -471,14 +471,14 @@ void PageTurnView::SetupShadowView()
   mShadowView.Activate();
 }
 
-void PageTurnView::OnStageConnection( int depth )
+void PageTurnView::OnSceneConnection( int depth )
 {
   SetupShadowView();
 
-  Control::OnStageConnection( depth );
+  Control::OnSceneConnection( depth );
 }
 
-void PageTurnView::OnStageDisconnection()
+void PageTurnView::OnSceneDisconnection()
 {
   if(mShadowView)
   {
@@ -491,7 +491,7 @@ void PageTurnView::OnStageDisconnection()
   // make sure the status of the control is updated correctly when the pan gesture is interrupted
   StopTurning();
 
-  Control::OnStageDisconnection();
+  Control::OnSceneDisconnection();
 }
 
 void PageTurnView::SetPageSize( const Vector2& viewPageSize )
@@ -500,19 +500,19 @@ void PageTurnView::SetPageSize( const Vector2& viewPageSize )
 
   if( mPointLight )
   {
-    mPointLight.SetPosition( 0.f, 0.f, mPageSize.width*POINT_LIGHT_HEIGHT_RATIO );
+    mPointLight.SetProperty( Actor::Property::POSITION, Vector3( 0.f, 0.f, mPageSize.width*POINT_LIGHT_HEIGHT_RATIO ));
   }
 
   for( size_t i=0; i<mPages.size(); i++ )
   {
-    mPages[i].actor.SetSize( mPageSize );
+    mPages[i].actor.SetProperty( Actor::Property::SIZE, mPageSize );
   }
 
   OnPageTurnViewInitialize();
 
   if( mShadowPlaneBackground )
   {
-    mShadowPlaneBackground.SetSize( mControlSize );
+    mShadowPlaneBackground.SetProperty( Actor::Property::SIZE, mControlSize );
   }
 }
 
@@ -589,7 +589,7 @@ void PageTurnView::AddPage( int pageIndex )
     }
 
     float degree = isLeftSide ? 180.f :0.f;
-    mPages[index].actor.SetOrientation( Degree( degree ), Vector3::YAXIS );
+    mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( degree ), Vector3::YAXIS ) );
     mPages[index].actor.SetProperty( Actor::Property::VISIBLE, false );
     mPages[index].UseEffect( mSpineEffectShader, mGeometry );
     mPages[index].SetTexture( newPage );
@@ -904,7 +904,7 @@ void PageTurnView::TurnedOver( Animation& animation )
   mAnimationPageIdPair.erase( animation );
 
   float degree = mPages[index].isTurnBack ? 180.f : 0.f;
-  mPages[index].actor.SetOrientation( Degree(degree), Vector3::YAXIS );
+  mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree(degree), Vector3::YAXIS ) );
   mPages[index].UseEffect( mSpineEffectShader );
 
   int id = pageId + (mPages[index].isTurnBack ? -1 : 1);
@@ -948,11 +948,11 @@ void PageTurnView::OrganizePageDepth()
   {
     if(mCurrentPageIndex+i < mTotalPageCount)
     {
-      mPages[( mCurrentPageIndex+i )%NUMBER_OF_CACHED_PAGES].actor.SetZ( -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
+      mPages[( mCurrentPageIndex+i )%NUMBER_OF_CACHED_PAGES].actor.SetProperty( Actor::Property::POSITION_Z,  -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
     }
     if( mCurrentPageIndex >= i + 1 )
     {
-      mPages[( mCurrentPageIndex-i-1 )%NUMBER_OF_CACHED_PAGES].actor.SetZ( -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
+      mPages[( mCurrentPageIndex-i-1 )%NUMBER_OF_CACHED_PAGES].actor.SetProperty( Actor::Property::POSITION_Z,  -static_cast<float>( i )*STATIC_PAGE_INTERVAL_DISTANCE );
     }
   }
 }
@@ -969,7 +969,7 @@ void PageTurnView::StopTurning()
     mPages[ index ].actor.RemoveConstraints();
     mPages[ index ].UseEffect( mSpineEffectShader );
     float degree = mTurningPageIndex==mCurrentPageIndex ? 0.f :180.f;
-    mPages[index].actor.SetOrientation( Degree(degree), Vector3::YAXIS );
+    mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree(degree), Vector3::YAXIS ) );
     mPageUpdated = true;
   }