Commit 346c047a487db6b75118680e39ce249a6cdaa8db
Committed by
Gerrit Code Review
Merge "Moved Gesture::State and -::Type to gesture-enumerations.h." into devel/master
Showing
13 changed files
with
41 additions
and
41 deletions
examples/cube-transition-effect/cube-transition-effect-example.cpp
| ... | ... | @@ -296,7 +296,7 @@ void CubeTransitionApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 296 | 296 | return; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | - if( gesture.GetState() == Gesture::Continuing ) | |
| 299 | + if( gesture.GetState() == GestureState::CONTINUING ) | |
| 300 | 300 | { |
| 301 | 301 | const Vector2& displacement = gesture.GetDisplacement(); |
| 302 | 302 | if( displacement.x < 0) | ... | ... |
examples/dissolve-effect/dissolve-effect-example.cpp
| ... | ... | @@ -276,7 +276,7 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 276 | 276 | return; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - if( gesture.GetState() == Gesture::Continuing ) | |
| 279 | + if( gesture.GetState() == GestureState::CONTINUING ) | |
| 280 | 280 | { |
| 281 | 281 | const Vector2& displacement = gesture.GetDisplacement(); |
| 282 | 282 | if( displacement.x < 0) | ... | ... |
examples/gestures/gesture-example.cpp
| ... | ... | @@ -266,7 +266,7 @@ private: |
| 266 | 266 | */ |
| 267 | 267 | void OnLongPress( Actor actor, const LongPressGesture& longPress ) |
| 268 | 268 | { |
| 269 | - if( longPress.GetState() == Gesture::Started ) | |
| 269 | + if( longPress.GetState() == GestureState::STARTED ) | |
| 270 | 270 | { |
| 271 | 271 | // When we first receive a long press, attach the actor to the pan detector. |
| 272 | 272 | mPanDetector.Attach( actor ); |
| ... | ... | @@ -305,14 +305,14 @@ private: |
| 305 | 305 | |
| 306 | 306 | switch( pan.GetState() ) |
| 307 | 307 | { |
| 308 | - case Gesture::Started: | |
| 308 | + case GestureState::STARTED: | |
| 309 | 309 | { |
| 310 | 310 | mPanStarted = true; |
| 311 | 311 | break; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - case Gesture::Finished: | |
| 315 | - case Gesture::Cancelled: | |
| 314 | + case GestureState::FINISHED: | |
| 315 | + case GestureState::CANCELLED: | |
| 316 | 316 | { |
| 317 | 317 | // If we cancel or finish the pan, do an animation to indicate this and stop the shake animation. |
| 318 | 318 | |
| ... | ... | @@ -371,15 +371,15 @@ private: |
| 371 | 371 | { |
| 372 | 372 | switch( pinch.GetState() ) |
| 373 | 373 | { |
| 374 | - case Gesture::Started: | |
| 374 | + case GestureState::STARTED: | |
| 375 | 375 | { |
| 376 | 376 | // Starting scale is required so that we know what to multiply the pinch.scale by. |
| 377 | 377 | mStartingScale = actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ); |
| 378 | 378 | break; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - case Gesture::Finished: | |
| 382 | - case Gesture::Cancelled: | |
| 381 | + case GestureState::FINISHED: | |
| 382 | + case GestureState::CANCELLED: | |
| 383 | 383 | { |
| 384 | 384 | Vector3 scale( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) ); |
| 385 | 385 | |
| ... | ... | @@ -419,15 +419,15 @@ private: |
| 419 | 419 | { |
| 420 | 420 | switch( rotation.GetState() ) |
| 421 | 421 | { |
| 422 | - case Gesture::Started: | |
| 422 | + case GestureState::STARTED: | |
| 423 | 423 | { |
| 424 | 424 | // Starting orientation is required so that we know what to multiply the rotation.rotation by. |
| 425 | 425 | mStartingOrientation = actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ); |
| 426 | 426 | break; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | - case Gesture::Finished: | |
| 430 | - case Gesture::Cancelled: | |
| 429 | + case GestureState::FINISHED: | |
| 430 | + case GestureState::CANCELLED: | |
| 431 | 431 | { |
| 432 | 432 | // Do an animation to come back to go back to the original orientation. |
| 433 | 433 | Animation anim = Animation::New( ROTATE_BACK_ANIMATION_DURATION ); | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/image-view-svg/image-view-svg-example.cpp
| ... | ... | @@ -153,7 +153,7 @@ public: |
| 153 | 153 | // Callback of pan gesture, for moving the actors |
| 154 | 154 | void OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 155 | 155 | { |
| 156 | - if( gesture.GetState() == Gesture::Continuing ) | |
| 156 | + if( gesture.GetState() == GestureState::CONTINUING ) | |
| 157 | 157 | { |
| 158 | 158 | for( unsigned int i = 0; i < NUM_IMAGES_DISPLAYED; i++ ) |
| 159 | 159 | { |
| ... | ... | @@ -169,8 +169,8 @@ public: |
| 169 | 169 | { |
| 170 | 170 | // Only scale the image when we start or continue pinching |
| 171 | 171 | |
| 172 | - case Gesture::Started: | |
| 173 | - case Gesture::Continuing: | |
| 172 | + case GestureState::STARTED: | |
| 173 | + case GestureState::CONTINUING: | |
| 174 | 174 | { |
| 175 | 175 | float scale = std::max( gesture.GetScale(), MIN_SCALE / mScale ); |
| 176 | 176 | scale = std::min( MAX_SCALE / mScale, scale ); |
| ... | ... | @@ -182,7 +182,7 @@ public: |
| 182 | 182 | break; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - case Gesture::Finished: | |
| 185 | + case GestureState::FINISHED: | |
| 186 | 186 | { |
| 187 | 187 | // Resize the image when pinching is complete, this will rasterize the SVG to the new size |
| 188 | 188 | |
| ... | ... | @@ -197,9 +197,9 @@ public: |
| 197 | 197 | break; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - case Gesture::Cancelled: | |
| 201 | - case Gesture::Clear: | |
| 202 | - case Gesture::Possible: | |
| 200 | + case GestureState::CANCELLED: | |
| 201 | + case GestureState::CLEAR: | |
| 202 | + case GestureState::POSSIBLE: | |
| 203 | 203 | break; |
| 204 | 204 | } |
| 205 | 205 | } | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -551,7 +551,7 @@ public: |
| 551 | 551 | { |
| 552 | 552 | switch( gesture.GetState() ) |
| 553 | 553 | { |
| 554 | - case Gesture::Started: | |
| 554 | + case GestureState::STARTED: | |
| 555 | 555 | { |
| 556 | 556 | const Size& size = mApplication.GetWindow().GetSize(); |
| 557 | 557 | |
| ... | ... | @@ -563,7 +563,7 @@ public: |
| 563 | 563 | |
| 564 | 564 | break; |
| 565 | 565 | } |
| 566 | - case Gesture::Finished: | |
| 566 | + case GestureState::FINISHED: | |
| 567 | 567 | { |
| 568 | 568 | Property::Map attributes; |
| 569 | 569 | mItemView.DoAction( "stopScrolling", attributes ); | ... | ... |
examples/primitive-shapes/primitive-shapes-example.cpp
| ... | ... | @@ -633,14 +633,14 @@ public: |
| 633 | 633 | { |
| 634 | 634 | switch( gesture.GetState() ) |
| 635 | 635 | { |
| 636 | - case Gesture::Started: | |
| 636 | + case GestureState::STARTED: | |
| 637 | 637 | { |
| 638 | 638 | //Pause animation, as the gesture will be used to manually rotate the model |
| 639 | 639 | mRotationAnimation.Pause(); |
| 640 | 640 | |
| 641 | 641 | break; |
| 642 | 642 | } |
| 643 | - case Gesture::Continuing: | |
| 643 | + case GestureState::CONTINUING: | |
| 644 | 644 | { |
| 645 | 645 | //Rotate based off the gesture. |
| 646 | 646 | const Vector2& displacement = gesture.GetDisplacement(); |
| ... | ... | @@ -653,14 +653,14 @@ public: |
| 653 | 653 | |
| 654 | 654 | break; |
| 655 | 655 | } |
| 656 | - case Gesture::Finished: | |
| 656 | + case GestureState::FINISHED: | |
| 657 | 657 | { |
| 658 | 658 | //Return to automatic animation |
| 659 | 659 | mRotationAnimation.Play(); |
| 660 | 660 | |
| 661 | 661 | break; |
| 662 | 662 | } |
| 663 | - case Gesture::Cancelled: | |
| 663 | + case GestureState::CANCELLED: | |
| 664 | 664 | { |
| 665 | 665 | //Return to automatic animation |
| 666 | 666 | mRotationAnimation.Play(); | ... | ... |
examples/shadows-and-lights/shadows-and-lights-example.cpp
| ... | ... | @@ -337,7 +337,7 @@ public: |
| 337 | 337 | { |
| 338 | 338 | switch (gesture.GetState()) |
| 339 | 339 | { |
| 340 | - case Gesture::Continuing: | |
| 340 | + case GestureState::CONTINUING: | |
| 341 | 341 | { |
| 342 | 342 | const Vector2& displacement = gesture.GetDisplacement(); |
| 343 | 343 | switch(mPanState) |
| ... | ... | @@ -380,7 +380,7 @@ public: |
| 380 | 380 | } |
| 381 | 381 | break; |
| 382 | 382 | |
| 383 | - case Gesture::Finished: | |
| 383 | + case GestureState::FINISHED: | |
| 384 | 384 | // Start animation at last known speed |
| 385 | 385 | break; |
| 386 | 386 | |
| ... | ... | @@ -391,7 +391,7 @@ public: |
| 391 | 391 | |
| 392 | 392 | void OnPinch(Actor actor, const PinchGesture& gesture) |
| 393 | 393 | { |
| 394 | - if (gesture.GetState() == Gesture::Started) | |
| 394 | + if (gesture.GetState() == GestureState::STARTED) | |
| 395 | 395 | { |
| 396 | 396 | mScaleAtPinchStart = mContents.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x; |
| 397 | 397 | } | ... | ... |
examples/sparkle/sparkle-effect-example.cpp
examples/text-label/text-label-example.cpp
| ... | ... | @@ -572,8 +572,8 @@ public: |
| 572 | 572 | void OnPan( Actor actor, const PanGesture& gesture ) |
| 573 | 573 | { |
| 574 | 574 | // Reset mLayoutSize when the pan starts |
| 575 | - Gesture::State state = gesture.GetState(); | |
| 576 | - if( state == Gesture::Started ) | |
| 575 | + GestureState state = gesture.GetState(); | |
| 576 | + if( state == GestureState::STARTED ) | |
| 577 | 577 | { |
| 578 | 578 | if( mLayoutSize.x < 2.0f ) |
| 579 | 579 | { |
| ... | ... | @@ -608,7 +608,7 @@ public: |
| 608 | 608 | mContainer.SetProperty( Actor::Property::SIZE, clampedSize ); |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - if( state == Gesture::Cancelled || state == Gesture::Finished ) | |
| 611 | + if( state == GestureState::CANCELLED || state == GestureState::FINISHED ) | |
| 612 | 612 | { |
| 613 | 613 | // Resize the text label to match the container size when panning is finished |
| 614 | 614 | mLabel.SetProperty( Actor::Property::SIZE, mLayoutSize ); | ... | ... |
examples/text-overlap/text-overlap-example.cpp
| ... | ... | @@ -75,8 +75,8 @@ void TextOverlapController::Create( Application& app ) |
| 75 | 75 | |
| 76 | 76 | void TextOverlapController::OnPan( Actor actor, const PanGesture& gesture ) |
| 77 | 77 | { |
| 78 | - const Gesture::State state = gesture.GetState(); | |
| 79 | - if( ! mGrabbedActor || state == PanGesture::Started ) | |
| 78 | + const GestureState state = gesture.GetState(); | |
| 79 | + if( ! mGrabbedActor || state == GestureState::STARTED ) | |
| 80 | 80 | { |
| 81 | 81 | const Vector2& gesturePosition = gesture.GetPosition(); |
| 82 | 82 | for( int i=0; i<NUMBER_OF_LABELS; ++i ) |
| ... | ... | @@ -91,7 +91,7 @@ void TextOverlapController::OnPan( Actor actor, const PanGesture& gesture ) |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | - else if( mGrabbedActor && state == PanGesture::Continuing ) | |
| 94 | + else if( mGrabbedActor && state == GestureState::CONTINUING ) | |
| 95 | 95 | { |
| 96 | 96 | Vector2 windowSize = mApplication.GetWindow().GetSize(); |
| 97 | 97 | Vector3 size = mGrabbedActor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ); | ... | ... |
examples/text-scrolling/text-scrolling-example.cpp
| ... | ... | @@ -377,7 +377,7 @@ public: |
| 377 | 377 | |
| 378 | 378 | void OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 379 | 379 | { |
| 380 | - if( gesture.GetState() == Gesture::Continuing ) | |
| 380 | + if( gesture.GetState() == GestureState::CONTINUING ) | |
| 381 | 381 | { |
| 382 | 382 | mTargetActorPosition.y = mTargetActorPosition.y + gesture.GetDisplacement().y; |
| 383 | 383 | mTargetActorPosition.y = std::min( mTargetActorPosition.y, -mTargetActorSize.height ); | ... | ... |
examples/video-view/video-view-example.cpp
| ... | ... | @@ -221,7 +221,7 @@ class VideoViewController: public ConnectionTracker |
| 221 | 221 | |
| 222 | 222 | void OnPan( Actor actor, const PanGesture& gesture ) |
| 223 | 223 | { |
| 224 | - if( !mIsFullScreen && gesture.GetState() == Gesture::Continuing ) | |
| 224 | + if( !mIsFullScreen && gesture.GetState() == GestureState::CONTINUING ) | |
| 225 | 225 | { |
| 226 | 226 | mVideoView.TranslateBy( Vector3( gesture.GetDisplacement() ) ); |
| 227 | 227 | } |
| ... | ... | @@ -229,13 +229,13 @@ class VideoViewController: public ConnectionTracker |
| 229 | 229 | |
| 230 | 230 | void OnPinch( Actor actor, const PinchGesture& gesture ) |
| 231 | 231 | { |
| 232 | - Gesture::State state = gesture.GetState(); | |
| 233 | - if( state == Gesture::Started ) | |
| 232 | + GestureState state = gesture.GetState(); | |
| 233 | + if( state == GestureState::STARTED ) | |
| 234 | 234 | { |
| 235 | 235 | mPinchStartScale = mScale; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - if( state == Gesture::Finished ) | |
| 238 | + if( state == GestureState::FINISHED ) | |
| 239 | 239 | { |
| 240 | 240 | mScale = mPinchStartScale * gesture.GetScale(); |
| 241 | 241 | mVideoView.SetProperty( Actor::Property::SCALE, mScale ); | ... | ... |