From d9d235b7f56da9868c1729ae78e0cdf7532d63d3 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Wed, 1 Apr 2015 15:03:10 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 From fb8e8c71148bedea165971db89fd62810ccdc901 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jun 2015 10:04:04 +0900 Subject: [PATCH 11/16] update package version to 0.4.0 Change-Id: I444324ec79fc753d9f5d2ec80fee5823a9dca219 --- 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 59d7a60..c2d29c3 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -3,7 +3,7 @@ Name: libscl-core Summary: A library for developing software keyboards -Version: 0.0.1 +Version: 0.4.0 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From a11180bf3355880330502294287f5e76826dd8c5 Mon Sep 17 00:00:00 2001 From: Sungwook Park Date: Wed, 3 Jun 2015 19:54:49 +0900 Subject: [PATCH 12/16] modify Non-virtual destructor issue Change-Id: Ia7c458572a2f8d03fa953cebbf3548c3b1388fa0 --- src/sclconnection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclconnection.h b/src/sclconnection.h index 58cc7a3..d4c5642 100644 --- a/src/sclconnection.h +++ b/src/sclconnection.h @@ -37,7 +37,7 @@ class CSCLConnection { public: CSCLConnection(); - ~CSCLConnection(); + virtual ~CSCLConnection(); std::string get_backend_indentifier(); -- 2.7.4 From cce88c4ce074f8334e457f32bd727de9dfc281f7 Mon Sep 17 00:00:00 2001 From: Sungwook Park Date: Wed, 3 Jun 2015 20:04:10 +0900 Subject: [PATCH 13/16] Empty virtual destructor (VIRTUAL_DTOR) issue resolve Change-Id: I3474bf335cc1a4cc0f4d50d18aad5023ff9d10ab --- src/sclcoreui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclcoreui.h b/src/sclcoreui.h index 01650fd..76d7998 100644 --- a/src/sclcoreui.h +++ b/src/sclcoreui.h @@ -36,7 +36,7 @@ class CSCLCoreUI { public: CSCLCoreUI(); - ~CSCLCoreUI(); + virtual ~CSCLCoreUI(); std::string get_backend_indentifier(); -- 2.7.4 From ea5282deaed888f552d6300b842d2c7f7858f811 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 10 Jun 2015 17:07:03 +0900 Subject: [PATCH 14/16] Support build in wayland environment Change-Id: Ibeafeb0f9d4f69608686cbb051739779d107e148 --- CMakeLists.txt | 12 ++++++++++-- packaging/libscl-core.spec | 11 +++++++++++ src/sclconnection-isf.cpp | 2 ++ src/sclcoreui-efl.cpp | 28 ++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ff9c4..4bb3989 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,15 +25,23 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src ) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED + +SET(PKGS_CHECK_MODULES elementary dlog isf vconf - ecore-x + libscl-common ) +IF (with_wayland) + ADD_DEFINITIONS("-DWAYLAND") + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES}) +ELSE (with_wayland) + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x) +ENDIF(with_wayland) + FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index c2d29c3..c346554 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -1,3 +1,6 @@ +%bcond_with x +%bcond_with wayland + %define _optdir /opt %define _appdir %{_optdir}/apps @@ -14,7 +17,10 @@ BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(isf) +%if %{with wayland} +%else BuildRequires: pkgconfig(ecore-x) +%endif BuildRequires: pkgconfig(libscl-common) @@ -40,7 +46,12 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE" rm -rf CMakeFiles rm -rf CMakeCache.txt + +%if %{with wayland} +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -Dwith_wayland=TRUE +%else cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +%endif make %{?jobs:-j%jobs} %install diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 4a11f22..96bbb22 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -625,6 +625,7 @@ void CSCLConnectionISF::open_connection(const sclchar *display) if (impl) { main_window = NATIVE_WINDOW_CAST(impl->get_main_window()); } +#ifndef WAYLAND Ecore_X_Window xwindow = elm_win_xwindow_get(main_window); char xid[255]; snprintf(xid, 255, "%d", xwindow); @@ -632,6 +633,7 @@ void CSCLConnectionISF::open_connection(const sclchar *display) scim::PropertyList props; props.push_back(prop); m_helper_agent.register_properties(props); +#endif m_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, input_handler, &m_helper_agent, NULL, NULL); } diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index a89f99d..4ffd69d 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -24,8 +24,12 @@ #include #include +#ifdef WAYLAND +#include +#else #include #include +#endif using namespace scl; @@ -74,10 +78,15 @@ sclwindow CSCLCoreUIEFL::get_main_window() void CSCLCoreUIEFL::set_keyboard_size_hints(SclSize portrait, SclSize landscape) { Evas_Object *main_window = NATIVE_WINDOW_CAST(m_main_window); + +#ifdef WAYLAND + evas_object_resize(main_window, portrait.width, portrait.height); +#else ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 0, 0, 0, portrait.width, portrait.height); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 90, 0, 0, landscape.height, landscape.width); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 180, 0, 0, portrait.width, portrait.height); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 270, 0, 0, landscape.height, landscape.width); +#endif } const char * extract_themename_from_theme_file_path(const char *filepath) { @@ -145,6 +154,7 @@ void accessibility_changed_cb(keynode_t *key, void* data) } } +#ifndef WAYLAND static Eina_Bool _client_message_cb(void *data, int type, void *event) { Ecore_X_Event_Client_Message *ev = (Ecore_X_Event_Client_Message *)event; @@ -197,10 +207,13 @@ static Eina_Bool _client_message_cb(void *data, int type, void *event) return ECORE_CALLBACK_RENEW; } +#endif int CSCLCoreUIEFL::get_screen_rotation_degree() { int angle = 0; + +#ifndef WAYLAND if (m_rotation_degree == -1) { int ret = 0; Atom type_return; @@ -250,6 +263,7 @@ int CSCLCoreUIEFL::get_screen_rotation_degree() } else { angle = m_rotation_degree; } +#endif return angle; } @@ -289,12 +303,14 @@ void CSCLCoreUIEFL::run(const sclchar *display) int rots[] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(main_window, rots, (sizeof(rots) / sizeof(int))); +#ifndef WAYLAND unsigned int set = 1; ecore_x_window_prop_card32_set(elm_win_xwindow_get(main_window), ECORE_X_ATOM_E_WINDOW_ROTATION_SUPPORTED, &set, 1); ecore_x_icccm_name_class_set(elm_win_xwindow_get(main_window), "Virtual Keyboard", "ISF"); +#endif vconf_notify_key_changed(VCONFKEY_LANGSET, language_changed_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb, NULL); @@ -305,8 +321,10 @@ void CSCLCoreUIEFL::run(const sclchar *display) impl->init(display); +#ifndef WAYLAND Ecore_Event_Handler *XClientMsgHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _client_message_cb, this); +#endif signal(SIGQUIT, signal_handler); signal(SIGTERM, signal_handler); @@ -320,10 +338,12 @@ void CSCLCoreUIEFL::run(const sclchar *display) vconf_ignore_key_changed(VCONFKEY_LANGSET, language_changed_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb); +#ifndef WAYLAND if (XClientMsgHandler) { ecore_event_handler_del(XClientMsgHandler); XClientMsgHandler = NULL; } +#endif elm_shutdown(); } @@ -360,6 +380,7 @@ set_transient_for_app_window(Evas_Object *window) { /* Set a transient window for window stack */ /* Gets the current XID of the active window into the root window property */ +#ifndef WAYLAND Atom type_return; unsigned long nitems_return; unsigned long bytes_after_return; @@ -385,6 +406,7 @@ set_transient_for_app_window(Evas_Object *window) XFree(data); } } +#endif } static void @@ -392,6 +414,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) { /* Set a transient window for window stack */ /* Gets the current XID of the active window into the root window property */ +#ifndef WAYLAND Atom type_return; unsigned long nitems_return; unsigned long bytes_after_return; @@ -421,6 +444,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) XFree(data); } } +#endif } sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) @@ -476,7 +500,11 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) Ecore_Event_Handler *handler = NULL; if (type == OPTION_WINDOW_TYPE_NORMAL) { +#ifdef WAYLAND + handler = ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, focus_out_cb, &m_option_window_info[type]); +#else handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, focus_out_cb, &m_option_window_info[type]); +#endif set_transient_for_app_window(window); } else if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) { set_transient_for_isf_setting_window(window); -- 2.7.4 From 7f074f078c7ca019f0b86689e889988ada8583b6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jun 2015 17:59:35 +0900 Subject: [PATCH 15/16] Remove unsupported signal temporarily Change-Id: Id6375603e9ea1be5ce439cbcd557aae6913f35a1 --- src/sclconnection-isf.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 96bbb22..b178d9a 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -597,8 +597,6 @@ sclboolean CSCLConnectionISF::init() 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; -- 2.7.4 From 555cc6cc1b9a6d4681959dc17270a71764845cda Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jun 2015 18:46:54 +0900 Subject: [PATCH 16/16] Support 64bit architecture Change-Id: I9ee26cbdee99f19b051879e819802ea430e8f3d6 --- CMakeLists.txt | 4 ++-- packaging/libscl-core.spec | 4 ++-- src/sclconnection-isf.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb3989..d84b5e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ SET(SRCS SET(PACKAGE ${PROJECT_NAME}) SET(PKGNAME ${PACKAGE}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(LIBDIR "${PREFIX}/lib") +SET(LIBDIR ${LIB_INSTALL_DIR}) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") SET(CMAKE_BUILD_TYPE "Release") @@ -67,4 +67,4 @@ INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcoretypes.h" DESTINATION include/libsc INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcorecallback.h" DESTINATION include/libscl-core) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index c346554..0a6da98 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -48,9 +48,9 @@ rm -rf CMakeFiles rm -rf CMakeCache.txt %if %{with wayland} -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -Dwith_wayland=TRUE +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE %else -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} %endif make %{?jobs:-j%jobs} diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index b178d9a..2a47667 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -211,7 +211,8 @@ static void slot_set_imdata (const scim::HelperAgent *agent, char *buf, size_t & if (impl) { ISCLCoreEventCallback *callback = impl->get_core_event_callback(); if (callback) { - callback->on_set_imdata(buf, len); + scl32 _len = static_cast(reinterpret_cast(len) & 0xffffffff); + callback->on_set_imdata(buf, _len); } } } @@ -221,7 +222,9 @@ static void slot_get_imdata (const scim::HelperAgent *, char **buf, size_t &len) if (impl) { ISCLCoreEventCallback *callback = impl->get_core_event_callback(); if (callback) { - callback->on_get_imdata(buf, &len); + sclu32 _len = 0; + callback->on_get_imdata(buf, &_len); + len = _len; } } } -- 2.7.4