X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fpublic-api%2Fadaptor-framework%2Fapplication.cpp;h=1db99e3e55de676dd409a6b3b6d9f08d1ecaf1fc;hb=07258d253749adf0fc003cdf7329b46d86591cba;hp=1d4fb365783dc06562728e404013a96055397404;hpb=a23bd76bc3499ef6d56b3bc060ab29b9df0e982c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/public-api/adaptor-framework/application.cpp b/adaptors/public-api/adaptor-framework/application.cpp index 1d4fb36..1db99e3 100644 --- a/adaptors/public-api/adaptor-framework/application.cpp +++ b/adaptors/public-api/adaptor-framework/application.cpp @@ -34,23 +34,90 @@ Application Application::New() Application Application::New( int* argc, char **argv[] ) { - Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE, - Internal::Adaptor::Framework::NORMAL); - return Application(internal.Get()); + Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); + if( internal ) + { + if( argc && ( *argc > 0 ) ) + { + internal->GetWindow().SetClass( (*argv)[0], "" ); + } + + return Application( internal.Get() ); + } + else + { + internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE, PositionSize(), + Internal::Adaptor::Framework::NORMAL); + return Application(internal.Get()); + } } Application Application::New( int* argc, char **argv[], const std::string& stylesheet ) { - Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE, - Internal::Adaptor::Framework::NORMAL); - return Application(internal.Get()); + Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); + if( internal ) + { + if( argc && ( *argc > 0 ) ) + { + internal->GetWindow().SetClass( (*argv)[0], "" ); + } + internal->SetStyleSheet( stylesheet ); + + return Application( internal.Get() ); + } + else + { + internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE, PositionSize(), + Internal::Adaptor::Framework::NORMAL); + return Application(internal.Get()); + } } Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode ) { - Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, - Internal::Adaptor::Framework::NORMAL); - return Application(internal.Get()); + Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); + if( internal ) + { + if( argc && ( *argc > 0 ) ) + { + internal->GetWindow().SetClass( (*argv)[0], "" ); + } + internal->SetStyleSheet( stylesheet ); + + internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) ); + + return Application( internal.Get() ); + } + else + { + internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, PositionSize(), + Internal::Adaptor::Framework::NORMAL); + return Application(internal.Get()); + } +} + +Application Application::New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize ) +{ + Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); + if( internal ) + { + if( argc && ( *argc > 0 ) ) + { + internal->GetWindow().SetClass( (*argv)[0], "" ); + } + internal->SetStyleSheet( stylesheet ); + + internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) ); + internal->GetWindow().SetSize( Window::WindowSize( positionSize.width, positionSize.height ) ); + internal->GetWindow().SetPosition( Window::WindowPosition( positionSize.x, positionSize.y ) ); + + return Application( internal.Get() ); + } + else + { + internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL ); + return Application( internal.Get() ); + } } Application::~Application() @@ -115,6 +182,16 @@ std::string Application::GetResourcePath() return Internal::Adaptor::Application::GetResourcePath(); } +std::string Application::GetRegion() const +{ + return Internal::Adaptor::GetImplementation(*this).GetRegion(); +} + +std::string Application::GetLanguage() const +{ + return Internal::Adaptor::GetImplementation(*this).GetLanguage(); +} + void Application::SetViewMode( ViewMode viewMode ) { Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode ); @@ -184,14 +261,26 @@ Application::AppSignalType& Application::RegionChangedSignal() Application::AppSignalType& Application::BatteryLowSignal() { + DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: BatteryLowSignal() is deprecated and will be removed from next release. Use Application::LowBatterySignal() instead.\n" ); return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal(); } Application::AppSignalType& Application::MemoryLowSignal() { + DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: MemoryLowSignal() is deprecated and will be removed from next release. Use Application::LowMemorySignal() instead.\n" ); return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal(); } +Application::LowBatterySignalType& Application::LowBatterySignal() +{ + return Internal::Adaptor::GetImplementation(*this).LowBatterySignal(); +} + +Application::LowMemorySignalType& Application::LowMemorySignal() +{ + return Internal::Adaptor::GetImplementation(*this).LowMemorySignal(); +} + Application::Application(Internal::Adaptor::Application* application) : BaseHandle(application) {