Ported IMF manager changes for C# 61/169161/2
authorDavid Steele <david.steele@samsung.com>
Fri, 2 Feb 2018 13:58:55 +0000 (13:58 +0000)
committerDavid Steele <david.steele@samsung.com>
Fri, 2 Feb 2018 16:25:03 +0000 (16:25 +0000)
Destroying IMF manager from C# side needs a 'Finalize' method to shut down
object cleanly.

Change-Id: I9c2f4bdeca7ae6af58df0863ed26e3a73f322224

dali/devel-api/adaptor-framework/imf-manager.cpp
dali/devel-api/adaptor-framework/imf-manager.h
dali/internal/input/common/imf-manager-impl.cpp
dali/internal/input/common/imf-manager-impl.h [changed mode: 0644->0755]
dali/internal/input/tizen-wayland/imf-manager-impl-ecore-wl.cpp
dali/internal/input/tizen-wayland/imf-manager-impl-ecore-wl.h
dali/internal/input/ubuntu-x11/imf-manager-impl-x.cpp
dali/internal/input/ubuntu-x11/imf-manager-impl-x.h

index 58d0e44..acd9b9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -33,6 +33,11 @@ ImfManager::~ImfManager()
 {
 }
 
+void ImfManager::Finalize()
+{
+  Internal::Adaptor::ImfManager::GetImplementation(*this).Finalize();
+}
+
 ImfManager ImfManager::Get()
 {
   return Internal::Adaptor::ImfManager::Get();
index 93ece49..aa28da9 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_IMF_MANAGER_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -172,6 +172,13 @@ public:
 public:
 
   /**
+   * @brief Finalize the IMF.
+   *
+   * It means that the context will be deleted.
+   */
+  void Finalize();
+
+  /**
    * @brief Retrieve a handle to the instance of ImfManager.
    * @return A handle to the ImfManager.
    */
index 58138ad..41cd44c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -50,6 +50,9 @@ Dali::ImfManager ImfManager::Get()
 ImfManager::~ImfManager()
 {}
 
+void ImfManager::Finalize()
+{}
+
 void ImfManager::NotifyCursorPosition()
 {}
 
@@ -166,4 +169,4 @@ std::string ImfManager::GetInputPanelLocale()
 
 }
 }
-}
\ No newline at end of file
+}
old mode 100644 (file)
new mode 100755 (executable)
index fca45c8..1c73810
@@ -55,7 +55,6 @@ public:
   using ImfKeyboardResizedSignalType = Dali::ImfManager::KeyboardResizedSignalType;
 
 public:
-
   /**
    * Check whether the ImfManager is available.
    * @return true if available, false otherwise
@@ -83,6 +82,11 @@ public:
   virtual void DisconnectCallbacks();
 
   /**
+   * @copydoc Dali::ImfManager::Finalize()
+   */
+  virtual void Finalize();
+
+  /**
    * @copydoc Dali::ImfManager::Activate()
    */
   virtual void Activate();
@@ -316,4 +320,4 @@ public:
 
 } // namespace Dali
 
-#endif // DALI_INTERNAL_INPUT_COMMON_IMF_MANAGER_IMPL_H
+#endif // __DALI_INTERNAL_IMF_MANAGER_H
index f8a8d49..7ddd5ed 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -290,7 +290,6 @@ Dali::ImfManager ImfManagerEcoreWl::Get()
     else if ( Adaptor::IsAvailable() )
     {
       // Create instance and register singleton only if the adaptor is available
-
       Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
       Any nativeWindow = adaptorImpl.GetNativeWindowHandle();
 
@@ -331,10 +330,15 @@ ImfManagerEcoreWl::ImfManagerEcoreWl( Ecore_Wl_Window *ecoreWlwin )
 
 ImfManagerEcoreWl::~ImfManagerEcoreWl()
 {
-  DisconnectCallbacks();
+  Finalize();
+  ecore_imf_shutdown();
+}
 
+void ImfManagerEcoreWl::Finalize()
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::Finalize\n" );
+  DisconnectCallbacks();
   DeleteContext();
-  ecore_imf_shutdown();
 }
 
 void ImfManagerEcoreWl::CreateContext( Ecore_Wl_Window *ecoreWlwin )
@@ -922,4 +926,4 @@ std::string ImfManagerEcoreWl::GetInputPanelLocale()
 
 } // Dali
 
-#pragma GCC diagnostic pop
\ No newline at end of file
+#pragma GCC diagnostic pop
index 406fe97..2e5c516 100644 (file)
@@ -72,6 +72,11 @@ public:
   void DisconnectCallbacks() override;
 
   /**
+   * @copydoc Dali::ImfManager::Finalize()
+   */
+  void Finalize() override;
+
+  /**
    * @copydoc Dali::ImfManager::Activate()
    */
   void Activate() override;
index 5f1338b..ee39014 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -195,12 +195,18 @@ ImfManagerX::ImfManagerX( Ecore_X_Window ecoreXwin )
 ImfManagerX::~ImfManagerX()
 {
   VirtualKeyboard::DisconnectCallbacks( mIMFContext );
-  DisconnectCallbacks();
+  Finalize();
+  ecore_imf_shutdown();
+}
 
+void ImfManagerX::Finalize()
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::Finalize\n" );
+  DisconnectCallbacks();
   DeleteContext();
-  ecore_imf_shutdown();
 }
 
+
 void ImfManagerX::CreateContext( Ecore_X_Window ecoreXwin )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::CreateContext\n" );
index e8e9a22..c223e79 100644 (file)
@@ -76,6 +76,11 @@ public:
   void DisconnectCallbacks() override;
 
   /**
+   * @copydoc Dali::ImfManager::Finalize()
+   */
+  void Finalize() override;
+
+  /**
    * @copydoc Dali::ImfManager::Activate()
    */
   void Activate() override;