namespace
{
-const int MILLISECONDS_PER_SECOND = 1000;
const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
-const int RENDER_ANIMATION_TEST_DURATION_MS = 1000; ///< 1000ms to test animation
-const int RENDER_DELAY_SCROLL = 1000; ///< duration to wait for any scroll to complete.
/*
* Simulate time passed by.
} // unnamed namespace
-
-int UtcDaliScrollViewCubeEffectSetup(void)
-{
- tet_infoline(" UtcDaliScrollViewCubeEffectSetup");
-
- ScrollViewCubeEffect effect;
-
- DALI_TEST_CHECK( !effect );
-
- BaseHandle handle = ScrollViewCubeEffect::New();
-
- DALI_TEST_CHECK( handle );
-
- effect = ScrollViewCubeEffect::DownCast(handle);
-
- DALI_TEST_CHECK( effect );
- END_TEST;
-}
-
-int UtcDaliScrollViewCubeEffectTest(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliScrollViewCubeEffectTest");
-
- Vector2 size = Stage::GetCurrent().GetSize();
-
- ScrollView scrollView = SetupTestScrollView(1, 3, size);
- Actor page = gPages[1];
- Wait(application, 500);
-
- ScrollViewCubeEffect effect = ScrollViewCubeEffect::New();
- scrollView.ApplyEffect(effect);
-
- Actor actor = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
- Wait(application);
- Vector3 actorPrePosition = actor.GetCurrentPosition();
-
- effect.ApplyToActor(actor, page, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
-
- Actor actor2 = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
- effect.ApplyToActor(actor2, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
-
- 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);
- CleanupTest();
- END_TEST;
-}
-
-int UtcDaliScrollViewCarouselEffectSetup(void)
-{
- tet_infoline(" UtcDaliScrollViewCarouselEffectSetup");
-
- ScrollViewCarouselEffect effect;
-
- DALI_TEST_CHECK( !effect );
-
- BaseHandle handle = ScrollViewCarouselEffect::New();
-
- DALI_TEST_CHECK( handle );
-
- effect = ScrollViewCarouselEffect::DownCast(handle);
-
- DALI_TEST_CHECK( effect );
- END_TEST;
-}
-
-int UtcDaliScrollViewCarouselEffectTest(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliScrollViewCarouselEffectTest");
-
- Vector2 size = Stage::GetCurrent().GetSize();
-
- ScrollView scrollView = SetupTestScrollView(1, 3, size);
- Actor testPage = gPages[1];
- Wait(application, 500);
-
- ScrollViewCarouselEffect effect = ScrollViewCarouselEffect::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) );
-
- scrollView.ScrollTo(Vector2(size.x, 0.0f), 0.5f, DirectionBiasNone, DirectionBiasNone);
- 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);
- CleanupTest();
- 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 UtcDaliScrollViewDepthEffectTest(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliScrollViewDepthEffectTest");
-
- Vector2 size = Stage::GetCurrent().GetSize();
-
- ScrollView scrollView = SetupTestScrollView(1, 3, size);
- Actor testPage = gPages[1];
- Wait(application, 500);
-
- ScrollViewDepthEffect effect = ScrollViewDepthEffect::New();
- scrollView.ApplyEffect(effect);
-
- Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
- 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);
- CleanupTest();
- END_TEST;
-}
-
-
int UtcDaliScrollViewPagePathEffectSetup(void)
{
tet_infoline(" UtcDaliScrollViewPagePathEffectSetup");
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
#include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
+++ /dev/null
-/*
- * 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 <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-/**
- * Gets a property index. If the property doesn't already exist, then
- * it will create the property.
- * @param[in] handle The handle that owns or will own the property
- * @param[in] name The name for this property
- * @param[in] propertyValue The initial value for this property
- * @return The property index for this property is returned.
- */
-Property::Index SafeRegisterProperty( Handle& handle, const std::string& name, Property::Value propertyValue )
-{
- Property::Index index = handle.GetPropertyIndex( name );
-
- if(index == Property::INVALID_INDEX)
- {
- index = handle.RegisterProperty( name, propertyValue );
- }
-
- return index;
-}
-
-/**
- * ScrollCarouselEffectInfo
- *
- * Visibility constraint: switches off the visibility when Actor
- * is outside of bounds, for performance reasons.
- *
- * Rotate constraint: adjusts the angle of the Actors
- * based on their position relative to the edges of the screen.
- * When in the middle portion of the screen Angle does not change.
- * When leaving the edge of the screen screen rotation changes.
- *
- * Position constraint: adjusts the position of the Actors
- * based on their parent page's position relative to the edges of the screen.
- * The position constraint compensates for the rotation which would otherwise
- * move the Actor's edge visually away from the neighboring actor, as they rotate
- * around their default anchor point.
- */
-class ScrollCarouselEffectInfo
-{
-public:
-
- ScrollCarouselEffectInfo(const Vector2& angleSwing)
- : mAngleSwing(angleSwing),
- mCanvasMargin( 0.0f, 0.0f ),
- mVisibilityThreshold( 1.0f, 1.0f )
- {
- }
-
- /**
- * @param[in,out] current The current visibility of this Actor
- * @param[in] inputs Contains:
- * The Actor's Position
- * The Actor's Scale
- * The Actor's Size
- * The scroll-view's position property (SCROLL_POSITION)
- * The size of the scroll-view (scrollView SIZE)
- * @return The new visibility of this Actor.
- */
- void VisibilityConstraint( bool& current, const PropertyInputContainer& inputs )
- {
- const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
- Vector2 position( inputs[0]->GetVector3().GetVectorXY() + inputs[3]->GetVector2());
- Vector2 scaledSize( inputs[2]->GetVector3() * inputs[1]->GetVector3());
-
- Vector2 domain( inputs[4]->GetVector3() );
-
- position -= (anchor - mVisibilityThreshold) * scaledSize;
- domain -= (Vector2::ONE - mVisibilityThreshold * 2.0f) * scaledSize;
-
- current = ( position.x >= 0 &&
- position.x <= domain.x &&
- position.y >= 0 &&
- position.y <= domain.y );
- }
-
- /**
- * @param[in,out] current The current orientation of this Actor
- * @param[in] inputs Contains:
- * The Actor's Position.
- * The Actor's Scale.
- * The Actor's Size
- * The scroll-view's position property (SCROLL_POSITION)
- * The size of the scroll-view (scrollView SIZE)
- * Activation value (0 - normal, 1.0 - full effect)
- * @return The new orientation of this Actor.
- */
- void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
- {
- const float activate(inputs[5]->GetFloat());
-
- if(activate <= Math::MACHINE_EPSILON_0)
- {
- return;
- }
-
- const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
- Vector2 position( inputs[0]->GetVector3().GetVectorXY() + inputs[3]->GetVector2());
- Vector2 scaledSize(inputs[2]->GetVector3() * inputs[1]->GetVector3());
- Vector2 domain(inputs[4]->GetVector3());
-
- position -= (anchor - mCanvasMargin) * scaledSize;
- domain -= (Vector2::ONE - mCanvasMargin * 2.0f) * scaledSize;
-
- Vector2 angle;
-
- if( position.y < 0 )
- {
- angle.y = (-position.y / scaledSize.height) * mAngleSwing.y;
- }
- else if( position.y > domain.y )
- {
- angle.y = ((domain.y - position.y) / scaledSize.height) * mAngleSwing.y;
- }
-
- angle *= activate;
-
- current = Quaternion( Radian( -angle.x ), Vector3::YAXIS ) *
- Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
- current;
- }
-
- /**
- * @param[in,out] current The current position of this Actor
- * @param[in] inputs Contains:
- * The Actor's Scale.
- * The Actor's Size
- * The scroll-view's position property (SCROLL_POSITION)
- * The size of the scroll-view (scrollView SIZE)
- * Activation value (0 - normal, 1.0 - full effect)
- * @return The new position of this Actor.
- */
- void PositionConstraint( Vector3& position, const PropertyInputContainer& inputs )
- {
- const float activate(inputs[4]->GetFloat());
-
- if(activate <= Math::MACHINE_EPSILON_0)
- {
- return;
- }
-
- position.GetVectorXY() += inputs[2]->GetVector2();
-
- const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
- Vector2 scaledSize(inputs[1]->GetVector3() * inputs[0]->GetVector3());
- Vector2 domain(inputs[3]->GetVector3());
-
- position.GetVectorXY() -= (anchor - mCanvasMargin) * scaledSize;
- domain -= (Vector2::ONE - mCanvasMargin * 2.0f) * scaledSize;
-
- Vector2 angle;
-
- if(position.y < 0)
- {
- angle.y = (-position.y / scaledSize.height) * mAngleSwing.y * activate;
- position.y += (1.0f - cosf(angle.y)) * scaledSize.height * 0.5f;
- position.z -= sinf(angle.y) * scaledSize.height * 0.5f;
- }
- else if(position.y > domain.y)
- {
- angle.y = ((domain.y - position.y) / scaledSize.height) * mAngleSwing.y * activate;
- position.y -= (1.0f - cosf(angle.y)) * scaledSize.height * 0.5f;
- position.z -= sinf(-angle.y) * scaledSize.height * 0.5f;
- }
-
- position.GetVectorXY() += (anchor - mCanvasMargin) * scaledSize;
- }
-
- Vector2 mAngleSwing; ///< Maximum amount in X and Y axes to rotate.
- Vector2 mCanvasMargin; ///< Margin around the canvas for when to start rotating
- Vector2 mVisibilityThreshold; ///< Threshold for when to to switch off visibility of Actor (for performance)
-};
-
-/**
- * Helper: Applies the 3D scroll carousel 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 ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
- Actor child,
- ScrollCarouselEffectInfo& info)
-{
- // Apply constraints to this actor //
- Constraint constraint;
-
- constraint = Constraint::New<bool>( child, Actor::Property::VISIBLE, info, &ScrollCarouselEffectInfo::VisibilityConstraint );
- constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
- constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
- constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.AddSource( Source( scrollView, Actor::Property::SIZE ) );
- constraint.AddSource( Source( scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
- constraint.SetRemoveAction( Constraint::Discard );
- constraint.Apply();
-
- constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollCarouselEffectInfo::RotationConstraint );
- constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
- constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
- constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.AddSource( Source( scrollView, Actor::Property::SIZE ) );
- constraint.AddSource( Source( scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
- constraint.SetRemoveAction( Constraint::Discard );
- constraint.Apply();
-
- constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollCarouselEffectInfo::PositionConstraint );
- constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
- constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
- constraint.AddSource( Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
- constraint.SetRemoveAction( Constraint::Discard );
- constraint.Apply();
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect()
-: mPropertyActivate(Property::INVALID_INDEX)
-{
-}
-
-ScrollViewCarouselEffect::~ScrollViewCarouselEffect()
-{
-}
-
-void ScrollViewCarouselEffect::ApplyToActor(Actor child, const Vector2& angleSwing)
-{
- ScrollCarouselEffectInfo info( angleSwing );
-
- ApplyScrollCarouselConstraints( GetScrollView(), child, info );
-}
-
-void ScrollViewCarouselEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
- if(mPropertyActivate == Property::INVALID_INDEX)
- {
- mPropertyActivate = SafeRegisterProperty( scrollView, Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE, 1.0f );
- }
-}
-
-void ScrollViewCarouselEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_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 <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-function.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewCarouselEffect
- */
-class ScrollViewCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * Constructor
- */
- ScrollViewCarouselEffect();
-
-public:
-
- /**
- * @copydoc ScrollViewEffect::ApplyToActor
- */
- void ApplyToActor(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 ~ScrollViewCarouselEffect();
-
-private:
-
- Property::Index mPropertyActivate; ///< Activation property (0.0 - deactivated, 1.0 - fully activated)
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewCarouselEffect& GetImpl(Dali::Toolkit::ScrollViewCarouselEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<Internal::ScrollViewCarouselEffect&>(handle);
-}
-
-inline const Internal::ScrollViewCarouselEffect& GetImpl(const Dali::Toolkit::ScrollViewCarouselEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- const Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<const Internal::ScrollViewCarouselEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CAROUSEL_EFFECT_H__
+++ /dev/null
-/*
- * 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 <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-/**
- * ScrollCubeEffectInfo
- *
- * Rotate constraint: adjusts the angle of the Actors
- * based on their parent page's 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 Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of screen Alpha is 100% opacity.
- * When one screen away from middle Alpha is at 0% opacity (invisble).
- *
- * Position constraint: adjusts the position of the Actors
- * 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 about it's origin + mAnchor
- */
-class ScrollCubeEffectInfo
-{
-public:
-
- ScrollCubeEffectInfo(const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing)
- : mAnchor(anchor),
- mAngleSwing(angleSwing),
- mPositionSwing(positionSwing)
- {
- }
-
- /**
- * @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 = Vector3(inputs[1]->GetVector2());
-
- // Get position of page.
- Vector3 position = pagePosition + scrollPosition;
-
- // short circuit: for orthognal view.
- if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
- {
- return;
- }
-
- const Vector3& pageSize = inputs[4]->GetVector3();
- bool wrap = inputs[5]->GetBoolean();
-
- if(wrap)
- {
- const Vector2& min = inputs[2]->GetVector2();
- const Vector2& max = inputs[3]->GetVector2();
-
- 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.x, min.x, max.x) - pageSize.x;
- }
-
- 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.y, min.y, max.y) - pageSize.y;
- }
- }
-
- // short circuit: for pages outside of view.
- if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
- {
- return;
- }
-
- position.x /= pageSize.x;
- position.y /= pageSize.y;
-
- Vector2 angle( Clamp(position.x, -1.0f,1.0f),
- Clamp(position.y, -1.0f,1.0f) );
-
- 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 = Vector3(inputs[1]->GetVector2());
-
- // Get position of page.
- Vector3 position = pagePosition + scrollPosition;
-
- // short circuit: for orthognal view.
- if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
- {
- return;
- }
-
- const Vector3& pageSize = inputs[4]->GetVector3();
- bool wrap = inputs[5]->GetBoolean();
-
- if(wrap)
- {
- const Vector2& min = inputs[2]->GetVector2();
- const Vector2& max = inputs[3]->GetVector2();
-
- 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.x, min.x, max.x) - pageSize.x;
- }
-
- 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.y, min.y, max.y) - pageSize.y;
- }
- }
-
- // short circuit: for pages outside of view.
- if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
- {
- // note preserve color channels incase there is a shader/further constraint
- // that wishes to do something with that information.
- current.a = 0.0f;
- return;
- }
-
- position.x /= pageSize.x;
- position.y /= pageSize.y;
-
- Vector2 angle( Clamp(position.x, -1.0f,1.0f),
- Clamp(position.y, -1.0f,1.0f) );
-
- float f = (1.0f - fabsf(angle.x)) * (1.0f - fabsf(angle.y));
- f = f*f;
-
- current.a *= f;
- }
-
- /**
- * @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 = Vector3(inputs[1]->GetVector2());
-
- // Get position of page.
- Vector3 relativePosition = pagePosition + scrollPosition;
-
- // short circuit: for orthognal view.
- if( (fabsf(relativePosition.x) < Math::MACHINE_EPSILON_1) && (fabsf(relativePosition.y) < Math::MACHINE_EPSILON_1) )
- {
- current.x += scrollPosition.x;
- current.y += scrollPosition.y;
- return;
- }
-
- const Vector3& pageSize = inputs[4]->GetVector3();
- bool wrap = inputs[5]->GetBoolean();
-
- if(wrap)
- {
- const Vector2& min = inputs[2]->GetVector2();
- const Vector2& max = inputs[3]->GetVector2();
-
- if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
- {
- // WRAP X (based on the position of the right side)
- relativePosition.x = WrapInDomain(relativePosition.x + pageSize.x, min.x, max.x) - pageSize.x;
- }
-
- if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
- {
- // WRAP Y (based on the position of the bottom side)
- relativePosition.y = WrapInDomain(relativePosition.y + pageSize.y, min.y, max.y) - pageSize.y;
- }
- }
-
- // short circuit: for pages outside of view.
- if( (fabsf(relativePosition.x) >= pageSize.x) || (fabsf(relativePosition.y) >= pageSize.y) )
- {
- // 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;
- }
-
- relativePosition.x /= pageSize.x;
- relativePosition.y /= pageSize.y;
-
- Vector3 angle( Clamp(relativePosition.x, -1.0f,1.0f) * mAngleSwing.x,
- Clamp(relativePosition.y, -1.0f,1.0f) * mAngleSwing.y,
- 0.0f);
-
- // Rotate position (current) about point.
- Vector3 position = current - mAnchor;
- Quaternion rotatorY( Radian( angle.x ), Vector3::YAXIS);
- position = rotatorY.Rotate(position);
- Quaternion rotatorX( Radian( -angle.y ), Vector3::XAXIS);
- position = rotatorX.Rotate(position);
- position += mAnchor;
- position += relativePosition * mPositionSwing;
-
- current = position - pagePosition;
- }
-
- Vector3 mAnchor; ///< Anchor point where Actor should rotate about.
- Vector2 mAngleSwing; ///< Maximum amount in X and Y axes to rotate.
- Vector3 mPositionSwing; ///< Maximum amount in X and Y axes to alter position.
-};
-
-/**
- * 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,
- Actor parentPage,
- const ScrollCubeEffectInfo& info)
-{
- // Apply constraints to this actor //
- Constraint constraint;
- constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollCubeEffectInfo::RotationConstraint );
- constraint.AddSource( Source(parentPage, 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<Vector4>( child, Actor::Property::COLOR, info, &ScrollCubeEffectInfo::ColorConstraint );
- constraint.AddSource( Source(parentPage, 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<Vector3>( child, Actor::Property::POSITION, info, &ScrollCubeEffectInfo::PositionConstraint );
- constraint.AddSource( Source(parentPage, 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
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewCubeEffect::ScrollViewCubeEffect()
-{
-
-}
-
-ScrollViewCubeEffect::~ScrollViewCubeEffect()
-{
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing)
-{
- ScrollCubeEffectInfo info( anchor, angleSwing, positionSwing );
-
- ApplyScrollCubeConstraints( GetScrollView(), child, child.GetParent(), info );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
- Actor parentPage,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing)
-{
- ScrollCubeEffectInfo info( anchor, angleSwing, positionSwing );
-
- ApplyScrollCubeConstraints( GetScrollView(), child, parentPage, info );
-}
-
-void ScrollViewCubeEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewCubeEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_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 <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-function.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewCubeEffect
- */
-class ScrollViewCubeEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * Constructor
- */
- ScrollViewCubeEffect();
-
-public:
-
- /**
- * @copydoc ScrollViewEffect::ApplyToActor
- */
- void ApplyToActor(Actor child,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing);
-
- /**
- * @copydoc ScrollViewEffect::ApplyToActor
- */
- void ApplyToActor(Actor child,
- Actor parentPage,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing);
-
-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 ~ScrollViewCubeEffect();
-
-private:
-
- Vector3 mPageSize; ///< The logical page size for the 3D effect.
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewCubeEffect& GetImpl(Dali::Toolkit::ScrollViewCubeEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<Internal::ScrollViewCubeEffect&>(handle);
-}
-
-inline const Internal::ScrollViewCubeEffect& GetImpl(const Dali::Toolkit::ScrollViewCubeEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- const Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<const Internal::ScrollViewCubeEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
+++ /dev/null
-/*
- * 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 <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-// constraints ////////////////////////////////////////////////////////////////
-
-/**
- * Ramp equation is a variable easing equation
- * of the form f(x) = |x|^y * x / |x|
- *
- * An exponent (y) of 1 will result in a fast (linear graph)
- * Increasing the exponent will increase the Ease In
- *
- * @param[in] x mantissa (value from -1.0f to 1.0f)
- * @param[in] y exponent (+ve value)
- * @return The signed progress value from -1.0f to 1.0f
- */
-inline float RampFunction(float x, float y)
-{
- if(x < 0.0f)
- {
- return -powf(fabsf(x), y);
- }
-
- return powf(fabsf(x), y);
-}
-
-/**
- * ScrollDepthScaleConstraint
- *
- * Scale constraint adjusts the scale of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of the screen the scale is not altered.
- * As the page is moved away from the middle, Actors shrink in scale but at
- * different rates defined by the RampFunction(x, f).
- * All Actors eventually shrink to the same amount once at their destination.
- */
-struct ScrollDepthScaleConstraint
-{
- /**
- * The scaling constraint uses the amount the actors
- * have moved in position to determine scaling extent.
- * So essentially very similar calculations are used here.
- *
- * @param[in] positionExtent Controls how much Actor's X and Y
- * position affects their alpha function's exponent value
- * @param[in] offsetExtent exponent offset for X and Y scrolling
- * axes.
- * @param[in] positionScale Changes the amount the page as a whole
- * moves by.
- * @param[in] scaleExtent Scale factor to reach when page is one whole
- * page away from screen.
- */
- ScrollDepthScaleConstraint( Vector2 positionExtent = Vector2(0.5f, 1.0f),
- Vector2 offsetExtent = Vector2(1.0f, 1.0f),
- float positionScale = 1.5f,
- float scaleExtent = 0.5f)
- : mPositionExtent(positionExtent),
- mOffsetExtent(offsetExtent),
- mMaxExtent(positionExtent.x + positionExtent.y),
- mPositionScale(positionScale),
- mScaleExtent(scaleExtent)
- {
- }
-
- /**
- * @param[in,out] current The current scale
- * @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 scale of this Actor.
- */
- void operator()( Vector3& currentScale, const PropertyInputContainer& inputs )
- {
- const Vector3& currentPosition = inputs[0]->GetVector3();
- const Vector3& pagePosition = inputs[1]->GetVector3();
- const Vector2& scrollPosition = inputs[2]->GetVector2();
-
- // Get position of page.
- Vector2 position = pagePosition.GetVectorXY() + scrollPosition;
-
- // short circuit: for orthognal view.
- if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
- {
- return;
- }
-
- const Vector3& pageSize = inputs[5]->GetVector3();
-
- // Don't have enough parameters, to provide Wrap mode (need a way of having 'uniforms' instead of scrollWrap.GetBoolean())
-
- const Vector2& min = inputs[3]->GetVector2();
- const Vector2& max = inputs[4]->GetVector2();
-
- 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.x, min.x, max.x) - pageSize.x;
- }
-
- 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.y, min.y, max.y) - pageSize.y;
- }
-
- // short circuit: for pages outside of view.
- if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
- {
- return;
- }
-
- // Calculate scale ////////////////////////////////////////////////////////
-
- position.x /= pageSize.x;
- position.y /= pageSize.y;
-
- position *= mPositionScale;
-
- Vector3 relCurrentPosition = currentPosition;
- relCurrentPosition.x = relCurrentPosition.x / pageSize.x + 0.5f;
- relCurrentPosition.y = relCurrentPosition.y / pageSize.y + 0.5f;
-
- Vector3 extent( (relCurrentPosition.x * mPositionExtent.x + relCurrentPosition.y * mPositionExtent.y) * 1.0f,
- (relCurrentPosition.x * mPositionExtent.y + relCurrentPosition.y * mPositionExtent.x) * 1.0f,
- 0.0f);
-
- if(position.x>0.0f)
- {
- extent.x = mMaxExtent - extent.x; // Flip for right.
- }
- if(position.y>0.0f)
- {
- extent.y = mMaxExtent - extent.y; // Flip for bottom.
- }
-
- position.x = RampFunction(position.x, mOffsetExtent.x + extent.x);
- position.y = RampFunction(position.y, mOffsetExtent.y + extent.y);
-
- float f = mScaleExtent + cos(position.x * Math::PI_2) * cos(position.y * Math::PI_2) * (1.0f - mScaleExtent);
-
- currentScale *= f;
- }
-
- const Vector2 mPositionExtent; ///< Determines how much of the Actor's X and Y position affects exponent value.
- const Vector2 mOffsetExtent; ///< Offset for exponent value.
- const float mMaxExtent; ///< Maximum possible extent (mOffsetExtent.x + mOffsetExtent.y)
- const float mPositionScale; ///< Position scaling factor (spreads out pages, to avoid overlap)
- const float mScaleExtent; ///< Scale factor when page is at furthest from
-};
-
-/**
- * ScrollDepthPositionConstraint
- *
- * Position constraint adjusts the position of the Actors
- * 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.
- * As the page is moved away from the middle, Actors move away but at
- * different rates defined by the RampFunction(x, f).
- * All Actors eventually arrive at their destination at the same time.
- */
-struct ScrollDepthPositionConstraint
-{
- /**
- * @param [in] positionExtent Controls how much Actor's X and Y
- * position affects their alpha function's exponent value
- * @param [in] offsetExtent exponent offset for X and Y scrolling
- * axes.
- * @param [in] positionScale Changes the amount the page as a whole
- * moves by.
- */
- ScrollDepthPositionConstraint( Vector2 positionExtent = Vector2(0.5f, 1.0f),
- Vector2 offsetExtent = Vector2(1.0f, 1.0f),
- float positionScale = 1.5f )
- : mPositionExtent(positionExtent),
- mOffsetExtent(offsetExtent),
- mMaxExtent(positionExtent.x + positionExtent.y),
- mPositionScale(positionScale)
- {
- }
-
- /**
- * @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 operator()( Vector3& currentPosition, const PropertyInputContainer& inputs )
- {
- const Vector3& pagePosition = inputs[0]->GetVector3();
- const Vector2& scrollPosition = inputs[1]->GetVector2();
-
- // Get position of page.
- Vector2 position = pagePosition.GetVectorXY() + scrollPosition;
-
- // short circuit: for orthognal view.
- if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
- {
- currentPosition.GetVectorXY() += scrollPosition;
- return;
- }
-
- const Vector3& pageSize = inputs[4]->GetVector3();
- bool wrap = inputs[5]->GetBoolean();
-
- if(wrap)
- {
- const Vector2& min = inputs[2]->GetVector2();
- const Vector2& max = inputs[3]->GetVector2();
-
- 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.x, min.x, max.x) - pageSize.x;
- }
-
- 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.y, min.y, max.y) - pageSize.y;
- }
- }
-
- // short circuit: for pages outside of view.
- if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
- {
- // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
- // they will be invisible so doesn't have to be precise, just away from stage.
- currentPosition.GetVectorXY() += scrollPosition;
- return;
- }
-
- // Calculate position /////////////////////////////////////////////////////
-
- position.x /= pageSize.x;
- position.y /= pageSize.y;
-
- position *= mPositionScale;
-
- Vector3 relCurrentPosition = currentPosition;
- relCurrentPosition.x = relCurrentPosition.x / pageSize.x + 0.5f;
- relCurrentPosition.y = relCurrentPosition.y / pageSize.y + 0.5f;
-
- Vector3 extent( (relCurrentPosition.x * mPositionExtent.x + relCurrentPosition.y * mPositionExtent.y) * 1.0f,
- (relCurrentPosition.x * mPositionExtent.y + relCurrentPosition.y * mPositionExtent.x) * 1.0f,
- 0.0f);
-
- if(position.x>0.0f)
- {
- extent.x = mMaxExtent - extent.x; // Flip for right.
- }
- if(position.y>0.0f)
- {
- extent.y = mMaxExtent - extent.y; // Flip for bottom.
- }
-
- position.x = RampFunction(position.x, mOffsetExtent.x + extent.x);
- position.y = RampFunction(position.y, mOffsetExtent.y + extent.y);
-
- currentPosition -= pagePosition;
- currentPosition += pageSize * Vector3(position);
- }
-
- const Vector2 mPositionExtent; ///< Determines how much of the Actor's X and Y position affects exponent value.
- const Vector2 mOffsetExtent; ///< Offset for exponent value.
- const float mMaxExtent; ///< Maximum possible extent (mOffsetExtent.x + mOffsetExtent.y)
- const float mPositionScale; ///< Position scaling factor (spreads out pages, to avoid overlap)
-};
-
-/**
- * Applies the scroll depth 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] positionExtent Controls how much Actor's X and Y
- * position affects their alpha function's exponent value
- * @param[in] offsetExtent exponent offset for X and Y scrolling
- * axes.
- * @param[in] positionScale Changes the amount the page as a whole
- * moves by.
- * @param[in] scaleExtent Scale factor to reach when page is one whole
- * page away from screen.
- */
-void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView,
- Actor child,
- const Vector2& positionExtent,
- const Vector2& offsetExtent,
- float positionScale,
- float scaleExtent)
-{
- // Scale Constraint
- Constraint constraint = Constraint::New<Vector3>( child, Actor::Property::SCALE, ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
- constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
- constraint.AddSource( ParentSource( Actor::Property::POSITION ) );
- constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- 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.SetRemoveAction( Constraint::Discard );
- constraint.Apply();
-
- // Position Constraint (apply last as other constraints use Actor::POSITION as a function input)
- constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
- constraint.AddSource( ParentSource(Actor::Property::POSITION) );
- constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- 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
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewDepthEffect::ScrollViewDepthEffect()
-{
-
-}
-
-ScrollViewDepthEffect::~ScrollViewDepthEffect()
-{
-}
-
-void ScrollViewDepthEffect::ApplyToActor(Actor child,
- const Vector2& positionExtent,
- const Vector2& offsetExtent,
- float positionScale,
- float scaleExtent)
-{
- ApplyScrollDepthConstraints( GetScrollView(), child, positionExtent, offsetExtent, positionScale, scaleExtent );
-}
-
-void ScrollViewDepthEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewDepthEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_DEPTH_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_DEPTH_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 <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-function.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewDepthEffect
- */
-class ScrollViewDepthEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * Constructor
- */
- ScrollViewDepthEffect();
-
-public:
-
- /**
- * @copydoc ScrollViewEffect::ApplyToActor
- */
- void ApplyToActor(Actor child,
- const Vector2& positionExtent,
- const Vector2& offsetExtent,
- float positionScale,
- float scaleExtent);
-
-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 ~ScrollViewDepthEffect();
-
-private:
-
- Vector3 mPageSize; ///< The logical page size for the 3D effect.
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewDepthEffect& GetImpl(Dali::Toolkit::ScrollViewDepthEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<Internal::ScrollViewDepthEffect&>(handle);
-}
-
-inline const Internal::ScrollViewDepthEffect& GetImpl(const Dali::Toolkit::ScrollViewDepthEffect& obj)
-{
- DALI_ASSERT_ALWAYS(obj);
-
- const Dali::RefObject& handle = obj.GetBaseObject();
-
- return static_cast<const Internal::ScrollViewDepthEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
+++ /dev/null
-/*
- * 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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-const float WOBBLEEFFECT_FRICTION_COEFFICIENT = 0.8f; ///< (deacc) - velocity multiplier per unit time (80%)
-const float WOBBLEEFFECT_IMPULSE_DISTANCE_FACTOR = 0.1f; ///< (acc) - move by 10% of distance-delta per unit time
-const float WOBBLEEFFECT_TIME_FACTOR = 30.0f; ///< (T) - 30 times faster (unit time = 1/30th sec)
-const float WOBBLEEFFECT_ANIMATION_MAX_TIME = 60.0f; ///< Animation time (every time finishes, checks if it needs to go again)
-const float WOBBLEEFFECT_STABLE_TIME_THRESHOLD = 0.5f; ///< Must be stable for more than half a second to stop animating.
-const float STABILITY_DELTA_THRESHOLD = Math::MACHINE_EPSILON_10000; ///< When velocity delta is greater than this threshold it is considered in motion.
-
-/**
- * Gets a property index. If the property doesn't already exist, then
- * it will create the property.
- * @param[in] handle The handle that owns or will own the property
- * @param[in] name The name for this property
- * @param[in] propertyValue The initial value for this property
- * @return The property index for this property is returned.
- */
-Property::Index SafeRegisterProperty( Handle& handle, const std::string& name, Property::Value propertyValue )
-{
- Property::Index index = handle.GetPropertyIndex( name );
-
- if(index == Property::INVALID_INDEX)
- {
- index = handle.RegisterProperty( name, propertyValue );
- }
-
- return index;
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * ScrollView WobbleEffect constraint
- * This constraint has a chase position and velocity, that chases
- * a target position (scroll-position + scroll-offset). As it has a
- * velocity. It will eventually pass it's target position, and chase back
- * in the opposite direction. As it has a friction coefficient, it will
- * gradually slow, and reach it's target position (stabilized).
- */
-struct ScrollViewWobbleEffectConstraint
-{
- /**
- * @param[in,out] wobbleEffect Reference to wobbleEffect instance
- */
- ScrollViewWobbleEffectConstraint(ScrollViewWobbleEffect& wobbleEffect)
- : mChase(Vector2::ZERO),
- mVelocity(Vector2::ZERO),
- mTime(0.0f),
- mStabilityTimeCounter(0),
- mStabilized(true),
- mWobbleEffect(wobbleEffect),
- mAnimationCycleId(0)
- {
-
- }
-
- /**
- * @param[in,out] direction The new wobble value
- * @param[in] inputs Contains:
- * The current time since the wobble effect started
- * The scroll-position
- * The scroll-overshoot x & y
- */
- void operator()( Vector3& direction, const PropertyInputContainer& inputs )
- {
- if(mStabilized)
- {
- // check if animation cycle id has changed (if so then this spells
- // the start of a new animation)
- if(mAnimationCycleId != mWobbleEffect.GetAnimationCycleId())
- {
- mStabilized = false;
- }
- }
- else
- {
- // not stable (i.e. wobbling)
- Vector2 offset(inputs[2]->GetFloat(), inputs[3]->GetFloat());
- const Vector2& position = inputs[1]->GetVector2() - offset;
- const float time = inputs[0]->GetFloat();
- const float timePassed = time - mTime;
-
- mTime = time;
-
- if(timePassed>0)
- {
- const Vector2 delta = position - mChase;
-
- // Check to see if wobble has stabilized.
- if( (fabsf(delta.x) < STABILITY_DELTA_THRESHOLD) &&
- (fabsf(mVelocity.x) < STABILITY_DELTA_THRESHOLD) )
- {
- mStabilityTimeCounter+=timePassed;
-
- if(mStabilityTimeCounter > WOBBLEEFFECT_STABLE_TIME_THRESHOLD)
- {
- mStabilityTimeCounter = 0.0f;
- mStabilized = true;
- mWobbleEffect.IncrementStableCount();
- mAnimationCycleId = mWobbleEffect.GetAnimationCycleId();
- }
- }
- else
- {
- mStabilityTimeCounter = 0.0f;
- }
-
- if(!mStabilized)
- {
- float t = timePassed * WOBBLEEFFECT_TIME_FACTOR;
-
- mVelocity *= pow( WOBBLEEFFECT_FRICTION_COEFFICIENT, t );
- mVelocity += delta * 0.1f * t;
- mChase += mVelocity;
- }
- else
- {
- // stabilized, so chase should be exactly on position.
- mChase = position;
- }
- }
-
- direction.x = position.x - mChase.x;
- direction.y = position.y - mChase.y;
- } // end else
- }
-
- Vector2 mChase; ///< Chaser position
- Vector2 mVelocity; ///< Velocity of Chaser
- float mTime; ///< Current time.
- float mStabilityTimeCounter; ///< Time in seconds that stable for.
- bool mStabilized; ///< Stabilized flag.
- ScrollViewWobbleEffect& mWobbleEffect; ///< Reference to Wobble Effect
- unsigned int mAnimationCycleId; ///< Animation Cycle Id
-};
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect()
-: mPropertyTime(Property::INVALID_INDEX),
- mStableCurrent(0),
- mAnimationCycleId(0)
-{
-}
-
-ScrollViewWobbleEffect::~ScrollViewWobbleEffect()
-{
-}
-
-void ScrollViewWobbleEffect::IncrementStableCount()
-{
- mStableCurrent++;
-}
-
-unsigned int ScrollViewWobbleEffect::GetAnimationCycleId() const
-{
- return mAnimationCycleId;
-}
-
-void ScrollViewWobbleEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
- mStableCurrent = 0;
- mAnimationCycleId = 0;
-
- // Create effect-time property if not already created.
- if(mPropertyTime == Property::INVALID_INDEX)
- {
- mPropertyTime = SafeRegisterProperty( scrollView, Toolkit::ScrollViewWobbleEffect::EFFECT_TIME, 0.0f );
- }
-
- // Connect to the scroll view signals
- scrollView.ScrollStartedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollStart);
- scrollView.ScrollUpdatedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollUpdate);
- scrollView.ScrollCompletedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollComplete);
-
- AttachActor(scrollView);
-}
-
-void ScrollViewWobbleEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
- scrollView.ScrollStartedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollStart);
- scrollView.ScrollUpdatedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollUpdate);
- scrollView.ScrollCompletedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollComplete);
-
- if(mAnimation)
- {
- mAnimation.FinishedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
- mAnimation.Clear();
- mAnimation.Reset();
- }
-}
-
-void ScrollViewWobbleEffect::AttachActor(Actor actor)
-{
- // Create effect-overshoot property if not already created.
- Property::Index propertyEffectOvershoot = actor.GetPropertyIndex(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT);
- if(propertyEffectOvershoot == Property::INVALID_INDEX)
- {
- propertyEffectOvershoot = actor.RegisterProperty(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT, Vector3::ZERO);
- }
-
- Actor scrollView = GetScrollView();
-
- Constraint constraint = Constraint::New<Vector3>( actor, propertyEffectOvershoot, ScrollViewWobbleEffectConstraint(*this) );
- constraint.AddSource( Source( scrollView, mPropertyTime ) );
- constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::OVERSHOOT_X ) );
- constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::OVERSHOOT_Y ) );
- constraint.Apply();
-}
-
-void ScrollViewWobbleEffect::DetachActor(Actor actor)
-{
- // TODO: remove the specific constraint defined in AttachActor (and possibly
- // unregister property) - neither functionality exists in Dali.
-}
-
-void ScrollViewWobbleEffect::ContinueAnimation(float endTime)
-{
-
- // continue animating
- if(mAnimation)
- {
- mAnimation.FinishedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
- mAnimation.Clear();
- }
-
- Actor scrollView = GetScrollView();
-
- mAnimation = Animation::New(WOBBLEEFFECT_ANIMATION_MAX_TIME);
- mAnimation.AnimateTo( Property(scrollView, mPropertyTime), endTime, AlphaFunction::LINEAR );
- mAnimation.FinishedSignal().Connect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
- mAnimation.Play();
-
-}
-
-void ScrollViewWobbleEffect::OnScrollStart( const Vector2& position )
-{
- // When animation starts, all constraints all unstable,
- // and we change the animation cycle id.
- mStableCurrent = 0;
- mAnimationCycleId++;
-
- GetScrollView().SetProperty(mPropertyTime, 0.0f);
-
- ContinueAnimation(WOBBLEEFFECT_ANIMATION_MAX_TIME);
-}
-
-void ScrollViewWobbleEffect::OnScrollUpdate( const Vector2& position )
-{
- // nothing to do
-}
-
-void ScrollViewWobbleEffect::OnScrollComplete( const Vector2& position )
-{
- // nothing to do
-}
-
-void ScrollViewWobbleEffect::OnAnimationFinished( Animation& animation )
-{
- if(mStableCurrent!=1)
- {
- // still unstable, so continue animating.
- float endTime = GetScrollView().GetProperty<float>(mPropertyTime) + WOBBLEEFFECT_ANIMATION_MAX_TIME;
- ContinueAnimation(endTime);
- }
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_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 <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-function.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/actors/custom-actor.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewWobbleEffect
- */
-class ScrollViewWobbleEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * Constructor
- */
- ScrollViewWobbleEffect();
-
- /**
- * Increases the Stable Count (when this reaches mStableTotal)
- * Then all constraints are stable, and the animation can stop.
- */
- void IncrementStableCount();
-
- /**
- * Returns animation cycle id. Every time a new animation starts
- * this cycle id is increased.
- *
- * @return The Animation Cycle id is returned.
- */
- unsigned int GetAnimationCycleId() const;
-
-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 ~ScrollViewWobbleEffect();
-
-private:
-
- /**
- * Signal handler, called when the ScrollView starts to move
- *
- * @param[in] position The current scroll position
- */
- void OnScrollStart( const Vector2& position );
-
- /**
- * Signal handler, called when the ScrollView is moving
- *
- * @param[in] position The current scroll position
- */
- void OnScrollUpdate( const Vector2& position );
-
- /**
- * Signal handler, called when the ScrollView has completed movement
- *
- * @param[in] position The current scroll position
- */
- void OnScrollComplete( const Vector2& position );
-
- /**
- * Signal handler, called when the Wobble Effect animation has completed.
- *
- * @param[in] animation The animation.
- */
- void OnAnimationFinished( Animation& animation );
-
- /**
- * Attaches effect to Scroll Actor (ScrollView)
- *
- * Applies the same wobble effect to each Scroll Actor.
- *
- * @param[in] actor The attached Actor
- */
- void AttachActor(Actor actor);
-
- /**
- * Detaches effect from Scroll Actor (ScrollView)
- *
- * @param[in] actor The attached Actor
- */
- void DetachActor(Actor actor);
-
- /**
- * Continues Animation to time reaches endTime
- *
- * @param[in] endTime the target time to reach.
- */
- void ContinueAnimation(float endTime);
-
-private:
-
- Animation mAnimation; ///< Animation Timer to drive the wobble effect constraint.
- Property::Index mPropertyTime; ///< Time property used by wobble effect constraint to calculate timePassed.
-
- int mStableCurrent; ///< Stability current - how many wobble constraints are not wobbling (or have neglible wobble).
- unsigned int mAnimationCycleId; ///< The start of each new animation cycle is a unique number.
-
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-base-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp \
- $(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-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 \
$(toolkit_src_dir)/controls/super-blur-view/super-blur-view-impl.cpp \
+++ /dev/null
-/*
- * 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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const std::string ScrollViewCarouselEffect::EFFECT_ACTIVATE( "ScrollViewCarouselEffect::EFFECT_ACTIVATE" );
-
-ScrollViewCarouselEffect ScrollViewCarouselEffect::New()
-{
- return ScrollViewCarouselEffect(new Internal::ScrollViewCarouselEffect());
-}
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect()
-{
-
-}
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewCarouselEffect ScrollViewCarouselEffect::DownCast( BaseHandle handle )
-{
- return ScrollViewCarouselEffect( dynamic_cast<Internal::ScrollViewCarouselEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewCarouselEffect::ApplyToActor(Actor child, const Vector2& angleSwing)
-{
- GetImpl(*this).ApplyToActor( child, angleSwing );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewCarouselEffect;
-}
-
-/**
- * ScrollView Carousel-Effect.
- *
- * This effect causes Actors to appear to move around around a carousel
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Container
- * |
- * Child (1..n)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to container, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- *
- * Notes:
- * * Assumes Actor's AnchorPoint = AnchorPoint::CENTER
- */
-class DALI_IMPORT_API ScrollViewCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
- static const std::string EFFECT_ACTIVATE; ///< Activation property (a value between: 0.0 normal/no effect, 1.0 - full effect)
-
-public:
-
- /**
- * Create an initialized ScrollViewCarouselEffect.
- * @return A handle to a newly allocated Dali resource.
- */
- static ScrollViewCarouselEffect New();
-
- /**
- * Create an uninitialized ScrollViewCarouselEffect; this can be initialized with ScrollViewCarouselEffect::New()
- * Calling member functions with an uninitialized Toolkit::ScrollViewCarouselEffect is not allowed.
- */
- ScrollViewCarouselEffect();
-
- /**
- * Downcast an Object handle to ScrollViewCarouselEffect. If handle points to a ScrollViewCarouselEffect the
- * downcast produces valid handle. If not the returned handle is left uninitialized.
- * @param[in] handle Handle to an object
- * @return handle to a ScrollViewCarouselEffect or an uninitialized handle
- */
- static ScrollViewCarouselEffect DownCast( BaseHandle handle );
-
- /**
- * Manually apply effect to an Actor.
- * @param[in] child The child Actor 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.
- */
- void ApplyToActor(Actor child, const Vector2& angleSwing);
-
-protected:
-
- /**
- * This constructor is used by Dali New() methods.
- * @param [in] impl A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
+++ /dev/null
-/*
- * 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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewCubeEffect ScrollViewCubeEffect::New()
-{
- return ScrollViewCubeEffect(new Internal::ScrollViewCubeEffect());
-}
-
-ScrollViewCubeEffect::ScrollViewCubeEffect()
-{
-
-}
-
-ScrollViewCubeEffect::ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewCubeEffect ScrollViewCubeEffect::DownCast( BaseHandle handle )
-{
- return ScrollViewCubeEffect( dynamic_cast<Internal::ScrollViewCubeEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing)
-{
- GetImpl(*this).ApplyToActor( child, anchor, angleSwing, positionSwing );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
- Actor parentPage,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing)
-{
- GetImpl(*this).ApplyToActor( child, parentPage, anchor, angleSwing, positionSwing );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_CUBE_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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewCubeEffect;
-}
-
-/**
- * @brief This effect causes Actors to appear to rotate around a 3D cube.
- *
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- * |
- * Child (1..m)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to pages, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewCubeEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * @brief Create an initialized ScrollViewCubeEffect.
- *
- * @return A handle to a newly allocated Dali resource.
- */
- static ScrollViewCubeEffect New();
-
- /**
- * @brief Create an uninitialized ScrollViewCubeEffect; this can be initialized with ScrollViewCubeEffect::New().
- *
- * Calling member functions with an uninitialized Toolkit::ScrollViewCubeEffect is not allowed.
- */
- ScrollViewCubeEffect();
-
- /**
- * @brief Downcast an Object handle to ScrollViewCubeEffect.
- *
- * If handle points to a ScrollViewCubeEffect the downcast produces
- * valid handle. If not the returned handle is left uninitialized.
- *
- * @param[in] handle Handle to an object
- * @return handle to a ScrollViewCubeEffect or an uninitialized handle
- */
- static ScrollViewCubeEffect DownCast( BaseHandle handle );
-
- /**
- * @brief Manually apply effect to an Actor.
- *
- * @param[in] child The child Actor to be affected by this effect.
- * @param[in] anchor The anchor point that the child actor should
- * rotate around when scrolling
- * @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] positionSwing The maximum amount the child actor should
- * move for each axis (X and Y) as the page is scrolled.
- */
- void ApplyToActor(Actor child,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing);
-
- /**
- * @brief Manually apply effect to an Actor.
- *
- * @param[in] child The child Actor to be affected by this effect.
- * @param[in] parentPage The parent page Actor to be used by this effect.
- * @param[in] anchor The anchor point that the child actor should
- * rotate around when scrolling
- * @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] positionSwing The maximum amount the child actor should
- * move for each axis (X and Y) as the page is scrolled.
- */
- void ApplyToActor(Actor child,
- Actor parentPage,
- const Vector3& anchor,
- const Vector2& angleSwing,
- const Vector2& positionSwing);
-
-protected:
-
- /**
- * @brief This constructor is used by Dali New() methods.
- *
- * @param [in] impl A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
+++ /dev/null
-/*
- * 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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewDepthEffect ScrollViewDepthEffect::New()
-{
- return ScrollViewDepthEffect(new Internal::ScrollViewDepthEffect());
-}
-
-ScrollViewDepthEffect::ScrollViewDepthEffect()
-{
-
-}
-
-ScrollViewDepthEffect::ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewDepthEffect ScrollViewDepthEffect::DownCast( BaseHandle handle )
-{
- return ScrollViewDepthEffect( dynamic_cast<Internal::ScrollViewDepthEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewDepthEffect::ApplyToActor(Actor child,
- const Vector2& positionExtent,
- const Vector2& offsetExtent,
- float positionScale,
- float scaleExtent)
-{
- GetImpl(*this).ApplyToActor( child, positionExtent, offsetExtent, positionScale, scaleExtent );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewDepthEffect;
-}
-
-/**
- * ScrollView Depth-Effect.
- *
- * This effect causes Actors to appear to scroll off the page
- * at different speeds.
- *
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- * |
- * Child (1..m)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to pages, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewDepthEffect : public ScrollViewEffect
-{
-
-public:
-
- /**
- * Create an initialized ScrollViewDepthEffect.
- * @return A handle to a newly allocated Dali resource.
- */
- static ScrollViewDepthEffect New();
-
- /**
- * Create an uninitialized ScrollViewDepthEffect; this can be initialized with ScrollViewDepthEffect::New()
- * Calling member functions with an uninitialized Toolkit::ScrollViewDepthEffect is not allowed.
- */
- ScrollViewDepthEffect();
-
- /**
- * Downcast an Object handle to ScrollViewDepthEffect. If handle points to a ScrollViewDepthEffect the
- * downcast produces valid handle. If not the returned handle is left uninitialized.
- * @param[in] handle Handle to an object
- * @return handle to a ScrollViewCubeEffect or an uninitialized handle
- */
- static ScrollViewDepthEffect DownCast( BaseHandle handle );
-
- /**
- * Manually apply effect to an Actor.
- * @param[in] child The child Actor to be affected by this effect.
- * @param[in] positionExtent Controls how much Actor's X and Y
- * position affects their alpha function's exponent value
- * @param[in] offsetExtent exponent offset for X and Y scrolling
- * axes.
- * @param[in] positionScale Changes the amount the page as a whole
- * moves by.
- * @param[in] scaleExtent Scale factor to reach when page is one whole
- * page away from screen.
- */
- void ApplyToActor(Actor child,
- const Vector2& positionExtent,
- const Vector2& offsetExtent,
- float positionScale,
- float scaleExtent);
-
-protected:
-
- /**
- * This constructor is used by Dali New() methods.
- * @param [in] impl A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__
+++ /dev/null
-/*
- * 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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const std::string ScrollViewWobbleEffect::EFFECT_OVERSHOOT( "ScrollViewWobbleEffect::EFFECT_OVERSHOOT" );
-const std::string ScrollViewWobbleEffect::EFFECT_TIME( "ScrollViewWobbleEffect::EFFECT_TIME" );
-
-ScrollViewWobbleEffect ScrollViewWobbleEffect::New()
-{
- return ScrollViewWobbleEffect(new Internal::ScrollViewWobbleEffect());
-}
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect()
-{
-
-}
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect(Internal::ScrollViewWobbleEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewWobbleEffect;
-}
-
-/**
- * ScrollView Wobble-Effect.
- *
- * Using this effect, a %wobble% property is produced which swings
- * towards the origin in accordance to how the user pans the ScrollView.
- */
-class DALI_IMPORT_API ScrollViewWobbleEffect : public ScrollViewEffect
-{
-public:
-
- static const std::string EFFECT_OVERSHOOT;
- static const std::string EFFECT_TIME;
-
-public:
-
- /**
- * Create an initialized ScrollViewWobbleEffect.
- * @return A handle to a newly allocated Dali resource.
- */
- static ScrollViewWobbleEffect New();
-
- /**
- * Create an uninitialized ScrollViewWobbleEffect; this can be initialized with ScrollViewWobbleEffect::New()
- * Calling member functions with an uninitialized Toolkit::ScrollViewWobbleEffect is not allowed.
- */
- ScrollViewWobbleEffect();
-
-protected:
-
- /**
- * This constructor is used by Dali New() methods.
- * @param [in] impl A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL ScrollViewWobbleEffect(Internal::ScrollViewWobbleEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_H__
$(public_api_src_dir)/controls/scrollable/item-view/item-factory.cpp \
$(public_api_src_dir)/controls/scrollable/item-view/item-layout.cpp \
$(public_api_src_dir)/controls/scrollable/item-view/item-view.cpp \
- $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.cpp \
- $(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-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/scrollable.cpp \
$(public_api_src_dir)/controls/shadow-view/shadow-view.cpp \
$(public_api_src_dir)/controls/scroll-bar/scroll-bar.h
public_api_scroll_view_header_files = \
- $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect.h \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.h \
- $(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-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
public_api_slider_header_files = \