stop using deprecated shader inheritance
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / internal / controls / page-turn-view / page-turn-view-impl.cpp
index f508b54..edac01e 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h>
@@ -250,7 +251,7 @@ const int PageTurnView::NUMBER_OF_CACHED_PAGES = NUMBER_OF_CACHED_PAGES_EACH_SID
 const float PageTurnView::STATIC_PAGE_INTERVAL_DISTANCE = 1.0f;
 
 PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& pageSize )
-: Control( true ),
+: Control( REQUIRES_TOUCH_EVENTS ),
   mPageFactory( pageFactory ),
   mPageSize( pageSize ),
   mIsEditMode( false ),
@@ -916,7 +917,7 @@ void PageTurnView::PanFinished( const Vector2& gesturePosition, float gestureSpe
 
   mPagePanFinishedSignal.Emit( handle );
 
-  Actor actor = mPanActor;
+  ImageActor actor = mPanActor;
   if(mPress)
   {
     if(!mConstraints) // if with constraints, the pan finished position is near spine, set up an animation to turn the page over
@@ -976,7 +977,7 @@ void PageTurnView::PanFinished( const Vector2& gesturePosition, float gestureSpe
 
 void PageTurnView::TurnedOver( Animation& animation )
 {
-  Actor actor = mAnimationActorPair[animation];
+  ImageActor actor = mAnimationActorPair[animation];
   mIsTurnBack[actor] = !mIsTurnBack[actor];
   actor.RemoveConstraints();
   mRootOnScreen.Add(actor);
@@ -995,7 +996,7 @@ void PageTurnView::TurnedOver( Animation& animation )
 
 void PageTurnView::SliddenBack( Animation& animation )
 {
-  Actor actor = mAnimationActorPair[animation];
+  ImageActor actor = mAnimationActorPair[animation];
   mRootOnScreen.Add(actor);
   int index = mAnimationIndexPair[animation];
   mIsSliding[index] = false;
@@ -1025,14 +1026,9 @@ void PageTurnView::OrganizePageDepth()
   }
 }
 
-void PageTurnView::SetShaderEffect( Actor actor, ShaderEffect shaderEffect )
+void PageTurnView::SetShaderEffect( ImageActor actor, ShaderEffect shaderEffect )
 {
-  actor.SetShaderEffect( shaderEffect );
-
-  if( actor.GetChildCount() > 0 )
-  {
-    actor.GetChildAt( 0 ).SetShaderEffect(shaderEffect);
-  }
+  SetShaderEffectRecursively( actor, shaderEffect );
 }
 
 Toolkit::PageTurnView::PageTurnSignal& PageTurnView::PageTurnStartedSignal()