Commit 346c047a487db6b75118680e39ce249a6cdaa8db

Authored by Adeel Kazmi
Committed by Gerrit Code Review
2 parents 1a473d51 7bdf3408

Merge "Moved Gesture::State and -::Type to gesture-enumerations.h." into devel/master

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