Revert "[Tizen] ecore-wl2: applying ecore-wl2"
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / tizen-wayland / imf-manager-impl-ecore-wl.cpp
index f8a8d49..ebe400a 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.
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/input-method-devel.h>
 #include <dali/integration-api/adaptor.h>
 #include <dali/internal/system/common/locale-utils.h>
 #include <dali/internal/window-system/tizen-wayland/window-render-surface-ecore-wl.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/public-api/adaptor-framework/input-method.h>
 
 #define TOKEN_STRING(x) #x
 
@@ -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 )
@@ -748,13 +752,13 @@ void ImfManagerEcoreWl::ApplyOptions( const InputMethodOptions& options )
   {
     ecore_imf_context_input_panel_layout_set( mIMFContext, panelLayoutMap[index] );
   }
-  if ( mOptions.CompareAndSet(AUTO_CAPITALISE, options, index) )
+  if ( mOptions.CompareAndSet(BUTTON_ACTION, options, index) )
   {
-    ecore_imf_context_autocapital_type_set( mIMFContext, autoCapitalMap[index] );
+    ecore_imf_context_input_panel_return_key_type_set( mIMFContext, returnKeyTypeMap[index] );
   }
-  if ( mOptions.CompareAndSet(ACTION_BUTTON_TITLE, options, index) )
+  if ( mOptions.CompareAndSet(AUTO_CAPITALIZE, options, index) )
   {
-    ecore_imf_context_input_panel_return_key_type_set( mIMFContext, returnKeyTypeMap[index] );
+    ecore_imf_context_autocapital_type_set( mIMFContext, autoCapitalMap[index] );
   }
   if ( mOptions.CompareAndSet(VARIATION, options, index) )
   {
@@ -922,4 +926,4 @@ std::string ImfManagerEcoreWl::GetInputPanelLocale()
 
 } // Dali
 
-#pragma GCC diagnostic pop
\ No newline at end of file
+#pragma GCC diagnostic pop