Modified to commit preedit_commit strings in remote input 50/102050/2
authorInHong Han <inhong1.han@samsung.com>
Mon, 5 Dec 2016 00:54:49 +0000 (09:54 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 5 Dec 2016 06:08:20 +0000 (22:08 -0800)
Change-Id: I19974a9df4b0efb7357ff2fd88510503415a725a

ism/extras/efl_panel/remote_input.cpp
ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp
ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp
ism/src/isf_info_manager.cpp
ism/src/isf_panel_agent_base.cpp
ism/src/isf_panel_agent_base.h
ism/src/isf_panel_agent_manager.cpp
ism/src/isf_panel_agent_manager.h

index e6a80d3..5dfd8f4 100644 (file)
@@ -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);
         }
index dc7393b..97743d6 100755 (executable)
@@ -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);
index 676f52b..2e5d981 100644 (file)
@@ -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
index cae12c8..767f9d1 100644 (file)
@@ -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 ();
index a66bebf..a3ba20e 100644 (file)
@@ -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 ());
 }
index 3458d51..8015dce 100644 (file)
@@ -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.
index a999bf5..7679a75 100644 (file)
@@ -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)
index 64fd175..9716775 100644 (file)
@@ -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);