X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fapplication-impl.cpp;h=e6424c55eb4a7fa365de3cb299d94489899c9c87;hb=420edbebea154da63c860873cf65908f55f893fc;hp=5e73d5e87350785b46dd9573210bbff831d6cc9d;hpb=fed121fa3d211ab395e22474f916bf06a68e4b61;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/application-impl.cpp b/adaptors/common/application-impl.cpp index 5e73d5e..e6424c5 100644 --- a/adaptors/common/application-impl.cpp +++ b/adaptors/common/application-impl.cpp @@ -146,6 +146,12 @@ void Application::CreateWindow() const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName(); mWindow = Dali::Window::New( mWindowPositionSize, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT ); + int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode(); + if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO ) + { + GetImplementation( mWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) ); + } + // Quit the application when the window is closed GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit ); } @@ -178,7 +184,8 @@ void Application::Lower() void Application::Quit() { // Actually quit the application. - AddIdle( MakeCallback( this, &Application::QuitFromMainLoop ) ); + // Force a call to Quit even if adaptor is not running. + Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle( MakeCallback( this, &Application::QuitFromMainLoop ), true ); } void Application::QuitFromMainLoop() @@ -258,6 +265,8 @@ void Application::DoLanguageChange() void Application::OnInit() { + DALI_LOG_RELEASE_INFO( "Application::OnInit has started.\n" ); + mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) ); DoInit(); @@ -277,10 +286,14 @@ void Application::OnInit() mInitSignal.Emit( application ); DoStart(); + + DALI_LOG_RELEASE_INFO( "Application::OnInit has finished.\n" ); } void Application::OnTerminate() { + DALI_LOG_RELEASE_INFO( "Application::OnTerminate\n" ); + // we've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously // delete the window as ecore_x has been destroyed by AppCore @@ -292,15 +305,21 @@ void Application::OnTerminate() void Application::OnPause() { + DALI_LOG_RELEASE_INFO( "Application::OnPause has started.\n" ); + // A DALi app should handle Pause/Resume events. // DALi just delivers the framework Pause event to the application, but not actually pause DALi core. // Pausing DALi core only occurs on the Window Hidden framework event Dali::Application application(this); mPauseSignal.Emit( application ); + + DALI_LOG_RELEASE_INFO( "Application::OnPause has finished.\n" ); } void Application::OnResume() { + DALI_LOG_RELEASE_INFO( "Application::OnResume has started.\n" ); + // Emit the signal first so the application can queue any messages before we do an update/render // This ensures we do not just redraw the last frame before pausing if that's not required Dali::Application application(this); @@ -308,6 +327,12 @@ void Application::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 + CoreEventInterface& coreEventInterface = Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() ); + coreEventInterface.ProcessCoreEvents(); + + DALI_LOG_RELEASE_INFO( "Application::OnResume has finished.\n" ); } void Application::OnReset() @@ -322,8 +347,12 @@ void Application::OnReset() void Application::OnAppControl(void *data) { + DALI_LOG_RELEASE_INFO( "Application::OnAppControl has started.\n" ); + Dali::Application application(this); mAppControlSignal.Emit( application , data ); + + DALI_LOG_RELEASE_INFO( "Application::OnAppControl has finished.\n" ); } void Application::OnLanguageChanged() @@ -339,18 +368,21 @@ void Application::OnRegionChanged() mRegionChangedSignal.Emit( application ); } -void Application::OnBatteryLow() +void Application::OnBatteryLow( Dali::DeviceStatus::Battery::Status status ) { Dali::Application application(this); mBatteryLowSignal.Emit( application ); + + mLowBatterySignal.Emit( status ); } -void Application::OnMemoryLow() +void Application::OnMemoryLow( Dali::DeviceStatus::Memory::Status status ) { Dali::Application application(this); mMemoryLowSignal.Emit( application ); -} + mLowMemorySignal.Emit( status ); +} void Application::OnResize(Dali::Adaptor& adaptor) { Dali::Application application(this); @@ -362,6 +394,16 @@ bool Application::AddIdle( CallbackBase* callback ) return mAdaptor->AddIdle( callback ); } +std::string Application::GetRegion() const +{ + return mFramework->GetRegion(); +} + +std::string Application::GetLanguage() const +{ + return mFramework->GetLanguage(); +} + Dali::Adaptor& Application::GetAdaptor() { return *mAdaptor; @@ -400,7 +442,13 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st Dali::Window newWindow = Dali::Window::New( positionSize, name, mWindowMode == Dali::Application::TRANSPARENT ); Window& windowImpl = GetImplementation(newWindow); windowImpl.SetAdaptor(*mAdaptor); - newWindow.ShowIndicator(Dali::Window::INVISIBLE); + + int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode(); + if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO ) + { + GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) ); + } + Dali::RenderSurface* renderSurface = windowImpl.GetSurface(); Any nativeWindow = newWindow.GetNativeHandle();