From 7bdf3408ec2e54c70da008761538e8ef22f64976 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gy=C3=B6rgy=20Straub?= Date: Wed, 2 Sep 2020 14:23:26 +0100 Subject: [PATCH] Moved Gesture::State and -::Type to gesture-enumerations.h. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I5d7f00f98adb1e803eca89b76da8eb3dcb3a1fe2 Signed-off-by: György Straub --- .../cube-transition-effect-example.cpp | 2 +- examples/dissolve-effect/dissolve-effect-example.cpp | 2 +- examples/gestures/gesture-example.cpp | 20 ++++++++++---------- .../image-scaling-and-filtering-example.cpp | 2 +- examples/image-view-svg/image-view-svg-example.cpp | 14 +++++++------- examples/item-view/item-view-example.cpp | 4 ++-- .../primitive-shapes/primitive-shapes-example.cpp | 8 ++++---- .../shadows-and-lights-example.cpp | 6 +++--- examples/sparkle/sparkle-effect-example.cpp | 2 +- examples/text-label/text-label-example.cpp | 6 +++--- examples/text-overlap/text-overlap-example.cpp | 6 +++--- examples/text-scrolling/text-scrolling-example.cpp | 2 +- examples/video-view/video-view-example.cpp | 8 ++++---- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/examples/cube-transition-effect/cube-transition-effect-example.cpp b/examples/cube-transition-effect/cube-transition-effect-example.cpp index ecf01c1..59a8e0f 100755 --- a/examples/cube-transition-effect/cube-transition-effect-example.cpp +++ b/examples/cube-transition-effect/cube-transition-effect-example.cpp @@ -296,7 +296,7 @@ void CubeTransitionApp::OnPanGesture( Actor actor, const PanGesture& gesture ) return; } - if( gesture.GetState() == Gesture::Continuing ) + if( gesture.GetState() == GestureState::CONTINUING ) { const Vector2& displacement = gesture.GetDisplacement(); if( displacement.x < 0) diff --git a/examples/dissolve-effect/dissolve-effect-example.cpp b/examples/dissolve-effect/dissolve-effect-example.cpp index 77cd84b..6e7aaec 100755 --- a/examples/dissolve-effect/dissolve-effect-example.cpp +++ b/examples/dissolve-effect/dissolve-effect-example.cpp @@ -276,7 +276,7 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture ) return; } - if( gesture.GetState() == Gesture::Continuing ) + if( gesture.GetState() == GestureState::CONTINUING ) { const Vector2& displacement = gesture.GetDisplacement(); if( displacement.x < 0) diff --git a/examples/gestures/gesture-example.cpp b/examples/gestures/gesture-example.cpp index 884c3f9..4bab310 100755 --- a/examples/gestures/gesture-example.cpp +++ b/examples/gestures/gesture-example.cpp @@ -266,7 +266,7 @@ private: */ void OnLongPress( Actor actor, const LongPressGesture& longPress ) { - if( longPress.GetState() == Gesture::Started ) + if( longPress.GetState() == GestureState::STARTED ) { // When we first receive a long press, attach the actor to the pan detector. mPanDetector.Attach( actor ); @@ -305,14 +305,14 @@ private: switch( pan.GetState() ) { - case Gesture::Started: + case GestureState::STARTED: { mPanStarted = true; break; } - case Gesture::Finished: - case Gesture::Cancelled: + case GestureState::FINISHED: + case GestureState::CANCELLED: { // If we cancel or finish the pan, do an animation to indicate this and stop the shake animation. @@ -371,15 +371,15 @@ private: { switch( pinch.GetState() ) { - case Gesture::Started: + case GestureState::STARTED: { // Starting scale is required so that we know what to multiply the pinch.scale by. mStartingScale = actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ); break; } - case Gesture::Finished: - case Gesture::Cancelled: + case GestureState::FINISHED: + case GestureState::CANCELLED: { Vector3 scale( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) ); @@ -419,15 +419,15 @@ private: { switch( rotation.GetState() ) { - case Gesture::Started: + case GestureState::STARTED: { // Starting orientation is required so that we know what to multiply the rotation.rotation by. mStartingOrientation = actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ); break; } - case Gesture::Finished: - case Gesture::Cancelled: + case GestureState::FINISHED: + case GestureState::CANCELLED: { // Do an animation to come back to go back to the original orientation. Animation anim = Animation::New( ROTATE_BACK_ANIMATION_DURATION ); diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp index 8ffb9a8..9ecf686 100755 --- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp +++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp @@ -530,7 +530,7 @@ public: void OnPinch( Actor actor, const PinchGesture& pinch ) { - if( pinch.GetState() == Gesture::Started ) + if( pinch.GetState() == GestureState::STARTED ) { mLastPinchScale = pinch.GetScale(); } diff --git a/examples/image-view-svg/image-view-svg-example.cpp b/examples/image-view-svg/image-view-svg-example.cpp index 05eae9a..fa3f1cb 100755 --- a/examples/image-view-svg/image-view-svg-example.cpp +++ b/examples/image-view-svg/image-view-svg-example.cpp @@ -153,7 +153,7 @@ public: // Callback of pan gesture, for moving the actors void OnPanGesture( Actor actor, const PanGesture& gesture ) { - if( gesture.GetState() == Gesture::Continuing ) + if( gesture.GetState() == GestureState::CONTINUING ) { for( unsigned int i = 0; i < NUM_IMAGES_DISPLAYED; i++ ) { @@ -169,8 +169,8 @@ public: { // Only scale the image when we start or continue pinching - case Gesture::Started: - case Gesture::Continuing: + case GestureState::STARTED: + case GestureState::CONTINUING: { float scale = std::max( gesture.GetScale(), MIN_SCALE / mScale ); scale = std::min( MAX_SCALE / mScale, scale ); @@ -182,7 +182,7 @@ public: break; } - case Gesture::Finished: + case GestureState::FINISHED: { // Resize the image when pinching is complete, this will rasterize the SVG to the new size @@ -197,9 +197,9 @@ public: break; } - case Gesture::Cancelled: - case Gesture::Clear: - case Gesture::Possible: + case GestureState::CANCELLED: + case GestureState::CLEAR: + case GestureState::POSSIBLE: break; } } diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 237c807..addbfe5 100755 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -551,7 +551,7 @@ public: { switch( gesture.GetState() ) { - case Gesture::Started: + case GestureState::STARTED: { const Size& size = mApplication.GetWindow().GetSize(); @@ -563,7 +563,7 @@ public: break; } - case Gesture::Finished: + case GestureState::FINISHED: { Property::Map attributes; mItemView.DoAction( "stopScrolling", attributes ); diff --git a/examples/primitive-shapes/primitive-shapes-example.cpp b/examples/primitive-shapes/primitive-shapes-example.cpp index 675e076..466abd8 100755 --- a/examples/primitive-shapes/primitive-shapes-example.cpp +++ b/examples/primitive-shapes/primitive-shapes-example.cpp @@ -633,14 +633,14 @@ public: { switch( gesture.GetState() ) { - case Gesture::Started: + case GestureState::STARTED: { //Pause animation, as the gesture will be used to manually rotate the model mRotationAnimation.Pause(); break; } - case Gesture::Continuing: + case GestureState::CONTINUING: { //Rotate based off the gesture. const Vector2& displacement = gesture.GetDisplacement(); @@ -653,14 +653,14 @@ public: break; } - case Gesture::Finished: + case GestureState::FINISHED: { //Return to automatic animation mRotationAnimation.Play(); break; } - case Gesture::Cancelled: + case GestureState::CANCELLED: { //Return to automatic animation mRotationAnimation.Play(); diff --git a/examples/shadows-and-lights/shadows-and-lights-example.cpp b/examples/shadows-and-lights/shadows-and-lights-example.cpp index 157dcbc..1141704 100755 --- a/examples/shadows-and-lights/shadows-and-lights-example.cpp +++ b/examples/shadows-and-lights/shadows-and-lights-example.cpp @@ -337,7 +337,7 @@ public: { switch (gesture.GetState()) { - case Gesture::Continuing: + case GestureState::CONTINUING: { const Vector2& displacement = gesture.GetDisplacement(); switch(mPanState) @@ -380,7 +380,7 @@ public: } break; - case Gesture::Finished: + case GestureState::FINISHED: // Start animation at last known speed break; @@ -391,7 +391,7 @@ public: void OnPinch(Actor actor, const PinchGesture& gesture) { - if (gesture.GetState() == Gesture::Started) + if (gesture.GetState() == GestureState::STARTED) { mScaleAtPinchStart = mContents.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x; } diff --git a/examples/sparkle/sparkle-effect-example.cpp b/examples/sparkle/sparkle-effect-example.cpp index 08227b4..61b6789 100755 --- a/examples/sparkle/sparkle-effect-example.cpp +++ b/examples/sparkle/sparkle-effect-example.cpp @@ -272,7 +272,7 @@ private: */ void OnPan( Actor actor, const PanGesture& gesture ) { - if( gesture.GetState() == Gesture::Finished ) + if( gesture.GetState() == GestureState::FINISHED ) { switch(mAnimationIndex) { diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp index 8874fcb..e50579d 100755 --- a/examples/text-label/text-label-example.cpp +++ b/examples/text-label/text-label-example.cpp @@ -572,8 +572,8 @@ public: void OnPan( Actor actor, const PanGesture& gesture ) { // Reset mLayoutSize when the pan starts - Gesture::State state = gesture.GetState(); - if( state == Gesture::Started ) + GestureState state = gesture.GetState(); + if( state == GestureState::STARTED ) { if( mLayoutSize.x < 2.0f ) { @@ -608,7 +608,7 @@ public: mContainer.SetProperty( Actor::Property::SIZE, clampedSize ); } - if( state == Gesture::Cancelled || state == Gesture::Finished ) + if( state == GestureState::CANCELLED || state == GestureState::FINISHED ) { // Resize the text label to match the container size when panning is finished mLabel.SetProperty( Actor::Property::SIZE, mLayoutSize ); diff --git a/examples/text-overlap/text-overlap-example.cpp b/examples/text-overlap/text-overlap-example.cpp index bbd7c0f..a7c64a2 100755 --- a/examples/text-overlap/text-overlap-example.cpp +++ b/examples/text-overlap/text-overlap-example.cpp @@ -75,8 +75,8 @@ void TextOverlapController::Create( Application& app ) void TextOverlapController::OnPan( Actor actor, const PanGesture& gesture ) { - const Gesture::State state = gesture.GetState(); - if( ! mGrabbedActor || state == PanGesture::Started ) + const GestureState state = gesture.GetState(); + if( ! mGrabbedActor || state == GestureState::STARTED ) { const Vector2& gesturePosition = gesture.GetPosition(); for( int i=0; i( Actor::Property::SIZE ); diff --git a/examples/text-scrolling/text-scrolling-example.cpp b/examples/text-scrolling/text-scrolling-example.cpp index c660ef4..9930073 100755 --- a/examples/text-scrolling/text-scrolling-example.cpp +++ b/examples/text-scrolling/text-scrolling-example.cpp @@ -377,7 +377,7 @@ public: void OnPanGesture( Actor actor, const PanGesture& gesture ) { - if( gesture.GetState() == Gesture::Continuing ) + if( gesture.GetState() == GestureState::CONTINUING ) { mTargetActorPosition.y = mTargetActorPosition.y + gesture.GetDisplacement().y; mTargetActorPosition.y = std::min( mTargetActorPosition.y, -mTargetActorSize.height ); diff --git a/examples/video-view/video-view-example.cpp b/examples/video-view/video-view-example.cpp index 7f56b19..087930b 100755 --- a/examples/video-view/video-view-example.cpp +++ b/examples/video-view/video-view-example.cpp @@ -221,7 +221,7 @@ class VideoViewController: public ConnectionTracker void OnPan( Actor actor, const PanGesture& gesture ) { - if( !mIsFullScreen && gesture.GetState() == Gesture::Continuing ) + if( !mIsFullScreen && gesture.GetState() == GestureState::CONTINUING ) { mVideoView.TranslateBy( Vector3( gesture.GetDisplacement() ) ); } @@ -229,13 +229,13 @@ class VideoViewController: public ConnectionTracker void OnPinch( Actor actor, const PinchGesture& gesture ) { - Gesture::State state = gesture.GetState(); - if( state == Gesture::Started ) + GestureState state = gesture.GetState(); + if( state == GestureState::STARTED ) { mPinchStartScale = mScale; } - if( state == Gesture::Finished ) + if( state == GestureState::FINISHED ) { mScale = mPinchStartScale * gesture.GetScale(); mVideoView.SetProperty( Actor::Property::SCALE, mScale ); -- 2.7.4