From 89a76f7caba2626b82a9e150551094755bee3b5c Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 25 Jul 2016 17:11:29 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 From d10bff62bbe2eff54ae5b99b69e2005d0d170ea1 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 11 Aug 2016 14:18:11 +0900 Subject: [PATCH 10/16] Fix coding rule detected by coding rule checker Change-Id: I24ac53d4387835008aba2179f25aca6eb1a1d819 Signed-off-by: sungwook79.park --- 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 From 124c61f0b0c71d2998439266064b2efb3c843b0d Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 11 Aug 2016 16:28:01 +0900 Subject: [PATCH 11/16] Remove build warning Change-Id: I5b0fa807916405bb9161343d6c165498be6e418f Signed-off-by: sungwook79.park --- src/MicEffector.cpp | 28 ++++++++++++++-------------- src/WInputSttMicEffect.cpp | 8 ++++---- src/w-input-selector.cpp | 22 +--------------------- src/w-input-stt-tos.cpp | 10 ++++------ src/w-input-stt-voice.cpp | 4 +++- 5 files changed, 26 insertions(+), 46 deletions(-) diff --git a/src/MicEffector.cpp b/src/MicEffector.cpp index f12d1ff..ab4de04 100755 --- a/src/MicEffector.cpp +++ b/src/MicEffector.cpp @@ -69,10 +69,10 @@ MicEffector::MicEffector(Evas_Object *canvas, Evas_Object *layout, IMicEffector& : drawcount(0) , forcestop(false) , started(false) + , fake(false) , timer(NULL) , layout(layout) , ieffect(effect) - , fake(false) { // path = ea_vector_path_create(); // paint = ea_vector_paint_create(); @@ -135,27 +135,27 @@ void MicEffector::DrawDummyFrame() */ void MicEffector::DrawQue(int idx, bool is_start) { - float margin = spectrum_posx; - float posx = 0.0; +// float margin = spectrum_posx; +// float posx = 0.0; double speed = cubic_easy_out(idx + 1.0, 0.0, 23.0, 23); unsigned int start = start_stop_anim_count - (int) speed; unsigned int end = start_stop_anim_count + (int) speed; - double opacity; +// double opacity; if (is_start) { - opacity = cubic_easy_out(idx, 0.0, 1.0, 26.0); +// opacity = cubic_easy_out(idx, 0.0, 1.0, 26.0); } else { - opacity = cubic_easy_out(idx, 0, 1.0, 26.0); +// opacity = cubic_easy_out(idx, 0, 1.0, 26.0); } // ea_vector_path_reset(path); for(unsigned int i = start; i < end; i++) { - posx = margin + (i * 5); +// posx = margin + (i * 5); // ea_vector_path_move_to(path, posx, 37.0f); // ea_vector_path_line_to(path, posx, 38.0f); @@ -223,17 +223,17 @@ float MicEffector::GetAmplifyValue(unsigned int idx) */ void MicEffector::DrawWave(unsigned int idx, int amount, int prev_amount, double opacity, bool is_lastcmd) { - float ratio = GetAmplifyValue(idx); +// float ratio = GetAmplifyValue(idx); - float am = ((float) amount) * ratio; - float pam = ((float) prev_amount) * ratio; - float cnt = (float) drawcount; +// float am = ((float) amount) * ratio; +// float pam = ((float) prev_amount) * ratio; +// float cnt = (float) drawcount; float posx = spectrum_posx; - float height = pam > am? - pam - cubic_easy_in_out(cnt + 1.0, am, pam, 7): - cubic_easy_in_out(cnt + 1.0, pam, am, 7); +// float height = pam > am? +// pam - cubic_easy_in_out(cnt + 1.0, am, pam, 7): +// cubic_easy_in_out(cnt + 1.0, pam, am, 7); posx += idx * 5; diff --git a/src/WInputSttMicEffect.cpp b/src/WInputSttMicEffect.cpp index cb128ee..5454f27 100755 --- a/src/WInputSttMicEffect.cpp +++ b/src/WInputSttMicEffect.cpp @@ -38,11 +38,11 @@ using namespace is::ui; WInputSttMicEffect::WInputSttMicEffect() - : processing_effect_timer(NULL) - , progressbar(NULL) + : square_sum(0) , count(5) - , square_sum(0) - , handle(NULL) { + , handle(NULL) + , processing_effect_timer(NULL) + , progressbar(NULL) { } WInputSttMicEffect::~WInputSttMicEffect() { diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index f08b774..542d2bb 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -164,26 +164,6 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info 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); - } -} - 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); @@ -273,7 +253,7 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, 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"); + elm_object_style_set(btn, "anchor"); string path_ic = path + "images/w_mode_stt_ic.png"; elm_image_file_set(ic, path_ic.c_str(), NULL); elm_object_content_set(btn, ic); diff --git a/src/w-input-stt-tos.cpp b/src/w-input-stt-tos.cpp index 3ee5215..906b586 100755 --- a/src/w-input-stt-tos.cpp +++ b/src/w-input-stt-tos.cpp @@ -383,11 +383,13 @@ static void _language_changed_cb(void *_data, Evas_Object *_obj, void *_event_in char body_str[40000]; switch (index) { - case 1: - snprintf(body_str, sizeof(body_str), gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"), " ", "", "", ""); + case 1: { + const char *format = gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"); + snprintf(body_str, sizeof(body_str), format, " ", "", "", ""); 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()); + } break; case 2: terms = tagging(std::string(gettext(TOS_BODY2))+ std::string("
") + std::string(gettext(TOS_BODY3))); @@ -496,16 +498,12 @@ static void _ise_voice_tos_anchor_clicked(void *data, Evas_Object *obj, void *ev if (!strncmp(ainfo->name, "\"http://", 8)) { show_terms(data, obj, ainfo); - } else if (!strncmp(ainfo->name, "\"file://", 8)) { -/* Evas_Object *senconds_layout = create_tos_second_page(ad); - Elm_Object_Item *nit = NULL; nit = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, senconds_layout, "empty"); elm_naviframe_item_pop_cb_set(nit, _naviframe_pop_cb2, NULL); elm_naviframe_item_title_enabled_set(nit, EINA_FALSE, EINA_FALSE); -*/ } } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 17abe66..642224b 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -727,7 +727,9 @@ void show_error_message(VoiceData *vd, stt_error_e reason) if (ancs_connected) { char text[512]; - snprintf(text, sizeof(text), _(SK_NETWORK_ERROR_FOR_IOS), _(SK_SAMSUNG_GEAR)); + const char *format1 = _(SK_NETWORK_ERROR_FOR_IOS); + const char *format2 = _(SK_SAMSUNG_GEAR); + snprintf(text, sizeof(text), format1, format2); show_popup_toast((const char*)text, false); } else { -- 2.7.4 From aae7e7068b22e5975d7182262b97c4538cdac25d Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 17 Aug 2016 20:27:51 +0900 Subject: [PATCH 12/16] Set app control launch mode to group Change-Id: Ic4a81c9c43dfaef47e195bb8f66ca05ca7caa116 Signed-off-by: sungwook79.park --- org.tizen.inputdelegator.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.tizen.inputdelegator.xml b/org.tizen.inputdelegator.xml index 316606f..bb81f27 100755 --- a/org.tizen.inputdelegator.xml +++ b/org.tizen.inputdelegator.xml @@ -2,7 +2,7 @@ - + w-input-selector.png -- 2.7.4 From 5391ab10176d04451edf0baf50573e1ec1e8d8bc Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 17 Aug 2016 22:13:51 +0900 Subject: [PATCH 13/16] Modify Selector Icon UI to circle Change-Id: I3827ea5155af799e1e6178812242bedcbdba07e8 Signed-off-by: sungwook79.park --- res/edje/w-input-selector.edc | 287 ++++++++++- res/edje/w-input-stt.edc | 1097 ++++++++++++++++++++--------------------- src/w-input-selector.cpp | 18 +- 3 files changed, 832 insertions(+), 570 deletions(-) diff --git a/res/edje/w-input-selector.edc b/res/edje/w-input-selector.edc index d9e9fd3..a436e58 100755 --- a/res/edje/w-input-selector.edc +++ b/res/edje/w-input-selector.edc @@ -580,7 +580,6 @@ collections { } ) } - //Gesture VI program { name: "do_start_expand_0.0"; action: STATE_SET "default" 0.0; @@ -672,13 +671,297 @@ collections { } +// 3 button + group { + name: "elm/genlist/item/3button_flat/default"; + alias: "elm/genlist/item/3button_flat_recent/default"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "contents" "base elm.icon.1 elm.icon.2 elm.icon.3 elm.icon.1.touch_area elm.icon.2.touch_area elm.icon.3.touch_area"; + data.item: "vi_effect" "on"; + data.item: "dim" "off"; + data.item: "focus_bg" "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"; // left icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 100 100; + max: 100 100; + rel1 { relative: 60/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 60/360 0.5; to: "base"; offset: 0 0;} + } + } + part { + name: "elm.icon.1.touch_area"; // left icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 120 120; + max: 120 120; + rel1 { relative: 60/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 60/360 0.5; to: "base"; offset: 0 0;} + } + } + + part { + name: "elm.icon.2"; // center icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 100 100; + max: 100 100; + rel1 { relative: 180/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 180/360 0.5; to: "base"; offset: 0 0;} + } + + } + part { + name: "elm.icon.2.touch_area"; // center icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 120 120; + max: 120 120; + rel1 { relative: 180/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 180/360 0.5; to: "base"; offset: 0 0;} + } + + } + + + part { + name: "elm.icon.3"; // right icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 100 100; + max: 100 100; + rel1 { relative: 300/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 300/360 0.5; to: "base"; offset: 0 0;} + } + } + part { + name: "elm.icon.3.touch_area"; // right icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 120 120; + max: 120 120; + rel1 { relative: 300/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 300/360 0.5; to: "base"; offset: 0 0;} + } + } + + } + } + +//2button + group { + name: "elm/genlist/item/2button_flat/default"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "contents" "base elm.icon.1 elm.icon.2 elm.icon.1.touch_area elm.icon.2.touch_area"; + data.item: "vi_effect" "on"; + data.item: "dim" "off"; + data.item: "focus_bg" "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"; // left icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 100 100; + max: 100 100; + rel1 { relative: 120/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 120/360 0.5; to: "base"; offset: 0 0;} + } + } + part { + name: "elm.icon.1.touch_area"; // left icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 120 120; + max: 120 120; + rel1 { relative: 120/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 120/360 0.5; to: "base"; offset: 0 0;} + } + } + + part { + name: "elm.icon.2"; // center icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 100 100; + max: 100 100; + rel1 { relative: 240/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 240/360 0.5; to: "base"; offset: 0 0;} + } + + } + part { + name: "elm.icon.2.touch_area"; // center icon + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + min: 120 120; + max: 120 120; + rel1 { relative: 240/360 0.5; to: "base"; offset: 0 0;} + rel2 { relative: 240/360 0.5; to: "base"; offset: 0 0;} + } + + } + } + } + + group { name: "elm/button/base/ime/transparent"; + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: 0 130; + color_class: "AO015"; + visible: 0; + } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO015P"; + } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO015D"; + } + } + part { + name: "padding_left_top"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + rel2.relative: 0.0 0.0; + min: 0 0; + fixed: 1 1; + } + } + part { + name: "padding_right_bottom"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + align: 1.0 1.0; + rel1.relative: 1.0 1.0; + min: 0 0; + fixed: 1 1; + } + } + part { + name: "icon_rect"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + min: 0 0; + fixed: 1 1; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + min: 134 61; + max: 134 61; + fixed: 1 1; + } + } + } + } + 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( diff --git a/res/edje/w-input-stt.edc b/res/edje/w-input-stt.edc index a7ea837..8eda165 100755 --- a/res/edje/w-input-stt.edc +++ b/res/edje/w-input-stt.edc @@ -149,7 +149,7 @@ collections color_class { name: "AO01153L1"; - color: 163 163 163 100; + color: 0 0 255 255; } color_class { @@ -164,7 +164,7 @@ collections color_class { name: "AO01154L1"; - color: 110 110 110 100; + color: 97 12 117 255; } color_class { @@ -179,7 +179,7 @@ collections color_class { name: "AO01155L1"; - color: 122 122 122 100; + color: 255 0 0 255; } color_class { @@ -1368,608 +1368,583 @@ collections #define BUTTON_PADDING_SIZE_INC 20 0 #define BUTTON_HEIGHT_INC 122 #define BUTTON_ICON_SIZE_INC 60 60 - group { name: "elm/button/base/default"; - script { - public mouse_down = 0; - public multi_down = 0; - } - parts { - part { name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 BUTTON_HEIGHT_INC; - color: 128 128 128 128; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - } - part { name: "padding_left_top"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_PADDING_SIZE_INC; - fixed: 1 1; - } - } - part { name: "padding_right_bottom"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_PADDING_SIZE_INC; - fixed: 1 1; - } - } - part { name: "icon_rect"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - min: 0 0; - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_ICON_SIZE_INC; - max: BUTTON_ICON_SIZE_INC; - fixed: 1 1; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "elm.swallow.content.clip"; - scale: 1; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 1; - min: BUTTON_ICON_SIZE_INC; - max: BUTTON_ICON_SIZE_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_ICON_SIZE_INC; - max: BUTTON_ICON_SIZE_INC; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - rel1 { - relative: 1.0 1.0; - to_x: "icon_rect"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - text { - max: 1 0; - style: "button_general_text_normal"; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text.style: "button_general_text_dim"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - text.style: "button_general_text_press"; - } - } - part { name: "elm.swallow.content.clip"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - color: 128 128 128 128; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - } - part { name: "event"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - } - programs { - program { name: "pressed"; - signal: "mouse,down,1*"; - source: "event"; - script { - if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0)) - { - set_int(mouse_down, 1); - run_program(PROGRAM:"button_press1"); - } - } - } - program { name: "button_press1"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - set_state(PART:"bg", "pressed", 0.0); - set_state(PART:"elm.text", "pressed", 0.0); - emit("elm,action,press", ""); - } - } - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "event"; - script { - if (get_int(mouse_down) == 1) { - set_int(mouse_down, 0); - run_program(PROGRAM:"button_unpress1"); - } - } - } - program { name: "button_unpress1"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - set_state(PART:"bg", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); - emit("elm,action,unpress", ""); - } - } - } - program { name: "touch_snd"; - signal: "mouse,clicked,1"; - source: "event"; - script { - new st[31]; - new Float:vl; - if (get_int(multi_down) == 0) { - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - //run_program(PROGRAM:"play_sample"); - emit("elm,action,click", ""); - } - } - } - } - program { - name: "play_sample"; - action: RUN_PLUGIN "touch_sound"; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - } - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) - set_state(PART:"elm.text", "default", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "default", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; - target: "icon_rect"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "icon_rect"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "bg"; - target: "elm.swallow.content.clip"; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.swallow.content.clip"; - target: "elm.text"; - } - program { name: "multi_down"; - signal: "elm,action,multi,down"; - source: "elm"; - script { - set_int(multi_down, 1); - } - } - program { name: "multi_up"; - signal: "elm,action,multi,up"; - source: "elm"; - script { - set_int(multi_down, 0); - } - } - } - } - - group { name: "elm/button/base/ime_transparent"; - inherit: "elm/button/base/default"; - parts { - part { name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 112; + group { name: "elm/button/base/default"; + script { + public mouse_down = 0; + public multi_down = 0; + } + parts { + part { name: "bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 BUTTON_HEIGHT_INC; + color_class: "W011"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "W011P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W011D"; + } + } + part { name: "padding_left_top"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + rel2.relative: 0.0 0.0; + min: BUTTON_PADDING_SIZE_INC; + fixed: 1 1; + } + } + part { name: "padding_right_bottom"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 1.0 1.0; + rel1.relative: 1.0 1.0; + min: BUTTON_PADDING_SIZE_INC; + fixed: 1 1; + } + } + part { name: "icon_rect"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.5; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + min: 0 0; + fixed: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: BUTTON_ICON_SIZE_INC; + max: BUTTON_ICON_SIZE_INC; + fixed: 1 1; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "elm.swallow.content.clip"; + scale: 1; + description { state: "default" 0.0; visible: 0; - } - description { state: "pressed" 0.0; + align: 0.0 0.5; + rel1 { + relative: 1.0 1.0; + to: "padding_left_top"; + } + rel2 { + relative: 1.0 0.0; + to_x: "padding_left_top"; + to_y: "padding_right_bottom"; + } + fixed: 1 0; + } + description { state: "visible" 0.0; + fixed: 1 1; + min: BUTTON_ICON_SIZE_INC; + max: BUTTON_ICON_SIZE_INC; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "elm.text"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to_x: "elm.text"; + to_y: "padding_right_bottom"; + } + } + description { state: "icononly" 0.0; + min: BUTTON_ICON_SIZE_INC; + max: BUTTON_ICON_SIZE_INC; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "icon_rect"; + to_y: "padding_left_top"; + } + rel2 { + relative: 0.0 0.0; + to: "padding_right_bottom"; + } + text { + max: 1 0; + style: "button_general_text_normal"; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - } - description { state: "disabled" 0.0; + text.style: "button_general_text_dim"; + } + description { state: "pressed" 0.0; inherit: "default" 0.0; + text.style: "button_general_text_press"; + } + } + part { name: "elm.swallow.content.clip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + color_class: "F022L1i"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "F022L1iD"; + } + } + part { name: "event"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.to: "bg"; + rel2.to: "bg"; + } + } + } + programs { + program { name: "pressed"; + signal: "mouse,down,1*"; + source: "event"; + script { + if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0)) + { + set_int(mouse_down, 1); + run_program(PROGRAM:"button_press1"); + } + } + } + program { name: "button_press1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + set_state(PART:"bg", "pressed", 0.0); + set_state(PART:"elm.text", "pressed", 0.0); + emit("elm,action,press", ""); + } + } + } + program { name: "unpressed"; + signal: "mouse,up,1"; + source: "event"; + script { + if (get_int(mouse_down) == 1) { + set_int(mouse_down, 0); + run_program(PROGRAM:"button_unpress1"); + } + } + } + program { name: "button_unpress1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"elm.text", "default", 0.0); + emit("elm,action,unpress", ""); + } + } + } + program { name: "touch_snd"; + signal: "mouse,clicked,1"; + source: "event"; + script { + new st[31]; + new Float:vl; + if (get_int(multi_down) == 0) { + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + //run_program(PROGRAM:"play_sample"); + emit("elm,action,click", ""); + } + } + } + } + program { + name: "play_sample"; + action: RUN_PLUGIN "touch_sound"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "icononly")) + { + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"icon_rect", "visible", 0.0); + } + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) + set_state(PART:"elm.text", "default", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + { + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"icon_rect", "default", 0.0); + } + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + target: "icon_rect"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + target: "icon_rect"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "bg"; + target: "elm.swallow.content.clip"; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "elm.swallow.content.clip"; + target: "elm.text"; + } + program { name: "multi_down"; + signal: "elm,action,multi,down"; + source: "elm"; + script { + set_int(multi_down, 1); + } + } + program { name: "multi_up"; + signal: "elm,action,multi,up"; + source: "elm"; + script { + set_int(multi_down, 0); + } + } + } +} + + group { name: "elm/button/base/ime_transparent"; + inherit: "elm/button/base/default"; + parts { + part { name: "bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 112; + visible: 0; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; } } } } group { name: "elm/button/base/ime_button"; - alias: "elm/button/base/ime_button_stt"; - inherit: "elm/button/base/default"; - parts { - part { name: "bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - color_class: "AO01153L1"; - visible: 1; - image.normal: "./w_mode_ic_bg.png"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO01153L1P"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; + alias: "elm/button/base/ime_button_stt"; + inherit: "elm/button/base/default"; + parts { + part { name: "bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + color_class: "AO01153L1"; + visible: 1; + image.normal: "./w_mode_ic_bg.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO01153L1P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W011D"; } } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "elm.swallow.content.clip"; - description { state: "default" 0.0; - visible: 1; - align: 0.5 0.5; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.content.clip"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - color_class: "AO01153L3"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO01153L3P"; + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + clip_to: "elm.swallow.content.clip"; + description { state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "bg";} + rel2 { relative: 1.0 1.0; to: "bg";} + fixed: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - } - part { name: "elm.swallow.content_ef"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 1; - align: 0.5 0.5; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - fixed: 1 1; - } - } - } - programs { - program { name: "pressed"; - signal: "mouse,down,1*"; - source: "event"; - script { - if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0)) - { - set_int(mouse_down, 1); - run_program(PROGRAM:"button_press1"); - } - } - } - program { name: "button_press1"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - set_state(PART:"bg", "pressed", 0.0); - set_state(PART:"elm.swallow.content.clip", "pressed", 0.0); - emit("elm,action,press", ""); - } - } - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "event"; - script { - if (get_int(mouse_down) == 1) { - set_int(mouse_down, 0); - run_program(PROGRAM:"button_unpress1"); - } - } - } - program { name: "button_unpress1"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - set_state(PART:"bg", "default", 0.0); - set_state(PART:"elm.swallow.content.clip", "default", 0.0); - emit("elm,action,unpress", ""); - } - } - } - } + + } + programs { + program { name: "pressed"; + signal: "mouse,down,1*"; + source: "event"; + script { + if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0)) + { + set_int(mouse_down, 1); + run_program(PROGRAM:"button_press1"); + } + } + } + program { name: "button_press1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + set_state(PART:"bg", "pressed", 0.0); + set_state(PART:"elm.swallow.content.clip", "pressed", 0.0); + emit("elm,action,press", ""); + } + } + } + program { name: "unpressed"; + signal: "mouse,up,1"; + source: "event"; + script { + if (get_int(mouse_down) == 1) { + set_int(mouse_down, 0); + run_program(PROGRAM:"button_unpress1"); + } + } + } + program { name: "button_unpress1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"elm.swallow.content.clip", "default", 0.0); + emit("elm,action,unpress", ""); + } + } + } + } } group { name: "elm/button/base/ime_button_emoticon"; - inherit: "elm/button/base/ime_button"; - parts { - part { name: "bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - color_class: "AO01154L1"; - visible: 1; - image.normal: "./w_mode_ic_bg.png"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO01154L1P"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; + inherit: "elm/button/base/ime_button"; + parts { + part { name: "bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + color_class: "AO01154L1"; + visible: 1; + image.normal: "./w_mode_ic_bg.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO01154L1P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W011D"; + } } } } - } group { name: "elm/button/base/ime_button_keyboard"; - inherit: "elm/button/base/ime_button"; - parts { - part { name: "bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - color_class: "AO01155L1"; - visible: 1; - image.normal: "./w_mode_ic_bg.png"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO01155L1P"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; + inherit: "elm/button/base/ime_button"; + parts { + part { name: "bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + color_class: "AO01155L1"; + visible: 1; + image.normal: "./w_mode_ic_bg.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO01155L1P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W011D"; } } } } group { name: "elm/button/base/ime_button_template"; - inherit: "elm/button/base/ime_button"; - parts { - part { name: "bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 76 76; - max: 76 76; - color_class: "AO01161"; - visible: 1; - image.normal: "./w_mode_ic_bg.png"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO01161P"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "AO01161D"; + inherit: "elm/button/base/ime_button"; + parts { + part { name: "bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 76 76; + max: 76 76; + color_class: "AO01161"; + visible: 1; + image.normal: "./w_mode_ic_bg.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO01161P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO01161D"; } } - part { name: "elm.swallow.content.clip"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - color_class: "AO0116"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO0116P"; + part { name: "elm.swallow.content.clip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + color_class: "AO01153L3"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO01153L3P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO01153L3D"; + } } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "AO0116D"; - } - } } } group { name: "elm/button/base/ime_button_stt_confirm"; - inherit: "elm/button/base/ime_button"; - parts { - part { name: "bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - color_class: "AO015L2"; - visible: 0; - image.normal: "./b_stt_icon_btn.png"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO015L2P"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "AO015L2D"; + inherit: "elm/button/base/ime_button"; + parts { + part { name: "bg"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + color_class: "AO015L2"; + visible: 0; + image.normal: "./b_stt_icon_btn.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO015L2P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO015L2D"; } } - part { name: "elm.swallow.content.clip"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - color_class: "AO015L2"; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color_class: "AO015L2P"; + part { name: "elm.swallow.content.clip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + color_class: "AO015L2"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO015L2P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO015L2D"; + } } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "AO015L2D"; - } - } } } group { name: "elm/button/base/touch_area"; - inherit: "elm/button/base/default"; - parts { - part { name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - color: 0 0 0 0; - visible: 1; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + inherit: "elm/button/base/default"; + parts { + part { name: "bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + color: 0 0 0 0; + visible: 1; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; } } } - programs { - program { name: "touch_snd"; - signal: "mouse,clicked,1"; - source: "event"; - script { - new st[31]; - new Float:vl; - if (get_int(multi_down) == 0) { - get_state(PART:"bg", st, 30, vl); - if (strcmp(st, "disabled")) { - run_program(PROGRAM:"play_sample"); - emit("elm,action,click", ""); - } + programs { + program { name: "touch_snd"; + signal: "mouse,clicked,1"; + source: "event"; + script { + new st[31]; + new Float:vl; + if (get_int(multi_down) == 0) { + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + run_program(PROGRAM:"play_sample"); + emit("elm,action,click", ""); + } + } } - } - } - } + } + } } #define NAVIFRAME_VIEW_TRANS_TIME 0.4 //time for push and pop diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 542d2bb..4156397 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -178,13 +178,15 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, 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")) { + elm_object_style_set(btn, "ime_button_stt"); path_ic = path + "images/w_mode_stt_ic.png"; } else if (!strcmp(first_input_type, "input_emoticon")) { + elm_object_style_set(btn, "ime_button_emoticon"); path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; } else if (!strcmp(first_input_type, "input_keyboard")) { + elm_object_style_set(btn, "ime_button_keyboard"); path_ic = path + "images/w_mode_keyboard_ic.png"; evas_object_propagate_events_set(btn, EINA_FALSE); } @@ -192,13 +194,15 @@ static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, 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")) { + elm_object_style_set(btn, "ime_button_stt"); path_ic = path + "images/w_mode_stt_ic.png"; } else if (!strcmp(second_input_type, "input_emoticon")) { + elm_object_style_set(btn, "ime_button_emoticon"); path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; } else if (!strcmp(second_input_type, "input_keyboard")) { + elm_object_style_set(btn, "ime_button_keyboard"); path_ic = path + "images/w_mode_keyboard_ic.png"; evas_object_propagate_events_set(btn, EINA_FALSE); } @@ -253,21 +257,21 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, 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"); + elm_object_style_set(btn, "ime_button_stt"); string path_ic = path + "images/w_mode_stt_ic.png"; 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"); + elm_object_style_set(btn, "ime_button_emoticon"); string path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; 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.3")){ - elm_object_style_set(btn, "anchor"); + elm_object_style_set(btn, "ime_button_keyboard"); string path_ic = path + "images/w_mode_keyboard_ic.png"; elm_image_file_set(ic, path_ic.c_str(), NULL); elm_object_content_set(btn, ic); @@ -575,13 +579,13 @@ void _create_genlist_items(void* user_data) Elm_Genlist_Item_Class * itc1 = elm_genlist_item_class_new(); if(g_input_type_data.input_type_array_len == 2){ - itc1->item_style = "2button"; + itc1->item_style = "2button_flat"; 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->item_style = "3button_flat"; itc1->func.text_get = NULL; itc1->func.content_get = __ise_gl_3button_content_get; itc1->func.state_get = NULL; -- 2.7.4 From fa5bb60a494e54eb7eab30dc911d7f59feedf340 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 18 Aug 2016 10:47:22 +0900 Subject: [PATCH 14/16] Update package version to 0.1.160818 Change-Id: I83fa3c08c252826fc7aad7bbd46303bae8944064 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 bb81f27..e001d06 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 366ba6a..b0a7532 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.1.160805 +Version: 0.1.160818 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From 72a64ab999a139cd46a9e9f9f07fb213e83a8b54 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 18 Aug 2016 14:59:17 +0900 Subject: [PATCH 15/16] remove dependency about efl-assist package Change-Id: I5724d6e44068f4d8a5868bf499c65af502cfb95e Signed-off-by: sungwook79.park --- inc/MicEffector.h | 3 +-- packaging/org.tizen.inputdelegator.spec | 1 - src/CMakeLists.txt | 1 - src/MicEffector.cpp | 1 - src/w-input-emoticon.cpp | 1 - src/w-input-selector.cpp | 1 - src/w-input-stt-tos.cpp | 2 -- src/w-input-stt-voice.cpp | 1 - 8 files changed, 1 insertion(+), 10 deletions(-) diff --git a/inc/MicEffector.h b/inc/MicEffector.h index df34494..8284f1c 100755 --- a/inc/MicEffector.h +++ b/inc/MicEffector.h @@ -17,8 +17,7 @@ #pragma once #include -#include - +#include #include "Debug.h" #define SAMPLE_COUNT 59 diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index b0a7532..c68b3de 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -24,7 +24,6 @@ BuildRequires: pkgconfig(capi-media-wav-player) BuildRequires: pkgconfig(capi-system-device) BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(efl-assist) BuildRequires: pkgconfig(efl-extension) BuildRequires: pkgconfig(feedback) BuildRequires: pkgconfig(stt) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e39c91..01749a5 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,7 +5,6 @@ PKG_CHECK_MODULES(CAPI_MEDIA_WAV_PLAYER REQUIRED capi-media-wav-player) PKG_CHECK_MODULES(CAPI_SYSTEM_DEVICE REQUIRED capi-system-device) PKG_CHECK_MODULES(EINA REQUIRED eina) PKG_CHECK_MODULES(ELEMENTARY REQUIRED elementary) -PKG_CHECK_MODULES(EFL_ASSIST REQUIRED efl-assist) PKG_CHECK_MODULES(EFL_EXTENSION REQUIRED efl-extension) PKG_CHECK_MODULES(FEEDBACK REQUIRED feedback) PKG_CHECK_MODULES(STT REQUIRED stt) diff --git a/src/MicEffector.cpp b/src/MicEffector.cpp index ab4de04..f2602d1 100755 --- a/src/MicEffector.cpp +++ b/src/MicEffector.cpp @@ -15,7 +15,6 @@ */ #include -#include #include "MicEffector.h" using namespace is::ui; diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index d73b692..7f96a37 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include "Debug.h" #include "w-input-selector.h" diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 4156397..8eb09bd 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/src/w-input-stt-tos.cpp b/src/w-input-stt-tos.cpp index 906b586..2084348 100755 --- a/src/w-input-stt-tos.cpp +++ b/src/w-input-stt-tos.cpp @@ -17,12 +17,10 @@ #include #include #include -#include #include #include #include #include -//#include #include diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 642224b..40dab3e 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include -- 2.7.4 From 7a95a8f1458712f72d18589dc4414db26256e13a Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Mon, 29 Aug 2016 18:16:57 +0900 Subject: [PATCH 16/16] include app_preference.h to fix build break Change-Id: Ibf925dec4a45e970f57455c6c0c73024fa9c3307 Signed-off-by: Jiwoong Im --- src/w-input-stt-voice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 40dab3e..0f14f77 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include -- 2.7.4