Removing Configuration::ContextLoss APIs and enum
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / application.cpp
index 3405faf..4103efc 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,28 +137,17 @@ 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;
 
-void Application::MainLoop()
-{
-  Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
-}
+Application::Application( Application&& rhs ) = default;
+
+Application& Application::operator=( Application&& rhs ) = default;
 
-void Application::MainLoop(Configuration::ContextLoss configuration)
+void Application::MainLoop()
 {
-  Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
+  Internal::Adaptor::GetImplementation(*this).MainLoop();
 }
 
 void Application::Lower()
@@ -172,11 +170,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,24 +185,9 @@ std::string Application::GetLanguage() const
   return Internal::Adaptor::GetImplementation(*this).GetLanguage();
 }
 
-void Application::SetViewMode( ViewMode viewMode )
-{
-  Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
-}
-
-ViewMode Application::GetViewMode() const
+ObjectRegistry Application::GetObjectRegistry() 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()
@@ -237,13 +215,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();
@@ -259,18 +230,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();