/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/object-registry.h>
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/application-impl.h>
namespace Dali
{
-
Application Application::New()
{
- return New( NULL, NULL );
+ return New(NULL, NULL);
}
-Application Application::New( int* argc, char **argv[] )
+Application Application::New(int* argc, char** argv[])
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
- if( argc && ( *argc > 0 ) )
+ // pre-initialized application
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ 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 )
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet)
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
- if( argc && ( *argc > 0 ) )
+ // pre-initialized application
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ internal->SetStyleSheet(stylesheet);
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ 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 )
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode)
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
- if( argc && ( *argc > 0 ) )
+ // pre-initialized application
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ internal->SetStyleSheet(stylesheet);
- internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) );
+ internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ 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 )
+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(internal)
{
- if( argc && ( *argc > 0 ) )
+ // pre-initialized application
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ 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 ) );
+ 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() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL );
- return Application( internal.Get() );
+ internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL);
+ return Application(internal.Get());
}
}
{
}
-Application::Application(const Application& application)
-: BaseHandle(application)
-{
-}
+Application::Application(const Application& copy) = default;
-Application& Application::operator=(const Application& application)
-{
- if( *this != application )
- {
- BaseHandle::operator=( application );
- }
- return *this;
-}
+Application& Application::operator=(const Application& rhs) = default;
-void Application::MainLoop()
-{
- Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
-}
+Application::Application(Application&& rhs) = default;
-void Application::MainLoop(Configuration::ContextLoss configuration)
+Application& Application::operator=(Application&& rhs) = default;
+
+void Application::MainLoop()
{
- Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
+ Internal::Adaptor::GetImplementation(*this).MainLoop();
}
void Application::Lower()
Internal::Adaptor::GetImplementation(*this).Quit();
}
-bool Application::AddIdle( CallbackBase* callback )
+bool Application::AddIdle(CallbackBase* callback)
{
- return Internal::Adaptor::GetImplementation(*this).AddIdle( callback, false );
+ return Internal::Adaptor::GetImplementation(*this).AddIdle(callback, false);
}
Window Application::GetWindow()
return Internal::Adaptor::GetImplementation(*this).GetWindow();
}
-void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
-{
- Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
-}
-
std::string Application::GetResourcePath()
{
return Internal::Adaptor::Application::GetResourcePath();
return Internal::Adaptor::GetImplementation(*this).GetLanguage();
}
-void Application::SetViewMode( ViewMode viewMode )
+ObjectRegistry Application::GetObjectRegistry() const
{
- Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
-}
-
-ViewMode Application::GetViewMode() const
-{
- return Internal::Adaptor::GetImplementation(*this).GetViewMode();
-}
-
-void Application::SetStereoBase( float stereoBase )
-{
- Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
-}
-
-float Application::GetStereoBase() const
-{
- return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
+ return Internal::Adaptor::GetImplementation(*this).GetObjectRegistry();
}
Application::AppSignalType& Application::InitSignal()
return Internal::Adaptor::GetImplementation(*this).ResetSignal();
}
-Application::AppSignalType& Application::ResizeSignal()
-{
- DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: ResizeSignal() is deprecated and will be removed from next release. Use Window::ResizedSignal() instead.\n" );
-
- return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
-}
-
-Application::AppControlSignalType & Application::AppControlSignal()
+Application::AppControlSignalType& Application::AppControlSignal()
{
return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
}
return Internal::Adaptor::GetImplementation(*this).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();
{
}
-
} // namespace Dali