Moved Gesture::State and -::Type to gesture-enumerations.h. 30/243030/1
authorGyörgy Straub <g.straub@partner.samsung.com>
Wed, 2 Sep 2020 13:23:26 +0000 (14:23 +0100)
committerGyörgy Straub <g.straub@partner.samsung.com>
Wed, 2 Sep 2020 13:23:26 +0000 (14:23 +0100)
Change-Id: I5d7f00f98adb1e803eca89b76da8eb3dcb3a1fe2
Signed-off-by: György Straub <g.straub@partner.samsung.com>
13 files changed:
examples/cube-transition-effect/cube-transition-effect-example.cpp
examples/dissolve-effect/dissolve-effect-example.cpp
examples/gestures/gesture-example.cpp
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/image-view-svg/image-view-svg-example.cpp
examples/item-view/item-view-example.cpp
examples/primitive-shapes/primitive-shapes-example.cpp
examples/shadows-and-lights/shadows-and-lights-example.cpp
examples/sparkle/sparkle-effect-example.cpp
examples/text-label/text-label-example.cpp
examples/text-overlap/text-overlap-example.cpp
examples/text-scrolling/text-scrolling-example.cpp
examples/video-view/video-view-example.cpp

index ecf01c1..59a8e0f 100755 (executable)
@@ -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)
index 77cd84b..6e7aaec 100755 (executable)
@@ -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)
index 884c3f9..4bab310 100755 (executable)
@@ -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 );
index 8ffb9a8..9ecf686 100755 (executable)
@@ -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();
     }
index 05eae9a..fa3f1cb 100755 (executable)
@@ -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;
     }
   }
index 237c807..addbfe5 100755 (executable)
@@ -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 );
index 675e076..466abd8 100755 (executable)
@@ -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();
index 157dcbc..1141704 100755 (executable)
@@ -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;
     }
index 08227b4..61b6789 100755 (executable)
@@ -272,7 +272,7 @@ private:
    */
   void OnPan( Actor actor, const PanGesture& gesture )
   {
-    if( gesture.GetState() == Gesture::Finished )
+    if( gesture.GetState() == GestureState::FINISHED )
     {
       switch(mAnimationIndex)
       {
index 8874fcb..e50579d 100755 (executable)
@@ -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 );
index bbd7c0f..a7c64a2 100755 (executable)
@@ -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<NUMBER_OF_LABELS; ++i )
@@ -91,7 +91,7 @@ void TextOverlapController::OnPan( Actor actor, const PanGesture& gesture )
       }
     }
   }
-  else if( mGrabbedActor && state == PanGesture::Continuing )
+  else if( mGrabbedActor && state == GestureState::CONTINUING )
   {
     Vector2 windowSize = mApplication.GetWindow().GetSize();
     Vector3 size = mGrabbedActor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
index c660ef4..9930073 100755 (executable)
@@ -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 );
index 7f56b19..087930b 100755 (executable)
@@ -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 );