From 80c687021a5ce0ff85853ae675570e867458e84a Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 9 Feb 2015 10:38:56 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 11/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 From d97104678906e38457186d2a96b40e005b71241d Mon Sep 17 00:00:00 2001 From: Wonkeun Oh Date: Tue, 2 Jun 2015 10:57:12 +0900 Subject: [PATCH 12/16] Fixed prevent issue about Big parameter passed by value Change-Id: I4844c46beeab589c688e8a8795a35db10a4e3ee8 --- src/sclcorecallback.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 3c66439..b6e2ea6 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -43,7 +43,7 @@ struct ISCLCoreEventCallback { virtual void on_update_surrounding_text(sclint ic, const sclchar *text, sclint cursor) {} virtual void on_focus_out(sclint ic, const sclchar *ic_uuid) {} virtual void on_focus_in(sclint ic, const sclchar *ic_uuid) {} - virtual void on_ise_show(sclint ic, const int degree, Ise_Context context) {} + virtual void on_ise_show(sclint ic, const int degree, Ise_Context &context) {} virtual void on_ise_hide(sclint ic, const sclchar *ic_uuid) {} virtual void on_get_geometry(sclu32 *pos_x, sclu32 *pos_y, sclu32 *width, sclu32 *height) {} virtual void on_set_mode(sclu32 mode) {} -- 2.7.4 From d74d29e826b8770fb694c2f63b943a875507bc47 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 2 Jun 2015 14:11:48 +0900 Subject: [PATCH 13/16] Update package information Change-Id: I0b14cf73a8dcfd19643d4597caad20054b75d683 --- packaging/libscl-core.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 415c5cd..bc2dc3c 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -5,8 +5,8 @@ Name: libscl-core Summary: A library for developing software keyboards Version: 0.0.1 Release: 1 -Group: System Environment/Libraries -License: Apache License, Version 2.0 +Group: Graphics & UI Framework/Input +License: Apache-2.0 Source0: libscl-core-%{version}.tar.gz BuildRequires: gettext-tools BuildRequires: cmake -- 2.7.4 From 88607d614b4a0d9b4bb9a9d1cf2da172ca46bf4e Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 2 Jun 2015 15:34:09 +0900 Subject: [PATCH 14/16] fix typo in description Change-Id: Ief5fd6112db0c47690a11fe14b59e7780138cc8d --- packaging/libscl-core.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index bc2dc3c..12b1e7d 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -27,7 +27,7 @@ Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel -A devel pacakge of libscl-core library that helps developing S/W Keyboard +A devel package of libscl-core library that helps developing S/W Keyboard %prep %setup -q -- 2.7.4 From 5da1a054e786d866089911712ef0fcab6c4873e8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jun 2015 09:21:39 +0900 Subject: [PATCH 15/16] Fix package dependency Change-Id: I9f00bea7b3ee46e698271c0c90b99f5a68d550f5 --- CMakeLists.txt | 2 +- packaging/libscl-core.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5527ec3..a9ff9c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ pkg_check_modules(pkgs REQUIRED dlog isf vconf - x11 + ecore-x libscl-common ) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 12b1e7d..59d7a60 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -14,7 +14,7 @@ BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(isf) -BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(ecore-x) BuildRequires: pkgconfig(libscl-common) -- 2.7.4 From a4304e372322ed307b75fce9a451bc5c3e155670 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jun 2015 10:02:14 +0900 Subject: [PATCH 16/16] Replace X dependent code Change-Id: I525d40cc4dfc10d2baf4bfe72415f5fd7ddecc8c --- src/sclcoreui-efl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 0a24933..a89f99d 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -457,7 +457,7 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) elm_win_borderless_set(window, EINA_TRUE); Evas_Coord win_w = 0, win_h = 0; - ecore_x_window_size_get(ecore_x_window_root_first_get(), &win_w, &win_h); + elm_win_screen_size_get (window, NULL, NULL, &win_w, &win_h); int degree = get_screen_rotation_degree(); if(degree == 90 || degree == 270){ evas_object_resize(window, win_h, win_w); -- 2.7.4