Add a new interface to pass processing result asynchronously 59/250659/2
authorInHong Han <inhong1.han@samsung.com>
Wed, 30 Dec 2020 06:46:00 +0000 (15:46 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 31 Dec 2020 01:40:35 +0000 (10:40 +0900)
Change-Id: I7ceda8ccc0b11b18c341ab7248af215d3f088144
(cherry picked from commit b37da750a87e66eaccbce50533f04f0712af1ee6)

src/sclconnection-isf.cpp
src/sclconnection-isf.h
src/sclconnection.cpp
src/sclconnection.h
src/sclcore.cpp
src/sclcore.h
src/sclcorecallback.h
src/sclcoreimpl.cpp
src/sclcoreimpl.h

index d8011fa..295f08e 100644 (file)
@@ -735,12 +735,12 @@ static void slot_set_optimization_hint(const scim::HelperAgent *agent, scim::uin
     }
 }
 
-static void slot_process_key_event_with_imengine(const scim::HelperAgent *agent, scim::KeyEvent &key, scim::uint32 &ret) {
+static void slot_process_key_event_with_imengine(const scim::HelperAgent *agent, scim::KeyEvent &key, scim::uint32 serial) {
     CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
     if (impl) {
         ISCLCoreEventCallback *callback = impl->get_core_event_callback();
         if (callback) {
-            callback->on_process_key_event_with_imengine(key, &ret);
+            callback->on_process_key_event_with_imengine(key, serial);
         }
     }
 }
@@ -1345,7 +1345,7 @@ void CSCLConnectionISF::send_private_command(const sclchar *command)
             callback->on_update_associate_table_page_size(0, NULL, 0);
             callback->on_process_key_event(key, NULL);
             callback->on_process_key_event_with_keycode(key, NULL, 0);
-            callback->on_process_key_event_with_imengine(key, NULL);
+            callback->on_process_key_event_with_imengine(key, 0);
 
             callback->on_set_display_language(NULL);
             callback->on_set_rotation_degree(0);
@@ -1460,6 +1460,13 @@ void CSCLConnectionISF::set_engine_loader_flag(sclboolean flag)
     }
 }
 
+void CSCLConnectionISF::send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success)
+{
+    if (m_initialized) {
+        m_helper_agent.send_key_event_processing_result(key, serial, is_success);
+    }
+}
+
 extern "C"
 {
     EXAPI void scim_module_init(void) {
index b3a95cc..dc67c5e 100644 (file)
@@ -98,6 +98,7 @@ public:
     void contract_candidate(void);
     void set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
     void set_engine_loader_flag(sclboolean flag);
+    void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
 private:
     sclboolean m_initialized;
 
index 4dd5cb6..561dfc2 100644 (file)
@@ -434,4 +434,11 @@ void CSCLConnection::set_engine_loader_flag(sclboolean flag)
     if (m_impl) {
         m_impl->set_engine_loader_flag(flag);
     }
+}
+
+void CSCLConnection::send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success)
+{
+    if (m_impl) {
+        m_impl->send_key_event_processing_result(key, serial, is_success);
+    }
 }
\ No newline at end of file
index 60da43e..db4656e 100644 (file)
@@ -104,6 +104,7 @@ public:
     virtual void contract_candidate(void);
     virtual void set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
     virtual void set_engine_loader_flag(sclboolean flag);
+    virtual void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
 protected:
     std::string m_backend_identifier;
 
index e507274..20e791b 100644 (file)
@@ -478,3 +478,10 @@ void CSCLCore::set_engine_loader_flag(sclboolean flag)
         m_impl->set_engine_loader_flag(flag);
     }
 }
+
+void CSCLCore::send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success)
+{
+    if (m_impl) {
+        m_impl->send_key_event_processing_result(key, serial, is_success);
+    }
+}
\ No newline at end of file
index 1cfb66d..5ce86b5 100644 (file)
@@ -484,6 +484,11 @@ public:
      */
     void set_engine_loader_flag(sclboolean flag);
 
+    /**
+     * @brief Request to send key event processing result
+     */
+    void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
+
 
 private:
     CSCLCoreImpl *m_impl;
index 6daf32a..1b76360 100644 (file)
@@ -78,7 +78,7 @@ struct ISCLCoreEventCallback {
     virtual void on_update_associate_table_page_size(sclint ic, const sclchar *uuid, sclint page_size) {}
     virtual void on_process_key_event(scim::KeyEvent &key, sclu32 *ret) {}
     virtual void on_process_key_event_with_keycode(scim::KeyEvent &key, sclu32 *ret, sclu32 keycode) {}
-    virtual void on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 *ret) {}
+    virtual void on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 serial) {}
 
     virtual void on_set_display_language(const sclchar *language) {}
     virtual void on_set_rotation_degree(sclint degree) {}
index 6c79337..9d0d7bb 100644 (file)
@@ -473,3 +473,8 @@ void CSCLCoreImpl::set_engine_loader_flag(sclboolean flag)
 {
     m_connection.set_engine_loader_flag(flag);
 }
+
+void CSCLCoreImpl::send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success)
+{
+    m_connection.send_key_event_processing_result(key, serial, is_success);
+}
\ No newline at end of file
index d78ee04..40fec01 100644 (file)
@@ -122,6 +122,7 @@ public:
     void contract_candidate(void);
     void set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
     void set_engine_loader_flag(sclboolean flag);
+    void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
 private:
     ISCLCoreEventCallback *m_event_callback;