Moved SingletonService into dali-core 48/225148/7
authorPaul Wisbey <p.wisbey@samsung.com>
Mon, 17 Feb 2020 17:34:25 +0000 (17:34 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 21 Feb 2020 17:26:20 +0000 (17:26 +0000)
Change-Id: Id4b95d15c2a499e2e0f42bd6a697d9767397e286

39 files changed:
automated-tests/src/dali-adaptor-internal/utc-Dali-Lifecycle-Controller.cpp
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/utc-Dali-SingletonService.cpp [deleted file]
dali/devel-api/adaptor-framework/singleton-service.cpp [deleted file]
dali/devel-api/adaptor-framework/singleton-service.h [deleted file]
dali/devel-api/file.list
dali/internal/accessibility/generic/accessibility-adaptor-impl-generic.cpp
dali/internal/accessibility/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp
dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
dali/internal/accessibility/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp
dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/adaptor/common/lifecycle-controller-impl.cpp
dali/internal/clipboard/common/clipboard-event-notifier-impl.cpp
dali/internal/clipboard/generic/clipboard-impl-generic.cpp
dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp
dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp
dali/internal/haptics/common/feedback-player-impl.cpp
dali/internal/input/common/input-method-context-impl.cpp
dali/internal/input/common/physical-keyboard-impl.cpp
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp
dali/internal/input/windows/input-method-context-impl-win.cpp
dali/internal/sensor/common/tilt-sensor-factory.cpp
dali/internal/sensor/tizen/tilt-sensor-impl-tizen.cpp
dali/internal/sensor/ubuntu/tilt-sensor-impl-ubuntu.cpp
dali/internal/styling/common/style-monitor-impl.cpp
dali/internal/system/common/color-controller-impl.cpp
dali/internal/system/common/singleton-service-impl.cpp [deleted file]
dali/internal/system/common/singleton-service-impl.h [deleted file]
dali/internal/system/common/sound-player-impl.cpp
dali/internal/system/file.list
dali/internal/text/text-abstraction/bidirectional-support-impl.cpp
dali/internal/text/text-abstraction/font-client-impl.cpp
dali/internal/text/text-abstraction/segmentation-impl.cpp
dali/internal/text/text-abstraction/shaping-impl.cpp
dali/internal/text/text-abstraction/text-renderer-impl.cpp

index 3a2c8d2..6511f3b 100644 (file)
@@ -91,6 +91,7 @@ int UtcDaliLifecycleControllerGet(void)
   lifecycleController = LifecycleController::Get();
   DALI_TEST_CHECK( !lifecycleController );
 
+  TestApplication app;
   Application application = Application::New();
 
   lifecycleController = LifecycleController::Get();
@@ -101,6 +102,7 @@ int UtcDaliLifecycleControllerGet(void)
 
 int UtcDaliLifecycleControllerSignalInit(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnInitCalled );
@@ -118,6 +120,7 @@ int UtcDaliLifecycleControllerSignalInit(void)
 
 int UtcDaliLifecycleControllerSignalTerminate(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnTerminateCalled );
@@ -135,6 +138,7 @@ int UtcDaliLifecycleControllerSignalTerminate(void)
 
 int UtcDaliLifecycleControllerSignalPause(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnPauseCalled );
@@ -152,6 +156,7 @@ int UtcDaliLifecycleControllerSignalPause(void)
 
 int UtcDaliLifecycleControllerSignalResume(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnResumeCalled );
@@ -169,6 +174,7 @@ int UtcDaliLifecycleControllerSignalResume(void)
 
 int UtcDaliLifecycleControllerSignalReset(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnResetCalled );
@@ -186,6 +192,7 @@ int UtcDaliLifecycleControllerSignalReset(void)
 
 int UtcDaliLifecycleControllerSignalResize(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnResizeCalled );
@@ -203,6 +210,7 @@ int UtcDaliLifecycleControllerSignalResize(void)
 
 int UtcDaliLifecycleControllerSignalLanguageChanged(void)
 {
+  TestApplication app;
   Application application = Application::New();
 
   DALI_TEST_CHECK( !g_OnLanguageChangedCalled );
index d7414fb..6545723 100644 (file)
@@ -12,7 +12,6 @@ SET(TC_SOURCES
     utc-Dali-Key.cpp
     utc-Dali-NativeImageSource.cpp
     utc-Dali-PixelBuffer.cpp
-    utc-Dali-SingletonService.cpp
     utc-Dali-Timer.cpp
     utc-Dali-TtsPlayer.cpp
     utc-Dali-Window.cpp
diff --git a/automated-tests/src/dali-adaptor/utc-Dali-SingletonService.cpp b/automated-tests/src/dali-adaptor/utc-Dali-SingletonService.cpp
deleted file mode 100644 (file)
index 2ceb1f0..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <stdlib.h>
-#include <iostream>
-#include <dali.h>
-#include <dali-test-suite-utils.h>
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
-
-using namespace Dali;
-
-namespace
-{
-
-class TestHandle : public BaseHandle
-{
-public:
-  TestHandle() {}
-  TestHandle( BaseObject* object ) : BaseHandle( object ) {}
-};
-
-class TestObject : public BaseObject
-{
-};
-
-} // unnamed namespace
-
-void utc_dali_singleton_service_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_singleton_service_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-int UtcDaliSingletonServiceGet(void)
-{
-  // Attempt to retrieve SingletonService before creating application
-  SingletonService singletonService;
-  singletonService = SingletonService::Get();
-  DALI_TEST_CHECK( !singletonService );
-
-  // Create Application class, should be able to retrieve SingletonService now
-  Application application = Application::New();
-  singletonService = SingletonService::Get();
-  DALI_TEST_CHECK( singletonService );
-
-  END_TEST;
-}
-
-int UtcDaliSingletonServiceRegisterAndGetSingleton(void)
-{
-  Application application = Application::New();
-  SingletonService singletonService( SingletonService::Get() );
-
-  // Attempt to register an empty handle
-  TestHandle handle;
-  singletonService.Register( typeid( handle ), handle );
-  DALI_TEST_CHECK( !singletonService.GetSingleton( typeid( handle ) ) );
-
-  // Create an actor instance and retrieve, should be valid this time
-  handle = TestHandle( new TestObject );
-  singletonService.Register( typeid( handle ), handle );
-  DALI_TEST_CHECK( singletonService.GetSingleton( typeid( handle ) ) );
-
-  END_TEST;
-}
diff --git a/dali/devel-api/adaptor-framework/singleton-service.cpp b/dali/devel-api/adaptor-framework/singleton-service.cpp
deleted file mode 100644 (file)
index ca1b3a9..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-namespace Dali
-{
-
-SingletonService::SingletonService()
-{
-}
-
-SingletonService SingletonService::New()
-{
-  return Internal::Adaptor::SingletonService::New();
-}
-
-SingletonService SingletonService::Get()
-{
-  return Internal::Adaptor::SingletonService::Get();
-}
-
-SingletonService::~SingletonService()
-{
-}
-
-void SingletonService::Register( const std::type_info& info, BaseHandle singleton )
-{
-  GetImplementation( *this ).Register( info, singleton );
-}
-
-void SingletonService::UnregisterAll()
-{
-  GetImplementation( *this ).UnregisterAll();
-}
-
-BaseHandle SingletonService::GetSingleton( const std::type_info& info ) const
-{
-  return GetImplementation( *this ).GetSingleton( info );
-}
-
-SingletonService::SingletonService( Internal::Adaptor::SingletonService* singletonService )
-: BaseHandle( singletonService )
-{
-}
-
-} // namespace Dali
diff --git a/dali/devel-api/adaptor-framework/singleton-service.h b/dali/devel-api/adaptor-framework/singleton-service.h
deleted file mode 100755 (executable)
index 7df5fc7..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef DALI_SINGELTON_SERVICE_H
-#define DALI_SINGELTON_SERVICE_H
-
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <typeinfo>
-#include <dali/public-api/object/base-handle.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
-
-namespace Dali
-{
-
-namespace Internal DALI_INTERNAL
-{
-namespace Adaptor
-{
-class SingletonService;
-}
-}
-
-/**
- * @brief Allows the registration of a class as a singleton
- *
- * @note This class is created by the Application class and is destroyed when the Application class is destroyed.
- *
- * @see Application
- */
-class DALI_ADAPTOR_API SingletonService : public BaseHandle
-{
-public:
-
-  /**
-   * @brief Create an uninitialized handle.
-   *
-   * This can be initialized by calling SingletonService::Get().
-   */
-  SingletonService();
-
-  /**
-   * Create a SingletonService.
-   * This should only be called once by the Application class.
-   * @return A newly created SingletonService.
-   */
-  static Dali::SingletonService New();
-
-  /**
-   * @brief Retrieves a handle to the SingletonService.
-   *
-   * @return A handle to the SingletonService if it is available. This will be an empty handle if
-   *         the service is not available.
-   */
-  static SingletonService Get();
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~SingletonService();
-
-  /**
-   * @brief Registers the singleton of Dali handle with its type info.
-   *
-   * The singleton will be kept alive for the lifetime of the service.
-   *
-   * @note This is not intended for application developers.
-   * @param[in] info The type info of the Dali handle generated by the compiler.
-   * @param[in] singleton The Dali handle to be registered
-   */
-  void Register( const std::type_info& info, BaseHandle singleton );
-
-  /**
-   * @brief Unregisters all singletons.
-   *
-   * @note This is not intended for application developers.
-   */
-  void UnregisterAll();
-
-  /**
-   * @brief Gets the singleton for the given type.
-   *
-   * @note This is not intended for application developers.
-   * @param[in] info The type info of the given type.
-   * @return the Dali handle if it is registered as a singleton or an uninitialized handle.
-   */
-  BaseHandle GetSingleton( const std::type_info& info ) const;
-
-public: // Not intended for application developers
-
-  /**
-   * @brief This constructor is used by SingletonService::Get().
-   * @param[in] singletonService A pointer to the internal singleton-service object.
-   */
-  explicit DALI_INTERNAL SingletonService( Internal::Adaptor::SingletonService* singletonService );
-};
-
-} // namespace Dali
-
-#endif // DALI_SINGELTON_SERVICE_H
index e39b2e2..e85cb13 100755 (executable)
@@ -23,7 +23,6 @@ SET( devel_api_src_files
   ${adaptor_devel_api_dir}/adaptor-framework/physical-keyboard.cpp 
   ${adaptor_devel_api_dir}/adaptor-framework/key-devel.cpp 
   ${adaptor_devel_api_dir}/adaptor-framework/pixel-buffer.cpp 
-  ${adaptor_devel_api_dir}/adaptor-framework/singleton-service.cpp 
   ${adaptor_devel_api_dir}/adaptor-framework/sound-player.cpp 
   ${adaptor_devel_api_dir}/adaptor-framework/style-monitor.cpp 
   ${adaptor_devel_api_dir}/adaptor-framework/tilt-sensor.cpp 
@@ -68,7 +67,6 @@ SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/orientation.h 
   ${adaptor_devel_api_dir}/adaptor-framework/performance-logger.h 
   ${adaptor_devel_api_dir}/adaptor-framework/pixel-buffer.h 
-  ${adaptor_devel_api_dir}/adaptor-framework/singleton-service.h 
   ${adaptor_devel_api_dir}/adaptor-framework/sound-player.h 
   ${adaptor_devel_api_dir}/adaptor-framework/style-monitor.h 
   ${adaptor_devel_api_dir}/adaptor-framework/tilt-sensor.h 
index 05dda37..62cfcbf 100644 (file)
@@ -20,9 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index 18d57df..b2418f8 100644 (file)
 #include <vconf.h>
 
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
index f75eff9..95f8809 100644 (file)
 #include <vconf.h>
 
 #include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
index f75eff9..95f8809 100644 (file)
 #include <vconf.h>
 
 #include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
index 18d57df..b2418f8 100644 (file)
 #include <vconf.h>
 
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/common/system-settings.h>
 
 namespace Dali
index d382759..525faaf 100644 (file)
 #include <vconf.h>
 
 #include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/common/system-settings.h>
 
 #ifndef WAYLAND
index 29e1b84..98ef0db 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/style-monitor.h>
@@ -27,7 +28,6 @@
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/system/common/command-line-options.h>
 #include <dali/internal/adaptor/common/framework.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
 #include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
@@ -108,7 +108,6 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mFramework( nullptr ),
   mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ),
   mCommandLineOptions( nullptr ),
-  mSingletonService( SingletonService::New() ),
   mAdaptorBuilder( nullptr ),
   mAdaptor( nullptr ),
   mMainWindow(),
@@ -138,7 +137,12 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
 
 Application::~Application()
 {
-  mSingletonService.UnregisterAll();
+  SingletonService service = SingletonService::Get();
+  // Note this can be false i.e. if Application has never created a Core instance
+  if( service )
+  {
+    service.UnregisterAll();
+  }
 
   mMainWindow.Reset();
   delete mAdaptor;
index 1337f7b..82826cd 100755 (executable)
@@ -24,7 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/application.h>
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 #include <dali/internal/adaptor/common/framework.h>
 #include <dali/internal/system/common/environment-options.h>
@@ -398,7 +398,6 @@ private:
   Dali::Configuration::ContextLoss      mContextLossConfiguration;
   CommandLineOptions*                   mCommandLineOptions;
 
-  Dali::SingletonService                   mSingletonService;
   Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder;   ///< The adaptor builder
   Dali::Adaptor*                           mAdaptor;
 
index 5358f4f..e4cd45e 100644 (file)
@@ -23,7 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index e027472..ff5acd6 100644 (file)
@@ -20,9 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index fe5ab5e..8e08371 100755 (executable)
@@ -19,7 +19,7 @@
 #include <dali/internal/clipboard/common/clipboard-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index 8721844..4204f1a 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 #include <unistd.h>
 
@@ -36,9 +37,6 @@
 #include <Eldbus.h>
 #endif // DALI_ELDBUS_AVAILABLE
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
 #define CBHM_DBUS_OBJPATH "/org/tizen/cbhm/dbus"
 #ifndef CBHM_DBUS_INTERFACE
 #define CBHM_DBUS_INTERFACE "org.tizen.cbhm.dbus"
index 38a488e..1cb8704 100644 (file)
@@ -27,7 +27,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/window-system/ubuntu-x11/window-interface-ecore-x.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/internal/clipboard/common/clipboard-event-notifier-impl.h>
 
 namespace //unnamed namespace
index ea4a5f0..7468372 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
 namespace Dali
 {
 
index 566027e..3598bd0 100755 (executable)
@@ -18,7 +18,7 @@
 #include <dali/internal/input/common/input-method-context-impl.h>
 #include <dali/internal/input/common/input-method-context-factory.h>
 #include <dali/internal/system/common/locale-utils.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index cfd7320..ec7523a 100644 (file)
@@ -20,8 +20,8 @@
 // CLASS HEADER
 #include <dali/internal/input/common/physical-keyboard-impl.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+// EXTERNAL INCLUDES
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index ab7c78b..db15ce9 100755 (executable)
@@ -31,6 +31,7 @@
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -39,7 +40,6 @@
 #include <dali/integration-api/adaptor-framework/scene-holder.h>
 #include <dali/internal/input/common/key-impl.h>
 #include <dali/internal/system/common/locale-utils.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
 
 #define TOKEN_STRING(x) #x
index ce6a57c..7101b58 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -33,7 +34,6 @@
 #include <dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h>
 #include <dali/internal/input/ubuntu-x11/dali-ecore-input.h>
 #include <dali/internal/system/common/locale-utils.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/system/linux/dali-ecore.h>
 
 namespace Dali
index 1061aec..009f543 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES\r
 #include <dali/public-api/events/key-event.h>\r
 #include <dali/public-api/object/type-registry.h>\r
+#include <dali/devel-api/common/singleton-service.h>\r
 #include <dali/integration-api/debug.h>\r
 \r
 // INTERNAL INCLUDES\r
@@ -30,7 +31,6 @@
 #include <dali/internal/input/common/key-impl.h>\r
 #include <dali/internal/input/common/virtual-keyboard-impl.h>\r
 #include <dali/internal/system/common/locale-utils.h>\r
-#include <dali/internal/system/common/singleton-service-impl.h>\r
 \r
 namespace Dali\r
 {\r
index c31836a..f5245b3 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <dali/internal/sensor/common/tilt-sensor-factory.h>
 #include <dali/internal/sensor/common/tilt-sensor-impl.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
@@ -65,4 +65,4 @@ Dali::TiltSensor Get()
 
 } // Internal
 
-} // Dali
\ No newline at end of file
+} // Dali
index d3773cf..13d3336 100644 (file)
 // EXTERNAL INCLUDES
 #include <cmath>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
 namespace // unnamed namespace
 {
 const char* const SIGNAL_TILTED = "tilted";
index efe12e7..9a2b5ea 100644 (file)
@@ -22,9 +22,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace // unnamed namespace
 {
index 9b23434..8e93285 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/file-loader.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/system/common/singleton-service-impl.h>
 
 namespace Dali
 {
index b8cf94d..c7630b2 100644 (file)
@@ -22,9 +22,7 @@
 #include <dlfcn.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
diff --git a/dali/internal/system/common/singleton-service-impl.cpp b/dali/internal/system/common/singleton-service-impl.cpp
deleted file mode 100755 (executable)
index a1c3329..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/core.h>
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/processor-interface.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/adaptor-framework/adaptor.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-
-#if defined(DEBUG_ENABLED)
-#include <dali/internal/system/common/logging.h>
-Debug::Filter* gSingletonServiceLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_SINGLETON_SERVICE" );
-
-// Need to define own macro as the log function is not installed when this object is created so no logging is shown with DALI_LOG_INFO at construction and destruction
-#define DALI_LOG_SINGLETON_SERVICE_DIRECT(level, message)                        \
-    if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) { std::string string(message); Dali::TizenPlatform::LogMessage( Debug::DebugInfo, string );  }
-
-#define DALI_LOG_SINGLETON_SERVICE(level, format, ...) DALI_LOG_INFO(gSingletonServiceLogFilter, level, format, ## __VA_ARGS__ )
-#else
-
-#define DALI_LOG_SINGLETON_SERVICE_DIRECT(level, message)
-#define DALI_LOG_SINGLETON_SERVICE(level, format, ...)
-
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-thread_local SingletonService * gSingletonService = 0;
-} // unnamed namespace
-
-Dali::SingletonService SingletonService::New()
-{
-  Dali::SingletonService singletonService( new SingletonService );
-  return singletonService;
-}
-
-Dali::SingletonService SingletonService::Get()
-{
-  Dali::SingletonService singletonService;
-  if ( gSingletonService )
-  {
-    singletonService = Dali::SingletonService( gSingletonService );
-  }
-  return singletonService;
-}
-
-void SingletonService::Register( const std::type_info& info, BaseHandle singleton )
-{
-  if( singleton )
-  {
-    DALI_LOG_SINGLETON_SERVICE( Debug::General, "Singleton Added: %s\n", info.name() );
-    mSingletonContainer.push_back( SingletonPair( info.name(), singleton ) );
-
-    Integration::Processor* processor = dynamic_cast<Integration::Processor*>( &singleton.GetBaseObject() );
-    if( processor )
-    {
-      Dali::Adaptor& adaptor = Dali::Adaptor::Get();
-      Dali::Internal::Adaptor::Adaptor& adaptorImpl = Adaptor::GetImplementation( adaptor );
-      Integration::Core& core = adaptorImpl.GetCore();
-      core.RegisterProcessor( *processor );
-    }
-  }
-}
-
-void SingletonService::UnregisterAll( )
-{
-  mSingletonContainer.clear();
-}
-
-BaseHandle SingletonService::GetSingleton( const std::type_info& info ) const
-{
-  BaseHandle object;
-
-  const SingletonContainer::const_iterator end = mSingletonContainer.end();
-  for( SingletonContainer::const_iterator iter = mSingletonContainer.begin(); iter != end; ++iter )
-  {
-    // comparing the addresses as these are allocated statically per library
-    if( ( *iter ).first == info.name() )
-    {
-      object = ( *iter ).second;
-    }
-  }
-
-  return object;
-}
-
-SingletonService::SingletonService()
-: mSingletonContainer()
-{
-  // Can only have one instance of SingletonService
-  DALI_ASSERT_ALWAYS( !gSingletonService && "Only one instance of SingletonService is allowed");
-
-  gSingletonService = this;
-
-  DALI_LOG_SINGLETON_SERVICE_DIRECT( Debug::Concise, "SingletonService Created\n" );
-}
-
-SingletonService::~SingletonService()
-{
-  gSingletonService = 0;
-
-  DALI_LOG_SINGLETON_SERVICE_DIRECT( Debug::Concise, "SingletonService Destroyed\n" );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/system/common/singleton-service-impl.h b/dali/internal/system/common/singleton-service-impl.h
deleted file mode 100644 (file)
index 986e72a..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef DALI_INTERNAL_SINGLETON_SERVICE_H
-#define DALI_INTERNAL_SINGLETON_SERVICE_H
-
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/common/vector-wrapper.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class SingletonService : public Dali::BaseObject
-{
-public:
-
-  /**
-   * Create a SingletonService.
-   * This should only be called once by the Application class.
-   * @return A newly created SingletonService.
-   */
-  static Dali::SingletonService New();
-
-  /**
-   * @copydoc Dali::SingletonService::Get()
-   */
-  static Dali::SingletonService Get();
-
-  /**
-   * @copydoc Dali::SingletonService::Register()
-   */
-  void Register( const std::type_info& info, BaseHandle singleton );
-
-  /**
-   * @copydoc Dali::SingletonService::UnregisterAll()
-   */
-  void UnregisterAll();
-
-  /**
-   * @copydoc Dali::SingletonService::GetSingleton()
-   */
-  BaseHandle GetSingleton( const std::type_info& info ) const;
-
-private:
-
-  /**
-   * Private Constructor
-   * @see SingletonService::New()
-   */
-  SingletonService();
-
-  /**
-   * Virtual Destructor
-   */
-  virtual ~SingletonService();
-
-  // Undefined
-  SingletonService( const SingletonService& );
-  SingletonService& operator=( SingletonService& );
-
-private:
-
-  // using the address of the type name string as compiler will allocate these once per library
-  // and we don't support un/re-loading of dali libraries while singleton service is alive
-  typedef std::pair< const char*, BaseHandle> SingletonPair;
-  typedef std::vector< SingletonPair >  SingletonContainer;
-  typedef SingletonContainer::const_iterator SingletonConstIter;
-
-  SingletonContainer mSingletonContainer; ///< The container to look up singleton by its type name
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::Adaptor::SingletonService& GetImplementation(Dali::SingletonService& player)
-{
-  DALI_ASSERT_ALWAYS( player && "SingletonService handle is empty" );
-
-  BaseObject& handle = player.GetBaseObject();
-
-  return static_cast<Internal::Adaptor::SingletonService&>(handle);
-}
-
-inline const Internal::Adaptor::SingletonService& GetImplementation(const Dali::SingletonService& player)
-{
-  DALI_ASSERT_ALWAYS( player && "SingletonService handle is empty" );
-
-  const BaseObject& handle = player.GetBaseObject();
-
-  return static_cast<const Internal::Adaptor::SingletonService&>(handle);
-}
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_SINGLETON_SERVICE_H
index 62084d5..572747d 100644 (file)
@@ -20,9 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index 0ac2ec5..3c5be55 100644 (file)
@@ -16,7 +16,6 @@ SET( adaptor_system_common_src_files
     ${adaptor_system_dir}/common/performance-logger-impl.cpp
     ${adaptor_system_dir}/common/performance-marker.cpp
     ${adaptor_system_dir}/common/performance-server.cpp
-    ${adaptor_system_dir}/common/singleton-service-impl.cpp
     ${adaptor_system_dir}/common/sound-player-impl.cpp
     ${adaptor_system_dir}/common/stat-context.cpp
     ${adaptor_system_dir}/common/stat-context-manager.cpp
index 2f5e7ab..7142ada 100755 (executable)
 // CLASS  HEADER
 #include <dali/internal/text/text-abstraction/bidirectional-support-impl.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
 // EXTERNAL INCLUDES
 #include <memory.h>
 #include <fribidi/fribidi.h>
 #include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
index 862ff7b..1a653d6 100755 (executable)
@@ -24,7 +24,7 @@
 #endif
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/common/singleton-service.h>
 #include <dali/internal/text/text-abstraction/font-client-plugin-impl.h>
 
 #include <dali/devel-api/text-abstraction/glyph-info.h>
index f585163..fd97c20 100644 (file)
 // CLASS  HEADER
 #include <dali/internal/text/text-abstraction/segmentation-impl.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
 // EXTERNAL INCLUDES
+#include <dali/devel-api/common/singleton-service.h>
 #include <third-party/libunibreak/linebreak.h>
 #include <third-party/libunibreak/wordbreak.h>
 
index 30dfbd0..b785c02 100755 (executable)
@@ -19,7 +19,6 @@
 #include <dali/internal/text/text-abstraction/shaping-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/devel-api/text-abstraction/glyph-info.h>
 #include <dali/integration-api/debug.h>
@@ -28,6 +27,7 @@
 // EXTERNAL INCLUDES
 #include <harfbuzz/hb.h>
 #include <harfbuzz/hb-ft.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace
 {
index 449eaa1..a360361 100755 (executable)
 // CLASS  HEADER
 #include <dali/internal/text/text-abstraction/text-renderer-impl.h>
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/common/singleton-service.h>
+
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/text/text-abstraction/cairo-renderer.h>
 
 namespace Dali