X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-carousel-effect-impl.cpp;h=ea529ff8415cac4f44fb7ad724420b5bd6296875;hp=ea5c6ebcb83ae0a50e681d01cf381ddc5318d988;hb=6b7d48695715c6f2292338fccbeeb02873d1f89d;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp index ea5c6eb..ea529ff 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp @@ -1,22 +1,27 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // EXTERNAL INCLUDES #include +#include +#include +#include +// INTERNAL INCLUDES #include #include @@ -62,7 +67,7 @@ Property::Index SafeRegisterProperty( Handle& handle, const std::string& name, P * move the Actor's edge visually away from the neighboring actor, as they rotate * around their default anchor point. */ -class ScrollCarouselEffectInfo : public Dali::RefObject +class ScrollCarouselEffectInfo { public: @@ -211,8 +216,6 @@ public: Vector2 mVisibilityThreshold; ///< Threshold for when to to switch off visibility of Actor (for performance) }; -typedef IntrusivePtr ScrollCarouselEffectInfoPtr; - /** * Helper: Applies the 3D scroll carousel constraints to the child actor * @@ -222,38 +225,38 @@ typedef IntrusivePtr ScrollCarouselEffectInfoPtr; */ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView, Actor child, - ScrollCarouselEffectInfoPtr info) + ScrollCarouselEffectInfo& info) { // Apply constraints to this actor // Constraint constraint; - constraint = Constraint::New( Actor::VISIBLE, - LocalSource( Actor::POSITION ), - LocalSource( Actor::SCALE ), - LocalSource( Actor::SIZE ), + constraint = Constraint::New( Actor::Property::VISIBLE, + LocalSource( Actor::Property::POSITION ), + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::SIZE ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::ROTATION, - LocalSource( Actor::POSITION ), - LocalSource( Actor::SCALE ), - LocalSource( Actor::SIZE ), + constraint = Constraint::New( Actor::Property::ORIENTATION, + LocalSource( Actor::Property::POSITION ), + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::SIZE ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) ); constraint.SetRemoveAction( Constraint::Discard ); child.ApplyConstraint( constraint ); - constraint = Constraint::New( Actor::POSITION, - LocalSource( Actor::SCALE ), - LocalSource( Actor::SIZE ), + constraint = Constraint::New( Actor::Property::POSITION, + LocalSource( Actor::Property::SCALE ), + LocalSource( Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), - Source(scrollView, Actor::SIZE ), + Source(scrollView, Actor::Property::SIZE ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ), boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) ); @@ -283,7 +286,7 @@ ScrollViewCarouselEffect::~ScrollViewCarouselEffect() void ScrollViewCarouselEffect::ApplyToActor(Actor child, const Vector2& angleSwing) { - ScrollCarouselEffectInfoPtr info(new ScrollCarouselEffectInfo(angleSwing)); + ScrollCarouselEffectInfo info( angleSwing ); ApplyScrollCarouselConstraints( GetScrollView(), child, info ); }