X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpage-turn-view%2Fpage-turn-landscape-view-impl.cpp;h=df0db9313da6d39cc6cdbc508b5df6ae926d97ea;hb=5437f8308b17393381dcf586e2a9aadd9aa4bdf3;hp=a83164128d44bd6812543a7a46c9bf92405da7cd;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp index a831641..df0db93 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp @@ -1,22 +1,28 @@ -// -// 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. -// - -//CLASS HEADER +/* + * 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 +// EXTERNAL INCLUDES +#include +#include +#include + namespace Dali { @@ -29,7 +35,10 @@ namespace Internal namespace { using namespace Dali; -TypeRegistration mType( typeid(Toolkit::PageTurnLandscapeView), typeid(Toolkit::PageTurnView), NULL ); + +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnLandscapeView, Toolkit::PageTurnView, NULL ) +DALI_TYPE_REGISTRATION_END() + } PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize ) @@ -62,30 +71,17 @@ void PageTurnLandscapeView::OnPageTurnViewInitialize() mTurningPageLayer.SetParentOrigin( ParentOrigin::CENTER ); } -ImageActor PageTurnLandscapeView::NewPageFromRenderBuffer( int pageIndex ) -{ - int index = pageIndex % NUMBER_OF_CACHED_PAGES; - ImageActor page = ImageActor::New( mRenderedPage[ index ], - ImageActor::PixelArea( mPageSize.width, 0, mPageSize.width, mPageSize.height ) ); - if( pageIndex <= mTotalPageCount-1) - { - int nextIndex = (pageIndex+1) % NUMBER_OF_CACHED_PAGES; - page.Add( ImageActor::New( mRenderedPage[ nextIndex ],ImageActor::PixelArea( 0, 0, mPageSize.width, mPageSize.height ) ) ); - } - return page; -} - void PageTurnLandscapeView::OnAddPage( ImageActor newPage, bool isLeftSide ) { newPage.SetParentOrigin( ParentOrigin::CENTER ); - newPage.SetCullFace( CullBack ); + SetCullFace( newPage, CullBack ); if( 0 < newPage.GetChildCount() ) { ImageActor backImage = ImageActor::DownCast( newPage.GetChildAt( 0 ) ); - backImage.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION ); + backImage.SetParentOrigin( ParentOrigin::CENTER ); backImage.SetSize( mPageSize ); - backImage.SetCullFace( CullFront ); + SetCullFace( backImage, CullFront ); backImage.SetZ( 0.25f * STATIC_PAGE_INTERVAL_DISTANCE ); } if( isLeftSide ) @@ -111,10 +107,12 @@ void PageTurnLandscapeView::SetPanActor( const Vector2& panPosition ) if( panPosition.x > mPageSize.width && mCurrentPageIndex < mTotalPageCount-1 ) { mPanActor = mPageActors[mCurrentPageIndex%NUMBER_OF_CACHED_PAGES]; // right side page + mTurningPageIndex = mCurrentPageIndex; } else if( panPosition.x <= mPageSize.width && mCurrentPageIndex > 0 ) { mPanActor = mPageActors[ (mCurrentPageIndex-1)%NUMBER_OF_CACHED_PAGES ]; // left side page + mTurningPageIndex = mCurrentPageIndex - 1; } else { @@ -122,7 +120,7 @@ void PageTurnLandscapeView::SetPanActor( const Vector2& panPosition ) } } -void PageTurnLandscapeView::SetSpineEffect(Actor actor, bool isLeftSide) +void PageTurnLandscapeView::SetSpineEffect(ImageActor actor, bool isLeftSide) { if(isLeftSide) {