Change-Id: I1094170d47c8dd6246bf5a32244424c9a3976c3d
Signed-off-by: György Straub <g.straub@partner.samsung.com>
21 files changed:
static DummyControl New();
public:
static DummyControl New();
public:
- inline void EnableGestureDetection(Gesture::Type type) { Internal::Control::EnableGestureDetection(type); }
- inline void DisableGestureDetection(Gesture::Type type) { Internal::Control::DisableGestureDetection(type); }
+ inline void EnableGestureDetection(GestureType::Value type) { Internal::Control::EnableGestureDetection(type); }
+ inline void DisableGestureDetection(GestureType::Value type) { Internal::Control::DisableGestureDetection(type); }
inline PinchGestureDetector GetPinchGestureDetector() const { return Internal::Control::GetPinchGestureDetector(); }
inline PanGestureDetector GetPanGestureDetector() const { return Internal::Control::GetPanGestureDetector(); }
inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
inline PinchGestureDetector GetPinchGestureDetector() const { return Internal::Control::GetPinchGestureDetector(); }
inline PanGestureDetector GetPanGestureDetector() const { return Internal::Control::GetPanGestureDetector(); }
inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Pinch);
+ dummyImpl.EnableGestureDetection(GestureType::PINCH);
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Pan);
+ dummyImpl.EnableGestureDetection(GestureType::PAN);
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Tap);
+ dummyImpl.EnableGestureDetection(GestureType::TAP);
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::LongPress);
+ dummyImpl.EnableGestureDetection(GestureType::LONG_PRESS);
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
}
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
}
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
// Enable when already enabled
// Enable when already enabled
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Pinch);
+ dummyImpl.DisableGestureDetection(GestureType::PINCH);
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Pan);
+ dummyImpl.DisableGestureDetection(GestureType::PAN);
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Tap);
+ dummyImpl.DisableGestureDetection(GestureType::TAP);
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::LongPress);
+ dummyImpl.DisableGestureDetection(GestureType::LONG_PRESS);
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
}
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
}
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION );
application.Render();
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.Render();
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
application.Render();
Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control);
application.Render();
Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control);
- impl.EnableGestureDetection(Gesture::Pinch);
+ impl.EnableGestureDetection(GestureType::PINCH);
// Scale becomes 0.6666666
TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
// Scale becomes 0.6666666
TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
- // Gesture::Finished (Up) events are delivered with previous (Motion) event position
+ // GestureState::FINISHED (Up) events are delivered with previous (Motion) event position
// Use the real previous position; otherwise we may incorrectly get a ZERO velocity
if ( AccessibilityGestureEvent::FINISHED != panEvent.state )
{
// Use the real previous position; otherwise we may incorrectly get a ZERO velocity
if ( AccessibilityGestureEvent::FINISHED != panEvent.state )
{
- // Store the previous position for next Gesture::Finished iteration.
+ // Store the previous position for next GestureState::FINISHED iteration.
mPreviousPosition = panEvent.previousPosition;
}
Actor rootActor = Stage::GetCurrent().GetRootLayer();
mPreviousPosition = panEvent.previousPosition;
}
Actor rootActor = Stage::GetCurrent().GetRootLayer();
- Dali::PanGesture pan = DevelPanGesture::New( static_cast<Dali::Gesture::State>(panEvent.state) );
+ Dali::PanGesture pan = DevelPanGesture::New( static_cast<Dali::GestureState>(panEvent.state) );
DevelPanGesture::SetTime( pan, panEvent.time );
DevelPanGesture::SetNumberOfTouches( pan, panEvent.numberOfTouches );
DevelPanGesture::SetScreenPosition( pan, panEvent.currentPosition );
DevelPanGesture::SetTime( pan, panEvent.time );
DevelPanGesture::SetNumberOfTouches( pan, panEvent.numberOfTouches );
DevelPanGesture::SetScreenPosition( pan, panEvent.currentPosition );
FocusIDPair mCurrentFocusActor; ///< The focus order and actor ID of current focused actor
Actor mCurrentGesturedActor; ///< The actor that will handle the gesture
Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the focusable actors for highlight
FocusIDPair mCurrentFocusActor; ///< The focus order and actor ID of current focused actor
Actor mCurrentGesturedActor; ///< The actor that will handle the gesture
Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the focusable actors for highlight
- Vector2 mPreviousPosition; ///< The previous pan position; useful for calculating velocity for Gesture::Finished events
+ Vector2 mPreviousPosition; ///< The previous pan position; useful for calculating velocity for GestureState::FINISHED events
unsigned int mRecursiveFocusMoveCounter; ///< The counter to count the number of recursive focus movement attempted before the focus movement is successful.
std::string mFocusSoundFilePath; ///< The path of the focus sound file
std::string mFocusChainEndSoundFilePath; ///< The path of the focus chain end sound file
unsigned int mRecursiveFocusMoveCounter; ///< The counter to count the number of recursive focus movement attempted before the focus movement is successful.
std::string mFocusSoundFilePath; ///< The path of the focus sound file
std::string mFocusChainEndSoundFilePath; ///< The path of the focus chain end sound file
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
{
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Tap );
+ controlImpl.EnableGestureDetection( GestureType::TAP );
controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
{
controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Pan );
+ controlImpl.EnableGestureDetection( GestureType::PAN );
controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
{
controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Pinch );
+ controlImpl.EnableGestureDetection( GestureType::PINCH );
controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
{
controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
{
- controlImpl.EnableGestureDetection( Gesture::LongPress );
+ controlImpl.EnableGestureDetection( GestureType::LONG_PRESS );
controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
}
}
controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
}
}
mPages[0].actor.SetProperty( Actor::Property::VISIBLE,true);
// enable the pan gesture which is attached to the control
mPages[0].actor.SetProperty( Actor::Property::VISIBLE,true);
// enable the pan gesture which is attached to the control
- EnableGestureDetection(Gesture::Type(Gesture::Pan));
+ EnableGestureDetection(GestureType::Value(GestureType::PAN));
}
Shader PageTurnView::CreateShader( const Property::Map& shaderMap )
}
Shader PageTurnView::CreateShader( const Property::Map& shaderMap )
// the pan gesture is attached to control itself instead of each page
switch( gesture.GetState() )
{
// the pan gesture is attached to control itself instead of each page
switch( gesture.GetState() )
{
+ case GestureState::STARTED:
{
// check whether the undergoing turning page number already reaches the maximum allowed
if( mPageUpdated && mAnimatingCount< MAXIMUM_TURNING_NUM && mSlidingCount < 1 )
{
// check whether the undergoing turning page number already reaches the maximum allowed
if( mPageUpdated && mAnimatingCount< MAXIMUM_TURNING_NUM && mSlidingCount < 1 )
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
PanContinuing( SetPanPosition( gesture.GetPosition() ) ); // pass in the pan position in the local page coordinate
break;
}
{
PanContinuing( SetPanPosition( gesture.GetPosition() ) ); // pass in the pan position in the local page coordinate
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled:
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED:
{
PanFinished( SetPanPosition( gesture.GetPosition() ), gesture.GetSpeed() );
break;
}
{
PanFinished( SetPanPosition( gesture.GetPosition() ), gesture.GetSpeed() );
break;
}
- case Gesture::Clear:
- case Gesture::Possible:
+ case GestureState::CLEAR:
+ case GestureState::POSSIBLE:
mIndicatorFirstShow = true;
Self().Add( mIndicator );
mIndicatorFirstShow = true;
Self().Add( mIndicator );
- EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
+ EnableGestureDetection( GestureType::Value( GestureType::PAN ) );
PanGestureDetector detector( GetPanGestureDetector() );
detector.DetachAll();
PanGestureDetector detector( GetPanGestureDetector() );
detector.DetachAll();
switch(gesture.GetState())
{
switch(gesture.GetState())
{
- case Dali::Gesture::Started:
+ case Dali::GestureState::STARTED:
{
if( !mPanProcessTimer )
{
{
if( !mPanProcessTimer )
{
- case Dali::Gesture::Continuing:
+ case Dali::GestureState::CONTINUING:
{
mGestureDisplacement += gesture.GetDisplacement();
{
mGestureDisplacement += gesture.GetDisplacement();
mScrollDistance(0.0f),
mScrollSpeed(0.0f),
mScrollOvershoot(0.0f),
mScrollDistance(0.0f),
mScrollSpeed(0.0f),
mScrollOvershoot(0.0f),
- mGestureState(Gesture::Clear),
+ mGestureState(GestureState::CLEAR),
mAnimatingOvershootOn(false),
mAnimateOvershootOff(false),
mAnchoringEnabled(false),
mAnimatingOvershootOn(false),
mAnimateOvershootOff(false),
mAnchoringEnabled(false),
mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
self.TouchedSignal().Connect( this, &ItemView::OnTouch );
mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
self.TouchedSignal().Connect( this, &ItemView::OnTouch );
- EnableGestureDetection(Gesture::Type(Gesture::Pan));
+ EnableGestureDetection(GestureType::Value(GestureType::PAN));
mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
mWheelEventFinishedTimer.TickSignal().Connect( this, &ItemView::OnWheelEventFinished );
mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
mWheelEventFinishedTimer.TickSignal().Connect( this, &ItemView::OnWheelEventFinished );
if ( touch.GetState( 0 ) == PointState::DOWN )
{
// Cancel ongoing scrolling etc.
if ( touch.GetState( 0 ) == PointState::DOWN )
{
// Cancel ongoing scrolling etc.
- mGestureState = Gesture::Clear;
+ mGestureState = GestureState::CLEAR;
mScrollDistance = 0.0f;
mScrollSpeed = 0.0f;
mScrollDistance = 0.0f;
mScrollSpeed = 0.0f;
// Short-circuit if there is no active layout
if (!mActiveLayout)
{
// Short-circuit if there is no active layout
if (!mActiveLayout)
{
- mGestureState = Gesture::Clear;
+ mGestureState = GestureState::CLEAR;
- case Gesture::Finished:
+ case GestureState::FINISHED:
{
// Swipe Detection
if (fabsf(mScrollDistance) > mMinimumSwipeDistance &&
{
// Swipe Detection
if (fabsf(mScrollDistance) > mMinimumSwipeDistance &&
- case Gesture::Started: // Fall through
+ case GestureState::STARTED: // Fall through
{
mTotalPanDisplacement = Vector2::ZERO;
mScrollStartedSignal.Emit(GetCurrentScrollPosition());
mRefreshEnabled = true;
}
{
mTotalPanDisplacement = Vector2::ZERO;
mScrollStartedSignal.Emit(GetCurrentScrollPosition());
mRefreshEnabled = true;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
const Vector2& displacement = gesture.GetDisplacement();
mScrollDistance = CalculateScrollDistance(displacement, *mActiveLayout);
{
const Vector2& displacement = gesture.GetDisplacement();
mScrollDistance = CalculateScrollDistance(displacement, *mActiveLayout);
- case Gesture::Cancelled:
+ case GestureState::CANCELLED:
{
mScrollAnimation = DoAnchoring();
}
{
mScrollAnimation = DoAnchoring();
}
float mScrollSpeed;
float mScrollOvershoot;
float mScrollSpeed;
float mScrollOvershoot;
- Dali::Gesture::State mGestureState : 4;
+ GestureState mGestureState : 8;
bool mAnimatingOvershootOn : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnimateOvershootOff : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnchoringEnabled : 1;
bool mAnimatingOvershootOn : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnimateOvershootOff : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnchoringEnabled : 1;
mGestureStackDepth = 0;
self.TouchedSignal().Connect( this, &ScrollView::OnTouch );
mGestureStackDepth = 0;
self.TouchedSignal().Connect( this, &ScrollView::OnTouch );
- EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
+ EnableGestureDetection( GestureType::Value( GestureType::PAN ) );
// By default we'll allow the user to freely drag the scroll view,
// while disabling the other rulers.
// By default we'll allow the user to freely drag the scroll view,
// while disabling the other rulers.
// while the scroll view is panning, the state needs to be reset.
if ( mPanning )
{
// while the scroll view is panning, the state needs to be reset.
if ( mPanning )
{
- PanGesture cancelGesture = DevelPanGesture::New( Gesture::Cancelled );
+ PanGesture cancelGesture = DevelPanGesture::New( GestureState::CANCELLED );
OnPan( cancelGesture );
}
OnPan( cancelGesture );
}
mPanDelta.y+= panDelta.y;
// Save the velocity, there is a bug in PanGesture
mPanDelta.y+= panDelta.y;
// Save the velocity, there is a bug in PanGesture
- // Whereby the Gesture::Finished's velocity is either:
+ // Whereby the GestureState::FINISHED's velocity is either:
// NaN (due to time delta of zero between the last two events)
// or 0 (due to position being the same between the last two events)
// NaN (due to time delta of zero between the last two events)
// or 0 (due to position being the same between the last two events)
}
// TODO: Upgrade to use a more powerful gesture detector (one that supports multiple touches on pan - so works as pan and flick gesture)
}
// TODO: Upgrade to use a more powerful gesture detector (one that supports multiple touches on pan - so works as pan and flick gesture)
-// BUG: Gesture::Finished doesn't always return velocity on release (due to
+// BUG: GestureState::FINISHED doesn't always return velocity on release (due to
// timeDelta between last two events being 0 sometimes, or posiiton being the same)
void ScrollView::OnPan( const PanGesture& gesture )
{
// timeDelta between last two events being 0 sometimes, or posiiton being the same)
void ScrollView::OnPan( const PanGesture& gesture )
{
// translate Gesture input to get useful data...
switch(gesture.GetState())
{
// translate Gesture input to get useful data...
switch(gesture.GetState())
{
+ case GestureState::STARTED:
{
DALI_LOG_SCROLL_STATE("[0x%X] Pan Started", this);
const Vector2& position = gesture.GetPosition();
{
DALI_LOG_SCROLL_STATE("[0x%X] Pan Started", this);
const Vector2& position = gesture.GetPosition();
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
- case Gesture::Finished:
- case Gesture::Cancelled:
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED:
- DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.GetState() == Gesture::Finished ) ? "Finished" : "Cancelled" ) );
+ DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.GetState() == GestureState::FINISHED ) ? "Finished" : "Cancelled" ) );
UpdateLocalScrollProperties();
mLastVelocity = gesture.GetVelocity();
UpdateLocalScrollProperties();
mLastVelocity = gesture.GetVelocity();
- case Gesture::Possible:
- case Gesture::Clear:
+ case GestureState::POSSIBLE:
+ case GestureState::CLEAR:
{
// Nothing to do, not needed.
break;
{
// Nothing to do, not needed.
break;
OnGestureEx(gesture.GetState());
}
OnGestureEx(gesture.GetState());
}
-void ScrollView::OnGestureEx(Gesture::State state)
+void ScrollView::OnGestureEx(GestureState state)
{
// call necessary signals for application developer
{
// call necessary signals for application developer
- if(state == Gesture::Started)
+ if(state == GestureState::STARTED)
{
Vector2 currentScrollPosition = GetCurrentScrollPosition();
Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
{
Vector2 currentScrollPosition = GetCurrentScrollPosition();
Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollStartedSignal.Emit( currentScrollPosition );
}
DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollStartedSignal.Emit( currentScrollPosition );
}
- else if( (state == Gesture::Finished) ||
- (state == Gesture::Cancelled) ) // Finished/default
+ else if( (state == GestureState::FINISHED) ||
+ (state == GestureState::CANCELLED) ) // Finished/default
{
// when all the gestures have finished, we finish the transform.
// so if a user decides to pan (1 gesture), and then pan+zoom (2 gestures)
{
// when all the gestures have finished, we finish the transform.
// so if a user decides to pan (1 gesture), and then pan+zoom (2 gestures)
*
* @param[in] gesture The gesture event.
*/
*
* @param[in] gesture The gesture event.
*/
- void OnGestureEx(Gesture::State state);
+ void OnGestureEx(GestureState state);
/**
* Performs snapping while taking into account Velocity of gesture
/**
* Performs snapping while taking into account Velocity of gesture
{
switch( gesture.GetState() )
{
{
switch( gesture.GetState() )
{
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
if( mState == PRESSED )
{
{
if( mState == PRESSED )
{
- case Gesture::Finished:
+ case GestureState::FINISHED:
{
if( mState == PRESSED )
{
{
if( mState == PRESSED )
{
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
- EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
+ EnableGestureDetection( static_cast<GestureType::Value>( GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
self.TouchedSignal().Connect( this, &TextEditor::OnTouched );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
self.TouchedSignal().Connect( this, &TextEditor::OnTouched );
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
- EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
+ EnableGestureDetection( static_cast<GestureType::Value>( GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
self.TouchedSignal().Connect( this, &TextField::OnTouched );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
self.TouchedSignal().Connect( this, &TextField::OnTouched );
{
Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
{
Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
- Gesture::State state = gesture.GetState();
+ GestureState state = gesture.GetState();
- if(state == Gesture::Started)
+ if(state == GestureState::STARTED)
{
mDragLocalPosition = gesture.GetPosition();
mPointDown = true;
{
mDragLocalPosition = gesture.GetPosition();
mPointDown = true;
SetPosition(gesture.GetScreenPosition());
EmitStartedSignal(control);
}
SetPosition(gesture.GetScreenPosition());
EmitStartedSignal(control);
}
- if(state == Gesture::Continuing)
+ if(state == GestureState::CONTINUING)
{
Vector2 screenPosition = gesture.GetScreenPosition();
control.GetParent().ScreenToLocal(mLocalPosition.x, mLocalPosition.y, screenPosition.x, screenPosition.y);
mShadowControl.SetProperty( Actor::Property::POSITION, Vector2(mLocalPosition.x - mDragLocalPosition.x, mLocalPosition.y - mDragLocalPosition.y));
}
{
Vector2 screenPosition = gesture.GetScreenPosition();
control.GetParent().ScreenToLocal(mLocalPosition.x, mLocalPosition.y, screenPosition.x, screenPosition.y);
mShadowControl.SetProperty( Actor::Property::POSITION, Vector2(mLocalPosition.x - mDragLocalPosition.x, mLocalPosition.y - mDragLocalPosition.y));
}
- if(state == Gesture::Finished)
+ if(state == GestureState::FINISHED)
{
mDragControl.GetParent().Remove(mShadowControl);
EmitEndedSignal(control);
{
mDragControl.GetParent().Remove(mShadowControl);
EmitEndedSignal(control);
void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
{
void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
{
- Gesture::State state = gesture.GetState();
- if( Gesture::Started == state )
+ GestureState state = gesture.GetState();
+ if( GestureState::STARTED == state )
{
handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
{
handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlippedOnTouch ? handle.lineHeight : 0.f );
const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlippedOnTouch ? handle.lineHeight : 0.f );
- if( ( Gesture::Started == state ) ||
- ( Gesture::Continuing == state ) )
+ if( ( GestureState::STARTED == state ) ||
+ ( GestureState::CONTINUING == state ) )
{
Vector2 targetSize;
mController.GetTargetSize( targetSize );
{
Vector2 targetSize;
mController.GetTargetSize( targetSize );
mIsHandlePanning = true;
}
mIsHandlePanning = true;
}
- else if( ( Gesture::Finished == state ) ||
- ( Gesture::Cancelled == state ) )
+ else if( ( GestureState::FINISHED == state ) ||
+ ( GestureState::CANCELLED == state ) )
{
if( mScrollTimer &&
( mScrollTimer.IsRunning() || mNotifyEndOfScroll ) )
{
if( mScrollTimer &&
( mScrollTimer.IsRunning() || mNotifyEndOfScroll ) )
- const int state = event.p1.mInt;
-
+ const GestureState state = static_cast<GestureState>( event.p1.mInt );
+ case GestureState::STARTED:
{
// Will remove the cursor, handles or text's popup, ...
ChangeState( EventData::TEXT_PANNING );
break;
}
{
// Will remove the cursor, handles or text's popup, ...
ChangeState( EventData::TEXT_PANNING );
break;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
const Vector2& layoutSize = mModel->mVisualModel->GetLayoutSize();
const Vector2 currentScroll = mModel->mScrollPosition;
{
const Vector2& layoutSize = mModel->mVisualModel->GetLayoutSize();
const Vector2 currentScroll = mModel->mScrollPosition;
mEventData->mDecorator->UpdatePositions( mModel->mScrollPosition - currentScroll );
break;
}
mEventData->mDecorator->UpdatePositions( mModel->mScrollPosition - currentScroll );
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled: // FALLTHROUGH
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED: // FALLTHROUGH
{
// Will go back to the previous state to show the cursor, handles, the text's popup, ...
ChangeState( mEventData->mPreviousState );
{
// Will go back to the previous state to show the cursor, handles, the text's popup, ...
ChangeState( mEventData->mPreviousState );
mImpl->ResetInputMethodContext();
}
mImpl->ResetInputMethodContext();
}
-void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
+void Controller::PanEvent( GestureState state, const Vector2& displacement )
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected PanEvent" );
if( NULL != mImpl->mEventData )
{
Event event( Event::PAN_EVENT );
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected PanEvent" );
if( NULL != mImpl->mEventData )
{
Event event( Event::PAN_EVENT );
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = displacement.x;
event.p3.mFloat = displacement.y;
mImpl->mEventData->mEventQueue.push_back( event );
event.p2.mFloat = displacement.x;
event.p3.mFloat = displacement.y;
mImpl->mEventData->mEventQueue.push_back( event );
-void Controller::LongPressEvent( Gesture::State state, float x, float y )
+void Controller::LongPressEvent( GestureState state, float x, float y )
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected LongPressEvent" );
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected LongPressEvent" );
- if( ( state == Gesture::Started ) &&
+ if( ( state == GestureState::STARTED ) &&
( NULL != mImpl->mEventData ) )
{
// The 1st long-press on inactive text-field is treated as tap
( NULL != mImpl->mEventData ) )
{
// The 1st long-press on inactive text-field is treated as tap
else if( !mImpl->IsShowingRealText() )
{
Event event( Event::LONG_PRESS_EVENT );
else if( !mImpl->IsShowingRealText() )
{
Event event( Event::LONG_PRESS_EVENT );
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
mImpl->ResetInputMethodContext();
Event event( Event::LONG_PRESS_EVENT );
mImpl->ResetInputMethodContext();
Event event( Event::LONG_PRESS_EVENT );
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
* @param[in] state The state of the gesture.
* @param[in] displacement This distance panned since the last pan gesture.
*/
* @param[in] state The state of the gesture.
* @param[in] displacement This distance panned since the last pan gesture.
*/
- void PanEvent( Gesture::State state, const Vector2& displacement );
+ void PanEvent( GestureState state, const Vector2& displacement );
/**
* @brief Called by editable UI controls when a long press gesture occurs.
/**
* @brief Called by editable UI controls when a long press gesture occurs.
* @param[in] x The x position relative to the top-left of the parent control.
* @param[in] y The y position relative to the top-left of the parent control.
*/
* @param[in] x The x position relative to the top-left of the parent control.
* @param[in] y The y position relative to the top-left of the parent control.
*/
- void LongPressEvent( Gesture::State state, float x, float y );
+ void LongPressEvent( GestureState state, float x, float y );
/**
* @brief Creates a selection event.
/**
* @brief Creates a selection event.
-void Control::EnableGestureDetection(Gesture::Type type)
+void Control::EnableGestureDetection(GestureType::Value type)
- if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
+ if ( (type & GestureType::PINCH) && !mImpl->mPinchGestureDetector )
{
mImpl->mPinchGestureDetector = PinchGestureDetector::New();
mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
mImpl->mPinchGestureDetector.Attach(Self());
}
{
mImpl->mPinchGestureDetector = PinchGestureDetector::New();
mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
mImpl->mPinchGestureDetector.Attach(Self());
}
- if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
+ if ( (type & GestureType::PAN) && !mImpl->mPanGestureDetector )
{
mImpl->mPanGestureDetector = PanGestureDetector::New();
mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
mImpl->mPanGestureDetector.Attach(Self());
}
{
mImpl->mPanGestureDetector = PanGestureDetector::New();
mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
mImpl->mPanGestureDetector.Attach(Self());
}
- if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
+ if ( (type & GestureType::TAP) && !mImpl->mTapGestureDetector )
{
mImpl->mTapGestureDetector = TapGestureDetector::New();
mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
mImpl->mTapGestureDetector.Attach(Self());
}
{
mImpl->mTapGestureDetector = TapGestureDetector::New();
mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
mImpl->mTapGestureDetector.Attach(Self());
}
- if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
+ if ( (type & GestureType::LONG_PRESS) && !mImpl->mLongPressGestureDetector )
{
mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
{
mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
-void Control::DisableGestureDetection(Gesture::Type type)
+void Control::DisableGestureDetection(GestureType::Value type)
- if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
+ if ( (type & GestureType::PINCH) && mImpl->mPinchGestureDetector )
{
mImpl->mPinchGestureDetector.Detach(Self());
mImpl->mPinchGestureDetector.Reset();
}
{
mImpl->mPinchGestureDetector.Detach(Self());
mImpl->mPinchGestureDetector.Reset();
}
- if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
+ if ( (type & GestureType::PAN) && mImpl->mPanGestureDetector )
{
mImpl->mPanGestureDetector.Detach(Self());
mImpl->mPanGestureDetector.Reset();
}
{
mImpl->mPanGestureDetector.Detach(Self());
mImpl->mPanGestureDetector.Reset();
}
- if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
+ if ( (type & GestureType::TAP) && mImpl->mTapGestureDetector )
{
mImpl->mTapGestureDetector.Detach(Self());
mImpl->mTapGestureDetector.Reset();
}
{
mImpl->mTapGestureDetector.Detach(Self());
mImpl->mTapGestureDetector.Reset();
}
- if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
+ if ( (type & GestureType::LONG_PRESS) && mImpl->mLongPressGestureDetector)
{
mImpl->mLongPressGestureDetector.Detach(Self());
mImpl->mLongPressGestureDetector.Reset();
{
mImpl->mLongPressGestureDetector.Detach(Self());
mImpl->mLongPressGestureDetector.Reset();
mImpl->mStartingPinchScale = new Vector3;
}
mImpl->mStartingPinchScale = new Vector3;
}
- if( pinch.GetState() == Gesture::Started )
+ if( pinch.GetState() == GestureState::STARTED )
{
*( mImpl->mStartingPinchScale ) = Self().GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
}
{
*( mImpl->mStartingPinchScale ) = Self().GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
}
*
* Gesture detection can be enabled one at a time or in bitwise format as shown:
* @code
*
* Gesture detection can be enabled one at a time or in bitwise format as shown:
* @code
- * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
+ * EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::TAP | GestureType::PAN));
* @endcode
* @SINCE_1_0.0
* @param[in] type The gesture type(s) to enable
*/
* @endcode
* @SINCE_1_0.0
* @param[in] type The gesture type(s) to enable
*/
- void EnableGestureDetection( Gesture::Type type );
+ void EnableGestureDetection( GestureType::Value type );
/**
* @brief Allows deriving classes to disable any of the gesture detectors.
/**
* @brief Allows deriving classes to disable any of the gesture detectors.
* @param[in] type The gesture type(s) to disable
* @see EnableGetureDetection
*/
* @param[in] type The gesture type(s) to disable
* @see EnableGetureDetection
*/
- void DisableGestureDetection( Gesture::Type type );
+ void DisableGestureDetection( GestureType::Value type );
/**
* @brief If deriving classes wish to fine tune pinch gesture
/**
* @brief If deriving classes wish to fine tune pinch gesture