Merge "Remove unused enumeration types of ButtonAction" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / ubuntu-x11 / virtual-keyboard-impl-x.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 19e0d2b..2aa062d
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * 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.
 #include <dali/internal/input/common/virtual-keyboard-impl.h>
 
 // EXTERNAL INCLUDES
-#include <X11/Xlib.h>
-#include <Ecore_X.h>
 #include <algorithm>
-
+#include <X11/Xlib.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/internal/input/ubuntu-x11/input-method-context-impl-x.h>
 #include <dali/internal/system/common/locale-utils.h>
-#include <dali/internal/input/ubuntu-x11/imf-manager-impl-x.h>
-
+#include <dali/internal/system/linux/dali-ecore-x.h>
 
 namespace Dali
 {
@@ -55,12 +53,9 @@ Ecore_IMF_Input_Panel_Return_Key_Type buttonActionMapping(Dali::InputMethod::But
     case InputMethod::ButtonAction::JOIN:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN;
     case InputMethod::ButtonAction::LOGIN:       return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN;
     case InputMethod::ButtonAction::NEXT:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
-    case InputMethod::ButtonAction::PREVIOUS:    return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
     case InputMethod::ButtonAction::SEARCH:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
     case InputMethod::ButtonAction::SEND:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND;
-    case InputMethod::ButtonAction::SIGNIN:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
-    case InputMethod::ButtonAction::UNSPECIFIED: return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
-    case InputMethod::ButtonAction::NONE:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+    case InputMethod::ButtonAction::SIGNIN:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN;
     default:                                     return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
   }
 }
@@ -76,7 +71,7 @@ void RotateTo(int angle)
     // Get Focus window
     XGetInputFocus(display, &focusWindow, &revert);
 
-    ecore_x_window_prop_property_set( focusWindow,
+    ecore_x_window_prop_property_set( static_cast<Ecore_X_Window>( focusWindow ),
                                       ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
                                       ECORE_X_ATOM_CARDINAL, 32, &angle, 1 );
     XCloseDisplay(display);
@@ -85,14 +80,6 @@ void RotateTo(int angle)
 
 void SetReturnKeyType( const InputMethod::ButtonAction::Type type )
 {
-  Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when setting values
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>(ImfManager::GetImplementation( imfManager ).GetContext());
-
-  if( imfContext )
-  {
-    gButtonActionFunction = type;
-    ecore_imf_context_input_panel_return_key_type_set( imfContext, buttonActionMapping( type ) );
-  }
 }
 
 Dali::InputMethod::ButtonAction::Type GetReturnKeyType()