From af4b014f6e2927f7ac6fb44c94c175e34ac9e0c9 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 18 Jul 2017 19:04:07 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 11/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 12/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 13/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 14/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 From f7fc0aa295fc1e0a8c51c7f54e7b44b30a4c2dbe Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 1 Sep 2017 15:57:54 +0900 Subject: [PATCH 15/16] Support API for set/get cursor position Change-Id: Ie28b7e1215d0309ec3ef2ec53a5a54f4da871713 Signed-off-by: sungwook79.park --- inc/w-input-selector.h | 3 ++- src/w-input-emoticon.cpp | 4 ++-- src/w-input-keyboard.cpp | 18 ++++++++++++++++-- src/w-input-selector.cpp | 11 +++++++---- src/w-input-stt-voice.cpp | 2 +- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index e79cbf5..7ff2ed2 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -118,6 +118,7 @@ struct _InputKeyboardData char *default_text; char *return_key_type; int max_text_length; + int cursor_position_set; }; typedef struct _InputKeyboardData InputKeyboardData; @@ -130,7 +131,7 @@ typedef struct _InputTypeData InputTypeData; void _app_terminate(void* user_data); void reply_to_sender_by_callback_for_back(); -void reply_to_sender_by_callback(const char *value, const char *type, const char *path[]); +void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_pos); char* get_resource_path(); char* get_shared_resource_path(); void show_gl_focus(Eina_Bool bVisible); diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index a2ab3c9..d94c553 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -379,7 +379,7 @@ 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); + reply_to_sender_by_callback(NULL, "image", (const char **)pathes, NULL); free(path); } ui_app_exit(); @@ -421,7 +421,7 @@ static void _emoticon_item_clicked_cb(void *data, Evas_Object * obj, void *event const Eina_Unicode unicode_event[2] = { (Eina_Unicode)emoticon_info[index].code, 0 }; char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length); - reply_to_sender_by_callback((const char*)utf_8, "emoticon", NULL); + reply_to_sender_by_callback((const char*)utf_8, "emoticon", NULL, NULL); PRINTFUNC(SECURE_DEBUG, "[%d]%s", index, utf_8); if (utf_8) diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index cd6356f..ba9a217 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -36,6 +36,7 @@ bool input_keyboard_init(app_control_h app_control) char *guide_text = NULL; char *return_key_type = "SEND"; char *max_text_length = NULL; + char *cursor_position_set = "0"; input_keyboard_deinit(); @@ -55,6 +56,10 @@ bool input_keyboard_init(app_control_h app_control) if (ret == APP_CONTROL_ERROR_NONE) { g_input_keyboard_data.max_text_length = atoi(max_text_length); } + ret = app_control_get_extra_data(app_control, "cursor_position_set", &cursor_position_set); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.cursor_position_set = atoi(cursor_position_set); + } return true; } @@ -74,6 +79,7 @@ void input_keyboard_deinit(void) g_input_keyboard_data.guide_text = NULL; g_input_keyboard_data.return_key_type = "SEND"; g_input_keyboard_data.max_text_length = KEYBOARD_EDITOR_CHAR_COUNT_MAX; + g_input_keyboard_data.cursor_position_set = 0; return; } @@ -90,6 +96,9 @@ void exit_keyboard() const char *getText = elm_entry_entry_get(entry); LOGD("button key clicked!! : getText = %s", getText); + char cursorPosition[512]; + snprintf(cursorPosition, sizeof(cursorPosition), "%d", elm_entry_cursor_pos_get(entry)); + char *app_id = NULL; app_control_get_caller(app_data->source_app_control, &app_id); if (app_id != NULL) @@ -97,9 +106,8 @@ void exit_keyboard() app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); set_source_caller_app_id(app_control); free(app_id); - reply_to_sender_by_callback(getText, "keyboard", NULL); + reply_to_sender_by_callback(getText, "keyboard", NULL, cursorPosition); ui_app_exit(); - } void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) @@ -166,6 +174,9 @@ void create_fullscreen_editor(void *data) 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); } + if (g_input_keyboard_data.cursor_position_set != 0) { + elm_entry_cursor_pos_set(entry, g_input_keyboard_data.cursor_position_set); + } evas_object_show(entry); elm_box_pack_end(box, entry); @@ -229,6 +240,9 @@ static Evas_Object *create_multiline_editfield_layout(Evas_Object *parent, void 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); } + if (g_input_keyboard_data.cursor_position_set != 0) { + elm_entry_cursor_pos_set(entry, g_input_keyboard_data.cursor_position_set); + } evas_object_show(entry); elm_object_part_content_set(editfield, "elm.swallow.content", entry); diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index d72a097..57320ec 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -221,7 +221,7 @@ static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_in char *reply = input_smartreply_get_nth_item(index, &type); if (reply) { input_smartreply_send_feedback(reply); - reply_to_sender_by_callback(reply, "smartreply", NULL); + reply_to_sender_by_callback(reply, "smartreply", NULL, NULL); free(reply); elm_exit(); } @@ -240,7 +240,7 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info const std::vector template_list = input_template_get_list(); if (index < (int)template_list.size()) { - reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template", NULL); + reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template", NULL, NULL); ui_app_exit(); } } @@ -479,7 +479,7 @@ void set_source_caller_app_id(app_control_h app_control) } } -void reply_to_sender_by_callback(const char *value, const char *type, const char *path[]) +void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_position) { PRINTFUNC(DLOG_DEBUG, ""); @@ -498,6 +498,9 @@ void reply_to_sender_by_callback(const char *value, const char *type, const char app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH, path, 1); } + if (cursor_position != NULL) + app_control_add_extra_data(app_control, "cursor_position_get", cursor_position); + set_source_caller_app_id(app_control); ret = app_control_reply_to_launch_request(app_control, app_data->source_app_control, APP_CONTROL_RESULT_SUCCEEDED); @@ -627,7 +630,7 @@ void _back_to_genlist_for_selector() } if (app_data->app_type == APP_TYPE_STT || app_data->app_type == APP_TYPE_EMOTICON || app_data->app_type == APP_TYPE_KEYBOARD){ PRINTFUNC(DLOG_DEBUG, "launched as STT/EMOTICON/KEYBOARD mode, So exit here."); - reply_to_sender_by_callback(NULL, NULL, NULL); + reply_to_sender_by_callback(NULL, NULL, NULL, NULL); ui_app_exit(); } } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index fb0c086..1795cc8 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -479,7 +479,7 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve if (!vr) filePath = vr->file_path; char *path[] = {filePath, }; - reply_to_sender_by_callback(result_text.c_str(), "voice", (const char **)path); + reply_to_sender_by_callback(result_text.c_str(), "voice", (const char **)path, NULL); destroy_voice(); powerUnlock(); ui_app_exit(); -- 2.7.4 From 5798b48ceb06da18d6331298eb37cb41a39cbc1f Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 4 Sep 2017 14:03:19 +0900 Subject: [PATCH 16/16] Update package version to 0.1.170904 Change-Id: I0c1c9adf0d23176674f666d90eb89041ea7dbd92 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 5832351..801deaf 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 e59273c..8816db5 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.170829 +Version: 0.1.170904 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4