+void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp )
+{
+ if( timeStamp < 1 )
+ {
+ timeStamp = GetCurrentMilliSeconds();
+ }
+
+ RecalculateTouchPosition( point );
+
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
+ if( type != Integration::TouchEventCombiner::DispatchNone )
+ {
+ DALI_LOG_INFO( gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y );
+
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
+ // First the touch and/or hover event & related gesture events are queued
+ if( type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth )
+ {
+ mScene.QueueEvent( touchEvent );
+ }
+
+ if( type == Integration::TouchEventCombiner::DispatchHover || type == Integration::TouchEventCombiner::DispatchBoth )
+ {
+ mScene.QueueEvent( hoverEvent );
+ }
+
+ // Next the events are processed with a single call into Core
+ mAdaptor->ProcessCoreEvents();
+ }
+}
+
+void SceneHolder::FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent )
+{
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
+ mScene.QueueEvent( wheelEvent );
+ mAdaptor->ProcessCoreEvents();
+}
+
+void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent )
+{
+ Dali::PhysicalKeyboard physicalKeyboard = PhysicalKeyboard::Get();
+ if( physicalKeyboard )
+ {
+ if( ! KeyLookup::IsDeviceButton( keyEvent.keyName.c_str() ) )
+ {
+ GetImplementation( physicalKeyboard ).KeyReceived( keyEvent.time > 1 );
+ }
+ }
+
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
+ // Create send KeyEvent to Core.
+ mScene.QueueEvent( keyEvent );
+ mAdaptor->ProcessCoreEvents();
+}
+
+Dali::Integration::SceneHolder SceneHolder::Get( Dali::Actor actor )
+{
+ SceneHolder* sceneHolderImpl = nullptr;
+
+ if ( Internal::Adaptor::Adaptor::IsAvailable() )
+ {
+ Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
+ sceneHolderImpl = adaptor.GetWindow( actor );
+ }
+
+ return Dali::Integration::SceneHolder( sceneHolderImpl );
+}
+
+void SceneHolder::Reset()
+{
+ mCombiner.Reset();
+
+ // Any touch listeners should be told of the interruption.
+ Integration::TouchEvent event;
+ Integration::Point point;
+ point.SetState( PointState::INTERRUPTED );
+ event.AddPoint( point );
+
+ // First the touch event & related gesture events are queued
+ mScene.QueueEvent( event );
+
+ // Next the events are processed with a single call into Core
+ mAdaptor->ProcessCoreEvents();
+}
+
+