From 6b9e5df8026b26e09f548a8482faf477634dc029 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 12:06:31 +0900 Subject: [PATCH 01/16] remove the legacy code for power saving mode Change-Id: If28a9bc28548a82dc5594a429724ecb9e5158695 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index eee74fc..b1a95fc 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -346,19 +346,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); - int powerSavingMode = -1; - int ret; - // Power Saving mode check - ret = vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &powerSavingMode); - if ( ret != 0 ) - { - PRINTFUNC(DLOG_ERROR, "VCONFKEY_SETAPPL_PSMODE FAILED"); - } - - if (powerSavingMode == SETTING_PSMODE_WEARABLE_ENHANCED) { - PRINTFUNC(DLOG_ERROR, "Power Saving mode, disable stt !!!"); - elm_object_disabled_set(btn, EINA_TRUE); - } } else if (!strcmp(part, "elm.icon.2")){ elm_object_style_set(btn, "anchor"); string path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; @@ -383,20 +370,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); string path = get_resource_path(); if (!strcmp(part, "elm.icon.1.touch_area")) { - int powerSavingMode = -1; - int ret; - // Power Saving mode check - ret = vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &powerSavingMode); - if ( ret != 0 ) - { - PRINTFUNC(DLOG_ERROR, "VCONFKEY_SETAPPL_PSMODE FAILED"); - } - - if (powerSavingMode == SETTING_PSMODE_WEARABLE_ENHANCED) { - PRINTFUNC(DLOG_ERROR, "Power Saving mode, disable stt !!!"); - elm_object_disabled_set(btn, EINA_TRUE); - } - evas_object_layer_set(btn, 32000); evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); -- 2.7.4 From 228788f2b541d0a41c449fcdfd962535542b6068 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 12:14:20 +0900 Subject: [PATCH 02/16] remove the legacy code for samsung log manager Change-Id: I9e19a791636b5f9a37a940afb258d6dd6fb8e731 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 90 ------------------------------------------------ 1 file changed, 90 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index b1a95fc..515a591 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -33,20 +33,12 @@ #include "w-input-emoticon.h" #include "w-input-stt-tos.h" -#ifdef SUPPORT_LOG_MANAGER -#include -#include -#endif - #include using namespace std; App_Data* app_data = NULL; -#ifdef SUPPORT_LOG_MANAGER -static samsung_log_manager_h g_log_manager = NULL; -#endif InputKeyboardData g_input_keyboard_data; @@ -65,11 +57,6 @@ static Eina_Bool is_genlist_highlighed = EINA_FALSE; void _init_app_data(App_Data* app_data); static void _app_language_changed(app_event_info_h event_info, void *user_data); static int _app_control_request_transient_app_cb(void *data); -#ifdef SUPPORT_LOG_MANAGER -static void log_manager_init(void); -static void log_manager_exit(void); -static void log_manager_set(const char *feature, const char *extra, const char *value); -#endif static char *_genlist_text_set_theme_color(const char *str, const char *code); @@ -164,11 +151,6 @@ static void _stt_clicked_cb(void *data, Evas_Object * obj, void *event_info) } else { ise_show_stt_popup(ad); } - - -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "STT", NULL); -#endif } static void _input_smartreply_notify_cb(void *user_data) @@ -194,10 +176,6 @@ static void _emoticon_clicked_cb(void *data, Evas_Object * obj, void *event_info // ise_show_emoticon_popup(ad); ise_show_emoticon_popup_rotary(ad); - -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Emoticon", NULL); -#endif } static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info) @@ -209,10 +187,6 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info if (!ad) return; -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Keypad", NULL); -#endif - if (app_data->app_type == APP_TYPE_KEYBOARD_FROM_SMS) input_keyboard_launch(ad->win_main); else @@ -251,10 +225,6 @@ static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_in int index = (unsigned int) elm_object_item_data_get(item); -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Preset", NULL); - log_manager_set("IM02", "Smart Reply", NULL); -#endif char *reply = input_smartreply_get_nth_item(index); if (reply) { input_smartreply_send_feedback(reply); @@ -316,10 +286,6 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info //@ToDo : should call reply function when any template string is selected and confirmed. // Here reply string will be template_list[index].text.c_str(); if( index < template_list.size()) { -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Preset", NULL); - log_manager_set("IM02", "Preset except smart reply", NULL); -#endif if(app_data->reply_type == REPLY_APP_CONTROL){ reply_to_sender_by_appcontrol((void*)app_data, gettext(template_list[index].text.c_str()), "template"); } else { @@ -1255,9 +1221,6 @@ bool _app_create(void* user_data) } _app_language_changed(NULL, NULL); -#ifdef SUPPORT_LOG_MANAGER - log_manager_init(); -#endif app_data = (App_Data*)user_data; @@ -1423,10 +1386,6 @@ void _app_terminate(void* user_data) input_template_unset_notify(); input_template_deinit(); - -#ifdef SUPPORT_LOG_MANAGER - log_manager_exit(); -#endif } static int init_i18n(const char *domain, const char *dir, char *lang_str) @@ -1498,52 +1457,3 @@ int main(int argc, char* argv[]) return ret; } - -#ifdef SUPPORT_LOG_MANAGER -static void log_manager_init(void) -{ - if (g_log_manager) - return; - - samsung_log_manager_create(&g_log_manager); -} - -static void log_manager_exit(void) -{ - samsung_log_manager_destroy(g_log_manager); - g_log_manager = NULL; -} - -static void log_manager_set(const char *feature, const char *extra, const char *value) -{ - const char *uri = USE_APP_FEATURE_SURVEY_URI; - - unsigned int request_id; - bundle *log_data; - - if (g_log_manager == NULL) { - PRINTFUNC(DLOG_ERROR, "log manager doesn't initialized"); - return; - } - - if (feature == NULL) { - PRINTFUNC(DLOG_ERROR, "feature is empty"); - return; - } - - log_data = bundle_create(); - - bundle_add(log_data, "app_id", PACKAGE); - bundle_add(log_data, "feature", feature); - - if (extra) - bundle_add(log_data, "extra", extra); - if (value) - bundle_add(log_data, "value", value); - - samsung_log_manager_insert(g_log_manager, uri, log_data, NULL, NULL, &request_id); - - bundle_free(log_data); -} -#endif - -- 2.7.4 From 843a2b0025eb07776ff8a6dd99cc2628938638f5 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 17:21:26 +0900 Subject: [PATCH 03/16] remove the legacy code for CSC feature Change-Id: I3cb72e60cd1232d98bf50643f7f679c381af1b88 Signed-off-by: sungwook79.park --- src/CMakeLists.txt | 15 +-------------- src/w-input-selector.cpp | 20 +++++++------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19c5f17..345580f 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,6 @@ PKG_CHECK_MODULES(SQLITE3_PKG REQUIRED sqlite3) #PKG_CHECK_MODULES(GRAPHICS_EXTENSION REQUIRED graphics-extension) #PKG_CHECK_MODULES(WNOTI_SERVICE REQUIRED wnoti-service2) #PKG_CHECK_MODULES(SAP_CLIENT_STUB_API REQUIRED sap-client-stub-api) -#PKG_CHECK_MODULES(CSC_FEATURE REQUIRED csc-feature) SET(W_INPUT_SELECTOR inputdelegator) @@ -41,13 +40,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${DATA_CONTROL_INCLUDE_DIRS} ${SMARTREPLY_INCLUDE_DIRS} ${WNOTI_SERVICE_INCLUDE_DIRS} - ${SAP_CLIENT_STUB_API_INCLUDE_DIRS} - ${CSC_FEATURE_INCLUDE_DIRS}) - -IF(enable_log_manager) - INCLUDE_DIRECTORIES(${LOG_CLIENT_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${BUNDLE_INCLUDE_DIRS}) -ENDIF() + ${SAP_CLIENT_STUB_API_INCLUDE_DIRS}) LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} @@ -67,14 +60,8 @@ LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} ${SMARTREPLY_LIBRARY_DIRS} ${WNOTI_SERVICE_LIBRARY_DIRS} ${SAP_CLIENT_STUB_API_LIBRARY_DIRS} - ${CSC_FEATURE_LIBRARY_DIRS} ) -IF(enable_log_manager) - LINK_DIRECTORIES(${LOG_CLIENT_PKG_LIBRARY_DIRS}) - LINK_DIRECTORIES(${BUNDLE_PKG_LIBRARY_DIRS}) -ENDIF() - ADD_EXECUTABLE(${W_INPUT_SELECTOR} ${W_INPUT_SELECTOR_SRCS}) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 515a591..65c8a0f 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -509,20 +509,14 @@ void set_source_caller_app_id(app_control_h app_control) return; } -// CscFeatureBool is_security_permission_manager = CSC_FEATURE_BOOL_FALSE; -// is_security_permission_manager = csc_feature_get_bool(CSC_FEATURE_DEF_BOOL_SECURITY_PERMISSION_MANAGER); + char *caller = NULL; + app_control_get_caller(app_data->source_app_control, &caller); -// if(is_security_permission_manager == CSC_FEATURE_BOOL_TRUE){ - - char *caller = NULL; - app_control_get_caller(app_data->source_app_control, &caller); - - if(caller){ - PRINTFUNC(DLOG_DEBUG, "caller = %s", caller); - app_control_add_extra_data(app_control, "caller_appid", caller); - free(caller); - } -// } + if(caller){ + PRINTFUNC(DLOG_DEBUG, "caller = %s", caller); + app_control_add_extra_data(app_control, "caller_appid", caller); + free(caller); + } } void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type) -- 2.7.4 From 83308a97987dd0a93652b226d429331a67c8e73d Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 19:09:57 +0900 Subject: [PATCH 04/16] remove the legacy code that is not used Change-Id: Ic3f3bfd5f6dd78b4163b82d7946a2179e0c09c12 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 48 ------- src/w-input-stt-voice.cpp | 322 ++-------------------------------------------- 2 files changed, 14 insertions(+), 356 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 65c8a0f..ea4a41b 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -67,7 +67,6 @@ void _update_smartreply_items(void *user_data); void _update_template_items(void *user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); -char * _toast_delete_popup_access_info_cb(void *data, Evas_Object *obj); @@ -716,14 +715,6 @@ static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info) elm_popup_dismiss(obj); } -char * _toast_delete_popup_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_ERROR, "%s", __func__); - const char * info = elm_object_part_text_get((Evas_Object*)data, "elm.text"); - - return strdup(info); -} - void _back_to_genlist_for_selector() { @@ -742,45 +733,6 @@ void _back_to_genlist_for_selector() eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE); } - -char *_it_plus_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - std::string text = std::string(gettext("IDS_ACCS_BODY_BUTTON_TTS")); - - return strdup(text.c_str()); -} - -char *_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - return strdup(gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND")); -} - -Eina_Bool _access_action_next_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info) -{ - Evas_Object *genlist = (Evas_Object*)data; - PRINTFUNC(DLOG_ERROR, "[TNT] _access_action_next_cb called, genlist type:%s", evas_object_type_get(genlist)); - Elm_Object_Item *it = elm_genlist_first_item_get(genlist);//emptry item? - PRINTFUNC(DLOG_ERROR, "[TNT] get first item:%p", it); - it = elm_genlist_item_next_get(it);//title item(3 button?) - PRINTFUNC(DLOG_ERROR, "[TNT] get Second item:%p, title_item:%p", it, it_title); - elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_IN); - force_highlight_to_top = EINA_TRUE; - return EINA_TRUE; -} - -Eina_Bool _access_action_prev_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info) -{ - Evas_Object *genlist = (Evas_Object*)data; - PRINTFUNC(DLOG_ERROR, "[TNT] _access_action_prev_cb called, genlist type:%s", evas_object_type_get(genlist)); - Elm_Object_Item *it = elm_genlist_last_item_get(genlist);//plus button item - PRINTFUNC(DLOG_ERROR, "[TNT] get last item:%p", it); - elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_IN); - force_highlight_to_bottom = EINA_TRUE; - return EINA_TRUE; -} - static void _item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { PRINTFUNC(DLOG_DEBUG, "%s", __func__); diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 659a7ee..ed41fc0 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -73,23 +73,7 @@ static bool g_mic_clicked = false; static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); -char *supported_language[13] = { - "auto", - "de_DE", - "en_GB", - "en_US", - "es_ES", - "es_US", - "fr_FR", - "it_IT", - "pt_BR", - "ru_RU", - "zh_CN", - "ja_JP", - "ko_KR", -}; - -char *supported_language_n66[7] = { +char *supported_language[7] = { "auto", "en_US", "es_US", @@ -100,23 +84,7 @@ char *supported_language_n66[7] = { }; -char *disp_lang_array[13] = { - "", - "Deutsch", - "English (United Kingdom)", - "English (United States)", - "Español (España)", - "Español (América Latina)", - "Français (France)", - "Italiano", - "Português (Brasil)", - "Pусский", - "简体中文", - "日本語", - "한국어", -}; - -char *disp_lang_array_n66[7] = { +char *disp_lang_array[7] = { "", "English (United States)", "Español (América Latina)", @@ -169,72 +137,26 @@ char* get_lang_label(char lang[]) { char *str = NULL; - if (strcmp(lang, "en_US") == 0) - str = disp_lang_array[3]; - - else if (strcmp(lang, "ko_KR") == 0) - str = disp_lang_array[12]; - - else if (strcmp(lang, "de_DE") == 0) - str = disp_lang_array[1]; - - else if (strcmp(lang, "fr_FR") == 0) - str = disp_lang_array[6]; - - else if (strcmp(lang, "it_IT") == 0) - str = disp_lang_array[7]; - - else if (strcmp(lang, "en_GB") == 0) - str = disp_lang_array[2]; - - else if (strcmp(lang, "ja_JP") == 0) - str = disp_lang_array[11]; - - else if (strcmp(lang, "zh_CN") == 0) - str = disp_lang_array[10]; - - else if (strcmp(lang, "ru_RU") == 0) - str = disp_lang_array[9]; - - else if (strcmp(lang, "pt_BR") == 0) - str = disp_lang_array[8]; - - else if (strcmp(lang, "es_ES") == 0) - str = disp_lang_array[4]; - - else if (strcmp(lang, "es_US") == 0) - str = disp_lang_array[5]; - - else - str = disp_lang_array[3]; - - return str; -} - -char* get_lang_label_n66(char lang[]) -{ - char *str = NULL; - if (strcmp (lang, "en_US") == 0) - str = disp_lang_array_n66[1]; + str = disp_lang_array[1]; else if (strcmp (lang, "ko_KR") == 0) - str = disp_lang_array_n66[6]; + str = disp_lang_array[6]; else if (strcmp (lang, "fr_FR") == 0) - str = disp_lang_array_n66[3]; + str = disp_lang_array[3]; else if (strcmp (lang, "ja_JP") == 0) - str = disp_lang_array_n66[5]; + str = disp_lang_array[5]; else if (strcmp (lang, "zh_CN") == 0) - str = disp_lang_array_n66[4]; + str = disp_lang_array[4]; else if (strcmp (lang, "es_US") == 0) - str = disp_lang_array_n66[2]; + str = disp_lang_array[2]; else - str = disp_lang_array_n66[1]; + str = disp_lang_array[1]; return str; } @@ -514,40 +436,6 @@ static void on_mic_button_press_cb(void *data, Evas_Object *obj, void *event_inf return; } -static char *_left_cue_access_info_cb(void *data, Evas_Object *obj) -{ - char text[512]; - - snprintf(text, sizeof(text), "%s, %s", gettext(TTS_SEND), gettext(TTS_BUTTON)); - - return strdup(text); -} - -static void _left_cue_access_activate_cb(void * data, Evas_Object *part_obj, Elm_Object_Item *item) -{ - Evas_Object *obj = (Evas_Object *)data; - elm_layout_signal_emit(obj, "cue,clicked", "elm"); - - elm_panel_toggle(obj); -} - - -static void _send_button_highlighted_cb(void *data, Evas_Object * obj, void *event_info) -{ - PRINTFUNC(DLOG_DEBUG, ""); - VoiceData* voicedata = (VoiceData*)data; - - if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING || - voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) - return; - - std::string text = std::string(gettext(TTS_SEND)); - text = text +" "+ gettext(TTS_BUTTON); - if (elm_object_disabled_get(obj)) - text = text + " " + gettext(TTS_DISABLED); - - elm_access_say(text.c_str()); -} static Eina_Bool _mic_button_enable_cb(void *data) { @@ -567,31 +455,6 @@ static Eina_Bool _mic_button_enable_cb(void *data) return ECORE_CALLBACK_CANCEL; } -static void _mic_highlighted_cb(void *data, Evas_Object * obj, void *event_info) -{ - PRINTFUNC(DLOG_DEBUG, ""); - VoiceData* voicedata = (VoiceData*)data; - - if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING || - voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) - return; - - elm_object_disabled_set(voicedata->mic_button, EINA_TRUE); - - if(voicedata->btn_disabling_timer == NULL){ - ecore_timer_del(voicedata->btn_disabling_timer); - } - voicedata->btn_disabling_timer = ecore_timer_add(3.0, _mic_button_enable_cb, voicedata); - - elm_access_say(gettext(SK_DOUBLE_TAP_TO_SPEAK)); -} - -static char *_mic_access_info_cb(void *data, Evas_Object *obj) -{ - if (data) return strdup((const char*)data); - return NULL; -} - static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { @@ -1079,11 +942,7 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) return strdup(_("IDS_VC_BODY_AUTOMATIC")); } else { char *s = NULL; - if(g_is_n66) { - s = (char *)disp_lang_array_n66[(int)data]; - } else { - s = (char *)disp_lang_array[(int)data]; - } + s = (char *)disp_lang_array[(int)data]; if(s) { char *p = strchr(s, '('); @@ -1114,18 +973,11 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) // confirm whether the system language is supported by stt engine or not. // if supported, set the language // otherwise, set language to en_US - if(g_is_n66) { - return strdup(get_lang_label_n66(system_lang)); - } else { - return strdup(get_lang_label(system_lang)); - } + return strdup(get_lang_label(system_lang)); + } else { char *s = NULL; - if(g_is_n66) { - s = (char *)disp_lang_array_n66[(int)data]; - } else { - s = (char *)disp_lang_array[(int)data]; - } + s = (char *)disp_lang_array[(int)data]; if(s) { char *p = strchr(s, '('); @@ -1184,13 +1036,7 @@ static int get_language_value() PRINTFUNC(DLOG_WARN, "vconf lang orig(%d) to be 0", lang); lang = 0; } - PRINTFUNC(DLOG_DEBUG, "n66 current language value for stt (%s).", disp_lang_array_n66[lang]); - } else { - if(lang < 0 || lang > 12) { - PRINTFUNC(DLOG_WARN, "vconf lang orig(%d) to be 0", lang); - lang = 0; - } - PRINTFUNC(DLOG_DEBUG, "current language value for stt (%s).", disp_lang_array[lang]); + PRINTFUNC(DLOG_DEBUG, "n66 current language value for stt (%s).", disp_lang_array[lang]); } return lang; @@ -1275,62 +1121,6 @@ static void get_stt_default_language(VoiceData *my_voicedata) case STT_VOICE_N66_KO_KR : case STT_VOICE_N66_ZH_CN : { - my_voicedata->kbd_lang = strdup(supported_language_n66[stt_lang]); - } - break; - default : - my_voicedata->kbd_lang = strdup("en_US"); - break; - } - } else { - STT_VOICE_LANGUAGE_I stt_lang; - stt_lang = (STT_VOICE_LANGUAGE_I)get_language_value(); - - PRINTFUNC(DLOG_DEBUG, "language type (%d)", stt_lang); - - switch(stt_lang) { - case STT_VOICE_AUTO : - { - stt_get_default_language(my_voicedata->voicefw_handle, &my_voicedata->kbd_lang); - - // get system display language - char* value = NULL; - value = vconf_get_str(VCONFKEY_LANGSET); - if (NULL == value) { - PRINTFUNC(DLOG_ERROR, "Fail to get display language"); - return; - } - PRINTFUNC(DLOG_DEBUG, "system language (%s)", value); - - char system_lang[6] = {0, }; - strncpy(system_lang, value , 5); - free(value); - - // confirm whether the system language is supported by stt engine or not. - // if supported, set the language - // otherwise, set language to en_US - if(is_lang_supported_by_stt(system_lang) == TRUE) { - my_voicedata->kbd_lang = strdup(system_lang); - PRINTFUNC(DLOG_DEBUG, "Set auto language (%s)", system_lang); - } else { - my_voicedata->kbd_lang = strdup("en_US"); - PRINTFUNC(DLOG_DEBUG, "System language is not supported by STT (%s), en_US will be set", system_lang); - } - } - break; - case STT_VOICE_DE_DE : - case STT_VOICE_EN_GB : - case STT_VOICE_EN_US : - case STT_VOICE_ES_ES : - case STT_VOICE_ES_US : - case STT_VOICE_FR_FR : - case STT_VOICE_IT_IT : - case STT_VOICE_JA_JP : - case STT_VOICE_KO_KR : - case STT_VOICE_RU_RU : - case STT_VOICE_ZH_CN : - case STT_VOICE_PT_BR : - { my_voicedata->kbd_lang = strdup(supported_language[stt_lang]); } break; @@ -1389,33 +1179,6 @@ Eina_Bool _ise_keydown_cb(void *data, int type, void *event) return ECORE_CALLBACK_DONE; } -char *_language_list_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - - int value; - int index; - std::string text = std::string(gettext(TTS_RADIO_BUTTON)); - const Elm_Object_Item *item = (Elm_Object_Item *)data; - - Evas_Object* radio = elm_object_item_part_content_get(item, "elm.icon"); - - index = elm_genlist_item_index_get(item); - - if(index == 1) // title - return NULL; - - - value = elm_radio_value_get(radio); - //PRINTFUNC(DLOG_DEBUG,"index=%d value = %d", index, value); - if(index == value + 2 ){ - text = text + std::string(" ") + std::string(gettext(TTS_SELECTED)); - } else { - text = text + std::string(" ") + std::string(gettext(TTS_NOT_SELECTED)); - } - - return strdup(text.c_str()); -} static void _language_list_item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { @@ -1484,27 +1247,6 @@ static Evas_Object *create_language_list(Evas_Object *parent) if(g_is_n66) { for (i = 1; i < 7; i++) { - char *s = (char *)disp_lang_array_n66[i]; - - if(strchr(s, '(')){ - item = item_append(genlist, itc_2text, i, language_set_genlist_radio_cb, genlist); - } else { - item = item_append(genlist, itc_1text, i, language_set_genlist_radio_cb, genlist); - } - - if(lang_val == i) { - PRINTFUNC(DLOG_DEBUG, "%d item is choiced.", i); - elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); - } - - if ( item == NULL ) { - PRINTFUNC(DLOG_DEBUG, "elm_genlist_item_append was failed"); - break; - } - } - } else { - for (i = 1; i < 13; i++) - { char *s = (char *)disp_lang_array[i]; if(strchr(s, '(')){ @@ -1637,42 +1379,6 @@ static void language_changed_cb(void *data, Evas_Object * obj, void *event_info) if(!data) return; } -static void get_text_part_width(Evas_Object *window, const char *text, Evas_Coord *calculated_width) -{ - if(!window) return; - if(!text) return; - if(!calculated_width) return; - - Evas_Coord width, height; - - char *strbuf = NULL; - Evas_Object *tb = NULL; - Evas_Textblock_Style *st = NULL; - Evas_Textblock_Cursor *cur = NULL; - - tb = evas_object_textblock_add(evas_object_evas_get(window)); - evas_object_textblock_legacy_newline_set(tb, EINA_FALSE); - - st = evas_textblock_style_new(); - evas_textblock_style_set(st, VIRTUAL_TEXT_AREA_FONT_STYLE); - evas_object_textblock_style_set(tb, st); - - cur = evas_object_textblock_cursor_new(tb); - strbuf = elm_entry_utf8_to_markup(text); - evas_object_resize(tb, 360, 47); - - evas_object_textblock_text_markup_set(tb, strbuf); - evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); - evas_object_textblock_size_formatted_get(tb, &width, &height); - evas_object_resize(tb, width, 47); - - *calculated_width = width; - - if(strbuf) free(strbuf); - if(tb) evas_object_del(tb); - if(st) evas_textblock_style_free(st); - if(cur) evas_textblock_cursor_free(cur); -} void _stt_lang_changed_cb(keynode_t *key, void* data) { -- 2.7.4 From d29826dc4607e2143fe96405935f038f7be3c632 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 21 Jul 2016 13:35:25 +0900 Subject: [PATCH 05/16] remove the legacy code for sms appcontrol Change-Id: I4f0c1d2dbd5a11355854179156913fe42f566857 Signed-off-by: sungwook79.park --- inc/w-input-keyboard.h | 3 +- inc/w-input-selector.h | 5 -- src/w-input-emoticon.cpp | 5 +- src/w-input-keyboard.cpp | 186 ++++++++++------------------------------------ src/w-input-selector.cpp | 152 ++++++------------------------------- src/w-input-stt-voice.cpp | 29 ++------ 6 files changed, 68 insertions(+), 312 deletions(-) diff --git a/inc/w-input-keyboard.h b/inc/w-input-keyboard.h index 192d005..4cff081 100755 --- a/inc/w-input-keyboard.h +++ b/inc/w-input-keyboard.h @@ -23,7 +23,6 @@ bool input_keyboard_init(app_control_h app_control); void input_keyboard_deinit(void); -bool input_keyboard_launch(Evas_Object *window); -bool input_keyboard_launch_with_ui(Evas_Object *window, void * data); +bool input_keyboard_launch(Evas_Object *window, void * data); #endif diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 5bfbc5e..83c1799 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -45,7 +45,6 @@ enum { APP_TYPE_REPLY, APP_TYPE_HANDWRITING, APP_TYPE_KEYBOARD, - APP_TYPE_KEYBOARD_FROM_SMS, }; enum { @@ -80,9 +79,6 @@ typedef enum struct _InputKeyboardData { - char *app_id; - char **data_array; - int data_array_len; char *guide_text; char *default_text; }; @@ -94,7 +90,6 @@ typedef struct _InputKeyboardData InputKeyboardData; void _app_terminate(void* user_data); void reply_to_sender_by_callback_for_back(); void reply_to_sender_by_callback(const char *value, const char *type); -void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type); char* get_resource_path(); char* get_shared_resource_path(); void show_gl_focus(Eina_Bool bVisible); diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 2240448..db808bd 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -137,10 +137,7 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length); input_smartreply_send_feedback(utf_8); - if(ad->reply_type == REPLY_APP_CONTROL) - reply_to_sender_by_appcontrol(data, (const char*)utf_8, "emoticon"); - else - reply_to_sender_by_callback((const char*)utf_8, "emoticon"); + reply_to_sender_by_callback((const char*)utf_8, "emoticon"); PRINTFUNC(SECURE_DEBUG, "[%d]%s", i, utf_8); if (utf_8) diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 6951c2e..486ffd8 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -36,9 +36,9 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { - char *feedback = NULL; + char *feedback = NULL; if (result == APP_CONTROL_RESULT_SUCCEEDED) { - if (reply) { + if (reply) { int ret; ret = app_control_get_extra_data(reply, "template_feedback", &feedback); @@ -50,7 +50,7 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ } } reply_to_sender_by_callback(feedback, "keyboard"); - free(feedback); + free(feedback); elm_exit(); } } @@ -59,194 +59,84 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ bool input_keyboard_init(app_control_h app_control) { int ret = -1; - - char *app_id = NULL; - char **data_array = NULL; - int data_array_len = -1; - char *default_text = NULL; - char *guide_text = NULL; + char *default_text = NULL; + char *guide_text = NULL; input_keyboard_deinit(); - ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_DEFAULT_TEXT, &default_text); - if (ret == APP_CONTROL_ERROR_NONE) { - g_input_keyboard_data.default_text = default_text; - } - ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_GUIDE_TEXT, &guide_text); - if (ret == APP_CONTROL_ERROR_NONE) { - g_input_keyboard_data.guide_text = guide_text; - } - - ret = app_control_get_extra_data(app_control, - "selector_keyboard_app_id", - &app_id); - - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_WARN, "can not get selector_keyboard_app_id: %d", ret); - return false; + ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_DEFAULT_TEXT, &default_text); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.default_text = default_text; } - - ret = app_control_get_extra_data_array(app_control, - "selector_keyboard_data_array", - &data_array, &data_array_len); - - - if (ret != APP_CONTROL_ERROR_NONE) { - if (app_id) - free(app_id); - - PRINTFUNC(DLOG_WARN, "can not get selector_keyboard_data_array : %d", ret); - return false; + ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_GUIDE_TEXT, &guide_text); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.guide_text = guide_text; } - if (app_id) - g_input_keyboard_data.app_id = app_id; - - if (data_array) - g_input_keyboard_data.data_array = data_array; - - g_input_keyboard_data.data_array_len = data_array_len; - - PRINTFUNC(DLOG_WARN, "app_id = %s", app_id); - PRINTFUNC(DLOG_WARN, "data_array = %s", data_array); - return true; } void input_keyboard_deinit(void) { - int i = 0; - char **data_array = NULL; - if (g_input_keyboard_data.guide_text) free(g_input_keyboard_data.guide_text); if (g_input_keyboard_data.default_text) free(g_input_keyboard_data.default_text); - if (g_input_keyboard_data.app_id) - free(g_input_keyboard_data.app_id); - - data_array = g_input_keyboard_data.data_array; - if (data_array) { - for (i = 0; i < g_input_keyboard_data.data_array_len; i++) { - if (*(data_array + i)) - free(*(data_array + i)); - } - - free(data_array); - } - - g_input_keyboard_data.app_id = NULL; - g_input_keyboard_data.data_array = NULL; - g_input_keyboard_data.data_array_len = 0; + g_input_keyboard_data.default_text = NULL; + g_input_keyboard_data.guide_text = NULL; return; } -bool input_keyboard_launch(Evas_Object *window) -{ - int ret; - - char *app_id; - - app_control_h app_control; - - if (window == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get window"); - return false; - } - - ret = app_control_create(&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); - return false; - } - - app_id = g_input_keyboard_data.app_id; - if (app_id == NULL) { - PRINTFUNC(DLOG_INFO, "app id is undefined, use defualt"); - app_id = "com.samsung.message.appcontrol.compose"; - } - - app_control_set_app_id(app_control, app_id); - app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); -/* - ret = app_control_set_window(app_control, - elm_win_xwindow_get(window)); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not app control set window : %d", ret); - app_control_destroy(app_control); - return false; - } -*/ - if (g_input_keyboard_data.data_array && g_input_keyboard_data.data_array_len > 0) { - app_control_add_extra_data_array(app_control, - "selector_keyboard_data_array", - (const char**)(g_input_keyboard_data.data_array), - g_input_keyboard_data.data_array_len); - } - - set_source_caller_app_id(app_control); - - ret = app_control_send_launch_request(app_control, - input_keyboard_app_control_send_reply_cb, - NULL); - if (ret != APP_CONTROL_ERROR_NONE) - PRINTFUNC(DLOG_ERROR, "Can not launch app_control: %d", ret); - - app_control_destroy(app_control); - - return true; -} - void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) { - app_control_h app_control; - int ret = app_control_create(&app_control); + app_control_h app_control; + int ret = app_control_create(&app_control); if (ret != APP_CONTROL_ERROR_NONE) { PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); return; } - const char *getText = elm_entry_entry_get(entry); - LOGD("button key clicked!! : getText = %s", getText); + const char *getText = elm_entry_entry_get(entry); + LOGD("button key clicked!! : getText = %s", getText); - if (getText) - input_smartreply_send_feedback(getText); + if (getText) + input_smartreply_send_feedback(getText); - char *app_id = NULL; - app_control_get_caller(app_data->source_app_control, &app_id); - if (app_id != NULL) - app_control_set_app_id(app_control, app_id); + char *app_id = NULL; + app_control_get_caller(app_data->source_app_control, &app_id); + if (app_id != NULL) + app_control_set_app_id(app_control, app_id); app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); - set_source_caller_app_id(app_control); - free(app_id); + set_source_caller_app_id(app_control); + free(app_id); reply_to_sender_by_callback(getText, "keyboard"); elm_exit(); } static Eina_Bool custom_back_cb(void *data, Elm_Object_Item *it) { - _back_to_genlist_for_selector(); - return EINA_TRUE; + _back_to_genlist_for_selector(); + return EINA_TRUE; } void create_fullscreen_editor(void *data) { App_Data *ad = (App_Data *)data; - Evas_Object *box = elm_box_add(ad->naviframe); - evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(box); - elm_win_resize_object_add(ad->naviframe, box); + Evas_Object *box = elm_box_add(ad->naviframe); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(box); + elm_win_resize_object_add(ad->naviframe, box); - entry = elm_entry_add(box); + entry = elm_entry_add(box); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_scrollable_set(entry, EINA_TRUE); elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); elm_object_part_text_set(entry, "elm.guide", g_input_keyboard_data.guide_text); - elm_entry_entry_set(entry, g_input_keyboard_data.default_text); + elm_entry_entry_set(entry, g_input_keyboard_data.default_text); elm_entry_cursor_end_set(entry); evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -263,16 +153,16 @@ void create_fullscreen_editor(void *data) evas_object_resize(ad->naviframe, 360, 360); evas_object_show(ad->naviframe); - Elm_Object_Item *nf_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, box, "empty"); - elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL); + Elm_Object_Item *nf_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, box, "empty"); + elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL); } -bool input_keyboard_launch_with_ui(Evas_Object *window, void *data) { +bool input_keyboard_launch(Evas_Object *window, void *data) { if (window == NULL) { PRINTFUNC(DLOG_ERROR, "Can not get window"); return false; } - create_fullscreen_editor(data); - return true; + create_fullscreen_editor(data); + return true; } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index ea4a41b..33befa9 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -186,31 +186,27 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info if (!ad) return; - if (app_data->app_type == APP_TYPE_KEYBOARD_FROM_SMS) - input_keyboard_launch(ad->win_main); - else - input_keyboard_launch_with_ui(ad->win_main, data); + input_keyboard_launch(ad->win_main, data); } static void __bt_connection_result_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { - char *val = NULL; - - if (reply == NULL) { - PRINTFUNC(DLOG_ERROR, "service_h is NULL"); - return; - } - - app_control_get_extra_data(reply, "__BT_CONNECTION__", &val); - if (val) { - if ( strcmp(val, "Connected") == 0 ) { - PRINTFUNC(DLOG_ERROR, "BT Connected"); - } else { - PRINTFUNC(DLOG_ERROR, "BT Not Connected"); - } - - free(val); - } + char *val = NULL; + + if (reply == NULL) { + PRINTFUNC(DLOG_ERROR, "service_h is NULL"); + return; + } + + app_control_get_extra_data(reply, "__BT_CONNECTION__", &val); + if (val) { + if ( strcmp(val, "Connected") == 0 ) { + PRINTFUNC(DLOG_ERROR, "BT Connected"); + } else { + PRINTFUNC(DLOG_ERROR, "BT Not Connected"); + } + free(val); + } } @@ -227,14 +223,9 @@ static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_in char *reply = input_smartreply_get_nth_item(index); if (reply) { input_smartreply_send_feedback(reply); - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, reply, "smartreply"); - free(reply); - } else { - reply_to_sender_by_callback(reply, "smartreply"); - free(reply); - elm_exit(); - } + reply_to_sender_by_callback(reply, "smartreply"); + free(reply); + elm_exit(); } } } @@ -285,19 +276,15 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info //@ToDo : should call reply function when any template string is selected and confirmed. // Here reply string will be template_list[index].text.c_str(); if( index < template_list.size()) { - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, gettext(template_list[index].text.c_str()), "template"); - } else { - reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); - elm_exit(); - } + reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); + elm_exit(); } } } static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { - if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { + if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { Evas_Object* btn = elm_button_add(obj); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -518,78 +505,6 @@ void set_source_caller_app_id(app_control_h app_control) } } -void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type) -{ - PRINTFUNC(DLOG_DEBUG, ""); - - int ret; - char *app_id; - - app_control_h app_control; - - App_Data *appdata = (App_Data *)data; - - if(!appdata){ - PRINTFUNC(DLOG_ERROR, "Null pointer"); - return; - } - - ret = app_control_create(&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); - return; - } - - app_id = g_input_keyboard_data.app_id; - if (app_id == NULL) { - PRINTFUNC(DLOG_INFO, "app id is undefined, use defualt"); - app_id = "com.samsung.message.appcontrol.compose"; - } - - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose")){ - app_id = "com.samsung.msg-send"; - } - - app_control_set_app_id(app_control, app_id); - app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); -/* - ret = app_control_set_window(app_control, - elm_win_xwindow_get(appdata->win_main)); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not app control set window : %d", ret); - app_control_destroy(app_control); - return; - } -*/ - if (g_input_keyboard_data.data_array && g_input_keyboard_data.data_array_len > 0) { - app_control_add_extra_data_array(app_control, - "selector_keyboard_data_array", - (const char**)(g_input_keyboard_data.data_array), - g_input_keyboard_data.data_array_len); - } - - app_control_add_extra_data(app_control, "selector_send_data_array", "sending_popup"); - - if (value) - app_control_add_extra_data(app_control, "selected_context", value); - - if (type) - app_control_add_extra_data(app_control, "reply_type", type); - - set_source_caller_app_id(app_control); - - ret = app_control_send_launch_request(app_control, - _app_control_send_reply_cb, - NULL); - - if (ret != APP_CONTROL_ERROR_NONE) - PRINTFUNC(DLOG_ERROR, "Can not launch app_control: %d", ret); - - app_control_destroy(app_control); - - return; -} - void reply_to_sender_by_callback(const char *value, const char *type) { PRINTFUNC(DLOG_DEBUG, ""); @@ -1228,25 +1143,9 @@ void _app_service(app_control_h service, void* user_data) int ret; bool b_ret; char *context = NULL; - char *app_id = NULL; app_control_clone(&(app_data->source_app_control), service); - app_data->reply_type = REPLY_APP_NORMAL; - ret = app_control_get_extra_data(service, "selector_keyboard_app_id", &app_id); - if (ret == APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_DEBUG, "app_id = %s", app_id); - } - - if(app_id){ - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose") || !strcmp(app_id, "com.samsung.wemail-send")) { - app_data->reply_type = REPLY_APP_CONTROL; - } else { - app_data->reply_type = REPLY_APP_NORMAL; - } - } - if (app_id) - free(app_id); bool is_type_reply = false; ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); @@ -1264,11 +1163,6 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); _keyboard_clicked_cb((void *)app_data, NULL, NULL); goto ACTIVATE; - } else if (!strcmp(context, "keyboard_input_from_sms")) { - app_data->app_type = APP_TYPE_KEYBOARD_FROM_SMS; - input_keyboard_init(service); - _keyboard_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; } else if (!strcmp(context, "input_reply")) { app_data->app_type = APP_TYPE_REPLY; is_type_reply = true; diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index ed41fc0..1fd68c9 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -480,14 +480,10 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve PRINTFUNC(DLOG_DEBUG, "result_text = %s", result_text.c_str()); input_smartreply_send_feedback(result_text.c_str()); - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, result_text.c_str(), "voice"); - } else { - reply_to_sender_by_callback(result_text.c_str(), "voice"); - destroy_voice(); - powerUnlock(); - elm_exit(); - } + reply_to_sender_by_callback(result_text.c_str(), "voice"); + destroy_voice(); + powerUnlock(); + elm_exit(); return; } @@ -1765,22 +1761,7 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) panel = elm_panel_add(panel_layout); elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT); elm_layout_theme_set(panel, "panel", "left_confirm", "default"); - if(app_data->source_app_control){ - int ret; - char *app_id = NULL; - ret = app_control_get_extra_data(app_data->source_app_control, "selector_keyboard_app_id", &app_id); - if (ret == APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_DEBUG, "app_id = %s", app_id); - } - - if(app_id){ - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose") - || !strcmp(app_id, "com.samsung.wemail-send")){ - elm_layout_theme_set(panel, "panel", "left_sending", "default"); - } - free(app_id); - } - } + elm_layout_theme_set(panel, "panel", "left_sending", "default"); elm_layout_signal_callback_add(panel, "cue,clicked", "elm", _panel_cue_clicked_cb, (void *) voicedata); evas_object_show(panel); -- 2.7.4 From 522eabfda1a07542a5440a035acf6606b51a61e3 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 22 Jul 2016 14:13:25 +0900 Subject: [PATCH 06/16] remove the unused legacy code Change-Id: I114d5084962d7424f631da90dc0812937be3b233 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 11 ----------- src/w-input-stt-voice.cpp | 39 +++++---------------------------------- 2 files changed, 5 insertions(+), 45 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 33befa9..307af6d 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -50,13 +50,8 @@ static unsigned int g_template_current_number = 0; /* currnetly loaded template Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary -static Eina_Bool force_highlight_to_top = EINA_FALSE; -static Eina_Bool force_highlight_to_bottom = EINA_FALSE; -static Eina_Bool is_genlist_highlighed = EINA_FALSE; - void _init_app_data(App_Data* app_data); static void _app_language_changed(app_event_info_h event_info, void *user_data); -static int _app_control_request_transient_app_cb(void *data); static char *_genlist_text_set_theme_color(const char *str, const char *code); @@ -443,11 +438,6 @@ static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info elm_genlist_realized_items_update(obj); } -static int _app_control_request_transient_app_cb(void *data) -{ - return 0; -} - static char *_genlist_text_set_theme_color(const char *str, const char *code) { @@ -1189,7 +1179,6 @@ void _app_service(app_control_h service, void* user_data) ACTIVATE : elm_win_activate(app_data->win_main); -// app_control_request_transient_app(service, elm_win_xwindow_get(app_data->win_main), _app_control_request_transient_app_cb, NULL); if(context) free(context); } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 1fd68c9..1b90386 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -52,8 +52,6 @@ extern VoiceData *my_voicedata; static bool power_state = false; -static bool bottom_button_access_state = false; - static Evas_Object *radio_gp = NULL; Evas_Object *g_setting_window = NULL; static Evas_Object *g_setting_naviframe = NULL; @@ -67,9 +65,6 @@ static Elm_Genlist_Item_Class itc_title; static Elm_Genlist_Item_Class itc_1text; static Elm_Genlist_Item_Class itc_2text; -static bool g_send_button_clicked = false; -//accessbility -static bool g_mic_clicked = false; static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); @@ -94,23 +89,6 @@ char *disp_lang_array[7] = { "한국어", }; - -typedef enum { - STT_VOICE_AUTO, - STT_VOICE_DE_DE, - STT_VOICE_EN_GB, - STT_VOICE_EN_US, - STT_VOICE_ES_ES, - STT_VOICE_ES_US, - STT_VOICE_FR_FR, - STT_VOICE_IT_IT, - STT_VOICE_PT_BR, - STT_VOICE_RU_RU, - STT_VOICE_ZH_CN, - STT_VOICE_JA_JP, - STT_VOICE_KO_KR -}STT_VOICE_LANGUAGE_I; - typedef enum { STT_VOICE_N66_AUTO, STT_VOICE_N66_EN_US, @@ -458,13 +436,6 @@ static Eina_Bool _mic_button_enable_cb(void *data) static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { - if(g_send_button_clicked == true){ - PRINTFUNC(DLOG_DEBUG, "skipped seding STT result"); - return; - } - - g_send_button_clicked = true; - if(!data) return; @@ -1597,8 +1568,8 @@ static Evas_Object *create_textblock(void* data) evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); -// elm_scroller_page_size_set(scroller, 0, 50); -// elm_scroller_page_scroll_limit_set(scroller, 0, 1); + elm_scroller_page_size_set(scroller, 0, 50); + elm_scroller_page_scroll_limit_set(scroller, 0, 1); elm_object_scroll_lock_x_set(scroller, EINA_TRUE); @@ -1654,7 +1625,7 @@ static Evas_Object *create_progressbar(Evas_Object *parent) progressbar = elm_progressbar_add(parent); elm_object_style_set(progressbar, "voice_input/process/small"); - //elm_progressbar_pulse(progressbar, EINA_TRUE); + elm_progressbar_pulse(progressbar, EINA_TRUE); evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -1713,11 +1684,11 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) elm_layout_file_set(layout_main, edj_path.c_str(), "mic_control"); - //elm_object_content_set(parent, layout_main); + elm_object_content_set(parent, layout_main); //Canvas for Cairo effect Evas_Object *canvas = evas_object_image_filled_add(evas_object_evas_get(layout_main)); -// evas_object_image_alpha_set(canvas, EINA_TRUE); + evas_object_image_alpha_set(canvas, EINA_TRUE); evas_object_size_hint_align_set(canvas, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(canvas, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_move(canvas, 0, 0); -- 2.7.4 From d23da1c0f3e3bffa0adbc0cf79299425d0522601 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 22 Jul 2016 14:15:38 +0900 Subject: [PATCH 07/16] fix the issue that not showed left cue button Change-Id: I9e8ee6b7961bd294d2f681aa26d0bc2faff1f88f Signed-off-by: sungwook79.park --- src/w-input-stt-voice.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 1b90386..23160a8 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -194,7 +194,7 @@ static inline Evas_Coord get_text_block_size(Evas_Object *obj, std::string text) if(strbuf) free(strbuf); if(tb) evas_object_del(tb); if(st) evas_textblock_style_free(st); - if(cur) evas_textblock_cursor_free(cur); +// if(cur) evas_textblock_cursor_free(cur); return height; } @@ -1819,6 +1819,12 @@ int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata) return FALSE; } + if (NULL != voicedata->textblock_timer) { + PRINTFUNC(DLOG_DEBUG, "delete previous textblock"); + ecore_timer_del(voicedata->textblock_timer); + voicedata->textblock_timer = NULL; + } + return TRUE; } -- 2.7.4 From 89a76f7caba2626b82a9e150551094755bee3b5c Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 25 Jul 2016 17:11:29 +0900 Subject: [PATCH 08/16] remove the smartreply and template feature Change-Id: I11cc3a5f57c6f88cd60dd379d4a929bd2956400b Signed-off-by: sungwook79.park --- inc/w-input-smartreply.h | 50 ---- inc/w-input-template.h | 46 --- packaging/org.tizen.inputdelegator.spec | 1 - src/CMakeLists.txt | 4 - src/w-input-emoticon.cpp | 2 - src/w-input-keyboard.cpp | 10 - src/w-input-selector.cpp | 481 -------------------------------- src/w-input-smartreply.cpp | 158 ----------- src/w-input-stt-voice.cpp | 2 - src/w-input-template.cpp | 290 ------------------- 10 files changed, 1044 deletions(-) delete mode 100755 inc/w-input-smartreply.h delete mode 100755 inc/w-input-template.h delete mode 100755 src/w-input-smartreply.cpp delete mode 100755 src/w-input-template.cpp diff --git a/inc/w-input-smartreply.h b/inc/w-input-smartreply.h deleted file mode 100755 index 87f8c05..0000000 --- a/inc/w-input-smartreply.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef _W_INPUT_SMARTREPLY_H_ -#define _W_INPUT_SMARTREPLY_H_ - -#include -#include - -typedef void (*input_smartreply_changed)(void *user_data); - - -bool input_smartreply_init(app_control_h app_control); - -void input_smartreply_deinit(void); - -const char *input_smartreply_get_lang(void); - -bool input_smartreply_get_reply(void); - -bool input_smartreply_get_reply_async(void); - -int input_smartreply_get_reply_num(void); - -char *input_smartreply_get_nth_item(int index); - -bool input_smartreply_send_feedback(const char *str); - -void input_smartreply_set_notify(input_smartreply_changed callback, - void *user_data); - -void input_smartreply_unset_notify(void); - -bool input_smartreply_is_enabled(void); - -#endif diff --git a/inc/w-input-template.h b/inc/w-input-template.h deleted file mode 100755 index 1902530..0000000 --- a/inc/w-input-template.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __W_INPUT_TEMPLATE_H_ -#define __W_INPUT_TEMPLATE_H_ - -#include -#include - -#include - -struct TemplateData { - std::string text; - bool use_gettext; -}; - -typedef void (*input_template_changed) (void *user_data); - - -void input_template_init(app_control_h app_control); - -void input_template_deinit(void); - -const std::vector input_template_get_list(void); - -void input_template_set_notify(input_template_changed callback, - void *user_data); - -void input_template_unset_notify(void); - -bool input_template_is_user_template(void); - -#endif diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 75ee232..2af5a00 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -31,7 +31,6 @@ BuildRequires: pkgconfig(stt) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(sqlite3) -#BuildRequires: pkgconfig(smartreply) %if %{enable_log_manager} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 345580f..5e39c91 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,6 @@ PKG_CHECK_MODULES(STT REQUIRED stt) PKG_CHECK_MODULES(VCONF REQUIRED vconf) PKG_CHECK_MODULES(DB_UTIL_PKG REQUIRED db-util) PKG_CHECK_MODULES(SQLITE3_PKG REQUIRED sqlite3) -#PKG_CHECK_MODULES(SMARTREPLY REQUIRED smartreply) #PKG_CHECK_MODULES(GRAPHICS_EXTENSION REQUIRED graphics-extension) #PKG_CHECK_MODULES(WNOTI_SERVICE REQUIRED wnoti-service2) #PKG_CHECK_MODULES(SAP_CLIENT_STUB_API REQUIRED sap-client-stub-api) @@ -38,7 +37,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${DB_UTIL_PKG_INCLUDE_DIRS} ${SQLITE3_PKG_INCLUDE_DIRS} ${DATA_CONTROL_INCLUDE_DIRS} - ${SMARTREPLY_INCLUDE_DIRS} ${WNOTI_SERVICE_INCLUDE_DIRS} ${SAP_CLIENT_STUB_API_INCLUDE_DIRS}) @@ -57,7 +55,6 @@ LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} ${DB_UTIL_PKG_LIBRARY_DIRS} ${SQLITE3_PKG_LIBRARY_DIRS} ${VCONF_LIBRARY_DIRS} - ${SMARTREPLY_LIBRARY_DIRS} ${WNOTI_SERVICE_LIBRARY_DIRS} ${SAP_CLIENT_STUB_API_LIBRARY_DIRS} ) @@ -79,7 +76,6 @@ TARGET_LINK_LIBRARIES(${W_INPUT_SELECTOR} ${DB_UTIL_PKG_LIBRARIES} ${SQLITE3_PKG_LIBRARIES} ${VCONF_LIBRARIES} -# ${SMARTREPLY_LIBRARIES} ) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index db808bd..33be4de 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -21,7 +21,6 @@ #include "Debug.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" #define EMOTICON_CNT 27 @@ -136,7 +135,6 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev const Eina_Unicode unicode_event[2] = { emoticon_info[i].code, 0 }; char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length); - input_smartreply_send_feedback(utf_8); reply_to_sender_by_callback((const char*)utf_8, "emoticon"); PRINTFUNC(SECURE_DEBUG, "[%d]%s", i, utf_8); diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 486ffd8..ec6393d 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -23,7 +23,6 @@ #include "w-input-keyboard.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" extern InputKeyboardData g_input_keyboard_data; extern App_Data* app_data; @@ -42,12 +41,6 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ int ret; ret = app_control_get_extra_data(reply, "template_feedback", &feedback); - - if (ret == APP_CONTROL_ERROR_NONE) { - if (feedback) { - input_smartreply_send_feedback(feedback); - } - } } reply_to_sender_by_callback(feedback, "keyboard"); free(feedback); @@ -102,9 +95,6 @@ void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) const char *getText = elm_entry_entry_get(entry); LOGD("button key clicked!! : getText = %s", getText); - if (getText) - input_smartreply_send_feedback(getText); - char *app_id = NULL; app_control_get_caller(app_data->source_app_control, &app_id); if (app_id != NULL) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 307af6d..5ce1a98 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -26,8 +26,6 @@ //#include "ui_extension.h" #include "w-input-selector.h" -#include "w-input-template.h" -#include "w-input-smartreply.h" #include "w-input-keyboard.h" #include "w-input-stt-ise.h" #include "w-input-emoticon.h" @@ -45,8 +43,6 @@ InputKeyboardData g_input_keyboard_data; static Elm_Object_Item *it_empty; static Elm_Object_Item *it_title; static Elm_Object_Item *it_plus; -static int g_smartreply_current_number = 0; /* currently loaded smartreply number */ -static unsigned int g_template_current_number = 0; /* currnetly loaded template number */ Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary @@ -57,9 +53,6 @@ static char *_genlist_text_set_theme_color(const char *str, const char *code); Evas_Object* _create_genlist(Evas_Object* parent); void _create_genlist_items(void* user_data, bool is_type_reply); -void _update_genlist_items(void *user_data); -void _update_smartreply_items(void *user_data); -void _update_template_items(void *user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); @@ -147,18 +140,6 @@ static void _stt_clicked_cb(void *data, Evas_Object * obj, void *event_info) } } -static void _input_smartreply_notify_cb(void *user_data) -{ - ecore_main_loop_iterate(); - _update_genlist_items((void *)app_data); -} - -static void _input_template_notify_cb(void *user_data) -{ - _update_genlist_items((void *)app_data); -} - - static void _emoticon_clicked_cb(void *data, Evas_Object * obj, void *event_info) { App_Data* ad = (App_Data*)data; @@ -205,78 +186,6 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } -static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - int index = (unsigned int) elm_object_item_data_get(item); - - char *reply = input_smartreply_get_nth_item(index); - if (reply) { - input_smartreply_send_feedback(reply); - reply_to_sender_by_callback(reply, "smartreply"); - free(reply); - elm_exit(); - } - } -} - -static void __ise_template_add_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - if(is_sap_connection() == EINA_TRUE){ - // Show toast popup - show_popup_toast(gettext("WDS_IME_TPOP_ADD_TEMPLATE_ON_YOUR_PHONE_ABB"), true); - - // send message to Host - app_control_h appctrl; - app_control_create(&appctrl); - app_control_set_app_id(appctrl, "com.samsung.w-manager-service"); - app_control_add_extra_data(appctrl, "type", "gm_setting"); - app_control_add_extra_data(appctrl, "data/setting_menu", "texttemplate_setting"); - app_control_send_launch_request(appctrl, NULL, NULL); - app_control_destroy(appctrl); - } else { - app_control_h app_control; - app_control_create(&app_control); - app_control_set_app_id(app_control, "com.samsung.bt-connection-popup"); - app_control_add_extra_data(app_control, "msg", "perform"); - app_control_send_launch_request(app_control, __bt_connection_result_cb, NULL); - app_control_destroy(app_control); - } - } -} - -static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - int index = 0; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - index = (unsigned int) elm_object_item_data_get(item); - const std::vector template_list = input_template_get_list(); - - //@ToDo : should call reply function when any template string is selected and confirmed. - // Here reply string will be template_list[index].text.c_str(); - if( index < template_list.size()) { - reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); - elm_exit(); - } - } -} - static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { @@ -338,99 +247,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, return NULL; } -static char * __ise_smartreply_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - int index; - char *reply = NULL; - - index = (int)data; - if (index < 0) - return NULL; - - reply = input_smartreply_get_nth_item(index); - if (reply == NULL) - return NULL; - - /* Set hightlight color on first 3 smartreply items */ - if (index < 3) { - char *colored = _genlist_text_set_theme_color(reply, "AT0113"); - - if (colored == NULL) { - return reply; - } else { - free(reply); - return colored; - } - } - - return reply; - } - return NULL; -} - -static char * __ise_template_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - unsigned int index = (unsigned int)data; - const std::vector template_list = input_template_get_list(); - - if(index < template_list.size()) { - if(template_list[index].use_gettext) { - return strdup(gettext(template_list[index].text.c_str())); - } else { - Eina_Strbuf *buf = NULL; - const char *str = NULL; - char *markup = NULL; - - buf = eina_strbuf_new(); - if(buf) { - eina_strbuf_append(buf, template_list[index].text.c_str()); - eina_strbuf_replace_all(buf, "\n", ""); - eina_strbuf_replace_all(buf, "\r", ""); - - str = eina_strbuf_string_get(buf); - - if (str) { - markup = elm_entry_utf8_to_markup(str); - } - eina_strbuf_free(buf); - } - - return markup; - } - } - } - return NULL; -} - -static char * __ise_addtemplate_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - return(strdup(gettext("WDS_IME_MBODY_ADD_TEMPLATE_ABB"))); - } - return NULL; -} - -static Evas_Object * __ise_gl_1button_content_get(void *data, Evas_Object *obj, const char *part) -{ - if (!strcmp(part, "elm.icon")) { - Evas_Object* btn = elm_button_add(obj); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); - Evas_Object* ic = elm_image_add(btn); - elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); - string path = get_resource_path(); - elm_object_style_set(btn, "ime_button_template"); - string path_ic = path + "/images/w_list_add_ic.png"; - elm_image_file_set(ic, path_ic.c_str(), NULL); - elm_object_content_set(btn, ic); - evas_object_layer_set(btn, 32000); - - return btn; - } - return NULL; -} static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info) { @@ -733,7 +549,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) } elm_genlist_clear(app_data->genlist); - g_smartreply_current_number = 0; /* reset previous smartreply size to 0 */ Elm_Genlist_Item_Class * itc0 = elm_genlist_item_class_new(); itc0->item_style = "title"; @@ -765,25 +580,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); } - if (input_smartreply_is_enabled() == false) { - _update_template_items(app_data); - if(g_template_current_number > 0) { - Evas_Object *circle_genlist = (Evas_Object *) evas_object_data_get(app_data->genlist, "circle"); - eext_circle_object_genlist_scroller_policy_set(circle_genlist, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - } - } else { - // dummy title for bottom - Elm_Object_Item *dummy; - - dummy = elm_genlist_item_append(app_data->genlist, itc0, - NULL, NULL, - ELM_GENLIST_ITEM_NONE, - NULL, NULL); - - elm_genlist_item_select_mode_set(dummy, ELM_OBJECT_SELECT_MODE_NONE); - } - Elm_Object_Item *item = elm_genlist_item_next_get(it_title); elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); @@ -794,269 +590,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) elm_genlist_item_class_free(itc1); } -void _update_genlist_items(void *user_data) -{ - int len = 0; - - if (input_smartreply_is_enabled()) - len = input_smartreply_get_reply_num(); - - if (g_smartreply_current_number != len) - _update_smartreply_items(user_data); - - _update_template_items(user_data); - - g_smartreply_current_number = len; - - if (g_smartreply_current_number > 0 || g_template_current_number > 0) { - Evas_Object *circle_genlist = (Evas_Object *) evas_object_data_get(app_data->genlist, "circle"); - eext_circle_object_genlist_scroller_policy_set(circle_genlist, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - } -} - -void _update_smartreply_items(void *user_data) -{ - App_Data* app_data; - - Elm_Object_Item *first; - Elm_Object_Item *menu; - Elm_Object_Item *pos; - - int len = 0; - int i = 0; - - app_data = (App_Data *)user_data; - - if (app_data == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get app_data"); - return; - } - - if (app_data->genlist == NULL) { - /* smartreply will update when genlist is exist only */ - PRINTFUNC(DLOG_ERROR, "Can not get getlist"); - return; - } - - if (input_smartreply_is_enabled()) - len = input_smartreply_get_reply_num(); - - if (g_smartreply_current_number == len) - return; - - first = elm_genlist_first_item_get(app_data->genlist); - menu = elm_genlist_item_next_get(first); - - /* Remove current smartreply list */ - pos = elm_genlist_item_next_get(menu); - for (i = 0; i < g_smartreply_current_number; i++) { - Elm_Object_Item *next; - - if (pos == NULL) - break; - - next = elm_genlist_item_next_get(pos); - elm_object_item_del(pos); - pos = next; - } - - /* Append newly added smartreply list */ - if (len > 0) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text"; - itc->func.text_get = __ise_smartreply_gl_text_get; - itc->func.content_get = NULL; - itc->func.state_get = NULL; - itc->func.del = NULL; - - pos = menu; - for (i = 0; i < len; i++) { - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - (void *)i, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_smartreply_gl_sel, - app_data); - } - - if (menu) - elm_genlist_item_show(menu, ELM_GENLIST_ITEM_SCROLLTO_TOP); - - elm_genlist_item_class_free(itc); - } - - g_smartreply_current_number = len; -} - - -void _update_template_items(void *user_data) -{ - App_Data* app_data; - - Elm_Object_Item *first; - Elm_Object_Item *menu; - Elm_Object_Item *pos; - Elm_Object_Item *template_pos; - - unsigned int template_len = 0; - unsigned int i = 0; - - app_data = (App_Data *)user_data; - - if (app_data == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get app_data"); - return; - } - - if (app_data->genlist == NULL) { - /* smartreply will update when genlist is exist only */ - PRINTFUNC(DLOG_ERROR, "Can not get getlist"); - return; - } - - if (app_data->app_type == APP_TYPE_REPLY) { - menu = elm_genlist_first_item_get(app_data->genlist); - } else { - first = elm_genlist_first_item_get(app_data->genlist); - menu = elm_genlist_item_next_get(first); - } - - pos = menu; - /* move to smartreply next if it need */ - if (input_smartreply_is_enabled()) { - int smartreply_len = 0; - - smartreply_len = input_smartreply_get_reply_num(); - if (smartreply_len > 0) { - int j = 0; - - for (j = 0; j < smartreply_len; j++) { - if (pos == NULL) - break; - - pos = elm_genlist_item_next_get(pos); - } - } - } - - /* Remove Current template list */ - template_pos = elm_genlist_item_next_get(pos); - for (i = 0 ; i < g_template_current_number; i++) { - Elm_Object_Item *next; - - if (template_pos == NULL) { - PRINTFUNC(DLOG_ERROR, "Template mismatched, iter : %d, current num: %d", - i, g_template_current_number); - break; - } - - next = elm_genlist_item_next_get(template_pos); - elm_object_item_del(template_pos); - template_pos = next; - } - - /* Remove Add or dummpy button */ - if(template_pos) { - Elm_Object_Item *next; - - next = elm_genlist_item_next_get(template_pos); - elm_object_item_del(template_pos); - template_pos = next; - } - - /* Append New Template list */ - const std::vector template_list = input_template_get_list(); - template_len = 0; - - if (template_list.size() > 0) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text"; - itc->func.text_get = __ise_template_gl_text_get; - itc->func.content_get = NULL; - itc->func.state_get = NULL; - itc->func.del = NULL; - - for (i = 0; i < template_list.size(); i++) { - bool matched = false; - - if(!template_list[i].use_gettext) { - int smartreply_len = 0; - int j = 0; - - smartreply_len = input_smartreply_get_reply_num(); - for (j = 0; j < smartreply_len; j++) { - char *reply = NULL; - - reply = input_smartreply_get_nth_item(j); - if (reply) { - if (!strcmp(reply, template_list[i].text.c_str())) { - matched = true; - free(reply); - break; - } - free(reply); - } - } - } - - if (matched == false) { - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - (void *)i, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_template_gl_sel, - app_data); - template_len++; - } - } - - elm_genlist_item_class_free(itc); - } - - - // template add button (+) -/* if (!input_template_is_user_template()) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text.1icon"; - itc->func.text_get = __ise_addtemplate_gl_text_get;; - itc->func.content_get = __ise_gl_1button_content_get; - itc->func.state_get = NULL; - itc->func.del = NULL; - - - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - NULL, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_template_add_gl_sel, - app_data); - - elm_genlist_item_class_free(itc); - } -*/ - if (menu) - elm_genlist_item_show(menu, ELM_GENLIST_ITEM_SCROLLTO_TOP); - - g_template_current_number = template_len; -} - - bool _app_create(void* user_data) { int width = 1000, height = 1000; @@ -1164,16 +697,6 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); -// input_smartreply_init(service); -// input_smartreply_set_notify(_input_smartreply_notify_cb, NULL); - -// if (input_smartreply_is_enabled()) -// input_smartreply_get_reply_async(); - - - input_template_init(service); - input_template_set_notify(_input_template_notify_cb, NULL); - _create_genlist_items(app_data, is_type_reply); ACTIVATE : @@ -1211,10 +734,6 @@ void _app_terminate(void* user_data) free(app_data->shared_res_path); input_keyboard_deinit(); - input_smartreply_deinit(); - - input_template_unset_notify(); - input_template_deinit(); } static int init_i18n(const char *domain, const char *dir, char *lang_str) diff --git a/src/w-input-smartreply.cpp b/src/w-input-smartreply.cpp deleted file mode 100755 index d449123..0000000 --- a/src/w-input-smartreply.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Debug.h" - -#include -#include -#include - -#include -#include -//#include - -#include "w-input-smartreply.h" - -#ifndef INPUT_SMARTREPLY_VCONF -#define INPUT_SMARTREPLY_VCONF "db/wms/smart_reply" -#endif - - -typedef struct _InputSmartreplyData InputSmartreplyData; - -struct _InputSmartreplyData -{ - char *caller_id; - char *sender; - char *message; - char *lang; - - int enabled; - - input_smartreply_changed callback; - void *user_data; - -// smartreply_reply_h *candidate_list; - int candidate_list_len; -}; - - -static void _input_smartreply_get_reply_callback(int handle, int error, - int length); -/* Disable smartreply on/off feature -static void _input_smartreply_vconf_changed(keynode_t *key, void *data); -*/ - - -static InputSmartreplyData *g_input_smartreply_data = NULL; - -static void _input_smartreply_get_reply_callback(int handle, int error, - int length) -{ -} - - - -bool input_smartreply_init(app_control_h app_control) -{ - return true; -} - -void input_smartreply_deinit(void) -{ - return; -} - -bool input_smartreply_get_reply(void) -{ - return true; -} - -bool input_smartreply_get_reply_async(void) -{ - return true; -} - -int input_smartreply_get_reply_num(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_ERROR, "InputSmartreplyData uninitialized"); - return 0; - } - - if (g_input_smartreply_data->enabled == 0) { - PRINTFUNC(DLOG_WARN, "Smartreply is disabled"); - return 0; - } - - return g_input_smartreply_data->candidate_list_len; -} - -char *input_smartreply_get_nth_item(int index) -{ - char *message = NULL; - - return message; -} - -bool input_smartreply_send_feedback(const char *str) -{ - return true; -} - - - -void input_smartreply_set_notify(input_smartreply_changed callback, - void *user_data) -{ - if (callback == NULL) { - PRINTFUNC(DLOG_ERROR, "empty callback function"); - return; - } - - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return; - } - - g_input_smartreply_data->callback = callback; - g_input_smartreply_data->user_data = user_data; -} - - -void input_smartreply_unset_notify(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return; - } - - g_input_smartreply_data->callback = NULL; - g_input_smartreply_data->user_data = NULL; -} - -bool input_smartreply_is_enabled(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return false; - } - - if (g_input_smartreply_data->enabled) - return true; - - return false; -} diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 23160a8..a3a2b83 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -28,7 +28,6 @@ #include "Debug.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" #include "w-input-stt-voice.h" #include "w-input-stt-engine.h" #include "w-input-stt-ise.h" @@ -449,7 +448,6 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve } PRINTFUNC(DLOG_DEBUG, "result_text = %s", result_text.c_str()); - input_smartreply_send_feedback(result_text.c_str()); reply_to_sender_by_callback(result_text.c_str(), "voice"); destroy_voice(); diff --git a/src/w-input-template.cpp b/src/w-input-template.cpp deleted file mode 100755 index afe2410..0000000 --- a/src/w-input-template.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Debug.h" - -#include -#include -#include - -#include "w-input-template.h" - - -#define INPUT_TEMPLATE_DB_VCONF "memory/wms/update_text_template_db" - -#define INPUT_TEMPLATE_DB_PATH "/opt/usr/dbspace/.WearableManagerService.db" -#define INPUT_TEMPLATE_QUERY_LEN 1024 - -struct InputTemplate { - std::vector template_list; - bool notify; - bool user_template; - input_template_changed callback; - void *user_data; -}; - -static struct InputTemplate g_input_template; - - -static void _input_template_db_vconf_changed(keynode_t *key, void *data); - -static bool input_template_init_app_control_list(app_control_h app_control); -static bool input_template_init_app_control(app_control_h app_control); -static bool input_template_init_db_util(void); -static bool input_template_init_default(void); - - -static void _input_template_db_vconf_changed(keynode_t *key, void *data) -{ - bool db_status = vconf_keynode_get_bool(key); - - PRINTFUNC(DLOG_DEBUG, "starts :: db_status = %d", db_status); - - if(db_status != 0) - return; - - if (g_input_template.callback) { - // Clear template list and reset to template_list from DB - g_input_template.template_list.clear(); - input_template_init_db_util(); - - g_input_template.callback(g_input_template.user_data); - } -} - -static bool input_template_init_app_control_list(app_control_h app_control) -{ - int ret; - int len; - - char **list = NULL; - - ret = app_control_get_extra_data_array(app_control, - "template_list", &list, &len); - - if (ret != APP_CONTROL_ERROR_NONE) - return false; - - if (list == NULL) - return false; - - for (int i = 0; i < len; i++) { - struct TemplateData data; - - if (*(list + i)) { - // if use_gettext is true, - // it's default template string that requires gettext. - data.use_gettext = false; - data.text = *(list + i); - - g_input_template.template_list.push_back(data); - - free(*(list + i)); - } - } - - free(list); - - g_input_template.user_template = true; - - return true; -} - -static bool input_template_init_app_control(app_control_h app_control) -{ - bool ret; - - if (app_control == NULL) - return false; - - ret = input_template_init_app_control_list(app_control); - if (ret) - return true; - - return false; -} - -static bool input_template_init_db_util(void) -{ - sqlite3 *g_tt_db = NULL; - sqlite3_stmt *stmt = NULL; - - int ret = -1; - - char query[INPUT_TEMPLATE_QUERY_LEN + 1] = {0, }; - - ret = db_util_open(INPUT_TEMPLATE_DB_PATH, &g_tt_db, 0); - - if (ret != SQLITE_OK) { - PRINTFUNC(DLOG_ERROR, "db_util open failed"); - return false; - } - - snprintf(query, INPUT_TEMPLATE_QUERY_LEN, - "select sortId, itemId, checked, message from %s", - "tmpl_msg_table"); - - sqlite3_prepare_v2(g_tt_db, query, strlen(query), &stmt, NULL); - - if (ret != SQLITE_OK) { - PRINTFUNC(DLOG_ERROR, "Can not get query"); - return false; - } - - ret = sqlite3_step(stmt); - - while(ret == SQLITE_ROW) { - struct TemplateData data; - int text_mode; - - // if checked is 0, - // it's default template string that requires gettext. - text_mode = sqlite3_column_int(stmt, 2); - if (text_mode) - data.use_gettext = false; - else - data.use_gettext = true; - - data.text = (char *)sqlite3_column_text(stmt, 3); - PRINTFUNC(DLOG_DEBUG, "db text %s", data.text.c_str()); - g_input_template.template_list.push_back(data); - - ret = sqlite3_step(stmt); - } - - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) - PRINTFUNC(DLOG_ERROR, "Can not finalize sqlite"); - - ret = db_util_close(g_tt_db); - if (ret != SQLITE_OK) - PRINTFUNC(DLOG_ERROR, "Can not close db_util"); - - /* set vconf callback for DB update */ - ret = vconf_notify_key_changed(INPUT_TEMPLATE_DB_VCONF, - _input_template_db_vconf_changed, NULL); - - if (ret < 0) - PRINTFUNC(DLOG_ERROR, "Can not create vconf notify"); - - g_input_template.user_template = false; - return true; -} - -static bool input_template_init_default(void) -{ - struct TemplateData data; - - data.text = "IDS_WMGR_MBODY_HOWS_IT_GOING_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_WHATS_UP_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_ILL_TALK_TO_YOU_SOON_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_ILL_CALL_YOU_LATER_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_MSG_BODY_WHERE_ARE_YOU_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_MSG_BODY_WHEN_CAN_WE_MEET_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "WDS_WMGR_MBODY_CALL_ME_LATER"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - g_input_template.user_template = false; - - return true; -} - -static void input_template_deinit_db_util(void) -{ - vconf_ignore_key_changed(INPUT_TEMPLATE_DB_VCONF, - _input_template_db_vconf_changed); -} - -void input_template_init(app_control_h app_control) -{ - input_template_unset_notify(); - g_input_template.template_list.clear(); - g_input_template.user_template = false; - - bool ret; - - ret = input_template_init_app_control(app_control); - if (ret) - return; - - ret = input_template_init_db_util(); - if (ret) - return; - - input_template_init_default(); -} - -void input_template_deinit(void) -{ - input_template_unset_notify(); - input_template_deinit_db_util(); - - g_input_template.template_list.clear(); - g_input_template.user_template = false; -} - -const std::vector input_template_get_list(void) -{ - return g_input_template.template_list; -} - -void input_template_set_notify(input_template_changed callback, - void *user_data) -{ - if (callback == NULL) { - PRINTFUNC(DLOG_ERROR, "empty callback function"); - return; - } - - g_input_template.callback = callback; - g_input_template.user_data = user_data; -} - -void input_template_unset_notify(void) -{ - g_input_template.callback = NULL; - g_input_template.user_data = NULL; -} - -bool input_template_is_user_template(void) -{ - return (g_input_template.user_template); -} -- 2.7.4 From a8a44e235a9294633c53150f8d3ec38a9c003e86 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 26 Jul 2016 17:14:03 +0900 Subject: [PATCH 09/16] Show text to textblock in voice input Change-Id: I948fd53fc41452f0b829c54cf763841242449bfc Signed-off-by: sungwook79.park --- src/w-input-stt-voice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index a3a2b83..eefd3db 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1595,7 +1595,7 @@ static Evas_Object *create_textblock(void* data) #define FORMAT_TEXT_AREA_FONT_STYLE \ "DEFAULT='font=Tizen:style=Regular font_size=32 color=#%02x%02x%02x%02x text_class=tizen wrap=mixed align=center' newline='br' b='+ font=Tizen:style=Bold'link='+ underline=on underline_color=#%02x%02x%02x%02x'" - int a, r, g, b; + int a = 0xFF, r = 0xFF, g = 0xFF, b = 0xFF; char customStyle[512]; // ea_theme_color_get("AT02112", &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); snprintf(customStyle, 512, FORMAT_TEXT_AREA_FONT_STYLE, r, g, b, a, r, g, b, a); -- 2.7.4 From fc3850e8fefca87b30bd95be25565cc31046f36b Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 27 Jul 2016 16:59:04 +0900 Subject: [PATCH 10/16] Add the feature to select multi input type Change-Id: I73ac7f7e14e6301a31d687bb6adace79bbeeb46c Signed-off-by: sungwook79.park --- inc/w-input-selector.h | 8 +- res/edje/w-input-selector.edc | 152 +++++++++++++++++++++++++++++++++ src/w-input-selector.cpp | 189 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 311 insertions(+), 38 deletions(-) mode change 100644 => 100755 res/edje/w-input-selector.edc diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 83c1799..3fcd43b 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -82,10 +82,14 @@ struct _InputKeyboardData char *guide_text; char *default_text; }; - typedef struct _InputKeyboardData InputKeyboardData; - +struct _InputTypeData +{ + char **input_type_array; + int input_type_array_len; +}; +typedef struct _InputTypeData InputTypeData; void _app_terminate(void* user_data); void reply_to_sender_by_callback_for_back(); diff --git a/res/edje/w-input-selector.edc b/res/edje/w-input-selector.edc old mode 100644 new mode 100755 index 1afb4d2..d9e9fd3 --- a/res/edje/w-input-selector.edc +++ b/res/edje/w-input-selector.edc @@ -580,6 +580,7 @@ collections { } ) } + //Gesture VI program { name: "do_start_expand_0.0"; action: STATE_SET "default" 0.0; @@ -671,4 +672,155 @@ collections { } + group { + name: "elm/genlist/item/2button/default"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "contents" "base elm.icon.1.touch_area elm.icon.2.touch_area elm.icon.1 elm.icon.2 elm.swallow.center_check"; + data.item: "vi_effect" "off"; + + parts { + PART_LIST_BG + PART_LIST_PADDINGS( + LIST_BUTTON_PADDING_LEFT_SIZE_INC, LIST_BUTTON_PADDING_RIGHT_SIZE_INC, + LIST_BUTTON_PADDING_2BUTTON_TOP_SIZE_INC, LIST_BUTTON_PADDING_BOTTOM_SIZE_INC + ) + PART(SWALLOW, "base", + DESC_LRTB("elm.padding.left", "elm.padding.right", "elm.padding.top", "elm.padding.bottom", + min: 360 0; + fixed: 1 0; + visible: 1; + ) + ) + part { name: "elm.icon.1.touch_area"; + type: SWALLOW; + repeat_events, 0; + description { + state: "default" 0.0; + color: 255 0 0 100; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -5 -5;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +5 +5;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -7 -7;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +7 +7;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -8 -8;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +8 +8;} + } + } + part { name: "elm.icon.2.touch_area"; + type: SWALLOW; + repeat_events, 0; + description { + state: "default" 0.0; + color: 0 0 255 100; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -6 -5;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +6 +5;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -7 -7;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +7 +7;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -9 -8;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +9 +8;} + } + } + part { name: "elm.icon.1"; + type: SWALLOW; + repeat_events, 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + fixed: 1 1; + min: 114 114; + max: 114 114; + rel1 { relative: 112/360 0; to: "base"; offset: 0 35;} + rel2 { relative: 112/360 0; to: "base"; offset: 0 35;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + min: 114+(198-114)/2 114+(198-114)/2; + max: 114+(198-114)/2 114+(198-114)/2; + rel1 { relative: ((64+112)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + rel2 { relative: ((64+112)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + min: 198 198; + max: 198 198; + rel1 { relative: 128/360 0; to: "base"; offset: 0 12;} + rel2 { relative: 128/360 0; to: "base"; offset: 0 12;} + } + } + part { name: "elm.icon.2"; + type: SWALLOW; + repeat_events, 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + fixed: 1 1; + min: 114 114; + max: 114 114; + rel1 { relative: 249/360 0; to: "base"; offset: 0 35;} + rel2 { relative: 249/360 0; to: "base"; offset: 0 35;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + min: 114+(198-114)/2 114+(99-114)/2; + max: 114+(198-114)/2 114+(198-114)/2; + rel1 { relative: ((249+297)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + rel2 { relative: ((249+297)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + min: 198 198; + max: 198 198; + rel1 { relative: 297/360 0; to: "base"; offset: 0 12;} + rel2 { relative: 297/360 0; to: "base"; offset: 0 12;} + } + } + + PART(SPACER, "elm.padding.fake", + DESC_TB("elm.padding.top","elm.padding.bottom", + min: LIST_BUTTON_PADDING_CENTER_SIZE_INC 0; + max: LIST_BUTTON_PADDING_CENTER_SIZE_INC -1; + fixed: 1 0; + ) + ) + PART(SPACER, "elm.padding.center", + DESC_LTB("elm.padding.fake", "elm.padding.top", "elm.padding.bottom", + min: LIST_BUTTON_PADDING_CENTER_SIZE_INC 0; + max: LIST_BUTTON_PADDING_CENTER_SIZE_INC -1; + fixed: 1 0; + ) + ) + PART(SWALLOW, "elm.swallow.center_check", + description { state: "default" 0.0; + align: 0.5 0.5; + } + ) + } } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 5ce1a98..021f6cd 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -39,6 +39,7 @@ using namespace std; App_Data* app_data = NULL; InputKeyboardData g_input_keyboard_data; +InputTypeData g_input_type_data; static Elm_Object_Item *it_empty; static Elm_Object_Item *it_title; @@ -52,9 +53,10 @@ static void _app_language_changed(app_event_info_h event_info, void *user_data); static char *_genlist_text_set_theme_color(const char *str, const char *code); Evas_Object* _create_genlist(Evas_Object* parent); -void _create_genlist_items(void* user_data, bool is_type_reply); +void _create_genlist_items(void* user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); +static void input_type_deinit(void); @@ -185,6 +187,92 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } } +static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, const char *part) +{ + char *first_input_type = *(g_input_type_data.input_type_array + 0); + char *second_input_type = *(g_input_type_data.input_type_array + 1); + + if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2"))) { + Evas_Object* btn = elm_button_add(obj); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + + Evas_Object* ic = elm_image_add(btn); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + string path = get_resource_path(); + if (!strcmp(part, "elm.icon.1")) { + elm_object_style_set(btn, "anchor"); + string path_ic; + if(!strcmp(first_input_type, "input_voice")) { + path_ic = path + "images/w_mode_stt_ic.png"; + } + else if(!strcmp(first_input_type, "input_emoticon")) { + path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; + } + else if(!strcmp(first_input_type, "input_keyboard")) { + path_ic = path + "images/w_mode_keyboard_ic.png"; + evas_object_propagate_events_set(btn, EINA_FALSE); + } + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + } else if (!strcmp(part, "elm.icon.2")){ + elm_object_style_set(btn, "anchor"); + string path_ic; + if(!strcmp(second_input_type, "input_voice")) { + path_ic = path + "images/w_mode_stt_ic.png"; + } + else if(!strcmp(second_input_type, "input_emoticon")) { + path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; + } + else if(!strcmp(second_input_type, "input_keyboard")) { + path_ic = path + "images/w_mode_keyboard_ic.png"; + evas_object_propagate_events_set(btn, EINA_FALSE); + } + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + } + return btn; + } else if (!strcmp(part, "elm.icon.1.touch_area") || (!strcmp(part, "elm.icon.2.touch_area"))) { + Evas_Object* btn = elm_button_add(obj); + elm_object_style_set(btn, "touch_area"); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + string path = get_resource_path(); + if (!strcmp(part, "elm.icon.1.touch_area")) { + evas_object_layer_set(btn, 32000); + if(!strcmp(first_input_type, "input_voice")) { + evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); + } + else if(!strcmp(first_input_type, "input_emoticon")) { + evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); + } + else if(!strcmp(first_input_type, "input_keyboard")) { + evas_object_propagate_events_set(btn, EINA_FALSE); + evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); + } + } else if (!strcmp(part, "elm.icon.2.touch_area")){ + evas_object_layer_set(btn, 32000); + if(!strcmp(second_input_type, "input_voice")) { + evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); + } + else if(!strcmp(second_input_type, "input_emoticon")) { + evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); + } + else if(!strcmp(second_input_type, "input_keyboard")) { + evas_object_propagate_events_set(btn, EINA_FALSE); + evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); + } + } + return btn; + } else if (!strcmp(part, "base")) { + Evas_Object* btn = elm_button_add(obj); + elm_object_style_set(btn, "ime_transparent"); + return btn; + } + return NULL; +} static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { @@ -536,7 +624,7 @@ _main_menu_title_text_get(void *data, Evas_Object *obj, const char *part) return strdup(buf); } -void _create_genlist_items(void* user_data, bool is_type_reply) +void _create_genlist_items(void* user_data) { LOGD("[psw] _create_genlist_items"); @@ -558,12 +646,19 @@ void _create_genlist_items(void* user_data, bool is_type_reply) itc0->func.del = NULL; Elm_Genlist_Item_Class * itc1 = elm_genlist_item_class_new(); - itc1->item_style = "3button"; - itc1->func.text_get = NULL; - itc1->func.content_get = __ise_gl_3button_content_get; - itc1->func.state_get = NULL; - itc1->func.del = NULL; - + if(g_input_type_data.input_type_array_len == 2){ + itc1->item_style = "2button"; + itc1->func.text_get = NULL; + itc1->func.content_get = __ise_gl_2button_content_get; + itc1->func.state_get = NULL; + itc1->func.del = NULL; + }else{ + itc1->item_style = "3button"; + itc1->func.text_get = NULL; + itc1->func.content_get = __ise_gl_3button_content_get; + itc1->func.state_get = NULL; + itc1->func.del = NULL; + } // dummy title for empty space it_empty = elm_genlist_item_append(app_data->genlist, itc0, @@ -571,15 +666,13 @@ void _create_genlist_items(void* user_data, bool is_type_reply) ELM_GENLIST_ITEM_NONE, NULL, NULL); - if (!is_type_reply) { - // 3 Buttons - it_title = elm_genlist_item_append(app_data->genlist, itc1, - NULL, NULL, - ELM_GENLIST_ITEM_NONE, - NULL, NULL); + // 3 Buttons + it_title = elm_genlist_item_append(app_data->genlist, itc1, + NULL, NULL, + ELM_GENLIST_ITEM_NONE, + NULL, NULL); - elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); - } + elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); Elm_Object_Item *item = elm_genlist_item_next_get(it_title); elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); @@ -666,29 +759,37 @@ void _app_service(app_control_h service, void* user_data) int ret; bool b_ret; char *context = NULL; + char **input_type_array = NULL; + int input_type_array_len = -1; + bool is_extra_data_array = false; app_control_clone(&(app_data->source_app_control), service); app_data->reply_type = REPLY_APP_NORMAL; - bool is_type_reply = false; - ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); - if (ret == APP_CONTROL_ERROR_NONE) { - if (!strcmp(context, "input_voice")) { - app_data->app_type = APP_TYPE_STT; - _stt_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_emoticon")) { - app_data->app_type = APP_TYPE_EMOTICON; - _emoticon_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_keyboard")) { - app_data->app_type = APP_TYPE_KEYBOARD; - input_keyboard_init(service); - _keyboard_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_reply")) { - app_data->app_type = APP_TYPE_REPLY; - is_type_reply = true; + ret = app_control_is_extra_data_array(service, APP_CONTROL_DATA_INPUT_TYPE, &is_extra_data_array); + if( is_extra_data_array == true) { + ret = app_control_get_extra_data_array(service, APP_CONTROL_DATA_INPUT_TYPE, &input_type_array, &input_type_array_len); + g_input_type_data.input_type_array = input_type_array; + g_input_type_data.input_type_array_len = input_type_array_len; + }else{ + ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); + if (ret == APP_CONTROL_ERROR_NONE) { + if (!strcmp(context, "input_voice")) { + app_data->app_type = APP_TYPE_STT; + _stt_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_emoticon")) { + app_data->app_type = APP_TYPE_EMOTICON; + _emoticon_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_keyboard")) { + app_data->app_type = APP_TYPE_KEYBOARD; + input_keyboard_init(service); + _keyboard_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_reply")) { + app_data->app_type = APP_TYPE_REPLY; + } } } @@ -697,7 +798,7 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); - _create_genlist_items(app_data, is_type_reply); + _create_genlist_items(app_data); ACTIVATE : elm_win_activate(app_data->win_main); @@ -734,6 +835,7 @@ void _app_terminate(void* user_data) free(app_data->shared_res_path); input_keyboard_deinit(); + input_type_deinit(); } static int init_i18n(const char *domain, const char *dir, char *lang_str) @@ -776,7 +878,22 @@ static void _app_language_changed(app_event_info_h event_info, void *user_data) } } +void input_type_deinit(void) +{ + int i = 0; + char **data_array = NULL; + data_array = g_input_type_data.input_type_array; + if (data_array) { + for (i = 0; i < g_input_type_data.input_type_array_len; i++) { + if (*(data_array + i)) + free(*(data_array + i)); + } + free(data_array); + } + g_input_type_data.input_type_array = NULL; + g_input_type_data.input_type_array_len = 0; +} int main(int argc, char* argv[]) { -- 2.7.4 From e2de57d9fa130487fbbf986c13e00748b8c0f36a Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 28 Jul 2016 15:02:48 +0900 Subject: [PATCH 11/16] Add app_control operation to xml Change-Id: Ifcf0fa5c58b5a4fefaecddc8ca76707389ca30f3 Signed-off-by: sungwook79.park --- org.tizen.inputdelegator.xml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/org.tizen.inputdelegator.xml b/org.tizen.inputdelegator.xml index 38a6f9b..8511202 100755 --- a/org.tizen.inputdelegator.xml +++ b/org.tizen.inputdelegator.xml @@ -1,14 +1,18 @@ - - - w-input-selector.png - - + - - http://tizen.org/privilege/display - http://tizen.org/privilege/recorder - http://tizen.org/privilege/appmanager.launch - + + w-input-selector.png + + + + + + + + http://tizen.org/privilege/display + http://tizen.org/privilege/recorder + http://tizen.org/privilege/appmanager.launch + -- 2.7.4 From 7291e437d68d92a295bd63336d425895964ac1ef Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 3 Aug 2016 10:19:27 +0900 Subject: [PATCH 12/16] Update package version to 0.0.160803 Change-Id: I1d51e992a4b96f6ea9d4c19e63e4f7545c11fb67 Signed-off-by: sungwook79.park --- packaging/org.tizen.inputdelegator.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 2af5a00..fef6886 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -1,6 +1,6 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.0.160712 +Version: 0.0.160803 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From 8a83b521aa0280e6a749237afbd29d76ae0e994d Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 5 Aug 2016 16:04:00 +0900 Subject: [PATCH 13/16] Remove build warning Change-Id: Ic6963cacae66f84adea5bcde843ebec3728bc531 Signed-off-by: sungwook79.park --- inc/w-input-stt-engine.h | 2 +- inc/w-input-stt-voice.h | 2 +- src/MoreOption.cpp | 3 +- src/w-input-emoticon.cpp | 22 +------------ src/w-input-keyboard.cpp | 20 ------------ src/w-input-selector.cpp | 47 +-------------------------- src/w-input-stt-engine.cpp | 39 ++-------------------- src/w-input-stt-tos.cpp | 81 +++++++--------------------------------------- src/w-input-stt-voice.cpp | 65 +++++++------------------------------ 9 files changed, 29 insertions(+), 252 deletions(-) diff --git a/inc/w-input-stt-engine.h b/inc/w-input-stt-engine.h index 2d392cb..8dbb1df 100755 --- a/inc/w-input-stt-engine.h +++ b/inc/w-input-stt-engine.h @@ -98,7 +98,7 @@ typedef enum _Feedback_Type{ void set_animation_state(VoiceData *ud); -char * error_string(int ecode); +const char * error_string(int ecode); // STT functions bool _app_stt_initialize(VoiceData *user_data); void on_feedback(stt_h handle); diff --git a/inc/w-input-stt-voice.h b/inc/w-input-stt-voice.h index 42b46e6..435b4f9 100755 --- a/inc/w-input-stt-voice.h +++ b/inc/w-input-stt-voice.h @@ -81,7 +81,7 @@ int is_lang_supported_by_stt(char lang[]); Evas_Object *show_voice_window(Evas_Object *parent, VoiceData *voicedata); void on_stt_pause(VoiceData *voicedata); void on_destroy(VoiceData *voicedata); -char* get_lang_label(char lang[]); +const char* get_lang_label(char lang[]); void _stt_lang_changed_cb(keynode_t *key, void* data); void start_by_press(VoiceData *voicedata); void voice_get_string(const char *keyValue, VoiceData *voicedata); diff --git a/src/MoreOption.cpp b/src/MoreOption.cpp index 41b6b26..63505ba 100755 --- a/src/MoreOption.cpp +++ b/src/MoreOption.cpp @@ -211,7 +211,7 @@ void MoreOption::Update() char lang[6] = {0, }; strncpy(lang, ((VoiceData *)voicedata)->kbd_lang , 5); - char* display_lang = get_lang_label(lang); + const char* display_lang = get_lang_label(lang); eext_more_option_item_part_text_set(item, "selector,sub_text", display_lang); } @@ -262,7 +262,6 @@ void MoreOption::AddMorePage() { [](void *data, Evas_Object *obj, void *event_info) { PRINTFUNC(DLOG_DEBUG, "item,selected"); - Eext_Object_Item *selected_item = (Eext_Object_Item *)event_info; }, NULL); } diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 33be4de..d73b692 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -24,13 +24,11 @@ #define EMOTICON_CNT 27 -static int previous_icon = -1; - using namespace std; typedef struct { int code; - char* name; + const char* name; }Emoticon; Emoticon emoticon_info[EMOTICON_CNT] = { @@ -94,21 +92,6 @@ _rotary_selector_rotary_cb(void *data, Evas_Object *obj, Eext_Rotary_Event_Info return ECORE_CALLBACK_PASS_ON; } -static char *_access_info_prepend_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - - std::string text; - - if (previous_icon == 10 || previous_icon == 11){ - text = std::string("Page") + " " +std::string(dgettext(PACKAGE, emoticon_info[previous_icon].name)); - text = text + " " + gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND"); - } else { - text = std::string("Page"); - } - return strdup(text.c_str()); -} - static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *event_info) { PRINTFUNC(DLOG_DEBUG, "%s", __func__); @@ -157,7 +140,6 @@ void ise_show_emoticon_popup_rotary(void *data) if (!ad) return; - Eext_Object_Item *first_it; Evas_Object *rotary_selector = eext_rotary_selector_add(ad->naviframe); // uxt_theme_object_replace_color(rotary_selector, "B01153", "AO0117"); @@ -167,8 +149,6 @@ void ise_show_emoticon_popup_rotary(void *data) Evas_Object *img = NULL; Eext_Object_Item *item = eext_rotary_selector_item_append(rotary_selector); - if (i == 0) first_it = item; - img = elm_image_add(rotary_selector); elm_image_file_set(img, get_emoticon_file_name(i), NULL); eext_rotary_selector_item_part_content_set(item, "item,bg_image", EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL, img); diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index ec6393d..943ab3b 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -29,26 +29,6 @@ extern App_Data* app_data; Evas_Object *entry; -static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_control_h reply, - app_control_result_e result, void *user_data); - -static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_control_h reply, - app_control_result_e result, void *user_data) -{ - char *feedback = NULL; - if (result == APP_CONTROL_RESULT_SUCCEEDED) { - if (reply) { - int ret; - ret = app_control_get_extra_data(reply, - "template_feedback", &feedback); - } - reply_to_sender_by_callback(feedback, "keyboard"); - free(feedback); - elm_exit(); - } -} - - bool input_keyboard_init(app_control_h app_control) { int ret = -1; diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 021f6cd..4760a7a 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -43,15 +43,12 @@ InputTypeData g_input_type_data; static Elm_Object_Item *it_empty; static Elm_Object_Item *it_title; -static Elm_Object_Item *it_plus; Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary void _init_app_data(App_Data* app_data); static void _app_language_changed(app_event_info_h event_info, void *user_data); -static char *_genlist_text_set_theme_color(const char *str, const char *code); - Evas_Object* _create_genlist(Evas_Object* parent); void _create_genlist_items(void* user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); @@ -342,46 +339,6 @@ static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info elm_genlist_realized_items_update(obj); } - -static char *_genlist_text_set_theme_color(const char *str, const char *code) -{ - int r, g, b, a; - Eina_Strbuf *buf = NULL; - char *colored = NULL; - - if (code == NULL) - return NULL; - - buf = eina_strbuf_new(); - if (buf == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get create strbuf"); - return NULL; - } - -// ea_theme_color_get(code, -// &r, &g, &b, &a, -// NULL, NULL, NULL, NULL, -// NULL, NULL, NULL, NULL); - - eina_strbuf_append_printf(buf, "%s", - r, g, b, a, str); - - colored = eina_strbuf_string_steal(buf); - - eina_strbuf_free(buf); - - return colored; -} - - -static void _app_control_send_reply_cb(app_control_h request, app_control_h reply, - app_control_result_e result, void *user_data) -{ - PRINTFUNC(DLOG_DEBUG, ""); - reply_to_sender_by_callback(NULL, NULL); - elm_exit(); -} - void set_source_caller_app_id(app_control_h app_control) { if(!app_control){ @@ -409,7 +366,7 @@ void reply_to_sender_by_callback(const char *value, const char *type) int ret; if (value) - app_control_add_extra_data(app_control, "selected_context", value); + app_control_add_extra_data(app_control, APP_CONTROL_DATA_TEXT, value); if (type) app_control_add_extra_data(app_control, "reply_type", type); @@ -554,7 +511,6 @@ Evas_Object* _create_genlist(Evas_Object* navi) return NULL; elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); - elm_genlist_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); Evas_Object* circle_object_genlist = eext_circle_object_genlist_add(genlist, app_data->circle_surface); eext_circle_object_genlist_scroller_policy_set(circle_object_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); @@ -757,7 +713,6 @@ bool _app_create(void* user_data) void _app_service(app_control_h service, void* user_data) { int ret; - bool b_ret; char *context = NULL; char **input_type_array = NULL; int input_type_array_len = -1; diff --git a/src/w-input-stt-engine.cpp b/src/w-input-stt-engine.cpp index e43a338..92075d5 100755 --- a/src/w-input-stt-engine.cpp +++ b/src/w-input-stt-engine.cpp @@ -38,47 +38,12 @@ } while (0); -static stt_state_e static_current_stt_state = STT_STATE_CREATED; static stt_h g_stt; -static void _on_state_change_cb(stt_h stt, stt_state_e previous, stt_state_e current, void* voice_data); -static void _on_error_cb(stt_h stt, stt_error_e reason, void *voice_data); -static void _on_result_cb(stt_h stt, stt_result_event_e event, const char** data, int data_count, const char* msg, void *voice_data); -static bool is_auto_spacing(void *voice_data) +const char * error_string(int ecode) { - VoiceData *voicedata = (VoiceData *)voice_data; - int lang = 0, ret = 0; -#if 0 - ret = preference_get_int(PREFERENCE_ISE_STT_LANGUAGE, &lang); - if(PREFERENCE_ERROR_NONE != ret){ - PRINTFUNC(DLOG_ERROR, "preference_get_int error!(%d)", ret); - } -#else - ret = vconf_get_int(VCONFKEY_ISE_STT_LANGUAGE, &lang); - if (ret !=0) { - PRINTFUNC(DLOG_ERROR, "Vconf_get_int error!(%d)", ret); - } -#endif - switch(lang) { - case 0 : - if((strcmp(voicedata->kbd_lang, "zh_CN") == 0) || (strcmp(voicedata->kbd_lang, "ja_JP") == 0)) - return false; - else - return true; - case 7: // Japanese - case 10: // Chinese - return false; - default : - return true; - } - - return true; -} - -char * error_string(int ecode) -{ - char *str = NULL; + const char *str = NULL; switch (ecode) { case STT_ERROR_OUT_OF_MEMORY: str = "STT_ERROR_OUT_OF_MEMORY"; diff --git a/src/w-input-stt-tos.cpp b/src/w-input-stt-tos.cpp index 0fc51fa..67359d3 100755 --- a/src/w-input-stt-tos.cpp +++ b/src/w-input-stt-tos.cpp @@ -46,7 +46,7 @@ static Evas_Object *g_circle_object_first = NULL; #define N66_URL "https://account.samsung.com/membership/pp" -char *nuance_support_language[12][2] = { +const char *nuance_support_language[12][2] = { {"en_GB", "en"}, // fallback {"de_DE", "de"}, {"en_US", "en"}, @@ -102,7 +102,6 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } void launch_bt_connection_popup(App_Data* data){ - App_Data* ad = (App_Data*)data; PRINTFUNC(DLOG_DEBUG, "Need to launch BT connection popup"); app_control_h app_control; @@ -207,8 +206,6 @@ static void show_terms(void *data, Evas_Object *obj, void *event_info) if (!data) return; if (!event_info) return; - Evas_Object *parent_win = (Evas_Object *)data; - int wms_connected = 0; vconf_get_int(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_connected); @@ -306,7 +303,7 @@ _naviframe_pop_cb(void *data , Elm_Object_Item *it) std::string getColorStyle(const char *code) { std::string strRet; - int r, g, b, a; + int r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF; char strColor[256]; // ea_theme_color_get(code, &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); snprintf(strColor, 256, "", r, g, b, a); @@ -318,13 +315,13 @@ std::string getColorStyle(const char *code) std::string getFontStyle(const char *code) { std::string strRet; - int r, g, b, a; - char *fontStyle; - int fontSize; - char strColor[256]; - char strFont[256]; +// int r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF; +// char *fontStyle; +// int fontSize; +// char strColor[256]; +// char strFont[256]; // ea_theme_color_get(code, &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - snprintf(strColor, 256, "", r, g, b, a); +// snprintf(strColor, 256, "", r, g, b, a); // ea_theme_font_get(code,&fontStyle,&fontSize); /* @@ -383,7 +380,6 @@ static void _language_changed_cb(void *_data, Evas_Object *_obj, void *_event_in int index = (int)_data; std::string terms = ""; - Elm_Object_Item *navi_it = NULL; char body_str[40000]; @@ -643,62 +639,7 @@ static void _response_n66_cb(void *data, Evas_Object *obj, void *event_info) static void _n66_language_changed_cb(void *_data, Evas_Object *_obj, void *_event_info) { - std::string terms = ""; - - Evas_Object* entry = elm_layout_content_get(_obj, "elm.swallow.content"); - - // 1. Get Country Code - char *country_code = NULL; -// country_code = vconf_get_str(VCONFKEY_CSC_COUNTRY_ISO); - - // 2. Set String ID depend on Count Code - char* popup_title_id = NULL; - char* popup_body_id = NULL; -// if (country_code) { -// if (!strcmp(country_code, "CN")) { -// popup_title_id = TOS_TITLE_CHN; -// popup_body_id = TOS_N66_BODY_CHN; -// } else { -// popup_title_id = TOS_TITLE; -// popup_body_id = TOS_N66_BODY; -// } -// } else { - PRINTFUNC(DLOG_ERROR, "Getting Count Code is Error!!! Set default TOS Text!"); - popup_title_id = TOS_TITLE; - popup_body_id = TOS_N66_BODY; -// } -// ea_cutlink_h cutlink; -// ea_cutlink_create(&cutlink, entry, EA_CUTLINK_USER); - - /* add a new scheme */ -// ea_cutlink_scheme_add(cutlink, "hello:", N66_URL); - - /* set prefix and postfix for a new scheme */ -// ea_cutlink_prefix_set(cutlink, "hello:", -// ""); -// ea_cutlink_postfix_set(cutlink, "hello:", ""); - - char *markup = NULL; - char *txt = NULL; - /* set text for parsing */ - markup = elm_entry_utf8_to_markup(gettext(popup_body_id)); -// ea_cutlink_markup_set(cutlink, markup); - -// ea_cutlink_markup_apply(cutlink, gettext(popup_body_id), &txt); - PRINTFUNC(DLOG_DEBUG, "%s", txt); - - terms = tagging(std::string(gettext(txt))); - elm_entry_entry_set(entry, terms.c_str()); - -// if (txt) -// free(txt); - - if (markup) - free(markup); - /* destroy cutlink object */ -// ea_cutlink_destroy(cutlink); } Evas_Object *create_tos_n66_popup(void *data) @@ -721,7 +662,7 @@ Evas_Object *create_tos_n66_popup(void *data) edj_path = edj_path + STT_EDJ_FILE; // 1. Get Country Code - char *country_code = NULL; +// char *country_code = NULL; // country_code = vconf_get_str(VCONFKEY_CSC_COUNTRY_ISO); // 2. Set String ID depend on Count Code @@ -737,8 +678,8 @@ Evas_Object *create_tos_n66_popup(void *data) // } // } else { PRINTFUNC(DLOG_ERROR, "Getting Count Code is Error!!! Set default TOS Text!"); - popup_title_id = TOS_TITLE; - popup_body_id = TOS_N66_BODY; +// popup_title_id = TOS_TITLE; +// popup_body_id = TOS_N66_BODY; // } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index eefd3db..17abe66 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -67,7 +67,7 @@ static Elm_Genlist_Item_Class itc_2text; static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); -char *supported_language[7] = { +const char *supported_language[7] = { "auto", "en_US", "es_US", @@ -78,7 +78,7 @@ char *supported_language[7] = { }; -char *disp_lang_array[7] = { +const char *disp_lang_array[7] = { "", "English (United States)", "Español (América Latina)", @@ -110,9 +110,9 @@ typedef enum { static void get_stt_default_language(VoiceData *my_voicedata); -char* get_lang_label(char lang[]) +const char* get_lang_label(char lang[]) { - char *str = NULL; + const char *str = NULL; if (strcmp (lang, "en_US") == 0) str = disp_lang_array[1]; @@ -162,8 +162,6 @@ _bring_in_cb(void *data) static inline Evas_Coord get_text_block_size(Evas_Object *obj, std::string text) { - int calculated_height = 0; - int max_height = 1280; int unit_width = 282; @@ -208,7 +206,7 @@ static Eina_Bool _update_textblock_timer_cb(void *data) voicedata->textblock_timer = NULL; std::string result_text; - for(int i = 0; i < voicedata->stt_results.size(); i++){ + for(unsigned int i = 0; i < voicedata->stt_results.size(); i++){ if(i == voicedata->stt_results.size()-1){ result_text += voicedata->stt_results.at(i); } else { @@ -222,7 +220,6 @@ static Eina_Bool _update_textblock_timer_cb(void *data) Evas_Object *scroller = NULL; Evas_Object *box = NULL; Evas_Object *inner_layout = NULL; - char *strbuf = NULL; scroller = elm_layout_content_get((Evas_Object *)voicedata->layout_main, "text_area"); if(!scroller) @@ -441,7 +438,7 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve VoiceData* voicedata = (VoiceData*)data; std::string result_text; - for(int i = 0; i < voicedata->stt_results.size(); i++){ + for(unsigned int i = 0; i < voicedata->stt_results.size(); i++){ result_text += voicedata->stt_results.at(i); if(i != voicedata->stt_results.size()-1) result_text += " "; @@ -1113,7 +1110,6 @@ static void language_set_genlist_radio_cb(void *data, Evas_Object *obj, void *ev if(!data) return; int index = 0; - Evas_Object *genlist = (Evas_Object *) data; Elm_Object_Item * item = (Elm_Object_Item *) event_info; if (item) { @@ -1127,7 +1123,7 @@ static void language_set_genlist_radio_cb(void *data, Evas_Object *obj, void *ev ecore_timer_add(0.3, close_setting_window_idler_cb, NULL); } -static void language_changed_cb2(void *data, Evas_Object *obj, const char *emission, const char *source) +static void language_changed_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { if(!obj) return; elm_genlist_realized_items_update(obj); @@ -1170,7 +1166,6 @@ static Evas_Object *create_language_list(Evas_Object *parent) int i = 0; int lang_val = 0; Elm_Object_Item * item = NULL; - Elm_Object_Item * item_title = NULL; evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -1185,7 +1180,7 @@ static Evas_Object *create_language_list(Evas_Object *parent) itc_title.func.text_get = __get_genlist_title_label; itc_title.func.content_get = NULL; - item_title = elm_genlist_item_append(genlist, &itc_title, (void *)-1, NULL, ELM_GENLIST_ITEM_GROUP, NULL, genlist); + item = elm_genlist_item_append(genlist, &itc_title, (void *)-1, NULL, ELM_GENLIST_ITEM_GROUP, NULL, genlist); // 2 line text itc_2text.item_style = "2text.1icon.1/sub1.multiline"; @@ -1234,7 +1229,7 @@ static Evas_Object *create_language_list(Evas_Object *parent) elm_radio_value_set(radio_gp, lang_val); - elm_object_signal_callback_add(genlist, "elm,system,language,change", "elm", language_changed_cb2, NULL); + elm_object_signal_callback_add(genlist, "elm,system,language,change", "elm", language_changed_cb, NULL); // eext_rotary_event_callback_set(genlist, _language_list_rotary_cb, NULL); evas_object_smart_callback_add(genlist, "realized", _language_list_item_realized, NULL); @@ -1245,17 +1240,11 @@ static Evas_Object *create_language_list(Evas_Object *parent) void create_setting_window(Evas_Object *more_option_layout) { - Evas_Coord w, h; - Evas_Object *window = NULL; Evas_Object *layout = NULL; Evas_Object *genlist = NULL; Evas_Object *naviframe = NULL; - Elm_Object_Item *item = NULL; - - const char *str = "mobile"; - /** * Create full size window * @@ -1267,12 +1256,10 @@ void create_setting_window(Evas_Object *more_option_layout) } elm_win_title_set(window, "voice-input-setting"); -// ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); elm_win_borderless_set(window, EINA_TRUE); - evas_object_resize(window, w, h); + elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_HIDE); - elm_win_profiles_set(window, &str, 1); /** * Set window theme @@ -1328,7 +1315,7 @@ void create_setting_window(Evas_Object *more_option_layout) genlist = create_language_list(naviframe); //item = elm_naviframe_item_push(naviframe, "IDS_VC_HEADER_VOICE_INPUT_LANGUAGE", NULL, NULL, genlist, NULL); - item = elm_naviframe_item_push(naviframe, NULL, NULL, NULL, genlist, "empty"); + elm_naviframe_item_push(naviframe, NULL, NULL, NULL, genlist, "empty"); //elm_object_item_domain_text_translatable_set(item, PACKAGE, EINA_TRUE); g_setting_window = window; @@ -1336,15 +1323,6 @@ void create_setting_window(Evas_Object *more_option_layout) g_more_option_layout = more_option_layout; } -static void language_changed_cb(void *data, Evas_Object * obj, void *event_info) -{ - PRINTFUNC(DLOG_DEBUG, ""); - - if(!obj) return; - if(!data) return; -} - - void _stt_lang_changed_cb(keynode_t *key, void* data) { PRINTFUNC(DLOG_DEBUG, ""); @@ -1428,14 +1406,6 @@ static Evas_Object *create_text_detiled_view(Evas_Object *parent) return layout; } -static Eina_Bool _idler_cb2(void *data) -{ - VoiceData *voicedata = (VoiceData *)data; - -// uxt_scroller_set_auto_scroll_enabled(voicedata->scroller, EINA_FALSE); - - return ECORE_CALLBACK_CANCEL; -} static Eina_Bool __stt_entry_detailed_view_pop_cb(void *data, Elm_Object_Item *it) { @@ -1470,8 +1440,6 @@ static Eina_Bool __stt_entry_detailed_view_pop_cb(void *data, Elm_Object_Item *i elm_scroller_region_bring_in(voicedata->scroller, 0, y+h, 300, 168); - ecore_idler_add(_idler_cb2, voicedata); - return EINA_TRUE; } @@ -1553,7 +1521,6 @@ static Evas_Object *create_textblock(void* data) Evas_Object *box = NULL; Evas_Object *inner_layout = NULL; Evas_Object *entry = NULL; - Evas_Object *tb = NULL; Evas_Object *circle_scroller = NULL; string edj_path = get_resource_path(); @@ -1639,16 +1606,8 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) { PRINTFUNC(NO_PRINT, ""); - Evas_Object *more_option_layout = NULL; Evas_Object *layout_main = NULL; - Evas_Object *lang_btn_box = NULL; - Evas_Object *lang_btn = NULL; - Evas_Object *to = NULL; - Evas_Object *ao = NULL; - char *lang_type_str = NULL; - - int lang_val = 0; int is_screen_reader_on = FALSE; VoiceData *voicedata = r_voicedata; @@ -1917,8 +1876,6 @@ void on_destroy(VoiceData *r_voicedata) VoiceData *voicedata = (VoiceData *)r_voicedata; - int result = STT_ERROR_NONE; - powerUnlock(); if (NULL != voicedata) { -- 2.7.4 From 13747374d04ec6809411b19536484753586a213e Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 5 Aug 2016 17:26:26 +0900 Subject: [PATCH 14/16] Change default attr to root Change-Id: I3bd1bfd10a8f0188e6755cbc958f31d40fcb9113 Signed-off-by: sungwook79.park --- packaging/org.tizen.inputdelegator.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index fef6886..0e59ba6 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -100,7 +100,7 @@ cp -rf org.tizen.inputdelegator.xml %{buildroot}%{_datadir}/packages %files %manifest org.tizen.inputdelegator.manifest -%defattr(-,app,app,-) +%defattr(-,root,root,-) %license LICENSE %{_datadir}/packages/org.tizen.inputdelegator.xml %{_app_destdir}%{_app_prefix}/bin/inputdelegator -- 2.7.4 From b9965e640a46def51ad85a340f859e0e31076956 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 5 Aug 2016 17:30:26 +0900 Subject: [PATCH 15/16] Update package version to 0.1.160805 Change-Id: I407cc271de5ac1350b88d01cf4604605c7e4cadb Signed-off-by: sungwook79.park --- org.tizen.inputdelegator.xml | 2 +- packaging/org.tizen.inputdelegator.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.inputdelegator.xml b/org.tizen.inputdelegator.xml index 8511202..316606f 100755 --- a/org.tizen.inputdelegator.xml +++ b/org.tizen.inputdelegator.xml @@ -1,5 +1,5 @@ - + diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 0e59ba6..366ba6a 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -1,6 +1,6 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.0.160803 +Version: 0.1.160805 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From 322ee6146c2c194766985391ffdfa52f9a87f04b Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 8 Aug 2016 11:26:39 +0900 Subject: [PATCH 16/16] Fix coding rule detected by coding rule checker Change-Id: I97425a1fd61292916c738d6c265ca8eafb874cd3 Signed-off-by: Jihoon Kim --- src/w-input-selector.cpp | 28 ++++++++++------------------ src/w-input-stt-tos.cpp | 8 +++----- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 4760a7a..f08b774 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -202,11 +202,9 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, string path_ic; if(!strcmp(first_input_type, "input_voice")) { path_ic = path + "images/w_mode_stt_ic.png"; - } - else if(!strcmp(first_input_type, "input_emoticon")) { + } else if (!strcmp(first_input_type, "input_emoticon")) { path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; - } - else if(!strcmp(first_input_type, "input_keyboard")) { + } else if (!strcmp(first_input_type, "input_keyboard")) { path_ic = path + "images/w_mode_keyboard_ic.png"; evas_object_propagate_events_set(btn, EINA_FALSE); } @@ -218,11 +216,9 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, string path_ic; if(!strcmp(second_input_type, "input_voice")) { path_ic = path + "images/w_mode_stt_ic.png"; - } - else if(!strcmp(second_input_type, "input_emoticon")) { + } else if (!strcmp(second_input_type, "input_emoticon")) { path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; - } - else if(!strcmp(second_input_type, "input_keyboard")) { + } else if (!strcmp(second_input_type, "input_keyboard")) { path_ic = path + "images/w_mode_keyboard_ic.png"; evas_object_propagate_events_set(btn, EINA_FALSE); } @@ -241,11 +237,9 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, evas_object_layer_set(btn, 32000); if(!strcmp(first_input_type, "input_voice")) { evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); - } - else if(!strcmp(first_input_type, "input_emoticon")) { + } else if (!strcmp(first_input_type, "input_emoticon")) { evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); - } - else if(!strcmp(first_input_type, "input_keyboard")) { + } else if (!strcmp(first_input_type, "input_keyboard")) { evas_object_propagate_events_set(btn, EINA_FALSE); evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); } @@ -253,11 +247,9 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, evas_object_layer_set(btn, 32000); if(!strcmp(second_input_type, "input_voice")) { evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); - } - else if(!strcmp(second_input_type, "input_emoticon")) { + } else if (!strcmp(second_input_type, "input_emoticon")) { evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); - } - else if(!strcmp(second_input_type, "input_keyboard")) { + } else if (!strcmp(second_input_type, "input_keyboard")) { evas_object_propagate_events_set(btn, EINA_FALSE); evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); } @@ -608,7 +600,7 @@ void _create_genlist_items(void* user_data) itc1->func.content_get = __ise_gl_2button_content_get; itc1->func.state_get = NULL; itc1->func.del = NULL; - }else{ + } else { itc1->item_style = "3button"; itc1->func.text_get = NULL; itc1->func.content_get = __ise_gl_3button_content_get; @@ -726,7 +718,7 @@ void _app_service(app_control_h service, void* user_data) ret = app_control_get_extra_data_array(service, APP_CONTROL_DATA_INPUT_TYPE, &input_type_array, &input_type_array_len); g_input_type_data.input_type_array = input_type_array; g_input_type_data.input_type_array_len = input_type_array_len; - }else{ + } else { ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); if (ret == APP_CONTROL_ERROR_NONE) { if (!strcmp(context, "input_voice")) { diff --git a/src/w-input-stt-tos.cpp b/src/w-input-stt-tos.cpp index 67359d3..3ee5215 100755 --- a/src/w-input-stt-tos.cpp +++ b/src/w-input-stt-tos.cpp @@ -101,8 +101,8 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } } -void launch_bt_connection_popup(App_Data* data){ - +void launch_bt_connection_popup(App_Data* data) +{ PRINTFUNC(DLOG_DEBUG, "Need to launch BT connection popup"); app_control_h app_control; app_control_create(&app_control); @@ -114,7 +114,6 @@ void launch_bt_connection_popup(App_Data* data){ app_control_destroy(app_control); } - Eina_Bool set_tos_N66_agreed(Eina_Bool bSet) { int ret = vconf_set_bool(VCONFKEY_USER_AGREEMENT, bSet); @@ -385,7 +384,7 @@ static void _language_changed_cb(void *_data, Evas_Object *_obj, void *_event_in switch (index) { case 1: - snprintf(body_str, sizeof(body_str), gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"), " ","","",""); + snprintf(body_str, sizeof(body_str), gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"), " ", "", "", ""); terms = tagging(std::string(body_str)); terms = replaceAll(terms , std::string("\n"), std::string("
")); elm_entry_entry_set(elm_layout_content_get(_obj, "elm.swallow.content"), terms.c_str()); @@ -639,7 +638,6 @@ static void _response_n66_cb(void *data, Evas_Object *obj, void *event_info) static void _n66_language_changed_cb(void *_data, Evas_Object *_obj, void *_event_info) { - } Evas_Object *create_tos_n66_popup(void *data) -- 2.7.4