From 4461422c02529a2c7c4fa12e4c838c8cfe7553a6 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 5 Dec 2016 09:54:49 +0900 Subject: [PATCH] Modified to commit preedit_commit strings in remote input Change-Id: I19974a9df4b0efb7357ff2fd88510503415a725a --- ism/extras/efl_panel/remote_input.cpp | 11 ++++------- .../ecoresocket/ecore_socket_panel_agent_module.cpp | 3 ++- ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp | 8 +++++--- ism/src/isf_info_manager.cpp | 2 +- ism/src/isf_panel_agent_base.cpp | 2 +- ism/src/isf_panel_agent_base.h | 2 +- ism/src/isf_panel_agent_manager.cpp | 4 ++-- ism/src/isf_panel_agent_manager.h | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ism/extras/efl_panel/remote_input.cpp b/ism/extras/efl_panel/remote_input.cpp index e6a80d3..5dfd8f4 100644 --- a/ism/extras/efl_panel/remote_input.cpp +++ b/ism/extras/efl_panel/remote_input.cpp @@ -464,22 +464,19 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message) if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_COMMIT_STRING]) == 0) { if (message.values.size() == 1) { - scim::AttributeList attrs; - attrs.push_back(scim::Attribute(0, scim::utf8_mbstowcs((char*)message.values.at(0).c_str()).length(), scim::SCIM_ATTR_DECORATE, scim::SCIM_ATTR_DECORATE_UNDERLINE)); - LOGD( "commit_str:|%s|", message.values.at(0).c_str()); - _info_manager->remoteinput_commit_string(scim::utf8_mbstowcs((char*)message.values.at(0).c_str())); + _info_manager->remoteinput_commit_string(utf8_mbstowcs((char*)message.values.at(0).c_str())); } } if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_UPDATE_PREEDIT_STRING]) == 0) { - scim::AttributeList attrs; - attrs.push_back(scim::Attribute(0, scim::utf8_mbstowcs((char*)message.values.at(0).c_str()).length(), scim::SCIM_ATTR_DECORATE, scim::SCIM_ATTR_DECORATE_UNDERLINE)); + AttributeList attrs; + attrs.push_back(Attribute(0, utf8_mbstowcs((char*)message.values.at(0).c_str()).length(), SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_UNDERLINE)); if (message.values.size() == 2) { int caret = atoi(message.values.at(1).c_str()); LOGD ("preedit:|%s|, caret = %d", message.values.at(0).c_str(), caret); - _info_manager->remoteinput_update_preedit_string(scim::utf8_mbstowcs((char*)message.values.at(0).c_str()), attrs, (uint32) caret); + _info_manager->remoteinput_update_preedit_string(utf8_mbstowcs((char*)message.values.at(0).c_str()), attrs, (uint32) caret); } else { _info_manager->remoteinput_update_preedit_string(L"", attrs, 0); } diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp index dc7393b..97743d6 100755 --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -1511,7 +1511,7 @@ private: m_send_trans.write_to_socket(client_socket); } - void remote_update_preedit_string (int client, uint32 target_context, const WideString str, const AttributeList &attrs, uint32 caret) { + void remote_update_preedit_string (int client, uint32 target_context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { LOGD("client id:%d\n", client); Socket client_socket(client); @@ -1521,6 +1521,7 @@ private: m_send_trans.put_data(target_context); m_send_trans.put_command(SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING); m_send_trans.put_data(str); + m_send_trans.put_data(commit); m_send_trans.put_data(attrs); m_send_trans.put_data(caret); m_send_trans.write_to_socket(client_socket); diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index 676f52b..2e5d981 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -148,6 +148,7 @@ static void panel_slot_forward_key_event (int bool remote_mode); static void panel_slot_update_preedit_string (int context, const WideString str, + const WideString commit, const AttributeList &attrs, int caret, bool remote_mode); @@ -2324,7 +2325,7 @@ panel_slot_forward_key_event (int context, const KeyEvent &key, bool remote_mode } static void -panel_slot_update_preedit_string (int context, const WideString str, const AttributeList &attrs, int caret, bool remote_mode) +panel_slot_update_preedit_string (int context, const WideString str, const WideString commit, const AttributeList &attrs, int caret, bool remote_mode) { LOGD (""); WSCContextISF* ic = find_ic (context); @@ -2345,6 +2346,7 @@ panel_slot_update_preedit_string (int context, const WideString str, const Attri if (ic->impl->preedit_string != str || str.length ()) { ic->impl->preedit_string = str; ic->impl->preedit_attrlist = attrs; + ic->impl->commit_string = commit; if (ic->impl->use_preedit) { if (!ic->impl->preedit_started) { @@ -2683,9 +2685,9 @@ public: } void - remote_update_preedit_string (int id, uint32 context_id, const WideString str, const AttributeList &attrs, uint32 caret) { + remote_update_preedit_string (int id, uint32 context_id, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { LOGD ("client id:%d", id); - panel_slot_update_preedit_string (context_id, str, attrs, caret, true); + panel_slot_update_preedit_string (context_id, str, commit, attrs, caret, true); } void diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index cae12c8..767f9d1 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -1949,7 +1949,7 @@ public: get_focused_context (client, context); if (client >= 0) { - m_panel_agent_manager.remote_update_preedit_string (client, context, str, attrs, caret); + m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret); } unlock (); diff --git a/ism/src/isf_panel_agent_base.cpp b/ism/src/isf_panel_agent_base.cpp index a66bebf..a3ba20e 100644 --- a/ism/src/isf_panel_agent_base.cpp +++ b/ism/src/isf_panel_agent_base.cpp @@ -540,7 +540,7 @@ void PanelAgentBase::set_autocapital_type(int client, uint32 context, String uui LOGW("not implemented for %s", m_name.c_str()); } -void PanelAgentBase::remote_update_preedit_string (int client, uint32 context, const WideString str, const AttributeList &attrs, uint32 caret) +void PanelAgentBase::remote_update_preedit_string (int client, uint32 context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { LOGW ("not implemented for %s", m_name.c_str ()); } diff --git a/ism/src/isf_panel_agent_base.h b/ism/src/isf_panel_agent_base.h index 3458d51..8015dce 100644 --- a/ism/src/isf_panel_agent_base.h +++ b/ism/src/isf_panel_agent_base.h @@ -869,7 +869,7 @@ public: * * @return none. */ - virtual void remote_update_preedit_string (int client, uint32 context, const WideString str, const AttributeList &attrs, uint32 caret); + virtual void remote_update_preedit_string (int client, uint32 context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret); /** * @brief remote_send_key_event. diff --git a/ism/src/isf_panel_agent_manager.cpp b/ism/src/isf_panel_agent_manager.cpp index a999bf5..7679a75 100644 --- a/ism/src/isf_panel_agent_manager.cpp +++ b/ism/src/isf_panel_agent_manager.cpp @@ -846,12 +846,12 @@ void PanelAgentManager::set_autocapital_type(int id, uint32 context_id, String u _p->set_autocapital_type (id, context_id, uuid, mode); } -void PanelAgentManager::remote_update_preedit_string (int id, uint32 context_id, const WideString str, const AttributeList &attrs, uint32 caret) +void PanelAgentManager::remote_update_preedit_string (int id, uint32 context_id, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); if (!_p.null ()) - _p->remote_update_preedit_string (id, context_id, str, attrs, caret); + _p->remote_update_preedit_string (id, context_id, str, commit, attrs, caret); } void PanelAgentManager::remote_send_key_event (int id, uint32 context_id, const KeyEvent &key) diff --git a/ism/src/isf_panel_agent_manager.h b/ism/src/isf_panel_agent_manager.h index 64fd175..9716775 100644 --- a/ism/src/isf_panel_agent_manager.h +++ b/ism/src/isf_panel_agent_manager.h @@ -350,7 +350,7 @@ public: void process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial); void request_ise_hide(int client, uint32 context); void set_autocapital_type(int id, uint32 context_id, String uuid, int mode); - void remote_update_preedit_string (int target_client, uint32 target_context, const WideString str, const AttributeList &attrs, uint32 caret); + void remote_update_preedit_string (int target_client, uint32 target_context, const WideString str, const WideString commit,const AttributeList &attrs, uint32 caret); void remote_send_key_event (int target_client, uint32 target_context, const KeyEvent &key); void remote_forward_key_event (int target_client, uint32 target_context, const KeyEvent &key); void remote_commit_string (int target_client, uint32 target_context,const WideString& wstr); -- 2.7.4