X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Foffscreen%2Fcommon%2Foffscreen-application-impl.cpp;h=1b2545a992e2d7a3fadedb146b75f903e4660f52;hb=36a0ec66fc40c3f6463cba0d3464be313dea56bd;hp=0b2682cbf799c35602597999d062c70331473980;hpb=66d7524ae388296c6e4f112b4d216c8a8b6faeb4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/offscreen/common/offscreen-application-impl.cpp b/dali/internal/offscreen/common/offscreen-application-impl.cpp index 0b2682c..1b2545a 100644 --- a/dali/internal/offscreen/common/offscreen-application-impl.cpp +++ b/dali/internal/offscreen/common/offscreen-application-impl.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,18 @@ namespace Dali { namespace Internal { +namespace +{ +void EmitLifecycleControllerSignal(void (Internal::Adaptor::LifecycleController::*member)(Dali::Application&)) +{ + Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get(); + if(DALI_LIKELY(lifecycleController)) + { + Dali::Application dummyApplication; + (GetImplementation(lifecycleController).*member)(dummyApplication); + } +} +} // namespace using RenderMode = Dali::OffscreenApplication::RenderMode; IntrusivePtr OffscreenApplication::New(uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, RenderMode renderMode) @@ -100,14 +113,18 @@ void OffscreenApplication::OnInit() // Start the adaptor mAdaptor->Start(); + Dali::OffscreenApplication application(this); mInitSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnInit); mAdaptor->NotifySceneCreated(); } void OffscreenApplication::OnTerminate() { + Dali::OffscreenApplication application(this); mTerminateSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnTerminate); // Stop the adaptor mAdaptor->Stop(); @@ -115,6 +132,47 @@ void OffscreenApplication::OnTerminate() mDefaultWindow.Reset(); } +void OffscreenApplication::OnPause() +{ + Dali::OffscreenApplication application(this); + mPauseSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnPause); +} + +void OffscreenApplication::OnResume() +{ + Dali::OffscreenApplication application(this); + mResumeSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnResume); + + // DALi just delivers the framework Resume event to the application. + // Resuming DALi core only occurs on the Window Show framework event + + // Trigger processing of events queued up while paused + Internal::Adaptor::CoreEventInterface& coreEventInterface = Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor); + coreEventInterface.ProcessCoreEvents(); +} + +void OffscreenApplication::OnReset() +{ + /* + * usually, reset callback was called when a caller request to launch this application via aul. + * because Application class already handled initialization in OnInit(), OnReset do nothing. + */ + Dali::OffscreenApplication application(this); + mResetSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnReset); +} + +void OffscreenApplication::OnLanguageChanged() +{ + mAdaptor->NotifyLanguageChanged(); + + Dali::OffscreenApplication application(this); + mLanguageChangedSignal.Emit(); + EmitLifecycleControllerSignal(&Internal::Adaptor::LifecycleController::OnLanguageChanged); +} + void OffscreenApplication::QuitFromMainLoop() { mAdaptor->Stop();