From ac2ec81f00e0df86765a38c5acc28087be237c5b Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 12 Jan 2015 15:39:11 +0900 Subject: [PATCH 01/16] Fix build error due to EFL 1.12 upgrade Change-Id: Icb70570718421a9db62d3d23374379f4b696cc27 --- src/sclcoreui-efl.cpp | 3 +-- 1 file changed, 1 insertion(+), 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 e54aa92..4a93596 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -461,8 +461,7 @@ 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_profile_set (window, "mobile"); elm_win_borderless_set(window, EINA_TRUE); -- 2.7.4 From 06ab14b27fde1c1da3b299bcfd8daba603ca2d6f Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Thu, 15 Jan 2015 10:35:03 +0900 Subject: [PATCH 02/16] Remove unused Vconf key codes. Change-Id: I2fa059cc4f1ac547804565c55d8e8d35b23a7b77 --- src/sclcoreui-efl.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 4a93596..f70d267 100755 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -128,25 +128,6 @@ void language_changed_cb(keynode_t *key, void* data) } } -void theme_changed_cb(keynode_t *key, void* data) -{ - char clang[256] = {0}; - char *vconf_str = vconf_get_str(VCONFKEY_SETAPPL_WIDGET_THEME_STR); - if (vconf_str) { - snprintf(clang, sizeof(clang), "%s",extract_themename_from_theme_file_path(vconf_str)); - free(vconf_str); - } - LOGD("current theme is %s\n",clang); - - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - callback->on_set_theme_name(clang); - } - } -} - void accessibility_changed_cb(keynode_t *key, void* data) { int vconf_value = 0; @@ -317,12 +298,10 @@ void CSCLCoreUIEFL::run(const sclchar *display) ecore_x_icccm_name_class_set(elm_win_xwindow_get(main_window), "Virtual Keyboard", "ISF"); vconf_notify_key_changed(VCONFKEY_LANGSET, language_changed_cb, NULL); - vconf_notify_key_changed(VCONFKEY_SETAPPL_WIDGET_THEME_STR, theme_changed_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb, NULL); /* Should we call these callback functions here? */ language_changed_cb(NULL, NULL); - theme_changed_cb(NULL, NULL); accessibility_changed_cb(NULL, NULL); impl->init(display); @@ -340,7 +319,6 @@ void CSCLCoreUIEFL::run(const sclchar *display) impl->fini(); vconf_ignore_key_changed(VCONFKEY_LANGSET, language_changed_cb); - vconf_ignore_key_changed(VCONFKEY_SETAPPL_WIDGET_THEME_STR, theme_changed_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb); if (XClientMsgHandler) { -- 2.7.4 From c34e9ee740e9a2b818207f29aadb73c29af3c01d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 16 Jan 2015 09:50:29 +0900 Subject: [PATCH 03/16] Fix build warning Change-Id: I555866431e2e4c41462cfcc43a6a6958f3148a89 --- src/sclconnection-isf.cpp | 2 +- src/sclcoreui-efl.cpp | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index debff6f..787ca12 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 (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); diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index f70d267..d69f6ff 100755 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -68,6 +68,8 @@ sclwindow CSCLCoreUIEFL::get_main_window() if (m_initialized) { return m_main_window; } + else + return NULL; } void CSCLCoreUIEFL::set_keyboard_size_hints(SclSize portrait, SclSize landscape) @@ -144,7 +146,7 @@ void accessibility_changed_cb(keynode_t *key, void* data) } } -static Eina_Bool _client_message_cb (void *data, int type, void *event) +static Eina_Bool _client_message_cb(void *data, int type, void *event) { Ecore_X_Event_Client_Message *ev = (Ecore_X_Event_Client_Message *)event; @@ -184,8 +186,8 @@ static Eina_Bool _client_message_cb (void *data, int type, void *event) callback->on_set_rotation_degree(degree); } Ecore_X_Window control_window = 0; - Ecore_X_Atom atom = ecore_x_atom_get ("_ISF_CONTROL_WINDOW"); - Ecore_X_Window root = ecore_x_window_root_first_get (); + Ecore_X_Atom atom = ecore_x_atom_get("_ISF_CONTROL_WINDOW"); + Ecore_X_Window root = ecore_x_window_root_first_get(); if (ecore_x_window_prop_xid_get(root, atom, ECORE_X_ATOM_WINDOW, &control_window, 1) == 1) { ecore_x_client_message32_send(control_window, ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST, ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, @@ -215,7 +217,7 @@ int CSCLCoreUIEFL::get_screen_rotation_degree() LOGD("Trying to get app window degree for %p\n", keypad_win); Ecore_X_Window win = elm_win_xwindow_get(NATIVE_WINDOW_CAST(keypad_win)); - ret = XGetWindowProperty((Display *)ecore_x_display_get (), + ret = XGetWindowProperty((Display *)ecore_x_display_get(), ecore_x_window_root_get(win), ecore_x_atom_get("_ISF_ACTIVE_WINDOW"), 0, G_MAXLONG, False, XA_WINDOW, &type_return, @@ -279,7 +281,7 @@ void CSCLCoreUIEFL::run(const sclchar *display) elm_init(argc, argv); - elm_policy_set (ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); + elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); Evas_Object *main_window = elm_win_add(NULL, "Tizen Keyboard", ELM_WIN_UTILITY); m_main_window = SCL_WINDOW_CAST(main_window); @@ -307,7 +309,7 @@ void CSCLCoreUIEFL::run(const sclchar *display) impl->init(display); Ecore_Event_Handler *XClientMsgHandler = - ecore_event_handler_add (ECORE_X_EVENT_CLIENT_MESSAGE, _client_message_cb, this); + ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _client_message_cb, this); signal(SIGQUIT, signal_handler); signal(SIGTERM, signal_handler); @@ -370,7 +372,7 @@ set_transient_for_app_window(Evas_Object *window) Ecore_X_Window xWindow = elm_win_xwindow_get(window); gint ret = 0; - ret = XGetWindowProperty ((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow), + ret = XGetWindowProperty((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow), ecore_x_atom_get("_ISF_ACTIVE_WINDOW"), 0, G_MAXLONG, False, XA_WINDOW, &type_return, &format_return, &nitems_return, &bytes_after_return, @@ -402,7 +404,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) Ecore_X_Window xWindow = elm_win_xwindow_get(window); gint ret = 0; - ret = XGetWindowProperty ((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow), + ret = XGetWindowProperty((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow), ecore_x_atom_get("_ISF_CONTROL_WINDOW"), 0, G_MAXLONG, False, XA_WINDOW, &type_return, &format_return, &nitems_return, &bytes_after_return, @@ -413,7 +415,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) if (type_return == XA_WINDOW) { xControlWindow = *(Window *)data; - ecore_x_window_prop_xid_get (xControlWindow, ecore_x_atom_get ("ISF Setting window"), + ecore_x_window_prop_xid_get(xControlWindow, ecore_x_atom_get("ISF Setting window"), ECORE_X_ATOM_WINDOW, &xSettingWindow, 1); LOGD("TRANSIENT_FOR SET : %x , %x", xSettingWindow, xWindow); @@ -455,7 +457,7 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) int rots[] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(window, rots, (sizeof(rots) / sizeof(int))); - elm_win_indicator_mode_set (window, ELM_WIN_INDICATOR_SHOW); + elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW); CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { -- 2.7.4 From b5eb76ec059495ad2b0df6a584fb4ce0b2fe92c9 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 16 Jan 2015 09:54:39 +0900 Subject: [PATCH 04/16] Revert "Fix build error due to EFL 1.12 upgrade" It's not necessary change. Change-Id: Ieefcbc67c5743d5b046a285279754ec9bccf9a7d --- src/sclcoreui-efl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index d69f6ff..4a678b3 100755 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -441,7 +441,8 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) Evas_Object *window = elm_win_util_standard_add("Option window", "Option window"); - elm_win_profile_set (window, "mobile"); + const char *szProfile[] = {"mobile", ""}; + elm_win_profiles_set(window, szProfile, 1); elm_win_borderless_set(window, EINA_TRUE); -- 2.7.4 From ca19d27e2a730595320dffea95730f997da385a2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 16 Jan 2015 21:17:46 +0900 Subject: [PATCH 05/16] Remove theme change callback Change-Id: If18b99372f3a5347c35179081279eaf18220e666 --- src/sclcorecallback.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index cc1650b..16a76d4 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -86,7 +86,6 @@ struct ISCLCoreEventCallback { virtual void on_turn_on_log(sclu32 on) {} virtual void on_set_display_language(const sclchar *language) {} - virtual void on_set_theme_name(const sclchar *name) {} virtual void on_set_rotation_degree(sclint degree) {} virtual void on_set_accessibility_state(sclboolean state) {} -- 2.7.4 From 7d0915690a495109ccce0e8f89e5246316a6dfe2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 17 Jan 2015 12:00:46 +0900 Subject: [PATCH 06/16] Remove unused log turn on feature Change-Id: I2c63028f5ed2f8b96bbb6faa9a30ac3f4b4d2e2d --- src/sclconnection-isf.cpp | 11 ----------- src/sclcorecallback.h | 1 - 2 files changed, 12 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 787ca12..97c5ab3 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -475,16 +475,6 @@ static void slot_update_associate_table_page_size (const scim::HelperAgent *, in } } -static void slot_turn_on_log (const scim::HelperAgent *agent, scim::uint32 &on) { - CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); - if (impl) { - ISCLCoreEventCallback *callback = impl->get_core_event_callback(); - if (callback) { - callback->on_turn_on_log(on); - } - } -} - static void slot_show_ise_option_window (const scim::HelperAgent *agent, int ic, const scim::String &uuid) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { @@ -594,7 +584,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_turn_on_log (scim::slot (slot_turn_on_log)); m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); return ret; diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 16a76d4..7013228 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -83,7 +83,6 @@ 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_turn_on_log(sclu32 on) {} virtual void on_set_display_language(const sclchar *language) {} virtual void on_set_rotation_degree(sclint degree) {} -- 2.7.4 From dada9403dec6a2a1d4f5f4de33b6f5810846cb10 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 17 Jan 2015 15:51:48 +0900 Subject: [PATCH 07/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 08/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 09/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 10/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 11/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 12/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 13/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 14/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 15/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 16/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