From: InHong Han Date: Wed, 30 Dec 2020 06:46:00 +0000 (+0900) Subject: Add a new interface to pass processing result asynchronously X-Git-Tag: accepted/tizen/unified/20210101.123050~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae1466e39660d010bf2508c06bb01a829ba6025b;p=platform%2Fcore%2Fuifw%2Flibscl-core.git Add a new interface to pass processing result asynchronously Change-Id: I7ceda8ccc0b11b18c341ab7248af215d3f088144 (cherry picked from commit b37da750a87e66eaccbce50533f04f0712af1ee6) --- diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index d8011fa..295f08e 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -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) { diff --git a/src/sclconnection-isf.h b/src/sclconnection-isf.h index b3a95cc..dc67c5e 100644 --- a/src/sclconnection-isf.h +++ b/src/sclconnection-isf.h @@ -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; diff --git a/src/sclconnection.cpp b/src/sclconnection.cpp index 4dd5cb6..561dfc2 100644 --- a/src/sclconnection.cpp +++ b/src/sclconnection.cpp @@ -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 diff --git a/src/sclconnection.h b/src/sclconnection.h index 60da43e..db4656e 100644 --- a/src/sclconnection.h +++ b/src/sclconnection.h @@ -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; diff --git a/src/sclcore.cpp b/src/sclcore.cpp index e507274..20e791b 100644 --- a/src/sclcore.cpp +++ b/src/sclcore.cpp @@ -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 diff --git a/src/sclcore.h b/src/sclcore.h index 1cfb66d..5ce86b5 100644 --- a/src/sclcore.h +++ b/src/sclcore.h @@ -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; diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 6daf32a..1b76360 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -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) {} diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp index 6c79337..9d0d7bb 100644 --- a/src/sclcoreimpl.cpp +++ b/src/sclcoreimpl.cpp @@ -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 diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h index d78ee04..40fec01 100644 --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -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;