X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Fevent-processor.cpp;h=ff6007b13617fedc1ee679ad0cca993995e6fc8e;hb=bc5f2ec93cdcd1d1fbd796292e37606ab894087a;hp=06250bafc4b47afaeebe7fde90adc3c0e0539a9a;hpb=bc9255ec35bec7223cd6a18fb2b3a6fcc273936b;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/event-processor.cpp b/dali/internal/event/events/event-processor.cpp index 06250ba..ff6007b 100644 --- a/dali/internal/event/events/event-processor.cpp +++ b/dali/internal/event/events/event-processor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +98,7 @@ void EventProcessor::QueueEvent( const Event& event ) case Event::Hover: { - typedef Integration::HoverEvent DerivedType; + using DerivedType = Integration::HoverEvent; // Reserve some memory inside the message queue uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) ); @@ -111,7 +111,7 @@ void EventProcessor::QueueEvent( const Event& event ) case Event::Key: { - typedef Integration::KeyEvent DerivedType; + using DerivedType = Integration::KeyEvent; // Reserve some memory inside the message queue uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) ); @@ -124,7 +124,7 @@ void EventProcessor::QueueEvent( const Event& event ) case Event::Wheel: { - typedef Integration::WheelEvent DerivedType; + using DerivedType = Integration::WheelEvent; // Reserve some memory inside the message queue uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) ); @@ -152,8 +152,18 @@ void EventProcessor::ProcessEvents() { case Event::Touch: { - mTouchEventProcessor.ProcessTouchEvent( static_cast(*event) ); - mGestureEventProcessor.ProcessTouchEvent(mScene, static_cast(*event)); + Integration::TouchEvent& touchEvent = static_cast(*event); + const bool consumed = mTouchEventProcessor.ProcessTouchEvent( touchEvent ); + + // If touch is consumed, then gestures should be cancelled + // Do this by sending an interrupted event to the GestureEventProcessor + if( consumed ) + { + Integration::Point& point = touchEvent.GetPoint(0); + point.SetState( PointState::INTERRUPTED ); + } + + mGestureEventProcessor.ProcessTouchEvent(mScene, touchEvent); break; }