X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fscene-holder-impl.cpp;h=7727a230185b8beeea26ed0facc85fecaef61025;hb=75c8a63b28da1d0e1ecb42897f7595ff28285e0c;hp=e5a0d88ec7cb51a7d325ab214914a1f6fe6417c0;hpb=641c43874ce1a7ec9b554440bdd4637ee8efe828;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/scene-holder-impl.cpp b/dali/integration-api/scene-holder-impl.cpp index e5a0d88..7727a23 100644 --- a/dali/integration-api/scene-holder-impl.cpp +++ b/dali/integration-api/scene-holder-impl.cpp @@ -188,7 +188,7 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) { mSurface.reset( surface ); - mScene.SetSurface( *mSurface.get(), false ); + mScene.SetSurface( *mSurface.get() ); unsigned int dpiHorizontal, dpiVertical; dpiHorizontal = dpiVertical = 0; @@ -201,6 +201,11 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) OnSurfaceSet( surface ); } +void SceneHolder::SurfaceResized( bool forceUpdate ) +{ + mScene.SurfaceResized( forceUpdate ); +} + Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const { return mSurface.get(); @@ -230,9 +235,7 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor) mAdaptorStarted = true; // Create the scene - PositionSize positionSize = mSurface->GetPositionSize(); - mScene = Dali::Integration::Scene::New( Vector2( positionSize.width, positionSize.height ) ); - mScene.SetSurface( *mSurface.get(), false ); + mScene = Dali::Integration::Scene::New( *mSurface ); Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor ); mAdaptor = &adaptorImpl; @@ -284,6 +287,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp { 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 ) { @@ -302,6 +309,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp 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(); } @@ -317,11 +328,28 @@ void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ) } } + // 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();