From dada9403dec6a2a1d4f5f4de33b6f5810846cb10 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 17 Jan 2015 15:51:48 +0900 Subject: [PATCH 01/16] Fix build related to cmake Change-Id: I9f0511e96a2548ecb414caf693b1b26b3b426d98 --- packaging/libscl-core.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index a4cb58f..415c5cd 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -37,6 +37,9 @@ A devel pacakge of libscl-core library that helps developing S/W Keyboard export CFLAGS+=" -DTIZEN_DEBUG_ENABLE" export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE" export FFLAGS+=" -DTIZEN_DEBUG_ENABLE" + +rm -rf CMakeFiles +rm -rf CMakeCache.txt cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?jobs:-j%jobs} -- 2.7.4 From cbb586e18c2be2a2b280f02689fe361cbd6647ca Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 20 Jan 2015 10:26:40 +0900 Subject: [PATCH 02/16] Fix build warning Change-Id: If5e33bfdc2c3237680de434e0895d46b38d48e1f --- src/sclconnection-isf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 97c5ab3..d5053ed 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -427,7 +427,7 @@ static void slot_update_lookup_table (const scim::HelperAgent *, scim::LookupTab callback->on_update_lookup_table(lookup_table); std::vector labels; - for (int loop = 0;loop < lookup_table.candidate_labels.size();loop++) { + for (unsigned int loop = 0;loop < lookup_table.candidate_labels.size();loop++) { labels.push_back(scim::utf8_mbstowcs(lookup_table.candidate_labels.at(loop).c_str())); } table.set_candidate_labels(labels); -- 2.7.4 From 5b97e5b309cef306019266902aeff41c74e003fc Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 20 Jan 2015 11:22:45 +0900 Subject: [PATCH 03/16] Add get_surrounding_text and delete_surrounding_text Change-Id: I4f16f41770421cc10a7a4940116184de3d681a3e --- src/sclconnection-isf.cpp | 18 ++++++++++++++++++ src/sclconnection-isf.h | 2 ++ src/sclconnection.cpp | 14 ++++++++++++++ src/sclconnection.h | 2 ++ src/sclcore.cpp | 16 +++++++++++++++- src/sclcore.h | 6 +++--- src/sclcoreimpl.cpp | 12 +++++++++++- src/sclcoreimpl.h | 9 +++------ 8 files changed, 68 insertions(+), 11 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index d5053ed..3066a15 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -847,6 +847,24 @@ void CSCLConnectionISF::update_input_context(sclu32 type, sclu32 value) } } +void CSCLConnectionISF::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const +{ + if (m_initialized) { + scim::String uuid; + if (ic_uuid) { + uuid = scim::String(ic_uuid); + } + m_helper_agent.get_surrounding_text(uuid, maxlen_before, maxlen_after); + } +} + +void CSCLConnectionISF::delete_surrounding_text(sclint offset, sclint len) const +{ + if (m_initialized) { + m_helper_agent.delete_surrounding_text(offset, len); + } +} + void CSCLConnectionISF::set_candidate_position(sclint left, sclint top) { if (m_initialized) { diff --git a/src/sclconnection-isf.h b/src/sclconnection-isf.h index bd66e42..3a6808c 100644 --- a/src/sclconnection-isf.h +++ b/src/sclconnection-isf.h @@ -71,6 +71,8 @@ public: void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); void update_aux_string(const sclchar *str); void update_input_context(sclu32 type, sclu32 value); + void get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const; + void delete_surrounding_text(sclint offset, sclint len) const; void set_candidate_position(sclint left, sclint top); void candidate_hide(void); void set_keyboard_ise_by_uuid(const sclchar *uuid); diff --git a/src/sclconnection.cpp b/src/sclconnection.cpp index 8cd59aa..68464ed 100644 --- a/src/sclconnection.cpp +++ b/src/sclconnection.cpp @@ -243,6 +243,20 @@ void CSCLConnection::update_input_context(sclu32 type, sclu32 value) } } +void CSCLConnection::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const +{ + if (m_impl) { + m_impl->get_surrounding_text(ic_uuid, maxlen_before, maxlen_after); + } +} + +void CSCLConnection::delete_surrounding_text(sclint offset, sclint len) const +{ + if (m_impl) { + m_impl->delete_surrounding_text(offset, len); + } +} + void CSCLConnection::set_candidate_position(sclint left, sclint top) { if (m_impl) { diff --git a/src/sclconnection.h b/src/sclconnection.h index 0179d25..5eec308 100644 --- a/src/sclconnection.h +++ b/src/sclconnection.h @@ -68,6 +68,8 @@ public: virtual void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); virtual void update_aux_string(const sclchar *str); virtual void update_input_context(sclu32 type, sclu32 value); + virtual void get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const; + virtual void delete_surrounding_text(sclint offset, sclint len) const; virtual void set_candidate_position(sclint left, sclint top); virtual void candidate_hide(void); virtual void set_keyboard_ise_by_uuid(const sclchar *uuid); diff --git a/src/sclcore.cpp b/src/sclcore.cpp index 9a27e93..4275f55 100644 --- a/src/sclcore.cpp +++ b/src/sclcore.cpp @@ -205,6 +205,20 @@ void CSCLCore::update_input_context(sclu32 type, sclu32 value) } } +void CSCLCore::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const +{ + if (m_impl) { + m_impl->get_surrounding_text(ic_uuid, maxlen_before, maxlen_after); + } +} + +void CSCLCore::delete_surrounding_text(sclint offset, sclint len) const +{ + if (m_impl) { + m_impl->delete_surrounding_text(offset, len); + } +} + void CSCLCore::set_candidate_position(sclint left, sclint top) { if (m_impl) { @@ -263,4 +277,4 @@ void CSCLCore::destroy_option_window(sclwindow window) if (m_impl) { m_impl->destroy_option_window(window); } -} \ No newline at end of file +} diff --git a/src/sclcore.h b/src/sclcore.h index 78dd569..a74adc2 100644 --- a/src/sclcore.h +++ b/src/sclcore.h @@ -221,11 +221,11 @@ public: /** * @ brief Request to get surrounding text. * - * @param[in] uuid The helper ISE UUID. + * @param[in] ic_uuid The helper ISE UUID. * @param[in] maxlen_before The max length of before. * @param[in] maxlen_after The max length of after. */ - void get_surrounding_text(const sclchar *uuid, sclint maxlen_before, sclint maxlen_after) const; + void get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const; /** * @ brief Request to delete surrounding text. @@ -233,7 +233,7 @@ public: * @param[in] offset The offset for cursor position. * @param[in] len The length for delete text. */ - void delete_surrounding_text(int offset, int len) const; + void delete_surrounding_text(sclint offset, sclint len) const; /** * @ brief Set candidate position in screen. diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp index 43b1ca4..5103a16 100644 --- a/src/sclcoreimpl.cpp +++ b/src/sclcoreimpl.cpp @@ -195,6 +195,16 @@ void CSCLCoreImpl::update_input_context(sclu32 type, sclu32 value) m_connection.update_input_context(type, value); } +void CSCLCoreImpl::get_surrounding_text(const sclchar* ic_uuid, sclint maxlen_before, sclint maxlen_after) const +{ + m_connection.get_surrounding_text(ic_uuid, maxlen_before, maxlen_after); +} + +void CSCLCoreImpl::delete_surrounding_text(sclint offset, sclint len) const +{ + m_connection.delete_surrounding_text(offset, len); +} + void CSCLCoreImpl::set_candidate_position(sclint left, sclint top) { m_connection.set_candidate_position(left, top); @@ -249,4 +259,4 @@ sclwindow CSCLCoreImpl::create_option_window() void CSCLCoreImpl::destroy_option_window(sclwindow window) { m_core_ui.destroy_option_window(window); -} \ No newline at end of file +} diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h index e11a04c..4ef1194 100644 --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -76,11 +76,8 @@ public: //void update_candidate_string (const LookupTable &table) const; //void update_associate_string (const LookupTable &table) const; void update_input_context(sclu32 type, sclu32 value); - //void get_surrounding_text (const String &uuid, - // int maxlen_before, - // int maxlen_after) const; - //void delete_surrounding_text (int offset, - // int len) const; + void get_surrounding_text(const sclchar* ic_uuid, sclint maxlen_before, sclint maxlen_after) const; + void delete_surrounding_text(sclint offset, sclint len) const; void set_candidate_position(sclint left, sclint top); void candidate_hide(void); //void get_candidate_window_geometry (const String &uuid) const; @@ -107,4 +104,4 @@ private: //SCL_END_DECLS -#endif //__SCL_CORE_IMPL_H__ \ No newline at end of file +#endif //__SCL_CORE_IMPL_H__ -- 2.7.4 From 91615de0dcb5e8649ba4c2b6c1c25c8c462f1656 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 29 Jan 2015 10:06:48 +0900 Subject: [PATCH 04/16] Split on_run callback and run method Change-Id: I09b44db4a79047c2a90a541a045a570eb86c748f --- src/sclconnection-isf.cpp | 2 +- src/sclcore.cpp | 7 +++++++ src/sclcore.h | 2 ++ src/sclcorecallback.h | 1 + src/sclcoreimpl.cpp | 22 ++++++++++++++++++++-- src/sclcoreimpl.h | 5 ++++- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 3066a15..c338a97 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -940,7 +940,7 @@ extern "C" _scim_config = config; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - impl->run(display.c_str()); + impl->on_run(display.c_str()); } } } diff --git a/src/sclcore.cpp b/src/sclcore.cpp index 4275f55..13fa0e8 100644 --- a/src/sclcore.cpp +++ b/src/sclcore.cpp @@ -34,6 +34,13 @@ CSCLCore::~CSCLCore() m_impl = NULL; } +void CSCLCore::run() +{ + if (m_impl) { + m_impl->run(); + } +} + void CSCLCore::config_reload() { if (m_impl) { diff --git a/src/sclcore.h b/src/sclcore.h index a74adc2..4319a7a 100644 --- a/src/sclcore.h +++ b/src/sclcore.h @@ -43,6 +43,8 @@ public: CSCLCore(ISCLCoreEventCallback *callback); ~CSCLCore(); + void run(); + /** * @brief Request ISF to reload all configuration. */ diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 7013228..135b608 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -44,6 +44,7 @@ struct ISCLCoreEventCallback { virtual void on_get_app_info(SclCoreAppInfo *info) {} virtual void on_init() {} + virtual void on_run(int argc, char **argv) {} virtual void on_exit() {} virtual void on_attach_input_context(sclint ic, const sclchar *ic_uuid) {} virtual void on_detach_input_context(sclint ic, const sclchar *ic_uuid) {} diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp index 5103a16..26c24ca 100644 --- a/src/sclcoreimpl.cpp +++ b/src/sclcoreimpl.cpp @@ -22,10 +22,15 @@ using namespace scl; CSCLCoreImpl::CSCLCoreImpl() { m_event_callback = NULL; + m_display = NULL; } CSCLCoreImpl::~CSCLCoreImpl() { + if (m_display) { + free(m_display); + m_display = NULL; + } } CSCLCoreImpl* @@ -225,12 +230,25 @@ void CSCLCoreImpl::get_keyboard_ise(const sclchar *uuid) m_connection.get_keyboard_ise(uuid); } -void CSCLCoreImpl::run(const sclchar *display) +void CSCLCoreImpl::on_run(const sclchar *display) { m_core_ui.init(); m_connection.init(); - m_core_ui.run(display); + if (m_display) { + free (m_display); + } + + m_display = strdup(display); + + if (m_event_callback) { + m_event_callback->on_run(1, NULL); + } +} + +void CSCLCoreImpl::run() +{ + m_core_ui.run(m_display); m_connection.fini(); m_core_ui.fini(); diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h index 4ef1194..448f6e2 100644 --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -33,6 +33,8 @@ class CSCLCoreImpl private: CSCLCoreImpl(); + sclchar* m_display; + public: ~CSCLCoreImpl(); static CSCLCoreImpl* get_instance(); @@ -40,7 +42,8 @@ public: void init(const sclchar *display); void fini(); - void run(const sclchar *display); + void on_run(const sclchar *display); + void run(); void set_core_event_callback(ISCLCoreEventCallback *callback); ISCLCoreEventCallback* get_core_event_callback(); -- 2.7.4 From ec36c19ac29abdf978f11bc55fb68b7742e2a2c4 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Sat, 31 Jan 2015 14:23:46 +0900 Subject: [PATCH 05/16] Remove a call to on_get_app_info() of each ISE. Change-Id: Ib163cba0d58f72eabe1fdb6d0492995d2c6886c8 --- src/sclconnection-isf.cpp | 59 +++++++++++++++++++++++++++-------------------- src/sclcorecallback.h | 2 -- src/sclcoreimpl.cpp | 20 ++++++++++++++-- src/sclcoreimpl.h | 4 +++- src/sclcoreui-efl.cpp | 15 +++++++----- 5 files changed, 64 insertions(+), 36 deletions(-) mode change 100644 => 100755 src/sclconnection-isf.cpp mode change 100644 => 100755 src/sclcorecallback.h mode change 100644 => 100755 src/sclcoreimpl.cpp mode change 100644 => 100755 src/sclcoreimpl.h diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp old mode 100644 new mode 100755 index c338a97..ed39041 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -17,7 +17,7 @@ #include "sclconnection-isf.h" #include "sclcoreimpl.h" - +#include #include #include @@ -530,14 +530,17 @@ sclboolean CSCLConnectionISF::init() CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - SclCoreAppInfo appinfo; - callback->on_get_app_info(&appinfo); - m_helper_info.uuid = scim::String(appinfo.uuid.c_str()); - m_helper_info.name = scim::String(appinfo.name.c_str()); - m_helper_info.option = scim::SCIM_HELPER_STAND_ALONE | scim::SCIM_HELPER_NEED_SCREEN_INFO | - scim::SCIM_HELPER_NEED_SPOT_LOCATION_INFO | scim::SCIM_HELPER_AUTO_RESTART; + sclchar *uuid = impl->get_uuid(); + if (uuid) { + sclchar *name = NULL; + int options = 0; + if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) { + m_helper_info.uuid = scim::String(uuid); + m_helper_info.name = scim::String(name); + m_helper_info.option = (scluint)options; + if (name) + free(name); + } } } @@ -908,16 +911,17 @@ extern "C" bool scim_helper_module_get_helper_info (unsigned int idx, scim::HelperInfo &info) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - SclCoreAppInfo appinfo; - callback->on_get_app_info(&appinfo); - info.uuid = scim::String(appinfo.uuid.c_str()); - info.name = scim::String(appinfo.name.c_str()); - info.option = scim::SCIM_HELPER_STAND_ALONE | scim::SCIM_HELPER_NEED_SCREEN_INFO | - scim::SCIM_HELPER_NEED_SPOT_LOCATION_INFO | scim::SCIM_HELPER_AUTO_RESTART; - - return true; + sclchar *uuid = impl->get_uuid(); + if (uuid) { + sclchar *name = NULL; + int options = 0; + if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) { + info.uuid = scim::String(uuid); + info.name = scim::String(name); + info.option = (scluint)options; + if (name) + free(name); + } } } return false; @@ -926,11 +930,16 @@ extern "C" scim::String scim_helper_module_get_helper_language (unsigned int idx) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - SclCoreAppInfo appinfo; - callback->on_get_app_info(&appinfo); - return scim::String(appinfo.language.c_str()); + sclchar *uuid = impl->get_uuid(); + if (uuid) { + sclchar *language = NULL; + if (isf_control_get_ise_info(uuid, NULL, &language, NULL, NULL) == 0) { + if (language) { + scim::String lang = scim::String(language); + free(language); + return lang; + } + } } } return scim::String(""); @@ -940,7 +949,7 @@ extern "C" _scim_config = config; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - impl->on_run(display.c_str()); + impl->on_run(uuid.c_str(), display.c_str()); } } } diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h old mode 100644 new mode 100755 index 135b608..132bea9 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -41,8 +41,6 @@ typedef struct { } SclCoreAppInfo; struct ISCLCoreEventCallback { - virtual void on_get_app_info(SclCoreAppInfo *info) {} - virtual void on_init() {} virtual void on_run(int argc, char **argv) {} virtual void on_exit() {} diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp old mode 100644 new mode 100755 index 26c24ca..259ea1f --- a/src/sclcoreimpl.cpp +++ b/src/sclcoreimpl.cpp @@ -23,6 +23,7 @@ CSCLCoreImpl::CSCLCoreImpl() { m_event_callback = NULL; m_display = NULL; + m_uuid = NULL; } CSCLCoreImpl::~CSCLCoreImpl() @@ -31,6 +32,10 @@ CSCLCoreImpl::~CSCLCoreImpl() free(m_display); m_display = NULL; } + if (m_uuid) { + free(m_uuid); + m_uuid = NULL; + } } CSCLCoreImpl* @@ -85,6 +90,11 @@ CSCLConnection* CSCLCoreImpl::get_connection() return &m_connection; } +sclchar* CSCLCoreImpl::get_uuid() +{ + return m_uuid; +} + void CSCLCoreImpl::config_reload() { m_connection.config_reload(); @@ -230,11 +240,17 @@ void CSCLCoreImpl::get_keyboard_ise(const sclchar *uuid) m_connection.get_keyboard_ise(uuid); } -void CSCLCoreImpl::on_run(const sclchar *display) +void CSCLCoreImpl::on_run(const sclchar *uuid, const sclchar *display) { m_core_ui.init(); m_connection.init(); + if (m_uuid) { + free (m_uuid); + } + + m_uuid = strdup(uuid); + if (m_display) { free (m_display); } @@ -242,7 +258,7 @@ void CSCLCoreImpl::on_run(const sclchar *display) m_display = strdup(display); if (m_event_callback) { - m_event_callback->on_run(1, NULL); + m_event_callback->on_run(0, NULL); } } diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h old mode 100644 new mode 100755 index 448f6e2..7f4e61c --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -42,7 +42,7 @@ public: void init(const sclchar *display); void fini(); - void on_run(const sclchar *display); + void on_run(const sclchar *uuid, const sclchar *display); void run(); void set_core_event_callback(ISCLCoreEventCallback *callback); @@ -50,6 +50,7 @@ public: CSCLCoreUI* get_core_ui(); CSCLConnection* get_connection(); + sclchar* get_uuid(); void config_reload(); sclboolean config_read_int(const sclchar *name, sclint &value); @@ -101,6 +102,7 @@ private: CSCLConnection m_connection; CSCLCoreUI m_core_ui; + sclchar *m_uuid; }; } diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 4a678b3..4a31eb6 100755 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -17,7 +17,7 @@ #include "sclcoreui-efl.h" #include "sclcoreimpl.h" - +#include #include #include @@ -267,11 +267,14 @@ void CSCLCoreUIEFL::run(const sclchar *display) std::string name; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - SclCoreAppInfo appinfo; - callback->on_get_app_info(&appinfo); - name = appinfo.name; + sclchar *uuid = impl->get_uuid(); + if (uuid) { + sclchar *label = NULL; + if (isf_control_get_ise_info(uuid, &label, NULL, NULL, NULL) == 0) { + name = std::string(label); + if (label) + free(label); + } } argv [0] = const_cast (name.c_str()); -- 2.7.4 From 80c687021a5ce0ff85853ae675570e867458e84a Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 9 Feb 2015 10:38:56 +0900 Subject: [PATCH 06/16] Fix a wrong indentation Change-Id: If2c64a30e6b3924ccd2e2ce9423ebb18ed7facae --- src/sclconnection-isf.cpp | 14 +++++++------- src/sclcorecallback.h | 0 src/sclcoreimpl.cpp | 0 src/sclcoreimpl.h | 0 src/sclcoreui-efl.cpp | 0 5 files changed, 7 insertions(+), 7 deletions(-) mode change 100755 => 100644 src/sclconnection-isf.cpp mode change 100755 => 100644 src/sclcorecallback.h mode change 100755 => 100644 src/sclcoreimpl.cpp mode change 100755 => 100644 src/sclcoreimpl.h mode change 100755 => 100644 src/sclcoreui-efl.cpp diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp old mode 100755 new mode 100644 index ed39041..1f3303e --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -328,13 +328,13 @@ static void slot_update_candidate_geometry (const scim::HelperAgent *agent, int } static void slot_update_keyboard_ise (const scim::HelperAgent *agent, int ic, const scim::String &uuid, const scim::String &ise_name, const scim::String &ise_uuid) { - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - callback->on_update_keyboard_ise(ic, uuid.c_str(), ise_name.c_str(), ise_uuid.c_str()); - } - } + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + ISCLCoreEventCallback *callback = impl->get_core_event_callback(); + if (callback) { + callback->on_update_keyboard_ise(ic, uuid.c_str(), ise_name.c_str(), ise_uuid.c_str()); + } + } } static void slot_candidate_more_window_show (const scim::HelperAgent *agent, int ic, const scim::String &uuid) { diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h old mode 100755 new mode 100644 diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp old mode 100755 new mode 100644 diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h old mode 100755 new mode 100644 diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp old mode 100755 new mode 100644 -- 2.7.4 From 1b2001903dba63b600e8ffa2034cd52f53e6dd4d Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Wed, 11 Feb 2015 18:00:44 +0900 Subject: [PATCH 07/16] Fix the name of IME window Change-Id: I3c82e4f323758b1d47755b41c85bf64640d93b47 --- src/sclcoreui-efl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/sclcoreui-efl.cpp diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp old mode 100644 new mode 100755 index 4a31eb6..15fab59 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -286,13 +286,13 @@ void CSCLCoreUIEFL::run(const sclchar *display) elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); - Evas_Object *main_window = elm_win_add(NULL, "Tizen Keyboard", ELM_WIN_UTILITY); + Evas_Object *main_window = elm_win_add(NULL, name.c_str(), ELM_WIN_UTILITY); m_main_window = SCL_WINDOW_CAST(main_window); elm_win_borderless_set(main_window, EINA_TRUE); elm_win_keyboard_win_set(main_window, EINA_TRUE); elm_win_autodel_set(main_window, EINA_TRUE); - elm_win_title_set(main_window, "Tizen Keyboard"); + elm_win_title_set(main_window, name.c_str()); elm_win_prop_focus_skip_set(main_window, EINA_TRUE); unsigned int set = 1; -- 2.7.4 From 393296129414359744ed94a06ceaaf5fec726a4f Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 16 Feb 2015 17:48:58 +0900 Subject: [PATCH 08/16] Add a missing return statement. Change-Id: I5c8a771b98c0a197548551da259d9d8c575750c5 --- src/sclconnection-isf.cpp | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 src/sclconnection-isf.cpp diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp old mode 100644 new mode 100755 index 1f3303e..e490f44 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -921,6 +921,7 @@ extern "C" info.option = (scluint)options; if (name) free(name); + return true; } } } -- 2.7.4 From 7618c7f8b86d932c05d404e93986531167137ddd Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Thu, 5 Mar 2015 11:20:09 +0900 Subject: [PATCH 09/16] Add on_process_key_event function for HW key event. Change-Id: I071aa44206f2eeb4ec9cbe2050734c0061e6683e --- src/sclconnection-isf.cpp | 11 +++++++++++ src/sclcorecallback.h | 5 +++++ src/sclcoreui-efl.cpp | 0 3 files changed, 16 insertions(+) mode change 100755 => 100644 src/sclconnection-isf.cpp mode change 100755 => 100644 src/sclcoreui-efl.cpp diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp old mode 100755 new mode 100644 index e490f44..de8ce57 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -486,6 +486,16 @@ static void slot_show_ise_option_window (const scim::HelperAgent *agent, int ic, } } +static void slot_process_key_event (const scim::HelperAgent *agent, scim::KeyEvent &key, scim::uint32 &ret) { + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + ISCLCoreEventCallback *callback = impl->get_core_event_callback(); + if (callback) { + callback->on_process_key_event (key, &ret); + } + } +} + /* Internal input handler function */ Eina_Bool input_handler (void *data, Ecore_Fd_Handler *fd_handler) { @@ -588,6 +598,7 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); + m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); return ret; } diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 132bea9..0b46d32 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -15,6 +15,10 @@ * */ +#include +#include +#include +#include #include #include "scltypes.h" #include "sclcoretypes.h" @@ -82,6 +86,7 @@ struct ISCLCoreEventCallback { virtual void on_associate_table_page_up(sclint ic, const sclchar *uuid) {} virtual void on_associate_table_page_down(sclint ic, const sclchar *uuid) {} 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_set_display_language(const sclchar *language) {} virtual void on_set_rotation_degree(sclint degree) {} diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp old mode 100755 new mode 100644 -- 2.7.4 From f93cf7acb5e93505e40b4a4424714479533826de Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Fri, 27 Mar 2015 14:09:58 +0900 Subject: [PATCH 10/16] Add on_check_option_window_availability() Change-Id: I49d945f847f8a3a9708b5c09e741cbc18454bb36 --- src/sclconnection-isf.cpp | 11 +++++++++++ src/sclcorecallback.h | 1 + src/sclcoreui-efl.cpp | 24 ++++++++++++++++++------ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index de8ce57..65b6e60 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -486,6 +486,16 @@ static void slot_show_ise_option_window (const scim::HelperAgent *agent, int ic, } } +static void slot_check_ise_option_window (const scim::HelperAgent *agent, sclu32 &avail) { + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + ISCLCoreEventCallback *callback = impl->get_core_event_callback(); + if (callback) { + callback->on_check_option_window_availability(reinterpret_cast(&avail)); + } + } +} + static void slot_process_key_event (const scim::HelperAgent *agent, scim::KeyEvent &key, scim::uint32 &ret) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { @@ -598,6 +608,7 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); + m_helper_agent.signal_connect_check_option_window (scim::slot (slot_check_ise_option_window)); m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); return ret; diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 0b46d32..73db935 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -94,6 +94,7 @@ struct ISCLCoreEventCallback { virtual void on_create_option_window(sclwindow window, SCLOptionWindowType type) {} virtual void on_destroy_option_window(sclwindow window) {} + virtual void on_check_option_window_availability(sclboolean *avail) { if (avail) *avail = false;} }; } diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 15fab59..085425a 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -435,6 +435,22 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) return SCLWINDOW_INVALID; } + ISCLCoreEventCallback *callback = NULL; + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + callback = impl->get_core_event_callback(); + if (callback) { + sclboolean ret = false; + callback->on_check_option_window_availability(&ret); + if (ret == false) { + LOGW("on_create_option_window() is not available"); + return SCLWINDOW_INVALID; + } + } + else + return SCLWINDOW_INVALID; + } + /* Just in case the previous option window for setting application exists */ if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) { if (m_option_window_info[type].window != SCLWINDOW_INVALID) { @@ -463,12 +479,8 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW); - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - callback->on_create_option_window(window, type); - } + if (callback) { + callback->on_create_option_window(window, type); } Ecore_Event_Handler *handler = NULL; -- 2.7.4 From 1ba9075835ce0a7079d1f064bac450f7bed547f1 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Tue, 31 Mar 2015 10:20:27 +0900 Subject: [PATCH 11/16] Remove an unused structure Change-Id: I86fcdb26d9c610efa95a96f52f5fa37263c0fb58 --- src/sclcorecallback.h | 13 ------------- src/sclcoreimpl.h | 1 - 2 files changed, 14 deletions(-) diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 73db935..3c66439 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -31,19 +31,6 @@ namespace scl { -/* The SCL Core app information struct */ -typedef struct { - /* The name of this input method - Example : "Tizen keyboard" */ - std::string name; - /* The uuid to identify this input method - Example : "12aa3425-f88d-45f4-a509-cee8dfe904e3"*/ - std::string uuid; - /* The locale string that this input methods supports - Example : "en_US" */ - std::string language; -} SclCoreAppInfo; - struct ISCLCoreEventCallback { virtual void on_init() {} virtual void on_run(int argc, char **argv) {} diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h index 7f4e61c..57db893 100644 --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -97,7 +97,6 @@ public: void destroy_option_window(sclwindow window); private: - SclCoreAppInfo m_app_info; ISCLCoreEventCallback *m_event_callback; CSCLConnection m_connection; -- 2.7.4 From d9d235b7f56da9868c1729ae78e0cdf7532d63d3 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Wed, 1 Apr 2015 15:03:10 +0900 Subject: [PATCH 12/16] Remove scim_helper_module_number_of_helpers(), scim_helper_module_get_helper_info() and scim_helper_module_get_helper_language() Remove the call to isf_control_get_ise_info() Change-Id: Ide00f8f14fa17a090504e132747d1713c6f73c50 --- src/sclconnection-isf.cpp | 54 ++--------------------------------------------- src/sclcoreui-efl.cpp | 18 +++++----------- 2 files changed, 7 insertions(+), 65 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 65b6e60..39db979 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -17,7 +17,6 @@ #include "sclconnection-isf.h" #include "sclcoreimpl.h" -#include #include #include @@ -552,15 +551,7 @@ sclboolean CSCLConnectionISF::init() if (impl) { sclchar *uuid = impl->get_uuid(); if (uuid) { - sclchar *name = NULL; - int options = 0; - if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) { - m_helper_info.uuid = scim::String(uuid); - m_helper_info.name = scim::String(name); - m_helper_info.option = (scluint)options; - if (name) - free(name); - } + m_helper_info.uuid = uuid; } } @@ -926,48 +917,6 @@ extern "C" void scim_module_exit (void) { } - unsigned int scim_helper_module_number_of_helpers (void) { - return 1; - } - - bool scim_helper_module_get_helper_info (unsigned int idx, scim::HelperInfo &info) { - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - sclchar *uuid = impl->get_uuid(); - if (uuid) { - sclchar *name = NULL; - int options = 0; - if (isf_control_get_ise_info(uuid, &name, NULL, NULL, &options) == 0) { - info.uuid = scim::String(uuid); - info.name = scim::String(name); - info.option = (scluint)options; - if (name) - free(name); - return true; - } - } - } - return false; - } - - scim::String scim_helper_module_get_helper_language (unsigned int idx) { - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - sclchar *uuid = impl->get_uuid(); - if (uuid) { - sclchar *language = NULL; - if (isf_control_get_ise_info(uuid, NULL, &language, NULL, NULL) == 0) { - if (language) { - scim::String lang = scim::String(language); - free(language); - return lang; - } - } - } - } - return scim::String(""); - } - void scim_helper_module_run_helper (const scim::String &uuid, const scim::ConfigPointer &config, const scim::String &display) { _scim_config = config; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); @@ -976,3 +925,4 @@ extern "C" } } } + diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 085425a..69a4057 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -17,7 +17,6 @@ #include "sclcoreui-efl.h" #include "sclcoreimpl.h" -#include #include #include @@ -264,20 +263,13 @@ void CSCLCoreUIEFL::run(const sclchar *display) char *argv[4]; int argc = 3; - std::string name; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { sclchar *uuid = impl->get_uuid(); - if (uuid) { - sclchar *label = NULL; - if (isf_control_get_ise_info(uuid, &label, NULL, NULL, NULL) == 0) { - name = std::string(label); - if (label) - free(label); - } - } + if (!uuid) + uuid = ""; - argv [0] = const_cast (name.c_str()); + argv [0] = const_cast (uuid); argv [1] = (char *)"--display"; argv [2] = const_cast (display); argv [3] = 0; @@ -286,13 +278,13 @@ void CSCLCoreUIEFL::run(const sclchar *display) elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); - Evas_Object *main_window = elm_win_add(NULL, name.c_str(), ELM_WIN_UTILITY); + Evas_Object *main_window = elm_win_add(NULL, uuid, ELM_WIN_UTILITY); m_main_window = SCL_WINDOW_CAST(main_window); elm_win_borderless_set(main_window, EINA_TRUE); elm_win_keyboard_win_set(main_window, EINA_TRUE); elm_win_autodel_set(main_window, EINA_TRUE); - elm_win_title_set(main_window, name.c_str()); + elm_win_title_set(main_window, uuid); elm_win_prop_focus_skip_set(main_window, EINA_TRUE); unsigned int set = 1; -- 2.7.4 From 3ac52488785f896f9c52cc818f8df335a9c8a365 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Wed, 8 Apr 2015 19:15:40 +0900 Subject: [PATCH 13/16] Add update_preedit_string() with attrs parameter Change-Id: I38991dabf2431a73d2ee63a8f2dfa5a514c312c3 --- src/sclconnection-isf.cpp | 17 +++++++++++++++++ src/sclconnection-isf.h | 1 + src/sclconnection.cpp | 7 +++++++ src/sclconnection.h | 4 ++++ src/sclcore.cpp | 7 +++++++ src/sclcore.h | 20 ++++++++++++++++---- src/sclcoreimpl.cpp | 5 +++++ src/sclcoreimpl.h | 2 +- 8 files changed, 58 insertions(+), 5 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 39db979..f665df2 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -848,6 +848,23 @@ void CSCLConnectionISF::update_preedit_string(sclint ic, const sclchar *ic_uuid, } } +void CSCLConnectionISF::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs) +{ + if (m_initialized) { + scim::String uuid; + if (ic_uuid) { + uuid = scim::String(ic_uuid); + } + m_helper_agent.update_preedit_string(ic, uuid, scim::utf8_mbstowcs(str), attrs); + + if (str && strlen(str) > 0) { + show_preedit_string(ic, ic_uuid); + } else { + hide_preedit_string(ic, ic_uuid); + } + } +} + void CSCLConnectionISF::update_aux_string(const sclchar *str) { if (m_initialized) { diff --git a/src/sclconnection-isf.h b/src/sclconnection-isf.h index 3a6808c..632ae4e 100644 --- a/src/sclconnection-isf.h +++ b/src/sclconnection-isf.h @@ -69,6 +69,7 @@ public: void hide_candidate_string(void); void hide_associate_string(void); void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); + void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs); void update_aux_string(const sclchar *str); void update_input_context(sclu32 type, sclu32 value); void get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const; diff --git a/src/sclconnection.cpp b/src/sclconnection.cpp index 68464ed..b63c028 100644 --- a/src/sclconnection.cpp +++ b/src/sclconnection.cpp @@ -229,6 +229,13 @@ void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, co } } +void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs) +{ + if (m_impl) { + m_impl->update_preedit_string(ic, ic_uuid, str, attrs); + } +} + void CSCLConnection::update_aux_string(const sclchar *str) { if (m_impl) { diff --git a/src/sclconnection.h b/src/sclconnection.h index 5eec308..58cc7a3 100644 --- a/src/sclconnection.h +++ b/src/sclconnection.h @@ -18,7 +18,10 @@ #ifndef __SCL_CONNECTION_H__ #define __SCL_CONNECTION_H__ +#define Uses_SCIM_ATTRIBUTE + #include +#include #include "scltypes.h" //SCL_BEGIN_DECLS @@ -66,6 +69,7 @@ public: virtual void hide_candidate_string(void); virtual void hide_associate_string(void); virtual void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); + virtual void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs); virtual void update_aux_string(const sclchar *str); virtual void update_input_context(sclu32 type, sclu32 value); virtual void get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const; diff --git a/src/sclcore.cpp b/src/sclcore.cpp index 13fa0e8..1e5f5ff 100644 --- a/src/sclcore.cpp +++ b/src/sclcore.cpp @@ -198,6 +198,13 @@ void CSCLCore::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sc } } +void CSCLCore::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs) +{ + if (m_impl) { + m_impl->update_preedit_string(ic, ic_uuid, str, attrs); + } +} + void CSCLCore::update_aux_string(const sclchar *str) { if (m_impl) { diff --git a/src/sclcore.h b/src/sclcore.h index 4319a7a..7c446d2 100644 --- a/src/sclcore.h +++ b/src/sclcore.h @@ -20,8 +20,10 @@ //SCL_BEGIN_DECLS -#include +#define Uses_SCIM_ATTRIBUTE +#include +#include #include #include "sclcoretypes.h" #include "sclcorecallback.h" @@ -176,19 +178,29 @@ public: void hide_associate_string(void); /** - * @brief Update a new WideString for preedit. + * @brief Update a new string for preedit. * * @param[in] ic The handle of the client Input Context to receive the WideString. * -1 means the currently focused Input Context. * @param[in] ic_uuid The UUID of the IMEngine used by the Input Context. * NULL means don't match. * @param[in] str The UTF-8 string to be updated. - * @param[in] attrs The attribute list for preedit string. */ - /*void update_preedit_string (int ic, const sclchar *ic_uuid, const sclchar *str, const AttributeList &attrs) const;*/ void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); /** + * @brief Update a new string for preedit. + * + * @param[in] ic The handle of the client Input Context to receive the WideString. + * -1 means the currently focused Input Context. + * @param[in] ic_uuid The UUID of the IMEngine used by the Input Context. + * NULL means don't match. + * @param[in] str The UTF-8 string to be updated. + * @param[in] attrs The attribute list for preedit string. + */ + void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs); + + /** * @brief Update a new string for aux. * * @param[in] str The string to be updated. diff --git a/src/sclcoreimpl.cpp b/src/sclcoreimpl.cpp index 259ea1f..16d179b 100644 --- a/src/sclcoreimpl.cpp +++ b/src/sclcoreimpl.cpp @@ -200,6 +200,11 @@ void CSCLCoreImpl::update_preedit_string(sclint ic, const sclchar *ic_uuid, cons m_connection.update_preedit_string(ic, ic_uuid, str); } +void CSCLCoreImpl::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs) +{ + m_connection.update_preedit_string(ic, ic_uuid, str, attrs); +} + void CSCLCoreImpl::update_aux_string(const sclchar *str) { m_connection.update_aux_string(str); diff --git a/src/sclcoreimpl.h b/src/sclcoreimpl.h index 57db893..62d2c56 100644 --- a/src/sclcoreimpl.h +++ b/src/sclcoreimpl.h @@ -73,8 +73,8 @@ public: void hide_aux_string(void); void hide_candidate_string(void); void hide_associate_string(void); - /*void update_preedit_string (int ic, const sclchar *ic_uuid, const sclchar *str, const AttributeList &attrs) const;*/ void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str); + void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs); //void update_aux_string (const sclchar *str, const AttributeList &attrs) const; void update_aux_string(const sclchar *str); //void update_candidate_string (const LookupTable &table) const; -- 2.7.4 From 6ea8455048a434c271ec02fb401f828cde5cfef5 Mon Sep 17 00:00:00 2001 From: Haifeng Deng Date: Mon, 11 May 2015 18:07:56 +0800 Subject: [PATCH 14/16] Fix double calling issue Change-Id: Ibdd40c053f0e92e379f147772ca42258fbe338c8 Signed-off-by: Haifeng Deng --- src/sclconnection-isf.cpp | 104 +++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index f665df2..4a11f22 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -543,9 +543,7 @@ CSCLConnectionISF::~CSCLConnectionISF() sclboolean CSCLConnectionISF::init() { - sclboolean ret = FALSE; - - m_initialized = TRUE; + LOGD ("Enter"); CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { @@ -555,54 +553,58 @@ sclboolean CSCLConnectionISF::init() } } - m_helper_agent.signal_connect_exit (scim::slot (slot_exit)); - m_helper_agent.signal_connect_attach_input_context (scim::slot (slot_attach_input_context)); - m_helper_agent.signal_connect_detach_input_context (scim::slot (slot_detach_input_context)); - m_helper_agent.signal_connect_reload_config (scim::slot (slot_reload_config)); - m_helper_agent.signal_connect_update_screen (scim::slot (slot_update_screen)); - m_helper_agent.signal_connect_update_spot_location (scim::slot (slot_update_spot_location)); - m_helper_agent.signal_connect_update_cursor_position (scim::slot (slot_update_cursor_position)); - m_helper_agent.signal_connect_update_surrounding_text (scim::slot (slot_update_surrounding_text)); - m_helper_agent.signal_connect_trigger_property (scim::slot (slot_trigger_property)); - //m_helper_agent.signal_connect_process_imengine_event (slot (slot_process_imengine_event)); - m_helper_agent.signal_connect_focus_out (scim::slot (slot_focus_out)); - m_helper_agent.signal_connect_focus_in (scim::slot (slot_focus_in)); - m_helper_agent.signal_connect_ise_show (scim::slot (slot_ise_show)); - m_helper_agent.signal_connect_ise_hide (scim::slot (slot_ise_hide)); - m_helper_agent.signal_connect_get_geometry (scim::slot (slot_get_geometry)); - m_helper_agent.signal_connect_set_mode (scim::slot (slot_set_mode)); - m_helper_agent.signal_connect_set_language (scim::slot (slot_set_language)); - m_helper_agent.signal_connect_set_imdata (scim::slot (slot_set_imdata)); - m_helper_agent.signal_connect_get_imdata (scim::slot (slot_get_imdata)); - m_helper_agent.signal_connect_get_language_locale (scim::slot (slot_get_language_locale)); - m_helper_agent.signal_connect_set_return_key_type (scim::slot (slot_set_return_key_type)); - m_helper_agent.signal_connect_get_return_key_type (scim::slot (slot_get_return_key_type)); - m_helper_agent.signal_connect_set_return_key_disable (scim::slot (slot_set_return_key_disable)); - m_helper_agent.signal_connect_get_return_key_disable (scim::slot (slot_get_return_key_disable)); - m_helper_agent.signal_connect_get_layout (scim::slot (slot_get_layout)); - m_helper_agent.signal_connect_set_layout (scim::slot (slot_set_layout)); - m_helper_agent.signal_connect_set_caps_mode (scim::slot (slot_set_caps_mode)); - m_helper_agent.signal_connect_reset_input_context (scim::slot (slot_reset_input_context)); - m_helper_agent.signal_connect_update_candidate_geometry (scim::slot (slot_update_candidate_geometry)); - m_helper_agent.signal_connect_update_keyboard_ise (scim::slot (slot_update_keyboard_ise)); - //m_helper_agent.signal_connect_update_keyboard_ise_list (slot (slot_update_keyboard_ise_list)); - m_helper_agent.signal_connect_candidate_more_window_show (scim::slot (slot_candidate_more_window_show)); - m_helper_agent.signal_connect_candidate_more_window_hide (scim::slot (slot_candidate_more_window_hide)); - m_helper_agent.signal_connect_select_aux (scim::slot (slot_select_aux)); - m_helper_agent.signal_connect_select_candidate (scim::slot (slot_select_candidate)); - m_helper_agent.signal_connect_candidate_table_page_up (scim::slot (slot_candidate_table_page_up)); - m_helper_agent.signal_connect_candidate_table_page_down (scim::slot (slot_candidate_table_page_down)); - m_helper_agent.signal_connect_update_candidate_table_page_size (scim::slot (slot_update_candidate_table_page_size)); - m_helper_agent.signal_connect_update_lookup_table (scim::slot (slot_update_lookup_table)); - m_helper_agent.signal_connect_select_associate (scim::slot (slot_select_associate)); - m_helper_agent.signal_connect_associate_table_page_up (scim::slot (slot_associate_table_page_up)); - m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); - m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); - m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); - m_helper_agent.signal_connect_check_option_window (scim::slot (slot_check_ise_option_window)); - m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); - - return ret; + if (!m_initialized) { + m_helper_agent.signal_connect_exit (scim::slot (slot_exit)); + m_helper_agent.signal_connect_attach_input_context (scim::slot (slot_attach_input_context)); + m_helper_agent.signal_connect_detach_input_context (scim::slot (slot_detach_input_context)); + m_helper_agent.signal_connect_reload_config (scim::slot (slot_reload_config)); + m_helper_agent.signal_connect_update_screen (scim::slot (slot_update_screen)); + m_helper_agent.signal_connect_update_spot_location (scim::slot (slot_update_spot_location)); + m_helper_agent.signal_connect_update_cursor_position (scim::slot (slot_update_cursor_position)); + m_helper_agent.signal_connect_update_surrounding_text (scim::slot (slot_update_surrounding_text)); + m_helper_agent.signal_connect_trigger_property (scim::slot (slot_trigger_property)); + //m_helper_agent.signal_connect_process_imengine_event (slot (slot_process_imengine_event)); + m_helper_agent.signal_connect_focus_out (scim::slot (slot_focus_out)); + m_helper_agent.signal_connect_focus_in (scim::slot (slot_focus_in)); + m_helper_agent.signal_connect_ise_show (scim::slot (slot_ise_show)); + m_helper_agent.signal_connect_ise_hide (scim::slot (slot_ise_hide)); + m_helper_agent.signal_connect_get_geometry (scim::slot (slot_get_geometry)); + m_helper_agent.signal_connect_set_mode (scim::slot (slot_set_mode)); + m_helper_agent.signal_connect_set_language (scim::slot (slot_set_language)); + m_helper_agent.signal_connect_set_imdata (scim::slot (slot_set_imdata)); + m_helper_agent.signal_connect_get_imdata (scim::slot (slot_get_imdata)); + m_helper_agent.signal_connect_get_language_locale (scim::slot (slot_get_language_locale)); + m_helper_agent.signal_connect_set_return_key_type (scim::slot (slot_set_return_key_type)); + m_helper_agent.signal_connect_get_return_key_type (scim::slot (slot_get_return_key_type)); + m_helper_agent.signal_connect_set_return_key_disable (scim::slot (slot_set_return_key_disable)); + m_helper_agent.signal_connect_get_return_key_disable (scim::slot (slot_get_return_key_disable)); + m_helper_agent.signal_connect_get_layout (scim::slot (slot_get_layout)); + m_helper_agent.signal_connect_set_layout (scim::slot (slot_set_layout)); + m_helper_agent.signal_connect_set_caps_mode (scim::slot (slot_set_caps_mode)); + m_helper_agent.signal_connect_reset_input_context (scim::slot (slot_reset_input_context)); + m_helper_agent.signal_connect_update_candidate_geometry (scim::slot (slot_update_candidate_geometry)); + m_helper_agent.signal_connect_update_keyboard_ise (scim::slot (slot_update_keyboard_ise)); + //m_helper_agent.signal_connect_update_keyboard_ise_list (slot (slot_update_keyboard_ise_list)); + m_helper_agent.signal_connect_candidate_more_window_show (scim::slot (slot_candidate_more_window_show)); + m_helper_agent.signal_connect_candidate_more_window_hide (scim::slot (slot_candidate_more_window_hide)); + m_helper_agent.signal_connect_select_aux (scim::slot (slot_select_aux)); + m_helper_agent.signal_connect_select_candidate (scim::slot (slot_select_candidate)); + m_helper_agent.signal_connect_candidate_table_page_up (scim::slot (slot_candidate_table_page_up)); + m_helper_agent.signal_connect_candidate_table_page_down (scim::slot (slot_candidate_table_page_down)); + m_helper_agent.signal_connect_update_candidate_table_page_size (scim::slot (slot_update_candidate_table_page_size)); + m_helper_agent.signal_connect_update_lookup_table (scim::slot (slot_update_lookup_table)); + m_helper_agent.signal_connect_select_associate (scim::slot (slot_select_associate)); + m_helper_agent.signal_connect_associate_table_page_up (scim::slot (slot_associate_table_page_up)); + m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); + m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); + m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); + m_helper_agent.signal_connect_check_option_window (scim::slot (slot_check_ise_option_window)); + m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); + + m_initialized = TRUE; + } + + return TRUE; } void CSCLConnectionISF::fini() -- 2.7.4 From 08356e0b51f073a3c9722b14ed84fb99d05752e8 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Thu, 28 May 2015 11:36:41 +0900 Subject: [PATCH 15/16] Call elm_win_wm_rotation_available_rotations_set for keyboard window Change-Id: I2cc1c8b5d4954217725d7397455b70b74c68a4f2 --- src/sclcoreui-efl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 69a4057..9c23539 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -286,6 +286,8 @@ void CSCLCoreUIEFL::run(const sclchar *display) elm_win_autodel_set(main_window, EINA_TRUE); elm_win_title_set(main_window, uuid); elm_win_prop_focus_skip_set(main_window, EINA_TRUE); + int rots[] = { 0, 90, 180, 270 }; + elm_win_wm_rotation_available_rotations_set(main_window, rots, (sizeof(rots) / sizeof(int))); unsigned int set = 1; ecore_x_window_prop_card32_set(elm_win_xwindow_get(main_window), -- 2.7.4 From 7881fbc9fec10fb76ad1fcf15308a1d84bdf2231 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 1 Jun 2015 19:19:38 +0900 Subject: [PATCH 16/16] Remove code to designate the specific profile Change-Id: I6383aeb830da5ad9f98e14c6c929115eb0040b7b --- src/sclcoreui-efl.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 9c23539..0a24933 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -454,9 +454,6 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) Evas_Object *window = elm_win_util_standard_add("Option window", "Option window"); - const char *szProfile[] = {"mobile", ""}; - elm_win_profiles_set(window, szProfile, 1); - elm_win_borderless_set(window, EINA_TRUE); Evas_Coord win_w = 0, win_h = 0; -- 2.7.4