From: Ferran Sole Date: Wed, 6 May 2015 08:22:14 +0000 (+0100) Subject: Added scroll view page path effect. X-Git-Tag: accepted/tizen/common/20150529.134100~37^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=41fcad41b941f67b55d499ab1997df97a005033c Added scroll view page path effect. Allows creating new scroll view effects for pages on a scrollview using a path. Removed ScrollViewPageCubeEffect, ScrollViewPageCarouselEffect and ScrollViewPageSpiralEffect which can be easily implemented using new scrollview path effect. Change-Id: Iabc4cef2dc810466def5b12846e451b46710ecb9 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp index 1c8d494..54e9765 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp @@ -262,24 +262,6 @@ int UtcDaliScrollViewCubeEffectSetup(void) END_TEST; } -int UtcDaliScrollViewSpiralEffectSetup(void) -{ - tet_infoline(" UtcDaliScrollViewSpiralEffectSetup"); - - ScrollViewPageSpiralEffect effect; - - DALI_TEST_CHECK( !effect ); - - BaseHandle handle = ScrollViewPageSpiralEffect::New(); - - DALI_TEST_CHECK( handle ); - - effect = ScrollViewPageSpiralEffect::DownCast(handle); - - DALI_TEST_CHECK( effect ); - END_TEST; -} - int UtcDaliScrollViewCubeEffectTest(void) { ToolkitTestApplication application; @@ -316,82 +298,6 @@ int UtcDaliScrollViewCubeEffectTest(void) END_TEST; } - -int UtcDaliScrollViewSpiralEffectTest(void) -{ - ToolkitTestApplication application; - tet_infoline(" UtcDaliScrollViewSpiralEffectTest"); - - Vector2 size = Stage::GetCurrent().GetSize(); - - ScrollView scrollView = SetupTestScrollView(1, 3, size); - Actor testPage = gPages[1]; - Wait(application, 500); - - ScrollViewPageSpiralEffect effect = ScrollViewPageSpiralEffect::New(); - scrollView.ApplyEffect(effect); - - for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter) - { - Actor page = *pageIter; - page.RemoveConstraints(); - - Constraint constraint = Constraint::New( page, Actor::Property::SIZE, EqualToConstraint() ); - constraint.AddSource( ParentSource( Actor::Property::SIZE ) ); - constraint.Apply(); - effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f)); - } - Wait(application); - - scrollView.ScrollTo(1); - while(!gOnScrollCompleteCalled) - { - Wait(application); - } - // test that the first page has reached centre of screen - Vector3 pagePos = testPage.GetCurrentPosition(); - DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION); - CleanupTest(); - END_TEST; -} - -int UtcDaliScrollViewPageCubeEffectSetup(void) -{ - tet_infoline(" UtcDaliScrollViewPageCubeEffectSetup"); - - ScrollViewPageCubeEffect effect; - - DALI_TEST_CHECK( !effect ); - - BaseHandle handle = ScrollViewPageCubeEffect::New(); - - DALI_TEST_CHECK( handle ); - - effect = ScrollViewPageCubeEffect::DownCast(handle); - - DALI_TEST_CHECK( effect ); - END_TEST; -} - - -int UtcDaliScrollViewPageCarouselEffectSetup(void) -{ - tet_infoline(" UtcDaliScrollViewCarouselEffectSetup"); - - ScrollViewPageCarouselEffect effect; - - DALI_TEST_CHECK( !effect ); - - BaseHandle handle = ScrollViewPageCarouselEffect::New(); - - DALI_TEST_CHECK( handle ); - - effect = ScrollViewPageCarouselEffect::DownCast(handle); - - DALI_TEST_CHECK( effect ); - END_TEST; -} - int UtcDaliScrollViewCarouselEffectSetup(void) { tet_infoline(" UtcDaliScrollViewCarouselEffectSetup"); @@ -410,29 +316,10 @@ int UtcDaliScrollViewCarouselEffectSetup(void) END_TEST; } -int UtcDaliScrollViewDepthEffectSetup(void) -{ - tet_infoline(" UtcDaliScrollViewDepthEffectSetup"); - - ScrollViewDepthEffect effect; - - DALI_TEST_CHECK( !effect ); - - BaseHandle handle = ScrollViewDepthEffect::New(); - - DALI_TEST_CHECK( handle ); - - effect = ScrollViewDepthEffect::DownCast(handle); - - DALI_TEST_CHECK( effect ); - END_TEST; -} - - -int UtcDaliScrollViewPageCubeEffectTest(void) +int UtcDaliScrollViewCarouselEffectTest(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliScrollViewPageCubeEffectTest"); + tet_infoline(" UtcDaliScrollViewCarouselEffectTest"); Vector2 size = Stage::GetCurrent().GetSize(); @@ -440,73 +327,50 @@ int UtcDaliScrollViewPageCubeEffectTest(void) Actor testPage = gPages[1]; Wait(application, 500); - ScrollViewPageCubeEffect effect = ScrollViewPageCubeEffect::New(); + ScrollViewCarouselEffect effect = ScrollViewCarouselEffect::New(); scrollView.ApplyEffect(effect); - for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter) - { - Actor page = *pageIter; - page.RemoveConstraints(); - Constraint constraint = Constraint::New( page, Actor::Property::SIZE, EqualToConstraint() ); - constraint.AddSource( ParentSource( Actor::Property::SIZE ) ); - constraint.Apply(); - effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f)); - } + Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3); Wait(application); + Vector3 actorPrePosition = actor.GetCurrentPosition(); - scrollView.ScrollTo(1); + effect.ApplyToActor( actor, Vector2(1.2f, 1.2f) ); + + scrollView.ScrollTo(Vector3(size.x, 0.0f, 0.0f), 0.5f, DirectionBiasNone, DirectionBiasNone); while(!gOnScrollCompleteCalled) { Wait(application); } // test that the first page has reached centre of screen - Vector3 pagePos = testPage.GetCurrentPosition(); - DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION); + Vector3 actorPostPosition = actor.GetCurrentPosition(); + // just check the actor has moved + DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1); CleanupTest(); END_TEST; } -int UtcDaliScrollViewPageCarouselEffectTest(void) +int UtcDaliScrollViewDepthEffectSetup(void) { - ToolkitTestApplication application; - tet_infoline(" UtcDaliScrollViewPageCarouselEffectTest"); + tet_infoline(" UtcDaliScrollViewDepthEffectSetup"); - Vector2 size = Stage::GetCurrent().GetSize(); + ScrollViewDepthEffect effect; - ScrollView scrollView = SetupTestScrollView(1, 3, size); - Actor testPage = gPages[1]; - Wait(application, 500); + DALI_TEST_CHECK( !effect ); - ScrollViewPageCarouselEffect effect = ScrollViewPageCarouselEffect::New(); - scrollView.ApplyEffect(effect); + BaseHandle handle = ScrollViewDepthEffect::New(); - for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter) - { - Actor page = *pageIter; - page.RemoveConstraints(); - Constraint constraint = Constraint::New( page, Actor::Property::SIZE, EqualToConstraint() ); - constraint.AddSource( ParentSource( Actor::Property::SIZE ) ); - constraint.Apply(); - effect.ApplyToPage(page); - } - Wait(application); + DALI_TEST_CHECK( handle ); - scrollView.ScrollTo(1, 0.5f, DirectionBiasNone); - while(!gOnScrollCompleteCalled) - { - Wait(application); - } - // test that the first page has reached centre of screen - Vector3 pagePos = testPage.GetCurrentPosition(); - DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION); - CleanupTest(); + effect = ScrollViewDepthEffect::DownCast(handle); + + DALI_TEST_CHECK( effect ); END_TEST; } -int UtcDaliScrollViewCarouselEffectTest(void) +int UtcDaliScrollViewDepthEffectTest(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliScrollViewCarouselEffectTest"); + tet_infoline(" UtcDaliScrollViewDepthEffectTest"); Vector2 size = Stage::GetCurrent().GetSize(); @@ -514,16 +378,21 @@ int UtcDaliScrollViewCarouselEffectTest(void) Actor testPage = gPages[1]; Wait(application, 500); - ScrollViewCarouselEffect effect = ScrollViewCarouselEffect::New(); + ScrollViewDepthEffect effect = ScrollViewDepthEffect::New(); scrollView.ApplyEffect(effect); Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3); Wait(application); Vector3 actorPrePosition = actor.GetCurrentPosition(); - effect.ApplyToActor( actor, Vector2(1.2f, 1.2f) ); + const Vector2 positionExtent(0.5f, 2.5f); + const Vector2 offsetExtent(1.0f, 1.0f); + const float positionScale(1.5f); + const float scaleExtent(0.5f); - scrollView.ScrollTo(Vector3(size.x, 0.0f, 0.0f), 0.5f, DirectionBiasNone, DirectionBiasNone); + effect.ApplyToActor( actor, positionExtent, offsetExtent, positionScale, scaleExtent ); + + scrollView.ScrollTo(1); while(!gOnScrollCompleteCalled) { Wait(application); @@ -536,40 +405,85 @@ int UtcDaliScrollViewCarouselEffectTest(void) END_TEST; } -int UtcDaliScrollViewDepthEffectTest(void) + +int UtcDaliScrollViewPagePathEffectSetup(void) +{ + tet_infoline(" UtcDaliScrollViewPagePathEffectSetup"); + + ScrollViewPagePathEffect effect; + + DALI_TEST_CHECK( !effect ); + + BaseHandle handle = ScrollViewPagePathEffect::New(Dali::Path::New(), Vector3::ZERO,Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3::ZERO,0); + + DALI_TEST_CHECK( handle ); + + effect = ScrollViewPagePathEffect::DownCast(handle); + + DALI_TEST_CHECK( effect ); + END_TEST; +} + +int UtcDaliScrollViewPagePathEffectTest(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliScrollViewDepthEffectTest"); + tet_infoline(" UtcDaliScrollViewPagePathEffectTest"); Vector2 size = Stage::GetCurrent().GetSize(); ScrollView scrollView = SetupTestScrollView(1, 3, size); - Actor testPage = gPages[1]; + Actor testPage = gPages[2]; Wait(application, 500); - ScrollViewDepthEffect effect = ScrollViewDepthEffect::New(); + //Create path + float xHalfSize( size.x * 0.5f); + + Dali::Path path = Dali::Path::New(); + Dali::Property::Array points; + points.resize(3); + points[0] = Vector3( xHalfSize, 0.0f, -xHalfSize); + points[1] = Vector3( 0.0f, 0.0f, 0.0f ); + points[2] = Vector3( -xHalfSize, 0.0f, -xHalfSize); + path.SetProperty( Path::Property::POINTS, points ); + + Dali::Property::Array controlPoints; + controlPoints.resize(4); + controlPoints[0] = Vector3( xHalfSize, 0.0f, 0.0f ); + controlPoints[1] = Vector3( xHalfSize, 0.0f, 0.0f ); + controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f ); + controlPoints[3] = Vector3(-xHalfSize, 0.0f, 0.0f ); + path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints ); + + ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::New(path, + Vector3::ZERO, + Toolkit::ScrollView::Property::SCROLL_FINAL_X, + Vector3(size.x,size.y,0.0f), + 3); scrollView.ApplyEffect(effect); - Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3); + unsigned int pageCounter(0); + for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter) + { + Actor page = *pageIter; + page.RemoveConstraints(); + Constraint constraint = Constraint::New( page, Actor::Property::SIZE, EqualToConstraint() ); + constraint.AddSource( ParentSource( Actor::Property::SIZE ) ); + constraint.Apply(); + effect.ApplyToPage(page, pageCounter++); + } Wait(application); - Vector3 actorPrePosition = actor.GetCurrentPosition(); - - const Vector2 positionExtent(0.5f, 2.5f); - const Vector2 offsetExtent(1.0f, 1.0f); - const float positionScale(1.5f); - const float scaleExtent(0.5f); - - effect.ApplyToActor( actor, positionExtent, offsetExtent, positionScale, scaleExtent ); scrollView.ScrollTo(1); while(!gOnScrollCompleteCalled) { Wait(application); } - // test that the first page has reached centre of screen - Vector3 actorPostPosition = actor.GetCurrentPosition(); - // just check the actor has moved - DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1); + + // test that the test page has reached centre of screen + Vector3 pagePos = testPage.GetCurrentPosition(); + DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION); + CleanupTest(); END_TEST; } + diff --git a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp index ed651ad..0e1385f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp @@ -207,8 +207,8 @@ int UtcDaliSuperBlurViewGetBlurredImage(void) DALI_TEST_CHECK( image1 ); Image image2 = blurView.GetBlurredImage( 2 ); - DALI_TEST_EQUALS( image2.GetWidth(), 25, TEST_LOCATION ); - DALI_TEST_EQUALS( image2.GetHeight(), 25, TEST_LOCATION ); + DALI_TEST_EQUALS( image2.GetWidth(), 25u, TEST_LOCATION ); + DALI_TEST_EQUALS( image2.GetHeight(), 25u, TEST_LOCATION ); Image image3 = blurView.GetBlurredImage( 3 ); DALI_TEST_CHECK( FrameBufferImage::DownCast( image2 ) ); diff --git a/dali-toolkit/dali-toolkit.h b/dali-toolkit/dali-toolkit.h index 36d50c8..3b152af 100644 --- a/dali-toolkit/dali-toolkit.h +++ b/dali-toolkit/dali-toolkit.h @@ -59,9 +59,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp deleted file mode 100644 index ae70701..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - * - */ - -// HEADER -#include - -// EXTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace ScrollViewHelperFunctions -{ - -bool IsStraightOnView( const Vector3& position ) -{ - return ( fabsf(position.x) < Math::MACHINE_EPSILON_1 ) && ( fabsf( position.y ) < Math::MACHINE_EPSILON_1 ); -} - -void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max ) -{ - if( fabsf( min.x - max.x ) > Math::MACHINE_EPSILON_1 ) - { - // WRAP X (based on the position of the right side) - position.x = WrapInDomain( position.x + pageSize.width, min.x, max.x ) - pageSize.width; - } - - if( fabsf( min.y - max.y ) > Math::MACHINE_EPSILON_1 ) - { - // WRAP Y (based on the position of the bottom side) - position.y = WrapInDomain( position.y + pageSize.height, min.y, max.y ) - pageSize.height; - } -} - -bool IsOutsideView( const Vector3& position, const Vector3& pageSize ) -{ - return ( fabsf( position.x ) >= pageSize.width ) || ( fabsf( position.y ) >= pageSize.height ); -} - -} // namespace ScrollViewHelperFunctions - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h deleted file mode 100644 index 7541825..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__ -#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__ - -/* - * 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. - * - */ - -// EXTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -/// Some helper methods with common functionality used in scroll view constraints -namespace ScrollViewHelperFunctions -{ - -/** - * Checks whether the we're looking straight at the page and if we are, it returns true. - * - * @param[in] position The position of the page. - */ -bool IsStraightOnView( const Vector3& position ); - -/** - * Modifies the position to wrap within the given domain. - * - * @param[in/out] position The position of the page, this is modified accordingly. - * @param[in] pageSize The size of each page. - * @param[in] min The minimum position of the scroll-view. - * @param[in] max The maximum position of the scroll-view. - */ -void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max ); - -/** - * Checks whether the page is positioned outside of our view and returns true if it is. - * - * @param[in] position The position of the page. - * @param[in] pageSize The size of each page. - */ -bool IsOutsideView( const Vector3& position, const Vector3& pageSize ); - -} // namespace ScrollViewHelperFunctions - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__ diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 043ca8d..00cd473 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -214,13 +214,14 @@ DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-x", FLOAT, OVERSHOOT_X ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-y", FLOAT, OVERSHOOT_Y ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-final", VECTOR3, SCROLL_FINAL ) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-x", SCROLL_FINAL_X, SCROLL_FINAL,0) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-y", SCROLL_FINAL_Y, SCROLL_FINAL,1) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "wrap", BOOLEAN, WRAP ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "panning", BOOLEAN, PANNING ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrolling", BOOLEAN, SCROLLING ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-domain-offset", VECTOR3, SCROLL_DOMAIN_OFFSET ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position-delta", VECTOR3, SCROLL_POSITION_DELTA ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "start-page-position", VECTOR3, START_PAGE_POSITION ) - DALI_SIGNAL_REGISTRATION( Toolkit, ScrollView, "value-changed", SIGNAL_SNAP_STARTED ) DALI_TYPE_REGISTRATION_END() diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp deleted file mode 100644 index e44800d..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * 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 - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace // unnamed namespace -{ - -const float PAGE_SIZE_MULTIPLIER( 1.15f ); - -using namespace ScrollViewHelperFunctions; - -/** - * ScrollPageCarouselEffectInfo - * - * Color constraint: adjusts the alpha of the page based on their parent page's position relative - * to the middle of the screen. - * When at middle of screen Alpha is 100% opacity. - * When outside the viewable area, the opacity is 0%. - * - * Position constraint: adjusts the position of the page based on their parent page's position - * relative to the middle of the screen. - * When at middle of the screen the position is not altered. - * When one screen away from middle the position is rotated as per expected in a 3D carousel. - */ -class ScrollPageCarouselEffectInfo -{ -public: - - ScrollPageCarouselEffectInfo( const Vector2& positionToPageSizeRatio ) - : mPositionToPageSizeRatio( positionToPageSizeRatio ) - { - } - - /** - * @param[in,out] current The current color of this Actor - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * Whether scroll wrap has been enabled or not (SCROLL_WRAP) - * @return The new color of this Actor. - */ - void ColorConstraint( Vector4& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - - if( inputs[5]->GetBoolean() ) - { - WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // note preserve color channels incase there is a shader/further constraint - // that wishes to do something with that information. - current.a = 0.0f; - return; - } - - Vector2 distance( position / pageSize * PAGE_SIZE_MULTIPLIER ); - current.a = Clamp( 1.0f - distance.Length(), 0.0f, 1.0f ); - } - - /** - * @param[in,out] current The current position - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * Whether scroll wrap has been enabled or not (SCROLL_WRAP) - * @return The new position of this Actor. - */ - void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - current += scrollPosition; - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - - if( inputs[5]->GetBoolean() ) - { - WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this) - // they will be invisible so doesn't have to be precise, just away from stage. - current += scrollPosition; - return; - } - - Vector3 angle( position / pageSize * PAGE_SIZE_MULTIPLIER ); - - position.x = pageSize.x * sinf( angle.x ); - position.y = pageSize.y * sinf( angle.y ); - - Vector2 zMovement( pageSize ); - zMovement *= mPositionToPageSizeRatio; - position.z = - ( ( zMovement.x - ( zMovement.x * cos( angle.x ) ) ) + ( zMovement.y - ( zMovement.y * cos( angle.y ) ) ) ); - - current = position; - } - - const Vector2 mPositionToPageSizeRatio; ///< The page will move its position according to this ratio. -}; - -/** - * Helper: Applies the 3D scroll cube constraints to the child actor - * - * @param[in] scrollView The ScrollView containing the pages. - * @param[in] child The child to be affected with the 3D Effect. - * @param[in] info The effect info for the constraints - */ -void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, - Actor child, - ScrollPageCarouselEffectInfo& info) -{ - // Apply constraints to this actor // - Constraint constraint; - constraint = Constraint::New( child, Actor::Property::COLOR, info, &ScrollPageCarouselEffectInfo::ColorConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); - - constraint = Constraint::New( child, Actor::Property::POSITION, info, &ScrollPageCarouselEffectInfo::PositionConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); -} - -} // unnamed namespace - -ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect() -{ - -} - -ScrollViewPageCarouselEffect::~ScrollViewPageCarouselEffect() -{ -} - -void ScrollViewPageCarouselEffect::ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio ) -{ - ScrollPageCarouselEffectInfo info( positionToPageSizeRatio ); - - ApplyScrollCubeConstraints( GetScrollView(), page, info ); -} - -void ScrollViewPageCarouselEffect::OnAttach(Toolkit::ScrollView& scrollView) -{ -} - -void ScrollViewPageCarouselEffect::OnDetach(Toolkit::ScrollView& scrollView) -{ -} - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h deleted file mode 100644 index b57ba4a..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ -#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ - -/* - * 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. - * - */ - -// EXTERNAL INCLUDES -#include -#include -#include -#include - -// INTERNAL INCLUDES -#include -#include -#include - -namespace Dali -{ - -class Animation; - -namespace Toolkit -{ - -class ScrollGroup; -class ScrollView; - -namespace Internal -{ - -/** - * @copydoc Toolkit::ScrollViewPageCarouselEffect - */ -class ScrollViewPageCarouselEffect : public ScrollViewEffect -{ - -public: - - /** - * Constructor - */ - ScrollViewPageCarouselEffect(); - -public: - - /** - * @copydoc ScrollViewEffect::ApplyToActor - */ - void ApplyToPage( Actor child, const Vector2& positionToPageSizeRatio ); - -public: - - /** - * @copydoc ScrollViewEffect::OnAttach - */ - virtual void OnAttach( Toolkit::ScrollView& scrollView ); - - /** - * @copydoc ScrollViewEffect::OnDetach - */ - virtual void OnDetach( Toolkit::ScrollView& scrollView ); - -protected: - - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~ScrollViewPageCarouselEffect(); - -private: - - Vector3 mPageSize; ///< The logical page size for the 3D effect. -}; - -} // namespace Internal - -// Helpers for public-api forwarding methods - -inline Internal::ScrollViewPageCarouselEffect& GetImpl(Dali::Toolkit::ScrollViewPageCarouselEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -inline const Internal::ScrollViewPageCarouselEffect& GetImpl(const Dali::Toolkit::ScrollViewPageCarouselEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - const Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp deleted file mode 100644 index 1184ca6..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* - * 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 - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace // unnamed namespace -{ - -using namespace ScrollViewHelperFunctions; - -/** - * ScrollPageCubeEffectInfo - * - * Rotate constraint: adjusts the angle of the page based on its position relative to the middle of - * the screen. - * When at middle of screen Angles on X and Y Axes is 0. - * When one screen away from the middle Angle is 90 degrees (pi/2) - * - * Color constraint: adjusts the alpha of the page based on their parent page's position relative - * to the middle of the screen. - * When at middle of screen Alpha is 100% opacity. - * When outside the viewable area, the opacity is 0%. - * - * Position constraint: adjusts the position of the page based on their parent page's position - * relative to the middle of the screen. - * When at middle of the screen the position is not altered. - * When one screen away from middle the position is rotated as per expected in a 3D inner cube. - */ -class ScrollPageCubeEffectInfo -{ -public: - - ScrollPageCubeEffectInfo( const Vector2& angleSwing ) - : mAngleSwing(angleSwing) - { - } - - /** - * @param[in,out] current The current orientation of this Actor - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * Whether scroll wrap has been enabled or not (SCROLL_WRAP) - * @return The new orientation of this Actor. - */ - void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - - if( inputs[5]->GetBoolean() ) - { - WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - return; - } - - // Our target is a 90 degree (PI/2) rotation per page, so calculate the angle we should be rotate - // our page by calculating the amount we've moved as a fraction of the total size of the page. - Vector2 angle( position / pageSize * Dali::Math::PI_2 ); - - current = Quaternion( Radian( -angle.x * mAngleSwing.x ), Vector3::YAXIS ) * - Quaternion( Radian( angle.y * mAngleSwing.y ), Vector3::XAXIS ) * - current; - } - - /** - * @param[in,out] current The current color of this Actor - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * Whether scroll wrap has been enabled or not (SCROLL_WRAP) - * @return The new color of this Actor. - */ - void ColorConstraint( Vector4& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - - if( inputs[5]->GetBoolean() ) - { - WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // note preserve color channels incase there is a shader/further constraint - // that wishes to do something with that information. - current.a = 0.0f; - return; - } - - // Calculate the distance of this page from our view and ensure it falls within the appropriate - // visual bounds. - // If it does not, then the opacity is set to 0.0f. - position.x /= pageSize.width; - position.y /= pageSize.height; - float distanceFactor = sqrt( position.x * position.x + position.y * position.y ); - - if ( distanceFactor > 1.0f ) - { - current.a = 0.0f; - } - } - - /** - * @param[in,out] current The current position - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * Whether scroll wrap has been enabled or not (SCROLL_WRAP) - * @return The new position of this Actor. - */ - void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - current += scrollPosition; - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - - if( inputs[5]->GetBoolean() ) - { - WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this) - // they will be invisible so doesn't have to be precise, just away from stage. - current += scrollPosition; - return; - } - - // Our target when scrolling is moving from the origin to the following points around a curve: - // Right To Left: (-pageWidth, 0, pageWidth) - // Left To Right: ( pageWidth, 0, pageWidth) - // Down To Up: ( 0, -pageHeight, pageWidth) - // Up To Down: ( 0, pageHeight, pageWidth) - - Vector2 angle( position / pageSize * Dali::Math::PI_2 ); - Vector2 radius( pageSize * 0.5 ); - - current.x = radius.x * sin( angle.x ); - current.y = radius.y * sin( angle.y ); - current.z = ( radius.x - ( radius.x * cos( angle.x ) ) ) + ( radius.y - ( radius.y * cos( angle.y ) ) ); - } - - Vector2 mAngleSwing; ///< Maximum amount in X and Y axes to rotate. -}; - -/** - * Helper: Applies the 3D scroll cube constraints to the child actor - * - * @param[in] scrollView The ScrollView containing the pages. - * @param[in] child The child to be affected with the 3D Effect. - * @param[in] info The effect info for the constraints - */ -void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, - Actor child, - ScrollPageCubeEffectInfo& info) -{ - // Apply constraints to this actor // - Constraint constraint; - constraint = Constraint::New( child, Actor::Property::ORIENTATION, info, &ScrollPageCubeEffectInfo::RotationConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); - - constraint = Constraint::New( child, Actor::Property::COLOR, info, &ScrollPageCubeEffectInfo::ColorConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); - - constraint = Constraint::New( child, Actor::Property::POSITION, info, &ScrollPageCubeEffectInfo::PositionConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); -} - -} // unnamed namespace - -ScrollViewPageCubeEffect::ScrollViewPageCubeEffect() -{ - -} - -ScrollViewPageCubeEffect::~ScrollViewPageCubeEffect() -{ -} - -void ScrollViewPageCubeEffect::ApplyToPage( Actor page, const Vector2& angleSwing ) -{ - ScrollPageCubeEffectInfo info( angleSwing ); - - ApplyScrollCubeConstraints( GetScrollView(), page, info ); -} - -void ScrollViewPageCubeEffect::OnAttach(Toolkit::ScrollView& scrollView) -{ -} - -void ScrollViewPageCubeEffect::OnDetach(Toolkit::ScrollView& scrollView) -{ -} - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h deleted file mode 100644 index 5e1c5bd..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ -#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ - -/* - * 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. - * - */ - -// EXTERNAL INCLUDES -#include -#include -#include -#include - -// INTERNAL INCLUDES -#include -#include -#include - -namespace Dali -{ - -class Animation; - -namespace Toolkit -{ - -class ScrollGroup; -class ScrollView; - -namespace Internal -{ - -/** - * @copydoc Toolkit::ScrollViewPageCubeEffect - */ -class ScrollViewPageCubeEffect : public ScrollViewEffect -{ - -public: - - /** - * Constructor - */ - ScrollViewPageCubeEffect(); - -public: - - /** - * @copydoc ScrollViewEffect::ApplyToActor - */ - void ApplyToPage( Actor child, - const Vector2& angleSwing ); - -public: - - /** - * @copydoc ScrollViewEffect::OnAttach - */ - virtual void OnAttach( Toolkit::ScrollView& scrollView ); - - /** - * @copydoc ScrollViewEffect::OnDetach - */ - virtual void OnDetach( Toolkit::ScrollView& scrollView ); - -protected: - - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~ScrollViewPageCubeEffect(); - -private: - - Vector3 mPageSize; ///< The logical page size for the 3D effect. -}; - -} // namespace Internal - -// Helpers for public-api forwarding methods - -inline Internal::ScrollViewPageCubeEffect& GetImpl(Dali::Toolkit::ScrollViewPageCubeEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -inline const Internal::ScrollViewPageCubeEffect& GetImpl(const Dali::Toolkit::ScrollViewPageCubeEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - const Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp new file mode 100644 index 0000000..50d57a1 --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015 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 + +//INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + +ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount) +:mPageSize(pageSize), + mInputPropertyIndex(inputPropertyIndex), + mPageCount(pageCount) +{ + //Create path constrainer + mPathConstrainer = Dali::PathConstrainer::New(); + mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward ); + + Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS); + Property::Array points; + pointsProperty.Get(points); + mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, points ); + + pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS); + pointsProperty.Get(points); + mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, points ); + + //Create linear constrainer + Property::Array pointsLinearConstrainer; + pointsProperty = Property::Value(pointsLinearConstrainer); + pointsProperty.AppendItem(0.0f); + pointsProperty.AppendItem(1.0f); + pointsProperty.AppendItem(0.0f); + mLinearConstrainer = Dali::LinearConstrainer::New(); + mLinearConstrainer.SetProperty( LinearConstrainer::Property::VALUE, pointsProperty ); +} + +ScrollViewPagePathEffect::~ScrollViewPagePathEffect() +{ +} + +void ScrollViewPagePathEffect::ApplyToPage( Actor page, unsigned int pageOrder ) +{ + float pageHalfSize = mPageSize.x * 0.5f; + Vector2 range = Vector2( pageHalfSize - (pageHalfSize*pageOrder), -pageHalfSize - (pageHalfSize*pageOrder) ); + Vector2 wrap = Vector2( range.x, -pageHalfSize*(mPageCount-2) + range.y); + + Toolkit::ScrollView scrollView = GetScrollView(); + + //Position + mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::POSITION ), + Dali::Property( scrollView, mInputPropertyIndex), + range, wrap + ); + + //Rotation + mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::ORIENTATION ), + Dali::Property( scrollView, mInputPropertyIndex ), + range, wrap + ); + + //Alpha + mLinearConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::COLOR_ALPHA ), + Dali::Property( scrollView, mInputPropertyIndex ), + range, wrap + ); + +} + +void ScrollViewPagePathEffect::OnAttach(Toolkit::ScrollView& scrollView) +{ +} + +void ScrollViewPagePathEffect::OnDetach(Toolkit::ScrollView& scrollView) +{ +} + +} // namespace Internal + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h new file mode 100644 index 0000000..46efb86 --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h @@ -0,0 +1,117 @@ +#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H__ +#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H__ + +/* + * Copyright (c) 2015 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. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + +/** + * @copydoc Toolkit::ScrollViewPagePathEffect + */ +class ScrollViewPagePathEffect : public ScrollViewEffect +{ + +public: + + /** + * Constructor + * @param[in] path Pages will follow this path + * @param[in] forward Vector in page local space which will be aligned with tangent of the path + * @param[in] inputPropertyIndex index of the property in the scrollview used to drivce the path + * @param[in] pageSize size of a page in the scrollview + * @param[in] pageCount total number of pages in the scrollview + */ + ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount ); + +public: + + /** + * @copydoc ScrollViewEffect::ApplyToActor + */ + void ApplyToPage( Actor child, unsigned int pageOrder ); + +public: + + /** + * @copydoc ScrollViewEffect::OnAttach + */ + virtual void OnAttach( Toolkit::ScrollView& scrollView ); + + /** + * @copydoc ScrollViewEffect::OnDetach + */ + virtual void OnDetach( Toolkit::ScrollView& scrollView ); + +protected: + + /** + * A reference counted object may only be deleted by calling Unreference() + */ + virtual ~ScrollViewPagePathEffect(); + +private: + + Vector3 mPageSize; ///< The logical page size for the 3D effect. + PathConstrainer mPathConstrainer; ///< PathConstrainer used to constraint position and orientation + LinearConstrainer mLinearConstrainer; ///< LinearConstrainer used to constraint opacity + Dali::Property::Index mInputPropertyIndex; ///< Index of the property in the scrollview used as the parameter for the path + unsigned int mPageCount; ///< Total number of pages (Needed for wrapping) +}; + +} // namespace Internal + +// Helpers for public-api forwarding methods + +inline Internal::ScrollViewPagePathEffect& GetImpl(Dali::Toolkit::ScrollViewPagePathEffect& obj) +{ + DALI_ASSERT_ALWAYS(obj); + + Dali::RefObject& handle = obj.GetBaseObject(); + + return static_cast(handle); +} + +inline const Internal::ScrollViewPagePathEffect& GetImpl(const Dali::Toolkit::ScrollViewPagePathEffect& obj) +{ + DALI_ASSERT_ALWAYS(obj); + + const Dali::RefObject& handle = obj.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp deleted file mode 100644 index 10d6d1e..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* - * 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 - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace // unnamed namespace -{ - -const float PAGE_EPSILON_FACTOR( 0.25f ); - -const float PAGE_SIZE_RELATIVE_ANGLE_FACTOR( 0.75f ); -const float NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR( 1.5f ); - -const float SCROLL_PAGE_OPAQUE_BEFORE( 0.4f ); -const float SCROLL_PAGE_FULLY_TRANSPARENT_AFTER( 0.9f ); -const float NON_SCROLL_PAGE_OPAQUE_BEFORE( 0.8f ); -const float NON_SCROLL_PAGE_FULLY_TRANSPARENT_AFTER( 1.0f ); - -const float RADIUS_FACTOR( 0.95f ); -const float SCROLL_PAGE_Z_POSITION_FACTOR( -2.0f ); -const float NON_SCROLL_PAGE_Z_POSITION_FACTOR( -0.75f ); - -using namespace ScrollViewHelperFunctions; - -/** - * ScrollPageSpiralEffectInfo - * - * Rotate constraint: adjusts the angle of the page based on its position relative to the middle of - * the screen. - * When at middle of screen Angles on X and Y Axes is 0. - * - * Color constraint: adjusts the alpha of the page based on their parent page's position relative - * to the middle of the screen. - * When at middle of screen Alpha is 100% opacity. - * When outside the viewable area, the opacity is 0%. - * - * Position constraint: adjusts the position of the page based on their parent page's position - * relative to the middle of the screen. - * When at middle of the screen the position is not altered. - */ -class ScrollPageSpiralEffectInfo -{ -public: - - ScrollPageSpiralEffectInfo( const Vector2& spiralAngle, bool scrollWrap ) - : mSpiralAngle( spiralAngle ), - mScrollWrap( scrollWrap ) - { - } - - /** - * @param[in,out] current The current orientation of this Actor - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION) - * @return The new orientation of this Actor. - */ - void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - const Vector3& scrollStartPagePosition = inputs[5]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - const Vector3& minScrollPosition( inputs[2]->GetVector3() ); - const Vector3& maxScrollPosition( inputs[3]->GetVector3() ); - - if( mScrollWrap ) - { - WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - return; - } - - Vector2 angle( position / ( pageSize * PAGE_SIZE_RELATIVE_ANGLE_FACTOR ) * Vector3( mSpiralAngle ) ); - const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR ); - Vector2 distanceFromScrollPage; - distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x ); - distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y ); - - Vector2 angleMaxMin( mSpiralAngle ); - - // X rotation - if ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) // Did scroll start on this page? - { - angle.x = -angle.x * 0.9f; - } - else - { - // If not then multiply by angle factor. - angleMaxMin.x *= NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR; - } - ClampInPlace( angle.x, -angleMaxMin.x, angleMaxMin.x ); - - // Y rotation - if ( fabsf( distanceFromScrollPage.y ) > epsilon.y ) // If not on the scroll page then multiply by angle factor. - { - angleMaxMin.y *= NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR; - angle.y = -angle.y; - } - ClampInPlace( angle.y, -angleMaxMin.y, angleMaxMin.y ); - - current = Quaternion( Radian( angle.x ), Vector3::YAXIS ) * - Quaternion( Radian( angle.y ), Vector3::XAXIS ) * - current; - } - - /** - * @param[in,out] current The current color of this Actor - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION) - * @return The new color of this Actor. - */ - void ColorConstraint( Vector4& color, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - const Vector3& scrollStartPagePosition = inputs[5]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - const Vector3& minScrollPosition( inputs[2]->GetVector3() ); - const Vector3& maxScrollPosition( inputs[3]->GetVector3() ); - - if( mScrollWrap ) - { - WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // note preserve color channels incase there is a shader/further constraint - // that wishes to do something with that information. - color.a = 0.0f; - return; - } - - Vector2 distance( position / pageSize ); - float distanceLength( distance.Length() ); - const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR ); - Vector2 distanceFromScrollPage; - distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x ); - distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y ); - - float fullyOpaqueBefore( 0.0f ); - float fullyTransparentAfter( 1.0f ); - - if ( ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) && ( fabsf( distanceFromScrollPage.y ) <= epsilon.y )) // Did scroll start on this page? - { - fullyOpaqueBefore = SCROLL_PAGE_OPAQUE_BEFORE; - fullyTransparentAfter = SCROLL_PAGE_FULLY_TRANSPARENT_AFTER; - } - else - { - fullyOpaqueBefore = NON_SCROLL_PAGE_OPAQUE_BEFORE; - fullyTransparentAfter = NON_SCROLL_PAGE_FULLY_TRANSPARENT_AFTER; - } - - if ( distanceLength <= fullyOpaqueBefore ) - { - color.a = 1.0f; - } - else if ( distanceLength <= fullyTransparentAfter ) - { - float opacity( distanceLength - fullyOpaqueBefore ); - opacity /= fullyTransparentAfter - fullyOpaqueBefore; - color.a = Clamp( 1.0f - opacity, 0.0f, 1.0f ); - } - else - { - color.a = 0.0f; - } - } - - /** - * @param[in,out] current The current position - * @param[in] inputs Contains: - * The page's position. - * The scroll-view's position property (SCROLL_POSITION) - * The minimum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The maximum extent of this scroll domain. (SCROLL_POSITION_MIN) - * The size of the page. (scrollView SIZE) - * The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION) - * @return The new position of this Actor. - */ - void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs ) - { - const Vector3& pagePosition = inputs[0]->GetVector3(); - const Vector3& scrollPosition = inputs[1]->GetVector3(); - const Vector3& scrollStartPagePosition = inputs[5]->GetVector3(); - - // Get position of page. - Vector3 position = pagePosition + scrollPosition; - - // short circuit: if we're looking straight on at the page. - if( IsStraightOnView( position ) ) - { - current += scrollPosition; - return; - } - - const Vector3& pageSize = inputs[4]->GetVector3(); - const Vector3& minScrollPosition( inputs[2]->GetVector3() ); - const Vector3& maxScrollPosition( inputs[3]->GetVector3() ); - - if( mScrollWrap ) - { - WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition ); - } - - // short circuit: for pages outside of view. - if( IsOutsideView( position, pageSize ) ) - { - // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this) - // they will be invisible so doesn't have to be precise, just away from stage. - current += scrollPosition; - return; - } - - const Vector2 angle( position / pageSize * ( Dali::Math::PI_4 ) ); - const Vector2 radius( pageSize * RADIUS_FACTOR ); - const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR ); - Vector2 distanceFromScrollPage; - distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x ); - distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y ); - - // X position and relative Z position - if ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) // Did scroll start on this page? - { - position.x = radius.x * sin( angle.x ) * 0.77f; - position.z = fabsf( position.x ) * SCROLL_PAGE_Z_POSITION_FACTOR; - } - else - { - position.x = radius.x * ( sinf( angle.x * Math::PI * 0.4f ) ); - - position.z = fabsf( position.x ) * NON_SCROLL_PAGE_Z_POSITION_FACTOR; - } - - // Y position and relative Z position - if ( fabsf( distanceFromScrollPage.y ) <= epsilon.y ) // Did scroll start on this page? - { - position.y = radius.y * sin( angle.y ) * 0.77f; - position.z += fabsf( position.y ) * SCROLL_PAGE_Z_POSITION_FACTOR; - } - else - { - position.y = radius.y * ( sinf( angle.y * Math::PI * 0.4f ) ); - - position.z += fabsf( position.y ) * NON_SCROLL_PAGE_Z_POSITION_FACTOR; - } - - current = position; - } - - Vector2 mSpiralAngle; ///< The angle of the spirald page - bool mScrollWrap; ///< Whether the scroll view wraps or not. -}; - -/** - * Helper: Applies the 3D scroll cube constraints to the child actor - * - * @param[in] scrollView The ScrollView containing the pages. - * @param[in] child The child to be affected with the 3D Effect. - * @param[in] info The effect info for the constraints - */ -void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView, - Actor child, - ScrollPageSpiralEffectInfo& info) -{ - // Apply constraints to this actor // - Constraint constraint; - constraint = Constraint::New( child, Actor::Property::ORIENTATION, info, &ScrollPageSpiralEffectInfo::RotationConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); - - constraint = Constraint::New( child, Actor::Property::COLOR, info, &ScrollPageSpiralEffectInfo::ColorConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); - - constraint = Constraint::New( child, Actor::Property::POSITION, info, &ScrollPageSpiralEffectInfo::PositionConstraint ); - constraint.AddSource( LocalSource(Actor::Property::POSITION) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) ); - constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) ); - constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) ); - constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) ); - constraint.SetRemoveAction( Constraint::Discard ); - constraint.Apply(); -} - -} // unnamed namespace - -ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect() -{ - -} - -ScrollViewPageSpiralEffect::~ScrollViewPageSpiralEffect() -{ -} - -void ScrollViewPageSpiralEffect::ApplyToPage( Actor page, const Vector2& spiralAngle ) -{ - Toolkit::ScrollView scrollView( GetScrollView() ); - - if ( scrollView ) - { - ScrollPageSpiralEffectInfo info( spiralAngle, GetImpl( scrollView ).GetWrapMode() ); - ApplyScrollCubeConstraints( scrollView, page, info ); - } -} - -void ScrollViewPageSpiralEffect::OnAttach(Toolkit::ScrollView& scrollView) -{ -} - -void ScrollViewPageSpiralEffect::OnDetach(Toolkit::ScrollView& scrollView) -{ -} - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h deleted file mode 100644 index ec76adf..0000000 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ -#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ - -/* - * 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. - * - */ - -// EXTERNAL INCLUDES -#include -#include -#include -#include - -// INTERNAL INCLUDES -#include -#include -#include - -namespace Dali -{ - -class Animation; - -namespace Toolkit -{ - -class ScrollGroup; -class ScrollView; - -namespace Internal -{ - -/** - * @copydoc Toolkit::ScrollViewPageSpiralEffect - */ -class ScrollViewPageSpiralEffect : public ScrollViewEffect -{ - -public: - - /** - * Constructor - */ - ScrollViewPageSpiralEffect(); - -public: - - /** - * @copydoc ScrollViewEffect::ApplyToActor - */ - void ApplyToPage( Actor child, const Vector2& spiralAngle ); - -public: - - /** - * @copydoc ScrollViewEffect::OnAttach - */ - virtual void OnAttach( Toolkit::ScrollView& scrollView ); - - /** - * @copydoc ScrollViewEffect::OnDetach - */ - virtual void OnDetach( Toolkit::ScrollView& scrollView ); - -protected: - - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~ScrollViewPageSpiralEffect(); - -private: - - Vector3 mPageSize; ///< The logical page size for the 3D effect. -}; - -} // namespace Internal - -// Helpers for public-api forwarding methods - -inline Internal::ScrollViewPageSpiralEffect& GetImpl(Dali::Toolkit::ScrollViewPageSpiralEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -inline const Internal::ScrollViewPageSpiralEffect& GetImpl(const Dali::Toolkit::ScrollViewPageSpiralEffect& obj) -{ - DALI_ASSERT_ALWAYS(obj); - - const Dali::RefObject& handle = obj.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index 2c7ae13..fcac775 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -41,11 +41,8 @@ toolkit_src_files = \ $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp \ $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp \ $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp \ - $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp \ $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-impl.cpp \ - $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp \ - $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp \ - $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp \ + $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp \ $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp \ $(toolkit_src_dir)/controls/shadow-view/shadow-view-impl.cpp \ $(toolkit_src_dir)/controls/slider/slider-impl.cpp \ diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp deleted file mode 100644 index 08ec102..0000000 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2015 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 - -// INTERNAL HEADERS -#include - -using namespace Dali; - -namespace Dali -{ - -namespace Toolkit -{ - -ScrollViewPageCarouselEffect ScrollViewPageCarouselEffect::New() -{ - return ScrollViewPageCarouselEffect(new Internal::ScrollViewPageCarouselEffect()); -} - -ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect() -{ - -} - -ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect(Internal::ScrollViewPageCarouselEffect *impl) -: ScrollViewEffect(impl) -{ -} - -ScrollViewPageCarouselEffect ScrollViewPageCarouselEffect::DownCast( BaseHandle handle ) -{ - return ScrollViewPageCarouselEffect( dynamic_cast(handle.GetObjectPtr()) ); -} - -void ScrollViewPageCarouselEffect::ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio ) -{ - GetImpl(*this).ApplyToPage( page, positionToPageSizeRatio ); -} - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h deleted file mode 100644 index 357a5b4..0000000 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ -#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ - -/* - * Copyright (c) 2015 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. - * - */ - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -class Actor; - -namespace Toolkit -{ - -namespace Internal DALI_INTERNAL -{ -class ScrollViewPageCarouselEffect; -} - -/** - * ScrollView Page Carousel Effect. - * - * This effect cause each page in a scroll-view to rotate round a 3D carousel. - * It should be used on the following Actor hierarchy: - * - * ScrollView - * | - * Page (1..n) - * - * You should ensure ScrollView's default constraints have been removed, - * by calling ScrollView::RemoveConstraintsFromChildren() before applying - * this effect to ScrollView. - * - * Manual operation: - * ApplyToPage(...) method should be called on every page. - * - * Automatic operation: - * not implemented. - */ -class DALI_IMPORT_API ScrollViewPageCarouselEffect : public ScrollViewEffect -{ - -public: - - /** - * Create an initialized ScrollViewPageCarouselEffect. - * @return A handle to a newly allocated Dali resource. - */ - static ScrollViewPageCarouselEffect New(); - - /** - * Create an uninitialized ScrollViewPageCarouselEffect; this can be initialized with ScrollViewPageCarouselEffect::New() - * Calling member functions with an uninitialized Toolkit::ScrollViewPageCarouselEffect is not allowed. - */ - ScrollViewPageCarouselEffect(); - - /** - * Downcast an Object handle to ScrollViewPageCarouselEffect. If handle points to a ScrollViewPageCarouselEffect the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle Handle to an object - * @return handle to a ScrollViewPageCarouselEffect or an uninitialized handle - */ - static ScrollViewPageCarouselEffect DownCast( BaseHandle handle ); - - /** - * Manually apply effect to a page in the scroll-view. - * @param[in] page The page to be affected by this effect. - * @param[in] positionToPageSizeRatio A ratio of the size of the page which determines the amount the page will move as it fades out. - * Default is moving it by the page size. - */ - void ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio = Vector2::ONE ); - -protected: - - /** - * This constructor is used by Dali New() methods. - * @param [in] impl A pointer to a newly allocated Dali resource - */ - explicit DALI_INTERNAL ScrollViewPageCarouselEffect( Internal::ScrollViewPageCarouselEffect *impl ); - -}; - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__ diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp similarity index 52% rename from dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp rename to dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp index 06a989b..a38f551 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp @@ -16,10 +16,10 @@ */ // CLASS HEADER -#include +#include // INTERNAL HEADERS -#include +#include using namespace Dali; @@ -29,29 +29,28 @@ namespace Dali namespace Toolkit { -ScrollViewPageCubeEffect ScrollViewPageCubeEffect::New() +ScrollViewPagePathEffect ScrollViewPagePathEffect::New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount) { - return ScrollViewPageCubeEffect(new Internal::ScrollViewPageCubeEffect()); + return ScrollViewPagePathEffect(new Internal::ScrollViewPagePathEffect(path, forward, inputPropertyIndex, pageSize,pageCount)); } -ScrollViewPageCubeEffect::ScrollViewPageCubeEffect() +ScrollViewPagePathEffect::ScrollViewPagePathEffect() { - } -ScrollViewPageCubeEffect::ScrollViewPageCubeEffect(Internal::ScrollViewPageCubeEffect *impl) -: ScrollViewEffect(impl) +ScrollViewPagePathEffect::ScrollViewPagePathEffect(Internal::ScrollViewPagePathEffect *impl) +:ScrollViewEffect(impl) { } -ScrollViewPageCubeEffect ScrollViewPageCubeEffect::DownCast( BaseHandle handle ) +ScrollViewPagePathEffect ScrollViewPagePathEffect::DownCast( BaseHandle handle ) { - return ScrollViewPageCubeEffect( dynamic_cast(handle.GetObjectPtr()) ); + return ScrollViewPagePathEffect( dynamic_cast(handle.GetObjectPtr()) ); } -void ScrollViewPageCubeEffect::ApplyToPage(Actor page, const Vector2& angleSwing) +void ScrollViewPagePathEffect::ApplyToPage( Actor page, unsigned int pageOrder ) { - GetImpl(*this).ApplyToPage( page, angleSwing ); + GetImpl(*this).ApplyToPage( page, pageOrder ); } } // namespace Toolkit diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h similarity index 50% rename from dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h rename to dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h index 0337b15..de7c649 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h @@ -1,5 +1,5 @@ -#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ -#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ +#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__ +#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__ /* * Copyright (c) 2015 Samsung Electronics Co., Ltd. @@ -25,20 +25,22 @@ namespace Dali { class Actor; +class Path; namespace Toolkit { namespace Internal DALI_INTERNAL { -class ScrollViewPageCubeEffect; +class ScrollViewPagePathEffect; } /** - * ScrollView Inner Cube-Effect. + * ScrollView Page Path Effect. + * This effect causes Actors to follow a given path. The opacity of the actor will be 0.0 at + * the beginning of the path and will go to 1.0 as it is approximating to half of the path to return + * to 0.0 at the end of the path * - * This effect cause each page in a scroll-view to rotate round an inner 3D cube. - * It should be used on the following Actor hierarchy: * * ScrollView * | @@ -54,38 +56,42 @@ class ScrollViewPageCubeEffect; * Automatic operation: * not implemented. */ -class DALI_IMPORT_API ScrollViewPageCubeEffect : public ScrollViewEffect +class DALI_IMPORT_API ScrollViewPagePathEffect : public ScrollViewEffect { public: /** - * Create an initialized ScrollViewPageCubeEffect. + * Create an initialized ScrollViewPagePathEffect. + * @param[in] path The path that will be used by the scroll effect + * @param[in] forward Vector in page object space which will be aligned with the tangent of the path + * @param[in] inputPropertyIndex Index of a property of the scroll-view which will be used as the input for the path. + * @param[in] pageSize Size of a page in the scrollview + * @param[in] pageCount Total number of pages in the scrollview * @return A handle to a newly allocated Dali resource. */ - static ScrollViewPageCubeEffect New(); + static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount); /** - * Create an uninitialized ScrollViewPageCubeEffect; this can be initialized with ScrollViewPageCubeEffect::New() - * Calling member functions with an uninitialized Toolkit::ScrollViewPageCubeEffect is not allowed. + * Create an uninitialized ScrollViewPagePathEffect; this can be initialized with ScrollViewPagePathEffect::New() + * Calling member functions with an uninitialized Toolkit::ScrollViewPagePathEffect is not allowed. */ - ScrollViewPageCubeEffect(); + ScrollViewPagePathEffect(); /** - * Downcast an Object handle to ScrollViewPageCubeEffect. If handle points to a ScrollViewPageCubeEffect the + * Downcast an Object handle to ScrollViewPagePathEffect. If handle points to a ScrollViewPagePathEffect the * downcast produces valid handle. If not the returned handle is left uninitialized. * @param[in] handle Handle to an object - * @return handle to a ScrollViewPageCubeEffect or an uninitialized handle + * @return handle to a ScrollViewPagePathEffect or an uninitialized handle */ - static ScrollViewPageCubeEffect DownCast( BaseHandle handle ); + static ScrollViewPagePathEffect DownCast( BaseHandle handle ); /** * Manually apply effect to a page in the scroll-view. * @param[in] page The page to be affected by this effect. - * @param[in] angleSwing The maximum amount the child actor should - * rotate in radians for each axis (X and Y) as the page is scrolled. + * @param[in] pageOrder The order of the page in the scroll-view */ - void ApplyToPage( Actor page, const Vector2& angleSwing ); + void ApplyToPage( Actor page, unsigned int pageOrder ); protected: @@ -93,7 +99,7 @@ protected: * This constructor is used by Dali New() methods. * @param [in] impl A pointer to a newly allocated Dali resource */ - explicit DALI_INTERNAL ScrollViewPageCubeEffect( Internal::ScrollViewPageCubeEffect *impl ); + explicit DALI_INTERNAL ScrollViewPagePathEffect( Internal::ScrollViewPagePathEffect *impl ); }; @@ -101,4 +107,4 @@ protected: } // namespace Dali -#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__ +#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__ diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp deleted file mode 100644 index b76ed79..0000000 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2015 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 - -// INTERNAL HEADERS -#include - -using namespace Dali; - -namespace Dali -{ - -namespace Toolkit -{ - -ScrollViewPageSpiralEffect ScrollViewPageSpiralEffect::New() -{ - return ScrollViewPageSpiralEffect(new Internal::ScrollViewPageSpiralEffect()); -} - -ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect() -{ - -} - -ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect(Internal::ScrollViewPageSpiralEffect *impl) -: ScrollViewEffect(impl) -{ -} - -ScrollViewPageSpiralEffect ScrollViewPageSpiralEffect::DownCast( BaseHandle handle ) -{ - return ScrollViewPageSpiralEffect( dynamic_cast(handle.GetObjectPtr()) ); -} - -void ScrollViewPageSpiralEffect::ApplyToPage( Actor page, const Vector2& spiralAngle ) -{ - GetImpl(*this).ApplyToPage( page, spiralAngle ); -} - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h deleted file mode 100644 index a31d6af..0000000 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ -#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ - -/* - * Copyright (c) 2015 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. - * - */ - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -class Actor; - -namespace Toolkit -{ - -namespace Internal DALI_INTERNAL -{ -class ScrollViewPageSpiralEffect; -} - -/** - * @brief This effect cause each page in a scroll-view to move along a spiral. - * - * It should be used on the following Actor hierarchy: - * - * ScrollView - * | - * Page (1..n) - * - * You should ensure ScrollView's default constraints have been removed, - * by calling ScrollView::RemoveConstraintsFromChildren() before applying - * this effect to ScrollView. - * - * Manual operation: - * ApplyToPage(...) method should be called on every page. - * - * Automatic operation: - * not implemented. - */ -class DALI_IMPORT_API ScrollViewPageSpiralEffect : public ScrollViewEffect -{ - -public: - - /** - * @brief Create an initialized ScrollViewPageSpiralEffect. - * - * @return A handle to a newly allocated Dali resource. - */ - static ScrollViewPageSpiralEffect New(); - - /** - * @brief Create an uninitialized ScrollViewPageSpiralEffect; this can be initialized with ScrollViewPageSpiralEffect::New(). - * - * Calling member functions with an uninitialized Toolkit::ScrollViewPageSpiralEffect is not allowed. - */ - ScrollViewPageSpiralEffect(); - - /** - * @brief Downcast an Object handle to ScrollViewPageSpiralEffect. - * - * If handle points to a ScrollViewPageSpiralEffect the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle Handle to an object - * @return handle to a ScrollViewPageSpiralEffect or an uninitialized handle - */ - static ScrollViewPageSpiralEffect DownCast( BaseHandle handle ); - - /** - * @brief Manually apply effect to a page in the scroll-view. - * - * @param[in] page The page to be affected by this effect. - * @param[in] spiralAngle The spirald angle (in radians). - * - * @note If the wrap mode of the scroll view is changed, then this needs to be called for every - * page again after removing the previous constraints. - */ - void ApplyToPage( Actor page, const Vector2& spiralAngle ); - -protected: - - /** - * @brief This constructor is used by Dali New() methods. - * - * @param [in] impl A pointer to a newly allocated Dali resource - */ - explicit DALI_INTERNAL ScrollViewPageSpiralEffect( Internal::ScrollViewPageSpiralEffect *impl ); - -}; - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__ diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index e7b02f2..881abd3 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -464,6 +464,8 @@ public: OVERSHOOT_X, ///< Property, name "overshoot-x", type float OVERSHOOT_Y, ///< Property, name "overshoot-y", type float SCROLL_FINAL, ///< Property, name "scroll-final", type Vector3 + SCROLL_FINAL_X, + SCROLL_FINAL_Y, WRAP, ///< Property, name "wrap", type bool PANNING, ///< Property, name "panning", type bool SCROLLING, ///< Property, name "scrolling", type bool diff --git a/dali-toolkit/public-api/file.list b/dali-toolkit/public-api/file.list index 67486ff..043d8f5 100755 --- a/dali-toolkit/public-api/file.list +++ b/dali-toolkit/public-api/file.list @@ -33,9 +33,7 @@ public_api_src_files = \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-effect.cpp \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp \ + $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.cpp \ $(public_api_src_dir)/controls/scrollable/scroll-connector.cpp \ @@ -176,9 +174,7 @@ public_api_scroll_view_header_files = \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect.h \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect.h \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-effect.h \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h \ - $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h \ + $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.h \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect.h \ $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.h