Update Ise_Context for reshow in IME On-demand 50/185450/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Tue, 31 Jul 2018 00:42:57 +0000 (09:42 +0900)
committerSungmin Kwak <sungmin.kwak@samsung.com>
Tue, 31 Jul 2018 00:44:23 +0000 (09:44 +0900)
Change-Id: I1402310bd1052d4fb9db92eb7bdb02fdf0bbcada

ism/src/isf_info_manager.cpp

index 17bb52c..6967e19 100644 (file)
@@ -68,6 +68,7 @@
 #include "isf_panel_agent_manager.h"
 #include "isf_debug.h"
 #include "isf_pkg.h"
+#include "ise_context.h"
 
 #ifdef LOG_TAG
 # undef LOG_TAG
@@ -1670,7 +1671,10 @@ public:
     //ISM_TRANS_CMD_SET_LAYOUT
     void set_ise_layout (int client_id, uint32 layout) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_layout (m_current_helper_uuid, layout);
     }
@@ -1684,21 +1688,30 @@ public:
     //ISM_TRANS_CMD_SET_INPUT_HINT
     void set_ise_input_hint (int client_id, uint32 input_hint) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(input_hint);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_input_hint (m_current_helper_uuid, input_hint);
     }
     //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
     void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->bidi_direction = static_cast<Ecore_IMF_BiDi_Direction>(bidi_direction);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
     }
     //ISM_TRANS_CMD_SET_ISE_LANGUAGE
     void set_ise_language (int client_id, uint32 language) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->language = static_cast<Ecore_IMF_Input_Panel_Lang>(language);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_language (m_current_helper_uuid, language);
     }
@@ -1911,7 +1924,10 @@ public:
     //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
     void set_ise_return_key_type (int client_id, uint32 type) {
         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(type);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_return_key_type (m_current_helper_uuid, type);
     }
@@ -1929,6 +1945,10 @@ public:
     //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
     void set_ise_return_key_disable (int client_id, uint32 disabled) {
         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->return_key_disabled = static_cast<Eina_Bool>(disabled);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_return_key_disable (m_current_helper_uuid, disabled);
     }
@@ -1967,7 +1987,10 @@ public:
     //ISM_TRANS_CMD_SET_CAPS_MODE
     void set_ise_caps_mode (int client_id, uint32 mode) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->caps_mode = static_cast<Eina_Bool>(mode);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
             set_helper_caps_mode (m_current_helper_uuid, mode);
     }
@@ -3015,6 +3038,10 @@ client context helpers: %d, helpers uuid count: %d",
     void socket_update_cursor_position (uint32 cursor_pos) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
         SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->cursor_pos = static_cast<int>(cursor_pos);
+        }
         helper_all_update_cursor_position ((int)cursor_pos);
     }
     //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
@@ -3056,7 +3083,14 @@ client context helpers: %d, helpers uuid count: %d",
 
     void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
+            iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
+            iseContext->layout_variation = static_cast<int>(variation);
+            iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
+            iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
+        }
         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
             lock();
             m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
@@ -4245,7 +4279,10 @@ client context helpers: %d, helpers uuid count: %d",
 
     bool set_autocapital_type (int mode) {
         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
 
@@ -4266,7 +4303,10 @@ client context helpers: %d, helpers uuid count: %d",
 
     bool set_prediction_allow (int client, int mode) {
         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
-
+        if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
+            Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
+            iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
+        }
         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);