From: Kimmo Hoikka Date: Thu, 28 Aug 2014 15:43:03 +0000 (-0700) Subject: Merge changes Ica8d7442,I39b8ad54 into tizen X-Git-Tag: dali_1.0.8~14 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=8cf2d800d92afd5980dd3ad9826f0d9ef65e4350;hp=9dd79332930150da4cf5c991e831684f052fd262 Merge changes Ica8d7442,I39b8ad54 into tizen * changes: (Control) Can connect to gestures through scripting (Builder) Ensure properties are not applied twice --- diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp index 1a3b893..c93d264 100755 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp @@ -541,9 +541,19 @@ void ScrollViewTwistEffect::Apply(Actor child) } } +void ScrollViewTwistEffect::SetMaxSwingAngle(const Vector2& maxSwingAngle) +{ + mMaxSwingAngle = maxSwingAngle; +} + +Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const +{ + return mMaxSwingAngle; +} + void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function) { - if( mDropOffDistance.LengthSquared() > Math::MACHINE_EPSILON_1 && mDropOff.LengthSquared() > Math::MACHINE_EPSILON_1 ) + if( distance.LengthSquared() > Math::MACHINE_EPSILON_1 && dropOff.LengthSquared() > Math::MACHINE_EPSILON_1 ) { mFlags |= FlagDropOff; mDropOff = dropOff; @@ -558,6 +568,13 @@ void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector mFlags = mFlags & ~FlagDefaultDropOff; } +void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const +{ + dropOff = mDropOff; + distance = mDropOffDistance; + function = mDropOffFunction; +} + void ScrollViewTwistEffect::OnAttach(Toolkit::ScrollView& scrollView) { // Create effect-time property if not already created. diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.h b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.h index d98a086..5aca6a0 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.h +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.h @@ -99,13 +99,23 @@ public: /** * @copydoc Toolkit::ScrollViewEffect::SetMaxSwingAngle */ - void SetMaxSwingAngle(const Vector2& maxSwingAngle) { mMaxSwingAngle = maxSwingAngle; } + void SetMaxSwingAngle(const Vector2& maxSwingAngle); + + /** + * @copydoc Toolkit::ScrollViewEffect::GetMaxSwingAngle + */ + Vector2 GetMaxSwingAngle() const; /** * @copydoc Toolkit::ScrollViewEffect::SetSwingDropOff */ void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL); + /** + * @copydoc Toolkit::ScrollViewEffect::GetSwingDropOff + */ + void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const; + public: /** diff --git a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp index 5ad2e57..0472917 100644 --- a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp +++ b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.cpp @@ -85,11 +85,21 @@ void ScrollViewTwistEffect::SetMaxSwingAngle(const Vector2& maxSwingAngle) GetImpl(*this).SetMaxSwingAngle(maxSwingAngle); } +Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const +{ + return GetImpl( *this ).GetMaxSwingAngle(); +} + void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function) { GetImpl(*this).SetSwingDropOff(dropOff, distance, function); } +void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const +{ + GetImpl(*this).GetSwingDropOff(dropOff, distance, function); +} + } // namespace Toolkit } // namespace Dali diff --git a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h index 719fba2..a208fb0 100644 --- a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h +++ b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-twist-effect.h @@ -130,6 +130,13 @@ public: void SetMaxSwingAngle(const Vector2& maxSwingAngle); /** + * @brief Retrieve the maximum swing angle when at zero drop off. + * + * @return The maximum swing angle for x and y axes + */ + Vector2 GetMaxSwingAngle() const; + + /** * @brief Set the drop off values to affect the amount of swing * angle applied to an actor the further it is from the scroll * position. @@ -146,6 +153,15 @@ public: */ void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL); + /** + * @brief Get the drop off values that affect the amount of swing angle that is applied to an actor. + * + * @param[out] dropOff The current drop-off amount. + * @param[out] distance The current distance to apply drop-off in pixels. + * @param[out] function The current alpha function used to affect how the drop iff is applied over the distance. + */ + void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const; + protected: /**