Add move semantics to BaseHandle derived classes in Adaptor public API
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / application.cpp
index 188e382..b7ed5f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -19,6 +19,7 @@
 #include <dali/public-api/adaptor-framework/application.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/object/object-registry.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -37,6 +38,8 @@ Application Application::New( int* argc, char **argv[] )
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -57,6 +60,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -78,6 +83,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -101,6 +108,8 @@ Application Application::New( int* argc, char **argv[], const std::string& style
   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
   if( internal )
   {
+    // pre-initialized application
+    internal->SetCommandLineOptions( argc, argv );
     if( argc && ( *argc > 0 ) )
     {
       internal->GetWindow().SetClass( (*argv)[0], "" );
@@ -128,19 +137,13 @@ Application::Application()
 {
 }
 
-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;
+
+Application::Application( Application&& rhs ) = default;
+
+Application& Application::operator=( Application&& rhs ) = default;
 
 void Application::MainLoop()
 {
@@ -172,11 +175,6 @@ 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();
@@ -192,22 +190,9 @@ std::string Application::GetLanguage() const
   return Internal::Adaptor::GetImplementation(*this).GetLanguage();
 }
 
-void Application::SetViewMode( ViewMode /*viewMode*/ )
+ObjectRegistry Application::GetObjectRegistry() const
 {
-}
-
-ViewMode Application::GetViewMode() const
-{
-  return ViewMode::MONO;
-}
-
-void Application::SetStereoBase( float /*stereoBase*/ )
-{
-}
-
-float Application::GetStereoBase() const
-{
-  return 0.f;
+  return Internal::Adaptor::GetImplementation(*this).GetObjectRegistry();
 }
 
 Application::AppSignalType& Application::InitSignal()
@@ -235,13 +220,6 @@ Application::AppSignalType& Application::ResetSignal()
   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()
 {
   return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
@@ -257,18 +235,6 @@ Application::AppSignalType& Application::RegionChangedSignal()
   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();