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 d8011fad5f325e2de7f827ccd293b6e97756d5ff..295f08ee48022950539a191a359dceea7607bb0e 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 b3a95cc7a8a21cf2fdc53cc1025908f0d1e9255a..dc67c5efe3c51c430083da00f97966eee34265ab 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 4dd5cb648dcaa791bfb09122e0e0ade9a26906fe..561dfc2710bcf79fa8b44395f249af3bbab59e5b 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 60da43ea6bcbcbd4ff457401598e47c3886d4939..db4656ec90f4130db20aa2d401e37c5f46b90efa 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 e5072744c583c6dcfbdc13a0fa77f58181f953ac..20e791bef6925fd45436ed6b0b9c6200bd08314d 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 1cfb66d2fb448f803b070b798348975ccf92157d..5ce86b50e0f2135dc95ad067474a25e822621580 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 6daf32a88ebd19d5e65679a31bf073184bc576be..1b7636076fca192255ecf27935bf48491550b179 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 6c79337e5d3447fb43e86187c1d41589bca89c3f..9d0d7bb3ce6e09d1db8934a70889bb6ebc900e7e 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 d78ee04fabe11d59832eec0ab3b013d4a284efa4..40fec01fd2fbcf090daa76091536b99319e5f2f9 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;