From e88a9250753b2cb59f5061cbdc2c316c5e4fdc5e Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 17 Jul 2017 09:24:14 +0900 Subject: [PATCH 01/16] Support return key type in keyboard input mode Change-Id: I0f352fce837060728f7b8c4c9e2270ddaa4d19de Signed-off-by: sungwook79.park --- inc/w-input-selector.h | 1 + src/w-input-keyboard.cpp | 44 +++++++++++++++++++++++++++++++++++++++++++- src/w-input-stt-voice.cpp | 2 ++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 92662e1..774f351 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -106,6 +106,7 @@ struct _InputKeyboardData { char *guide_text; char *default_text; + char *return_key_type; }; typedef struct _InputKeyboardData InputKeyboardData; diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 9257a12..7fe4860 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -34,6 +34,7 @@ bool input_keyboard_init(app_control_h app_control) int ret = -1; char *default_text = NULL; char *guide_text = NULL; + char *return_key_type = NULL; input_keyboard_deinit(); @@ -45,6 +46,10 @@ bool input_keyboard_init(app_control_h app_control) if (ret == APP_CONTROL_ERROR_NONE) { g_input_keyboard_data.guide_text = guide_text; } + ret = app_control_get_extra_data(app_control, "return_key_type", &return_key_type); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.return_key_type = return_key_type; + } return true; } @@ -57,13 +62,17 @@ void input_keyboard_deinit(void) if (g_input_keyboard_data.default_text) free(g_input_keyboard_data.default_text); + if (g_input_keyboard_data.return_key_type) + free(g_input_keyboard_data.return_key_type); + g_input_keyboard_data.default_text = NULL; g_input_keyboard_data.guide_text = NULL; + g_input_keyboard_data.return_key_type = NULL; return; } -void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +void exit_keyboard() { app_control_h app_control; int ret = app_control_create(&app_control); @@ -84,6 +93,12 @@ void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) free(app_id); reply_to_sender_by_callback(getText, "keyboard", NULL); ui_app_exit(); + +} + +void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + exit_keyboard(); } static Eina_Bool custom_back_cb(void *data, Elm_Object_Item *it) @@ -97,6 +112,23 @@ static void maxlength_cb(void *data, Evas_Object *obj, void *event_info) LOGD("maxlength_cb : size = %d", KEYBOARD_EDITOR_CHAR_COUNT_MAX); } +static void enter_keydown_cb(void *data, Evas_Object *obj, void *event_info) +{ + LOGD("enter_keydown_cb"); + Evas_Object *entry = obj; + if (entry == NULL) + return; + + Ecore_IMF_Context *imf_context = NULL; + imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry); + if (imf_context) + ecore_imf_context_input_panel_hide(imf_context); + + elm_object_focus_set(entry, EINA_FALSE); + + exit_keyboard(); +} + void create_fullscreen_editor(void *data) { App_Data *ad = (App_Data *)data; @@ -121,6 +153,10 @@ void create_fullscreen_editor(void *data) elm_entry_cursor_end_set(entry); evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + if (g_input_keyboard_data.return_key_type && strcmp(g_input_keyboard_data.return_key_type, "DONE") == 0) { + elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); + evas_object_smart_callback_add(entry, "activated", enter_keydown_cb, ad); + } evas_object_show(entry); elm_box_pack_end(box, entry); @@ -159,6 +195,7 @@ static void editfield_unfocused_cb(void *data, Evas_Object *obj, void *event_inf static Evas_Object *create_multiline_editfield_layout(Evas_Object *parent, void *data) { + App_Data *ad = (App_Data *)data; Evas_Object *editfield; editfield = elm_layout_add(parent); @@ -179,6 +216,11 @@ static Evas_Object *create_multiline_editfield_layout(Evas_Object *parent, void elm_entry_cursor_end_set(entry); evas_object_smart_callback_add(entry, "focused", editfield_focused_cb, editfield); evas_object_smart_callback_add(entry, "unfocused", editfield_unfocused_cb, editfield); + if (g_input_keyboard_data.return_key_type && strcmp(g_input_keyboard_data.return_key_type, "DONE") == 0) { + elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); + evas_object_smart_callback_add(entry, "activated", enter_keydown_cb, ad); + } + evas_object_show(entry); elm_object_part_content_set(editfield, "elm.swallow.content", entry); diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 595d417..ac682cc 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -933,6 +933,7 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) } } else { strncpy(text, "", strlen("")); + text[strlen("")] = '\0'; } } return strdup(text); @@ -969,6 +970,7 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) } } else { strncpy(text, "", strlen("")); + text[strlen("")] = '\0'; } return strdup(text); } -- 2.7.4 From e5dc7bcfb200e4b6d7c7290fb88ae62fac0e57a7 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 18 Jul 2017 15:26:40 +0900 Subject: [PATCH 02/16] Support filter and popup notification for maximum characters length in keyboard input mode Change-Id: Ibd720794c674987b106c4cb01a7d22fd18b4471e Signed-off-by: sungwook79.park --- inc/w-input-keyboard.h | 2 ++ inc/w-input-selector.h | 1 + po/ar.po | 2 ++ po/az.po | 2 ++ po/bg.po | 2 ++ po/ca.po | 2 ++ po/cs.po | 2 ++ po/da.po | 2 ++ po/de.po | 2 ++ po/el_GR.po | 2 ++ po/en.po | 2 ++ po/en_PH.po | 2 ++ po/en_US.po | 3 +++ po/es_ES.po | 2 ++ po/es_US.po | 2 ++ po/et.po | 2 ++ po/eu.po | 2 ++ po/fi.po | 2 ++ po/fr.po | 2 ++ po/fr_CA.po | 2 ++ po/ga.po | 2 ++ po/gl.po | 2 ++ po/hi.po | 2 ++ po/hr.po | 2 ++ po/hu.po | 2 ++ po/hy.po | 2 ++ po/is.po | 2 ++ po/it_IT.po | 2 ++ po/ja_JP.po | 2 ++ po/ka.po | 2 ++ po/kk.po | 2 ++ po/ko_KR.po | 2 ++ po/lt.po | 2 ++ po/lv.po | 2 ++ po/mk.po | 2 ++ po/nb.po | 2 ++ po/nl.po | 2 ++ po/pl.po | 2 ++ po/pt_BR.po | 2 ++ po/pt_PT.po | 2 ++ po/ro.po | 2 ++ po/ru_RU.po | 2 ++ po/sk.po | 2 ++ po/sl.po | 2 ++ po/sr.po | 2 ++ po/sv.po | 2 ++ po/tr_TR.po | 2 ++ po/uk.po | 2 ++ po/uz.po | 2 ++ po/zh_CN.po | 2 ++ po/zh_HK.po | 2 ++ po/zh_TW.po | 2 ++ src/w-input-keyboard.cpp | 13 +++++++++++-- src/w-input-stt-voice.cpp | 15 ++++++--------- 54 files changed, 121 insertions(+), 11 deletions(-) diff --git a/inc/w-input-keyboard.h b/inc/w-input-keyboard.h index b127fdf..349dc54 100755 --- a/inc/w-input-keyboard.h +++ b/inc/w-input-keyboard.h @@ -21,6 +21,8 @@ #include #include +#define MAX_TEXT_LENGTH_REACH "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" + const int KEYBOARD_EDITOR_CHAR_COUNT_MAX = 300; bool input_keyboard_init(app_control_h app_control); void input_keyboard_deinit(void); diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 774f351..c5afd21 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -107,6 +107,7 @@ struct _InputKeyboardData char *guide_text; char *default_text; char *return_key_type; + int max_text_length; }; typedef struct _InputKeyboardData InputKeyboardData; diff --git a/po/ar.po b/po/ar.po index c15b1b9..0283829 100644 --- a/po/ar.po +++ b/po/ar.po @@ -256,3 +256,5 @@ msgstr "إدخال ساعة Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "تأكد من أن تطبيق %s قيد التفعيل على هاتفك." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "تم تجاوز الحد الأقصى لعدد الأحرف (%d)." \ No newline at end of file diff --git a/po/az.po b/po/az.po index d9f741c..7d59e8e 100644 --- a/po/az.po +++ b/po/az.po @@ -256,3 +256,5 @@ msgstr "Gear Girişi" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Telefonda %s proqramının aktiv olduğundan əmin ol." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Simvolların sayı maksimumu (%d) keçdi." \ No newline at end of file diff --git a/po/bg.po b/po/bg.po index 230b745..cf1ce05 100644 --- a/po/bg.po +++ b/po/bg.po @@ -256,3 +256,5 @@ msgstr "Въвеждане на Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Уверете се, че приложението %s е активно в телефона." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Максималният брой знаци (%d) е надвишен." \ No newline at end of file diff --git a/po/ca.po b/po/ca.po index 29923a4..7f23fa6 100644 --- a/po/ca.po +++ b/po/ca.po @@ -256,3 +256,5 @@ msgstr "Entrada del Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Asseguri's que l'app %s estigui activa al telèfon." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "S'ha excedit el nombre màxim de caràcters (%d)." \ No newline at end of file diff --git a/po/cs.po b/po/cs.po index c602228..77fabba 100644 --- a/po/cs.po +++ b/po/cs.po @@ -256,3 +256,5 @@ msgstr "Zadávání do Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Zkontrolujte, zda je v telefonu aktivní aplikace %s." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Byl překročen maximální počet znaků (%d)." \ No newline at end of file diff --git a/po/da.po b/po/da.po index 2f0c88c..ef1b75e 100644 --- a/po/da.po +++ b/po/da.po @@ -256,3 +256,5 @@ msgstr "Gear-input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Sørg for, at appen %s er aktiv på telefonen." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Det maksimale antal tegn er overskredet (%d)." \ No newline at end of file diff --git a/po/de.po b/po/de.po index 9e0c4e3..c10e87c 100644 --- a/po/de.po +++ b/po/de.po @@ -256,3 +256,5 @@ msgstr "Gear-Eingabe" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Stellen Sie sicher, dass die %s-App auf Ihrem Telefon aktiv ist." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maximale Anzahl von Zeichen (%d) überschritten." \ No newline at end of file diff --git a/po/el_GR.po b/po/el_GR.po index 0319b34..fca2872 100644 --- a/po/el_GR.po +++ b/po/el_GR.po @@ -256,3 +256,5 @@ msgstr "Είσοδος Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Βεβαιωθείτε ότι η εφαρμογή %s είναι ενεργή στο τηλέφωνό σας." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Ξεπεράσατε το μέγιστο αριθμό χαρακτήρων (%d)." \ No newline at end of file diff --git a/po/en.po b/po/en.po index d7dc941..491b270 100644 --- a/po/en.po +++ b/po/en.po @@ -256,3 +256,5 @@ msgstr "Gear Input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Make sure the %s app is active on your phone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maximum number of characters (%d) exceeded." \ No newline at end of file diff --git a/po/en_PH.po b/po/en_PH.po index 128fe6e..8c74d21 100644 --- a/po/en_PH.po +++ b/po/en_PH.po @@ -256,3 +256,5 @@ msgstr "Gear Input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Make sure the %s app is active on your phone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maximum number of characters (%d) exceeded." \ No newline at end of file diff --git a/po/en_US.po b/po/en_US.po index 8f90a0a..4331d77 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -261,3 +261,6 @@ msgstr "Emojis" msgid "IDS_IME_HEADER_RECENT_M_RECETLY_SENT_EMOJIS_ABB" msgstr "Recent" + +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maximum number of characters (%d) exceeded." \ No newline at end of file diff --git a/po/es_ES.po b/po/es_ES.po index 99412d0..6516753 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -256,3 +256,5 @@ msgstr "Entrada de Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Asegúrese de que la aplicación %s está activa en el teléfono." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Se ha superado el número máximo de caracteres (%d)." \ No newline at end of file diff --git a/po/es_US.po b/po/es_US.po index 4c679c9..690639d 100644 --- a/po/es_US.po +++ b/po/es_US.po @@ -256,3 +256,5 @@ msgstr "Tipo de entrada en Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Compruebe que la aplicación %s está activa en el teléfono." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Se superó el número máximo de caracteres (%d)." \ No newline at end of file diff --git a/po/et.po b/po/et.po index e65697a..99e9a3b 100644 --- a/po/et.po +++ b/po/et.po @@ -256,3 +256,5 @@ msgstr "Geari sisend" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Veenduge, et rakendus %s oleks teie telefonis aktiivne." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maksimaalne tähemärkide arv (%d) on ületatud." \ No newline at end of file diff --git a/po/eu.po b/po/eu.po index 6101419..c92ad58 100644 --- a/po/eu.po +++ b/po/eu.po @@ -256,3 +256,5 @@ msgstr "Gear sarrera" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Ziurtatu %s aplikazioa telefonoan aktibo dagoela." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Gehienezko karaktere kopurua (%d) gainditu da." \ No newline at end of file diff --git a/po/fi.po b/po/fi.po index 3919efd..ede3969 100644 --- a/po/fi.po +++ b/po/fi.po @@ -256,3 +256,5 @@ msgstr "Gearin syöttö" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Varmista, että %s -sovellus on käynnissä puhelimessa." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Merkkien enimmäismäärä (%d) on ylitetty." \ No newline at end of file diff --git a/po/fr.po b/po/fr.po index 9ba7b8b..0f0cec8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -256,3 +256,5 @@ msgstr "Saisie de la Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Assurez-vous que l'application %s est active sur votre téléphone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Le nombre maximal de caractères (%d) a été dépassé." \ No newline at end of file diff --git a/po/fr_CA.po b/po/fr_CA.po index a926e61..e7233b3 100644 --- a/po/fr_CA.po +++ b/po/fr_CA.po @@ -256,3 +256,5 @@ msgstr "Saisie de la Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Assurez-vous que l'application %s est active sur votre téléphone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Le nombre maximal de caractères (%d) a été dépassé." \ No newline at end of file diff --git a/po/ga.po b/po/ga.po index 70ed706..ed7bfd4 100644 --- a/po/ga.po +++ b/po/ga.po @@ -256,3 +256,5 @@ msgstr "Ionchur Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Cinntigh go bhfuil an feidhmchlár %s gníomhach ar d'fhón." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Uaslíon na gcarachtar (%d) sáraithe." \ No newline at end of file diff --git a/po/gl.po b/po/gl.po index 831300c..3760442 100644 --- a/po/gl.po +++ b/po/gl.po @@ -256,3 +256,5 @@ msgstr "Entrada de Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Asegúrate de que a aplicación %s estea activa no teu teléfono." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Superouse o número máximo de caracteres (%d)." \ No newline at end of file diff --git a/po/hi.po b/po/hi.po index c080819..b1b3f25 100644 --- a/po/hi.po +++ b/po/hi.po @@ -256,3 +256,5 @@ msgstr "गियर इनपुट" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "सुनिश्चित करें कि आपके फोन पर %s एप सक्रिय है।" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "वर्णों की अधिकतम संख्या (%d) पार हो गई है।" \ No newline at end of file diff --git a/po/hr.po b/po/hr.po index f168589..514f251 100644 --- a/po/hr.po +++ b/po/hr.po @@ -256,3 +256,5 @@ msgstr "Unos za Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Provjerite je li aplikacija %s aktivna na vašem telefonu." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Premašen je maksimalni broj znakova (%d)." \ No newline at end of file diff --git a/po/hu.po b/po/hu.po index efbe276..ca5eda2 100644 --- a/po/hu.po +++ b/po/hu.po @@ -256,3 +256,5 @@ msgstr "Gear-bevitel" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Indítsa el a %s alkalmazást a telefonon." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Túllépte a karakterek maximális számát (%d)." \ No newline at end of file diff --git a/po/hy.po b/po/hy.po index 5ae818c..ce56265 100644 --- a/po/hy.po +++ b/po/hy.po @@ -256,3 +256,5 @@ msgstr "Gear-ի ներածում" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Համոզվեք, որ %s ծրագիրն ակտիվ է հեռախոսում:" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Նիշերի առավելագույն քանակը (%d) գերազանցվել է:" \ No newline at end of file diff --git a/po/is.po b/po/is.po index 84cc092..d601d66 100644 --- a/po/is.po +++ b/po/is.po @@ -256,3 +256,5 @@ msgstr "Gear inntak" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Gakktu úr skugga um að forritið %s sé virkt í símanum." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Hámarksfjölda stafa (%d) náð." \ No newline at end of file diff --git a/po/it_IT.po b/po/it_IT.po index 64b331b..868e769 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -256,3 +256,5 @@ msgstr "Inserimento Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Assicuratevi che l'applicazione %s sia attiva sul dispositivo." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Il numero massimo di caratteri (%d) è stato superato." \ No newline at end of file diff --git a/po/ja_JP.po b/po/ja_JP.po index 7d16f63..947a368 100644 --- a/po/ja_JP.po +++ b/po/ja_JP.po @@ -256,3 +256,5 @@ msgstr "Gear入力" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "端末で%sアプリが実行されていることを確認してください。" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "最大文字数(%d文字)を超えています。" \ No newline at end of file diff --git a/po/ka.po b/po/ka.po index 8461e81..f49e785 100644 --- a/po/ka.po +++ b/po/ka.po @@ -256,3 +256,5 @@ msgstr "Gear-ით შეყვანა" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "დარწმუნდით, რომ ტელეფონში აქტიურია %s აპლიკაცია." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "გადაჭარბებულია სიმბოლოების მაქსიმალური რაოდენობა (%d)." \ No newline at end of file diff --git a/po/kk.po b/po/kk.po index 34f6d99..052cbbf 100644 --- a/po/kk.po +++ b/po/kk.po @@ -256,3 +256,5 @@ msgstr "Gear енгізу" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "%s қолданбасының телефоныңызда қосулы екеніне көз жеткізіңіз." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Таңбалар ең көп (%d) санынан асып кетті." diff --git a/po/ko_KR.po b/po/ko_KR.po index f34f13a..1def068 100644 --- a/po/ko_KR.po +++ b/po/ko_KR.po @@ -256,3 +256,5 @@ msgstr "Gear 입력" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "폰에서 %s 앱이 실행되어 있는지 확인하세요." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "최대 글자 수(%d)를 초과했습니다." \ No newline at end of file diff --git a/po/lt.po b/po/lt.po index e78ef58..8ce18c8 100644 --- a/po/lt.po +++ b/po/lt.po @@ -256,3 +256,5 @@ msgstr "„Gear“ įvestis" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Įsitikinkite, kad telefone suaktyvinta %s programa." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Viršytas didžiausias simbolių skaičius (%d)." \ No newline at end of file diff --git a/po/lv.po b/po/lv.po index 3f0cfdf..d134eda 100644 --- a/po/lv.po +++ b/po/lv.po @@ -256,3 +256,5 @@ msgstr "Gear Input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Aktivizējiet tālrunī programmu %s." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Pārsniegts maksimālais rakstzīmju skaits (%d)." \ No newline at end of file diff --git a/po/mk.po b/po/mk.po index 15989b0..e790aba 100644 --- a/po/mk.po +++ b/po/mk.po @@ -256,3 +256,5 @@ msgstr "Внес на Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Осигурете се дека апликацијата %s е активна на телефонот." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Надминат е максималниот број на знаци (%d)." \ No newline at end of file diff --git a/po/nb.po b/po/nb.po index a90f2d9..68e2219 100644 --- a/po/nb.po +++ b/po/nb.po @@ -256,3 +256,5 @@ msgstr "Gear-inndata" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Pass på at %s-appen er aktiv på telefonen." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maksimalt antall tegn (%d) er oversteget." \ No newline at end of file diff --git a/po/nl.po b/po/nl.po index 45a5965..0ad134f 100644 --- a/po/nl.po +++ b/po/nl.po @@ -256,3 +256,5 @@ msgstr "Invoer Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Controleer of de app %s actief is op uw telefoon." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maximumaantal tekens (%d) overschreden." \ No newline at end of file diff --git a/po/pl.po b/po/pl.po index 3baec11..99b3b99 100644 --- a/po/pl.po +++ b/po/pl.po @@ -256,3 +256,5 @@ msgstr "Wprowadzanie Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Upewnij się, że aplikacja %s jest aktywna w telefonie." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Przekroczono maksymalną liczbę znaków (%d)." \ No newline at end of file diff --git a/po/pt_BR.po b/po/pt_BR.po index ae1e3b4..42cabcc 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -256,3 +256,5 @@ msgstr "Entrada do Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Verifique se o aplicativo %s está ativo no telefone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "O número máximo de caracteres (%d) foi excedido." \ No newline at end of file diff --git a/po/pt_PT.po b/po/pt_PT.po index 884d706..bf861e9 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -256,3 +256,5 @@ msgstr "Introdução do Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Certifique-se de que a aplicação %s está activa no seu telefone." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Número máximo de caracteres (%d) excedido." \ No newline at end of file diff --git a/po/ro.po b/po/ro.po index 24ccaa6..f449e08 100644 --- a/po/ro.po +++ b/po/ro.po @@ -256,3 +256,5 @@ msgstr "Introducere prin dispozitivul Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Asiguraţi-vă că aplicaţia %s este activă pe telefon." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "A fost depășit numărul maxim de caractere (%d)." \ No newline at end of file diff --git a/po/ru_RU.po b/po/ru_RU.po index c2abf82..f15c9d5 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -256,3 +256,5 @@ msgstr "Gear Input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "На телефоне должно быть запущено приложение %s." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Превышено максимальное число символов (%d)." \ No newline at end of file diff --git a/po/sk.po b/po/sk.po index 5769a1c..b805618 100644 --- a/po/sk.po +++ b/po/sk.po @@ -256,3 +256,5 @@ msgstr "Vstup cez Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Skontrolujte, či je v telefóne aktívna aplikácia %s." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Prekročil sa maximálny počet znakov (%d)." \ No newline at end of file diff --git a/po/sl.po b/po/sl.po index a272122..0c2b3dd 100644 --- a/po/sl.po +++ b/po/sl.po @@ -256,3 +256,5 @@ msgstr "Vnos z napravo Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Preverite, ali je aplikacija %s aktivna v telefonu." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Največje dovoljeno število znakov (%d) je preseženo." \ No newline at end of file diff --git a/po/sr.po b/po/sr.po index 529528c..21f2542 100644 --- a/po/sr.po +++ b/po/sr.po @@ -256,3 +256,5 @@ msgstr "Unos za Gear" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Proverite da li je aplikacija %s aktivna na telefonu." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Prekoračen je maksimalan broj karaktera (%d)." \ No newline at end of file diff --git a/po/sv.po b/po/sv.po index a1e779b..0f60ae1 100644 --- a/po/sv.po +++ b/po/sv.po @@ -256,3 +256,5 @@ msgstr "Gear-inmatning" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Se till att programmet %s är aktivt på telefonen." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Max antal tecken (%d) överskreds." \ No newline at end of file diff --git a/po/tr_TR.po b/po/tr_TR.po index b98bbb5..a915b97 100644 --- a/po/tr_TR.po +++ b/po/tr_TR.po @@ -256,3 +256,5 @@ msgstr "Gear Girişi" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "%s uygulamasının telefonunuzda etkin olduğundan emin olun." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Maksimum karakter sayısı (%d) aşıldı." \ No newline at end of file diff --git a/po/uk.po b/po/uk.po index 8a8cb5d..7619449 100644 --- a/po/uk.po +++ b/po/uk.po @@ -256,3 +256,5 @@ msgstr "Gear Input" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "На телефоні потрібно відкрити програму %s." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Перевищено максимальну кількість символів (%d)." \ No newline at end of file diff --git a/po/uz.po b/po/uz.po index 2e51f8f..d29f33a 100644 --- a/po/uz.po +++ b/po/uz.po @@ -256,3 +256,5 @@ msgstr "Gear kiritish" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "Telefonda %s ilovasi yoqilganligiga ishonch hosil qiling." +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "Belgilar soni maksimal miqdordan (%d) oshib ketdi." \ No newline at end of file diff --git a/po/zh_CN.po b/po/zh_CN.po index 65f4abf..15551c6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -256,3 +256,5 @@ msgstr "Gear 输入" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "请确保 %s 应用程序已在您的手机上运行。" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "已超过字符数上限 (%d)。" \ No newline at end of file diff --git a/po/zh_HK.po b/po/zh_HK.po index e72d325..0078af9 100644 --- a/po/zh_HK.po +++ b/po/zh_HK.po @@ -256,3 +256,5 @@ msgstr "Gear 輸入" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "請確保 %s 應用程式已在手機上啟動。" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "已超過字元數目上限 (%d)。" \ No newline at end of file diff --git a/po/zh_TW.po b/po/zh_TW.po index bcd1d7d..a798590 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -256,3 +256,5 @@ msgstr "Gear 輸入" msgid "WDS_WMGR_POP_MAKE_SURE_THE_PS_APP_IS_ACTIVE_ON_YOUR_PHONE" msgstr "請確認手機上已執行 %s 應用程式。" +msgid "WDS_MSG_BODY_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_EXCEEDED" +msgstr "已超過字數上限 (%d)。" \ No newline at end of file diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 7fe4860..9da2294 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -35,6 +35,7 @@ bool input_keyboard_init(app_control_h app_control) char *default_text = NULL; char *guide_text = NULL; char *return_key_type = NULL; + char *max_text_length = NULL; input_keyboard_deinit(); @@ -50,6 +51,10 @@ bool input_keyboard_init(app_control_h app_control) if (ret == APP_CONTROL_ERROR_NONE) { g_input_keyboard_data.return_key_type = return_key_type; } + ret = app_control_get_extra_data(app_control, "max_text_length", &max_text_length); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.max_text_length = atoi(max_text_length); + } return true; } @@ -68,6 +73,7 @@ void input_keyboard_deinit(void) g_input_keyboard_data.default_text = NULL; g_input_keyboard_data.guide_text = NULL; g_input_keyboard_data.return_key_type = NULL; + g_input_keyboard_data.max_text_length = KEYBOARD_EDITOR_CHAR_COUNT_MAX; return; } @@ -110,6 +116,9 @@ static Eina_Bool custom_back_cb(void *data, Elm_Object_Item *it) static void maxlength_cb(void *data, Evas_Object *obj, void *event_info) { LOGD("maxlength_cb : size = %d", KEYBOARD_EDITOR_CHAR_COUNT_MAX); + char text[512]; + snprintf(text, sizeof(text), _(MAX_TEXT_LENGTH_REACH), g_input_keyboard_data.max_text_length); + show_popup_toast((const char *)text, false); } static void enter_keydown_cb(void *data, Evas_Object *obj, void *event_info) @@ -141,7 +150,7 @@ void create_fullscreen_editor(void *data) entry = elm_entry_add(box); static Elm_Entry_Filter_Limit_Size limit_filter_data; - limit_filter_data.max_char_count = KEYBOARD_EDITOR_CHAR_COUNT_MAX; + limit_filter_data.max_char_count = g_input_keyboard_data.max_text_length; elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data); evas_object_smart_callback_add(entry, "maxlength,reached", maxlength_cb, data); @@ -205,7 +214,7 @@ static Evas_Object *create_multiline_editfield_layout(Evas_Object *parent, void entry = elm_entry_add(editfield); static Elm_Entry_Filter_Limit_Size limit_filter_data; - limit_filter_data.max_char_count = KEYBOARD_EDITOR_CHAR_COUNT_MAX; + limit_filter_data.max_char_count = g_input_keyboard_data.max_text_length; elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data); evas_object_smart_callback_add(entry, "maxlength,reached", maxlength_cb, data); diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index ac682cc..820299c 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -913,7 +913,8 @@ static char *__get_genlist_title_label(void *data, Evas_Object *obj, const char char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) { - char text[128] = {0, }; + const int BUF_LEN = 128; + char text[BUF_LEN] = {'\0', }; if(!strcmp(part, "elm.text")) { @@ -928,12 +929,10 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) if(p) { strncpy(text, s, p-s); } else { - strncpy(text, s, strlen(s)); - text[strlen(s)] = '\0'; + snprintf(text, BUF_LEN, "%s", s); } } else { - strncpy(text, "", strlen("")); - text[strlen("")] = '\0'; + snprintf(text, BUF_LEN, "%s", ""); } } return strdup(text); @@ -965,12 +964,10 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) if(p) { strncpy(text, p+1, strlen(s)-(p-s)-2); } else { - strncpy(text, s, strlen(s)); - text[strlen(s)] = '\0'; + snprintf(text, BUF_LEN, "%s", s); } } else { - strncpy(text, "", strlen("")); - text[strlen("")] = '\0'; + snprintf(text, BUF_LEN, "%s", ""); } return strdup(text); } -- 2.7.4 From af4b014f6e2927f7ac6fb44c94c175e34ac9e0c9 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 18 Jul 2017 19:04:07 +0900 Subject: [PATCH 03/16] Update package version to 0.1.170718 Change-Id: Iafac823f5f67487f81d47a25c0d7b22a5ef3198b 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 ccb38de..bad1540 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 8063566..47f117f 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -9,7 +9,7 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.1.170620 +Version: 0.1.170718 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From ef5da1fb757f5035a36869652cd6d561f829f075 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 20 Jul 2017 13:45:02 +0900 Subject: [PATCH 04/16] adopt the return type for caller to send button in keyboard mode Change-Id: I016683204d21ed5c3ef14c0569c41fde9e61a406 Signed-off-by: sungwook79.park --- src/w-input-keyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 9da2294..cd6356f 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -34,7 +34,7 @@ bool input_keyboard_init(app_control_h app_control) int ret = -1; char *default_text = NULL; char *guide_text = NULL; - char *return_key_type = NULL; + char *return_key_type = "SEND"; char *max_text_length = NULL; input_keyboard_deinit(); @@ -72,7 +72,7 @@ void input_keyboard_deinit(void) g_input_keyboard_data.default_text = NULL; g_input_keyboard_data.guide_text = NULL; - g_input_keyboard_data.return_key_type = NULL; + g_input_keyboard_data.return_key_type = "SEND"; g_input_keyboard_data.max_text_length = KEYBOARD_EDITOR_CHAR_COUNT_MAX; return; @@ -170,7 +170,7 @@ void create_fullscreen_editor(void *data) elm_box_pack_end(box, entry); Evas_Object *btn = elm_button_add(box); - elm_object_text_set(btn, "SEND"); + elm_object_text_set(btn, g_input_keyboard_data.return_key_type); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.5); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, NULL); -- 2.7.4 From 14f0deffe01d498bf18693417fac9f5b9a38ad0a Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 25 Jul 2017 13:35:20 +0900 Subject: [PATCH 05/16] Add drawing feature in emoticon input mode Change-Id: I58785c2289022243bc36a36e6623403c32d3abef Signed-off-by: sungwook79.park --- res/wearable/edje/w-input-selector.edc | 143 ++++++++++++++++++++++++++++++++- res/wearable/edje/w-input-stt.edc | 41 ++++++++++ src/w-input-emoticon.cpp | 113 +++++++++++++++++++++++--- 3 files changed, 283 insertions(+), 14 deletions(-) diff --git a/res/wearable/edje/w-input-selector.edc b/res/wearable/edje/w-input-selector.edc index c00e082..9be1ffa 100755 --- a/res/wearable/edje/w-input-selector.edc +++ b/res/wearable/edje/w-input-selector.edc @@ -805,4 +805,145 @@ collections { } ) } -} + } + +// ------------------------------------------------Drawing ---------------------------------------------// + styles{ + style { + name: "list_text_drawing_normal"; + base: "font=Tizen:style=Regular font_size=36 align=left color=#FFFFFF color_class=AT021 wrap=word text_class=AT021"; + } + } + + images { + image, "./fadeout_masking.#.png" COMP; + } + + group { + name: "elm/genlist/item/drawing/default"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "texts" "elm.text"; + data.item: "contents" "base elm.icon"; + data.item: "vi_effect" "on"; + data.item: "dim" "off"; + data.item: "focus_bg" "off"; + + parts { + PART_LIST_BG + PART_LIST_PADDINGS( + 0, 0, + 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.padding.text.left_a"; + type: SPACER; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + min: (30+76+24) 0; + max: (30+76+24) 51; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 1.0 1.0; to_x: "elm.padding.left"; to_y: "elm.padding.top"; } + rel2 { relative: 1.0 0.0; to_x: "elm.padding.left"; to_y: "elm.padding.bottom"; } + } + } + part { + name: "elm.padding.text.left_b"; + type: SPACER; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + min: (360-30) 0; + max: (360-30) 51; + fixed: 1 0; + align: 0.0 0.5; + rel1 { relative: 1.0 1.0; to_x: "elm.padding.left"; to_y: "elm.padding.top"; } + rel2 { relative: 1.0 0.0; to_x: "elm.padding.left"; to_y: "elm.padding.bottom"; } + } + } + + part { + name: "elm.text"; + type: TEXTBLOCK; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + min: 0 48; + max: -1 48; + fixed: 0 1; + align: 0.5 0.5; + text { + min: 0 1; + max: 1 1; + ellipsis: -1.0; + fade_ellipsis: 1.0; + style: "list_text_drawing_normal"; + } + rel1 { relative: 1.0 1.0; to_x: "elm.padding.text.left_a"; to_y: "elm.padding.top"; } + rel2 { relative: 1.0 0.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.bottom"; } + } + } + + part { + name: "fadeout"; + type: IMAGE; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + align: 1.0 0.5; + min: 49 44; + max: 49 44; + fixed: 1 1; + rel1 { relative: 1.0 1.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.top"; } + rel2 { relative: 1.0 0.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.bottom"; } + image.normal: "./fadeout_masking.#.png"; + color: 0 0 0 10; + } + } + + part { + name: "elm.padding.icon.left"; + type: SPACER; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + min: 24 0; + max: 24 51; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 1.0; to_x: "elm.text"; to_y: "elm.padding.top"; } + rel2 { relative: 0.0 0.0; to_x: "elm.text"; to_y: "elm.padding.bottom"; } + } + } + + part { + name: "elm.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 1.0 0.5; + fixed: 1 1; + min: 76 76; + max: 76 76; + rel1 { relative: 0.0 1.0; to_x: "elm.padding.icon.left"; to_y: "elm.padding.top"; } + rel2 { relative: 0.0 0.0; to_x: "elm.padding.icon.left"; to_y: "elm.padding.bottom"; } + } + } + } + } diff --git a/res/wearable/edje/w-input-stt.edc b/res/wearable/edje/w-input-stt.edc index 082731d..13168ba 100755 --- a/res/wearable/edje/w-input-stt.edc +++ b/res/wearable/edje/w-input-stt.edc @@ -58,6 +58,7 @@ collections image, "./tw_bottom_btn_bg.png" COMP; image, "./w_mode_ic_bg.png" COMP; + image, "./wi_drawing_bg.png" COMP; image, "./b_stt_text_fade_out.png" COMP; image, "./b_stt_icon_btn.png" COMP; @@ -433,6 +434,21 @@ collections name: "AT023D"; color: 0 0 0 40; } + color_class + { + name: "AO0391"; + color: 0 151 207 100; + } + color_class + { + name: "AO0391P"; + color: 0 0 0 50; + } + color_class + { + name: "AO0391D"; + color: 0 0 0 40; + } } styles @@ -1903,6 +1919,31 @@ collections } } + group { name: "elm/button/base/ime_button_drawing"; + 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: "AO0391"; + visible: 1; + image.normal: "./wi_drawing_bg.png"; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO0391P"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "AO0391D"; + } + } + } + } + group { name: "elm/button/base/ime_button_stt_confirm"; inherit: "elm/button/base/ime_button"; parts { diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 4bd585b..a7f9a9c 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -49,6 +49,7 @@ typedef struct { static Elm_Object_Item *it_emoticon_empty = NULL; static Elm_Object_Item *it_emoticon_recent_group = NULL; static Elm_Object_Item *it_emoticon_emoji_group = NULL; +static Elm_Object_Item* it_drawing = NULL; static Elm_Object_Item *it_last = NULL; static Elm_Genlist_Item_Class *itc_emoticon = NULL; @@ -72,6 +73,7 @@ typedef struct emoticon_content } emoticon_content_s; static emoticon_content_s emoticon_contents_pool[EMOTICON_CNT] = { 0, }; +static emoticon_content_s emoticon_drawing_pool = { 0, }; static emoticon_content_s emoticon_recents_pool[RECENT_CNT] = { 0, }; @@ -278,6 +280,11 @@ static Eina_Bool _custom_back_cb2(void *data, Elm_Object_Item *it) lazy_loading_timer_for_contents = NULL; } + if(emoticon_drawing_pool.used == 0){ + evas_object_del(emoticon_drawing_pool.content); + } + emoticon_drawing_pool.content = NULL; + //Recent EMOTICONS : the recent emoiton need to be updated whenever emoticon view is generated, so deleted here. for (i=0;i< RECENT_CNT;i++) { @@ -361,6 +368,44 @@ void set_recent_emoticons(vector &emoticon_list, int val) if (PREFERENCE_ERROR_NONE != ret) { PRINTFUNC(DLOG_ERROR, "preference_set_string error!(%d)", ret); } + +} + +static void _drawing_app_control_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) +{ + char* path = NULL; + app_control_get_extra_data(reply, APP_CONTROL_DATA_PATH, &path); + + if(path){ + PRINTFUNC(DLOG_DEBUG, "path=%s", path); + free(path); + reply_to_sender_by_callback((const char*)path, "image", NULL); + } + ui_app_exit(); +} + +static void _drawing_item_clicked_cb(void *data, Evas_Object * obj, void *event_info) +{ + PRINTFUNC(DLOG_DEBUG, "%s", __func__); + App_Data* ad = (App_Data*) data; + if (!ad) + return; + + Elm_Object_Item *item = (Elm_Object_Item *) event_info; + if (item) + elm_genlist_item_selected_set(item, EINA_FALSE); + + /* launch */ + app_control_h request = NULL; + app_control_create(&request); + app_control_set_app_id(request, "com.samsung.sketch"); + //app_control_set_app_id(request, "wearable-input.sketch"); + + int ret = app_control_send_launch_request(request, _drawing_app_control_reply_cb, NULL); + if (ret != APP_CONTROL_ERROR_NONE) { + PRINTFUNC(DLOG_DEBUG, "error code = 0x%x", ret); + } + app_control_destroy(request); } static void _emoticon_item_clicked_cb(void *data, Evas_Object * obj, void *event_info) @@ -442,7 +487,6 @@ static void _emoticon_gl_lang_changed(void *data, Evas_Object *obj, void *event_ static char * __emoticon_gl_text_get(void *data, Evas_Object *obj, const char *part) { //PRINTFUNC(DLOG_DEBUG,"part = %s", part); - const char* str = (const char*) data; if (!str) return NULL; @@ -460,7 +504,7 @@ static void _emoticon_gl_content_unswallowed_cb(void *data, Evas_Object *obj, vo const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(it); -// PRINTFUNC(DLOG_DEBUG,"%s - stype[%s]", __func__, itc->item_style); + //PRINTFUNC(DLOG_DEBUG,"%s - stype[%s]", __func__, itc->item_style); if (!strcmp(itc->item_style, "3button_flat")) { int index = (uintptr_t)elm_object_item_data_get(it); //PRINTFUNC(DLOG_DEBUG,"it = %p", it); @@ -488,16 +532,55 @@ static void _emoticon_gl_content_unswallowed_cb(void *data, Evas_Object *obj, vo if (index + 2 < recent_emoji_list.size()) { emoticon_recents_pool[index+2].used = 0; } + } else if (it_drawing == it) { + //PRINTFUNC(DLOG_DEBUG,"it_drawing = %p", it_drawing); + emoticon_drawing_pool.used = 0; } } +static Evas_Object * __emoticon_gl_1_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(); + if (_WEARABLE) + path = path + "wearable/"; + else if (_TV) + path = path + "tv/"; + else + path = path + "mobile/"; + + elm_object_style_set(btn, "ime_button_drawing"); + string path_ic = path + "images/wi_drawing_icon.png"; + PRINTFUNC(DLOG_DEBUG, "path_ic = %s", path_ic.c_str()); + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + + emoticon_drawing_pool.index = 0; + emoticon_drawing_pool.content = btn; + emoticon_drawing_pool.used = 0; + 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 * __emoticon_gl_recent_content_get(void *data, Evas_Object *obj, const char *part) { if (is_content_reuse_on) { unsigned int index = (uintptr_t)data; int new_index = 0; - //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index); + //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index); if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { if (!strcmp(part, "elm.icon.1")) { if (index >= recent_emoji_list.size()) return NULL; @@ -523,7 +606,7 @@ static Evas_Object * __emoticon_gl_recent_content_get(void *data, Evas_Object *o unsigned int index = (uintptr_t)data; int new_index = 0; - // PRINTFUNC(DLOG_DEBUG,"%s %d", part, index); + //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index); if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { if (!strcmp(part, "elm.icon.1")) { if (index >= recent_emoji_list.size()) return NULL; @@ -548,7 +631,6 @@ static Evas_Object * __emoticon_gl_recent_content_get(void *data, Evas_Object *o static Evas_Object * __emoticon_gl_emoticon_content_get(void *data, Evas_Object *obj, const char *part) { //PRINTFUNC(DLOG_DEBUG,"%s", __func__); - if (is_content_reuse_on) { int index = (uintptr_t)data; int new_index = 0; @@ -614,7 +696,6 @@ static Evas_Object * __emoticon_gl_emoticon_content_get(void *data, Evas_Object return NULL; } - void _create_reusable_recents(Evas_Object *parent) { if (!parent) { @@ -802,8 +883,14 @@ void _update_emoticon_items(void *data) itc_dummy->func.state_get = NULL; itc_dummy->func.del = NULL; - Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new(); + Elm_Genlist_Item_Class *itc_1text_1icon = elm_genlist_item_class_new(); + itc_1text_1icon->item_style = "drawing"; + itc_1text_1icon->func.text_get = __emoticon_gl_text_get; + itc_1text_1icon->func.content_get = __emoticon_gl_1_content_get; + itc_1text_1icon->func.state_get = NULL; + itc_1text_1icon->func.del = NULL; + Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new(); itc_group->item_style = "groupindex"; itc_group->func.text_get = __emoticon_gl_text_get; itc_group->func.content_get = NULL; @@ -811,9 +898,6 @@ void _update_emoticon_items(void *data) itc_group->func.del = NULL; Elm_Genlist_Item_Class *itc_recent = elm_genlist_item_class_new(); - if (is_content_reuse_on) { -// itc_recent->content_reusable = EINA_TRUE; - } itc_recent->item_style = "3button_flat_recent"; itc_recent->func.text_get = NULL; itc_recent->func.content_get = __emoticon_gl_recent_content_get; @@ -821,9 +905,6 @@ void _update_emoticon_items(void *data) itc_recent->func.del = NULL; itc_emoticon = elm_genlist_item_class_new(); - if (is_content_reuse_on) { -// itc_emoticon->content_reusable = EINA_TRUE; - } itc_emoticon->item_style = "3button_flat"; itc_emoticon->func.text_get = NULL; itc_emoticon->func.content_get = __emoticon_gl_emoticon_content_get; @@ -833,6 +914,10 @@ void _update_emoticon_items(void *data) // dummy title for empty space it_emoticon_empty = elm_genlist_item_append(gl, itc_dummy, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + // Drawing + it_drawing = elm_genlist_item_append(gl, itc_1text_1icon, "Doodle", NULL, ELM_GENLIST_ITEM_NONE, _drawing_item_clicked_cb, (void *)app_data); + first_it = it_drawing; + if (recent_emoji_list.size() > 0) { if (is_content_reuse_on) { _create_reusable_recents(gl); @@ -877,6 +962,7 @@ void _update_emoticon_items(void *data) elm_genlist_item_class_free(itc_recent); elm_genlist_item_class_free(itc_group); + elm_genlist_item_class_free(itc_1text_1icon); elm_genlist_item_class_free(itc_dummy); } @@ -889,6 +975,7 @@ void ise_show_emoticon_list(void *data) it_emoticon_empty = NULL; it_emoticon_recent_group = NULL; it_emoticon_emoji_group = NULL; + it_drawing = NULL; it_last = NULL; get_recent_emoticons(recent_emoji_list); -- 2.7.4 From 5b633f28bf048df0eccebc99445cd118ad9c6c66 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 25 Jul 2017 19:01:06 +0900 Subject: [PATCH 06/16] Fix issue detected by static analysis tool Change-Id: I0f272e71f07c1b11d3927312442f3b75b0caa91a Signed-off-by: Jihoon Kim --- src/w-input-stt-voice.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 820299c..3f8e754 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -569,14 +569,13 @@ static Eina_Bool _idler_cb(void *data) Evas_Object *canvas = elm_object_part_content_get(voicedata->layout_main, "EFFECT_BG"); is::ui::WInputSttMicEffect *ieffect = new is::ui::WInputSttMicEffect(); - if (ieffect) + if (ieffect) { ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle()); - is::ui::MicEffector *effector = new is::ui::MicEffector(canvas, voicedata->layout_main, *ieffect); - voicedata->ieffect = ieffect; - voicedata->effector = effector; + is::ui::MicEffector *effector = new is::ui::MicEffector(canvas, voicedata->layout_main, *ieffect); + voicedata->ieffect = ieffect; + voicedata->effector = effector; - if (ieffect) { ieffect->SetProgressBar(voicedata->progressbar); ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle()); } -- 2.7.4 From 8f56e97798140f71b25e8ea2bea68e32035c5b02 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 26 Jul 2017 16:44:23 +0900 Subject: [PATCH 07/16] Adopt the package name that changed to org.tizen.sketch when calling drawing function Change-Id: Ief78b3a6ddc00c2b7de89ea661cdceb5e89a3ce2 Signed-off-by: sungwook79.park --- src/w-input-emoticon.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index a7f9a9c..995a955 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -398,8 +398,7 @@ static void _drawing_item_clicked_cb(void *data, Evas_Object * obj, void *event_ /* launch */ app_control_h request = NULL; app_control_create(&request); - app_control_set_app_id(request, "com.samsung.sketch"); - //app_control_set_app_id(request, "wearable-input.sketch"); + app_control_set_app_id(request, "org.tizen.sketch"); int ret = app_control_send_launch_request(request, _drawing_app_control_reply_cb, NULL); if (ret != APP_CONTROL_ERROR_NONE) { -- 2.7.4 From 795bc9917b27c02fce3e6caa1578d59035b167af Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 31 Jul 2017 13:56:43 +0900 Subject: [PATCH 08/16] Modify the operation for app control to path for image input Change-Id: I15b9cd62c811e29ef6be405ed778ad7210ddd797 Signed-off-by: sungwook79.park --- src/w-input-emoticon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 995a955..ea1140a 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -378,8 +378,9 @@ static void _drawing_app_control_reply_cb(app_control_h request, app_control_h r if(path){ PRINTFUNC(DLOG_DEBUG, "path=%s", path); + char *pathes[] = {path, }; + reply_to_sender_by_callback(NULL, "image", (const char **)pathes); free(path); - reply_to_sender_by_callback((const char*)path, "image", NULL); } ui_app_exit(); } -- 2.7.4 From b1ad982d7d88ca1280fb36217816cd5758c78f2a Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 31 Jul 2017 15:46:01 +0900 Subject: [PATCH 09/16] Fix issue that detected by static analysis tool Change-Id: I4b6698fff33df9a627943ec0c9e8315adadacaf6 Signed-off-by: sungwook79.park --- inc/w-input-stt-voice.h | 1 + src/w-input-stt-ise.cpp | 2 +- src/w-input-stt-voice.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/inc/w-input-stt-voice.h b/inc/w-input-stt-voice.h index 435b4f9..685f252 100755 --- a/inc/w-input-stt-voice.h +++ b/inc/w-input-stt-voice.h @@ -76,6 +76,7 @@ #define EVAS_CANDIDATE_LAYER 32000 +int init_voicedata(VoiceData *r_voicedata); int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata); int is_lang_supported_by_stt(char lang[]); Evas_Object *show_voice_window(Evas_Object *parent, VoiceData *voicedata); diff --git a/src/w-input-stt-ise.cpp b/src/w-input-stt-ise.cpp index da6e71f..3dab87d 100755 --- a/src/w-input-stt-ise.cpp +++ b/src/w-input-stt-ise.cpp @@ -49,7 +49,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)( PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__); return; } - memset(my_voicedata, 0, sizeof(VoiceData)); + init_voicedata(my_voicedata); } if (my_voicedata) { diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 3f8e754..77b8bb1 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1770,6 +1770,44 @@ int is_lang_supported_by_stt(char lang[]) return FALSE; } +int init_voicedata(VoiceData *r_voicedata) +{ + VoiceData *voicedata = (VoiceData *)r_voicedata; + if (!voicedata) { + return FALSE; + } + + voicedata->voicefw_state = 0; + voicedata->voicefw_handle = NULL; + voicedata->naviframe = NULL; + voicedata->layout_main = NULL; + voicedata->progressbar = NULL; + voicedata->scroller = NULL; + voicedata->main_entry = NULL; + voicedata->mic_button = NULL; + voicedata->state = STT_STATE_VAL_INIT; + voicedata->kbd_lang = NULL; + voicedata->start_timer = NULL; + voicedata->refresh_timer = NULL; + voicedata->progressbar_timer = NULL; + voicedata->textblock_timer = NULL; + voicedata->guide_text_timer = NULL; + voicedata->btn_disabling_timer = NULL; + voicedata->power_unlock_timer = NULL; + + voicedata->stt_results.clear(); + voicedata->partial_result = NULL; + voicedata->result_type = 0; + voicedata->disclaimer = 0; + voicedata->mo = NULL; + voicedata->sttfeedback = NULL; + voicedata->sttmanager = NULL; + voicedata->ieffect = NULL; + voicedata->effector = NULL; + + return TRUE; +} + int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata) { PRINTFUNC(DLOG_DEBUG, "[init_voice]"); -- 2.7.4 From d820c96713094f1d9c9ad0278f9055bdfc71b313 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 1 Aug 2017 09:41:13 +0900 Subject: [PATCH 10/16] Modify the operation of app control for prediction hint Change-Id: I2bbc82e6aae5d37a2339bf7e294c6880af5ff989 Signed-off-by: sungwook79.park --- src/w-input-smartreply.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/w-input-smartreply.cpp b/src/w-input-smartreply.cpp index aae5a0e..3a0624a 100644 --- a/src/w-input-smartreply.cpp +++ b/src/w-input-smartreply.cpp @@ -147,10 +147,10 @@ bool input_smartreply_init(app_control_h app_control) */ ret = app_control_get_extra_data(app_control, - "template_context", &message); + APP_CONTROL_DATA_INPUT_PREDICTION_HINT, &message); if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_WARN, "Can not get template_context %d", ret); + PRINTFUNC(DLOG_WARN, "Can not get APP_CONTROL_DATA_INPUT_PREDICTION_HINT %d", ret); return false; } -- 2.7.4 From 1e84304beb0ae72a1b49a07d62a73aeac2308fce Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 2 Aug 2017 17:52:08 +0900 Subject: [PATCH 11/16] Adopt to execute app control with mime type Change-Id: I9fac1058198ea2c588d1c7f0985627d63905bed3 Signed-off-by: sungwook79.park --- inc/w-input-emoticon.h | 1 + inc/w-input-selector.h | 10 ++++++++++ org.tizen.inputdelegator.xml | 1 + src/w-input-emoticon.cpp | 30 ++++++++++++++++++++++-------- src/w-input-selector.cpp | 11 ++++++++++- 5 files changed, 44 insertions(+), 9 deletions(-) diff --git a/inc/w-input-emoticon.h b/inc/w-input-emoticon.h index 709fd76..047081a 100755 --- a/inc/w-input-emoticon.h +++ b/inc/w-input-emoticon.h @@ -17,6 +17,7 @@ #define W_INPUT_EMOTICON_H_ void ise_show_emoticon_list(void *data); +void launch_drawing_app(void *data); #endif /* W_INPUT_EMOTICON_H_ */ diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index c5afd21..e79cbf5 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -52,6 +52,8 @@ enum { APP_TYPE_REPLY, APP_TYPE_HANDWRITING, APP_TYPE_KEYBOARD, + APP_TYPE_DRAWING, + APP_TYPE_RECORDING, }; enum { @@ -59,6 +61,13 @@ enum { REPLY_APP_CONTROL, }; +enum { + MIME_TYPE_ALL = 0, + MIME_TYPE_IMAGE, + MIME_TYPE_AUDIO, + MIME_TYPE_TEXT, +}; + typedef enum { TIZEN_PROFILE_UNKNOWN = 0, TIZEN_PROFILE_MOBILE = 0x1, @@ -88,6 +97,7 @@ typedef struct appdata{ app_control_h source_app_control; int app_type; + int mime_type; int reply_type; char* res_path; char* shared_res_path; diff --git a/org.tizen.inputdelegator.xml b/org.tizen.inputdelegator.xml index bad1540..5b2829b 100755 --- a/org.tizen.inputdelegator.xml +++ b/org.tizen.inputdelegator.xml @@ -10,6 +10,7 @@ + diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index ea1140a..a2ab3c9 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -883,12 +883,15 @@ void _update_emoticon_items(void *data) itc_dummy->func.state_get = NULL; itc_dummy->func.del = NULL; - Elm_Genlist_Item_Class *itc_1text_1icon = elm_genlist_item_class_new(); - itc_1text_1icon->item_style = "drawing"; - itc_1text_1icon->func.text_get = __emoticon_gl_text_get; - itc_1text_1icon->func.content_get = __emoticon_gl_1_content_get; - itc_1text_1icon->func.state_get = NULL; - itc_1text_1icon->func.del = NULL; + Elm_Genlist_Item_Class *itc_1text_1icon = NULL; + if (app_data->mime_type == MIME_TYPE_ALL) { + itc_1text_1icon = elm_genlist_item_class_new(); + itc_1text_1icon->item_style = "drawing"; + itc_1text_1icon->func.text_get = __emoticon_gl_text_get; + itc_1text_1icon->func.content_get = __emoticon_gl_1_content_get; + itc_1text_1icon->func.state_get = NULL; + itc_1text_1icon->func.del = NULL; + } Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new(); itc_group->item_style = "groupindex"; @@ -915,8 +918,10 @@ void _update_emoticon_items(void *data) it_emoticon_empty = elm_genlist_item_append(gl, itc_dummy, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); // Drawing - it_drawing = elm_genlist_item_append(gl, itc_1text_1icon, "Doodle", NULL, ELM_GENLIST_ITEM_NONE, _drawing_item_clicked_cb, (void *)app_data); - first_it = it_drawing; + if (app_data->mime_type == MIME_TYPE_ALL) { + it_drawing = elm_genlist_item_append(gl, itc_1text_1icon, "Doodle", NULL, ELM_GENLIST_ITEM_NONE, _drawing_item_clicked_cb, (void *)app_data); + first_it = it_drawing; + } if (recent_emoji_list.size() > 0) { if (is_content_reuse_on) { @@ -989,3 +994,12 @@ void ise_show_emoticon_list(void *data) } _update_emoticon_items(emoticon_list); } + +void launch_drawing_app(void *data) +{ + App_Data* ad = (App_Data*) data; + if (!ad) + return; + + _drawing_item_clicked_cb(ad, NULL, NULL); +} diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index e22274d..8646781 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -1117,6 +1117,7 @@ void _app_service(app_control_h service, void* user_data) app_control_clone(&(app_data->source_app_control), service); app_data->reply_type = REPLY_APP_NORMAL; + app_data->mime_type = MIME_TYPE_ALL; ret = app_control_get_mime(service, &mime_type); if (ret != APP_CONTROL_ERROR_NONE) { @@ -1125,13 +1126,21 @@ void _app_service(app_control_h service, void* user_data) if (mime_type) { LOGD("mime type = %s", mime_type); if (!strncmp(mime_type, "image/", strlen("image/"))) { - + app_data->mime_type = MIME_TYPE_IMAGE; + app_data->app_type = APP_TYPE_DRAWING; + launch_drawing_app((void *)app_data); + if (mime_type) + free(mime_type); + goto ACTIVATE; } else if(!strncmp(mime_type, "audio/", strlen("audio/"))) { + app_data->mime_type = MIME_TYPE_AUDIO; app_data->app_type = APP_TYPE_STT; _stt_clicked_cb((void *)app_data, NULL, NULL); if (mime_type) free(mime_type); goto ACTIVATE; + } else if(!strncmp(mime_type, "text/", strlen("text/"))) { + app_data->mime_type = MIME_TYPE_TEXT; } } } -- 2.7.4 From db968048096c6791747016f6f5deaf5c371f1a03 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 21 Aug 2017 19:27:33 +0900 Subject: [PATCH 12/16] Fix issue that Black screen displayed when exiting Voice input screen Change-Id: I965ceca6ae0527cefffbeaa6b25093be1f8461e4 Signed-off-by: sungwook79.park --- src/MoreOption.cpp | 2 +- src/w-input-stt-voice.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/MoreOption.cpp b/src/MoreOption.cpp index 5159e0c..7550d75 100755 --- a/src/MoreOption.cpp +++ b/src/MoreOption.cpp @@ -131,7 +131,7 @@ void MoreOption::SetContentLayout(Evas_Object *content) { MoreOption *opt = (MoreOption *)data; VoiceData *vd = (VoiceData *) opt->voicedata; - if(vd->disclaimer == 1){ + if(vd->disclaimer == 1){ PRINTFUNC(DLOG_ERROR, "pop to top"); //inb case of (selector view -> disclaimer view-> stt view) if(opt->option_opened == EINA_FALSE){ diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 77b8bb1..d39c87c 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1631,6 +1631,13 @@ static Evas_Object *create_progressbar(Evas_Object *parent) return progressbar; } +static Eina_Bool _custom_back_cb(void *data, Elm_Object_Item *it) +{ + PRINTFUNC(DLOG_DEBUG, ""); + _back_to_genlist_for_selector(); + return EINA_TRUE; +} + static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) { PRINTFUNC(NO_PRINT, ""); @@ -1694,7 +1701,6 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) elm_object_part_content_set(layout_main, "EFFECT_BG", canvas); - // MIC Button Evas_Object *m_mic_button = elm_button_add(layout_main); elm_object_style_set(m_mic_button, "vic/micbutton"); @@ -1795,10 +1801,9 @@ int init_voicedata(VoiceData *r_voicedata) voicedata->btn_disabling_timer = NULL; voicedata->power_unlock_timer = NULL; - voicedata->stt_results.clear(); voicedata->partial_result = NULL; voicedata->result_type = 0; - voicedata->disclaimer = 0; + voicedata->disclaimer = 1; voicedata->mo = NULL; voicedata->sttfeedback = NULL; voicedata->sttmanager = NULL; @@ -1866,6 +1871,12 @@ static Eina_Bool init_view(void *data) if(voicedata == NULL) return ECORE_CALLBACK_CANCEL; + const char *item_style = NULL; + if (_WEARABLE) + item_style = "empty"; + Elm_Object_Item *nf_voice_item = elm_naviframe_item_push(voicedata->naviframe, NULL, NULL, NULL, NULL, item_style); + elm_naviframe_item_pop_cb_set(nf_voice_item, _custom_back_cb, NULL); + voicedata->layout_main = create_fullview(voicedata->naviframe, voicedata); if (voicedata->layout_main) { -- 2.7.4 From 0565f55d16d2dd3f6678e71f70cc1f5f7e9f2e1a Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 22 Aug 2017 10:38:48 +0900 Subject: [PATCH 13/16] update package version to 0.1.170822 Change-Id: I30ef4a038c05643c0eb523d17d7c06907b97b0f5 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 5b2829b..fd710e6 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 47f117f..493425d 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -9,7 +9,7 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.1.170718 +Version: 0.1.170822 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From 2be8b14bbc2d7ad3c6ec19f782c6591538df0954 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 22 Aug 2017 15:23:23 +0900 Subject: [PATCH 14/16] Initialize voidedata with new operation Change-Id: Ic191278ffd51bb6d2119e5a6eddcb8475352a037 Signed-off-by: sungwook79.park --- src/w-input-stt-ise.cpp | 2 +- src/w-input-stt-voice.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/w-input-stt-ise.cpp b/src/w-input-stt-ise.cpp index 3dab87d..db786c4 100755 --- a/src/w-input-stt-ise.cpp +++ b/src/w-input-stt-ise.cpp @@ -44,7 +44,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)( //stt_feedback_initialize(); if (!my_voicedata) { - my_voicedata = (VoiceData*)malloc(sizeof(VoiceData)); + my_voicedata = new VoiceData; if (my_voicedata == NULL) { PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__); return; diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index d39c87c..fb0c086 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1800,7 +1800,7 @@ int init_voicedata(VoiceData *r_voicedata) voicedata->guide_text_timer = NULL; voicedata->btn_disabling_timer = NULL; voicedata->power_unlock_timer = NULL; - + voicedata->stt_results.clear(); voicedata->partial_result = NULL; voicedata->result_type = 0; voicedata->disclaimer = 1; @@ -2040,7 +2040,7 @@ void on_destroy(VoiceData *r_voicedata) voicedata->sttfeedback = NULL; } - free(voicedata); + delete voicedata; } } -- 2.7.4 From 21979ed92d01c3c2b0088f3a6a938256e262fc8e Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 29 Aug 2017 10:10:26 +0900 Subject: [PATCH 15/16] Remove unused variables Change-Id: I9227819101e8f3a6330092080b9160a044e099c1 Signed-off-by: Jihoon Kim --- src/w-input-selector.cpp | 7 +------ src/w-input-smartreply.cpp | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 8646781..d72a097 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -210,7 +210,6 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info 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) { @@ -842,7 +841,6 @@ unsigned int _update_smartreply_items(void *user_data) Elm_Object_Item *first; Elm_Object_Item *menu; - Elm_Object_Item *pos; unsigned int i = 0; unsigned int len = 0; @@ -883,8 +881,6 @@ unsigned int _update_smartreply_items(void *user_data) itc->func.state_get = NULL; itc->func.del = NULL; - pos = menu; - for (i = 0; i < len; i++) { char *reply = "hello"; unsigned int j; @@ -898,7 +894,6 @@ unsigned int _update_smartreply_items(void *user_data) continue; PRINTFUNC(DLOG_DEBUG, "SmartReply = [%d]%s", i, reply); - for (j = 0; j < template_list.size(); j++) { const char *template_str; @@ -916,7 +911,7 @@ unsigned int _update_smartreply_items(void *user_data) if (matched == true) continue; - pos = elm_genlist_item_append(app_data->genlist, + elm_genlist_item_append(app_data->genlist, itc, (void *)(uintptr_t)i, NULL, diff --git a/src/w-input-smartreply.cpp b/src/w-input-smartreply.cpp index 3a0624a..aa1f5e6 100644 --- a/src/w-input-smartreply.cpp +++ b/src/w-input-smartreply.cpp @@ -317,8 +317,6 @@ bool input_smartreply_get_reply(void) bool input_smartreply_get_reply_async(void) { - int ret; - if (g_input_smartreply_data == NULL) { PRINTFUNC(DLOG_ERROR, "InputSmartreplyData uninitialized"); return false; @@ -334,7 +332,7 @@ bool input_smartreply_get_reply_async(void) return false; } - ret = smartreply_service_get_replies_async(g_input_smartreply_data->caller_id, + smartreply_service_get_replies_async(g_input_smartreply_data->caller_id, g_input_smartreply_data->sender, g_input_smartreply_data->message, _input_smartreply_get_reply_callback); -- 2.7.4 From 349ded7a02c15cd04a2d3a1ec6a2b5d172c38647 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 29 Aug 2017 20:12:48 +0900 Subject: [PATCH 16/16] Update package version to 0.1.170829 Change-Id: I00a0cd9b6ad1bcc4f2fcdd6ae50afe4abc77abf6 Signed-off-by: Jihoon Kim --- 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 fd710e6..5832351 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 493425d..e59273c 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -9,7 +9,7 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.1.170822 +Version: 0.1.170829 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4