From b063e06c7158fa5e51ed1b176d4186335edf2c0f Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 8 Jul 2016 10:12:59 +0900 Subject: [PATCH 01/16] Add License file Change-Id: I09779fcad0bd32a0183cad5199195d54a211ab83 Signed-off-by: sungwook79.park --- LICENSE | 202 ++++++++++++++++++++++++++++++++ packaging/org.tizen.inputdelegator.spec | 2 +- 2 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 536be3b..0e6d0a1 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -102,7 +102,7 @@ cp -rf org.tizen.inputdelegator.xml %{buildroot}%{_datadir}/packages %files %manifest org.tizen.inputdelegator.manifest %defattr(-,app,app,-) - +%license LICENSE %{_datadir}/packages/org.tizen.inputdelegator.xml %{_app_destdir}%{_app_prefix}/bin/inputdelegator %{_app_destdir}%{_app_prefix}/res/edje/w-input-selector.edj -- 2.7.4 From 7f4f2c40b1e33c1e7303e6aa9bbbd2c0c473830f Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 8 Jul 2016 15:08:13 +0900 Subject: [PATCH 02/16] Update package version to 0.0.160708 Change-Id: I661fcf736f73d55c60be02276e051fc7de61a3b7 Signed-off-by: sungwook79.park --- packaging/org.tizen.inputdelegator.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 0e6d0a1..4a94efd 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -1,6 +1,6 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.0.160704 +Version: 0.0.160708 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From fc00d8558046055a16f40a845034e46904b8c6b8 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 8 Jul 2016 16:49:00 +0900 Subject: [PATCH 03/16] Exclude aarch64 in build option Change-Id: I247b5a26142d96b27d43c84e839ee0c7ddcf87cd Signed-off-by: sungwook79.park --- packaging/org.tizen.inputdelegator.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 4a94efd..2d6302a 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -39,19 +39,19 @@ BuildRequires: pkgconfig(bundle) %endif %if "%{?profile}" == "mobile" -ExcludeArch: %{arm} %ix86 x86_64 +ExcludeArch: %{arm} aarch64 %ix86 x86_64 %endif %if "%{?profile}" == "tv" -ExcludeArch: %{arm} %ix86 x86_64 +ExcludeArch: %{arm} aarch64 %ix86 x86_64 %endif %if "%{?profile}" == "common" -ExcludeArch: %{arm} %ix86 x86_64 +ExcludeArch: %{arm} aarch64 %ix86 x86_64 %endif %if "%{?profile}" == "ivi" -ExcludeArch: %{arm} %ix86 x86_64 +ExcludeArch: %{arm} aarch64 %ix86 x86_64 %endif %define _appdir /usr/apps -- 2.7.4 From f0f6176a372ff963c16a40ecff446ae4250772bc Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 12 Jul 2016 13:21:21 +0900 Subject: [PATCH 04/16] fix the issue about TAINTED_ARRAY_INDEX in static analysis tool Change-Id: Ib480489a1031e766d2b97934490f36848ff220b2 Signed-off-by: sungwook79.park --- src/w-input-stt-voice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 6587abe..4d6e8f0 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1207,6 +1207,10 @@ static int get_language_value() } PRINTFUNC(DLOG_DEBUG, "n66 current language value for stt (%s).", disp_lang_array_n66[lang]); } else { + if(lang < 0 || lang > 12) { + PRINTFUNC(DLOG_WARN, "vconf lang orig(%d) to be 0", lang); + lang = 0; + } PRINTFUNC(DLOG_DEBUG, "current language value for stt (%s).", disp_lang_array[lang]); } @@ -2104,6 +2108,7 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) free(app_id); } } + elm_layout_signal_callback_add(panel, "cue,clicked", "elm", _panel_cue_clicked_cb, (void *) voicedata); evas_object_show(panel); -- 2.7.4 From 893715070ac267e7358f2300794be330c1d63acf Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 12 Jul 2016 15:43:22 +0900 Subject: [PATCH 05/16] Update package version to 0.0.160712 Change-Id: Ia5b9fdecb398e7046c0d4cac4f5eeee13b8ed81b Signed-off-by: sungwook79.park --- packaging/org.tizen.inputdelegator.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 2d6302a..75ee232 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -1,6 +1,6 @@ Name: org.tizen.inputdelegator Summary: Input Delegator Application -Version: 0.0.160708 +Version: 0.0.160712 Release: 1 Group: Applications License: Apache-2.0 -- 2.7.4 From 104df28fc268bea849c9845e23560972ca5e70bd Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 11:59:51 +0900 Subject: [PATCH 06/16] remove the legacy code for accessibility Change-Id: I98cb63c81a7fb6703ab770660d5c09347ec13413 Signed-off-by: sungwook79.park --- src/MoreOption.cpp | 29 ---------------- src/SttFeedback.cpp | 7 +--- src/w-input-emoticon.cpp | 40 ---------------------- src/w-input-selector.cpp | 66 +------------------------------------ src/w-input-stt-voice.cpp | 84 +---------------------------------------------- 5 files changed, 3 insertions(+), 223 deletions(-) diff --git a/src/MoreOption.cpp b/src/MoreOption.cpp index 5693264..41b6b26 100755 --- a/src/MoreOption.cpp +++ b/src/MoreOption.cpp @@ -262,36 +262,7 @@ void MoreOption::AddMorePage() { [](void *data, Evas_Object *obj, void *event_info) { PRINTFUNC(DLOG_DEBUG, "item,selected"); - Eext_Object_Item *selected_item = (Eext_Object_Item *)event_info; - - //for custom accessibility - if (elm_config_access_get()) - { - Evas_Object *panel = elm_object_part_content_get(obj, "elm.swallow.right"); - if (!panel) return; - - Evas_Object *rotary_selector = elm_object_content_get(panel); - if (!rotary_selector) return; - - Evas_Object *content = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(rotary_selector), "content"); - if (!content) return; - - Evas_Object *content_access = elm_access_object_get(content); - if (!content_access) return; - - if (eext_more_option_item_part_text_get(selected_item, "selector,main_text")) - { - std::string text; - if(eext_more_option_item_part_text_get(selected_item, "selector,main_text")) - text = text + std::string(eext_more_option_item_part_text_get(selected_item, "selector,main_text")) + " "; - - if(eext_more_option_item_part_text_get(selected_item, "selector,main_text")) - text = text + std::string(eext_more_option_item_part_text_get(selected_item, "selector,sub_text")); - - elm_access_info_set(content_access, ELM_ACCESS_INFO, text.c_str()); - } - } }, NULL); } diff --git a/src/SttFeedback.cpp b/src/SttFeedback.cpp index 1af1796..a3b5f2a 100755 --- a/src/SttFeedback.cpp +++ b/src/SttFeedback.cpp @@ -99,12 +99,7 @@ void SttFeedback::OnResult( void SttFeedback::AutoStart(void) { PRINTFUNC(DLOG_DEBUG, "start"); - - if (elm_config_access_get()){ - PRINTFUNC(DLOG_DEBUG, "accessbility on: It will not start automatically."); - } else { - start_by_press((VoiceData *) owner); - } + start_by_press((VoiceData *) owner); } void SttFeedback::SttIdle(void) diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 87d691f..2240448 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -153,38 +153,6 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev static void _rotary_selector_item_selected(void *data, Evas_Object *obj, void *event_info) { PRINTFUNC(DLOG_DEBUG, "%s", __func__); - if (elm_config_access_get()) - { - Eext_Object_Item *selected_item = (Eext_Object_Item *)event_info; - Eina_List *rotary_selector_list = (Eina_List *)eext_rotary_selector_items_get(obj); - - int i = 0; - Eina_List *l = rotary_selector_list; - Eext_Object_Item *item = (Eext_Object_Item *)eina_list_data_get(l); - - for (i = 0; l != NULL; i++) { - if (selected_item == item) - break; - - l = eina_list_next(l); - item = (Eext_Object_Item *)eina_list_data_get(l); - } - - - previous_icon = i; - - Evas_Object *content = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(obj), "content"); - if (!content) return; - - Evas_Object *content_access = elm_access_object_get(content); - if (!content_access) - return; - - std::string text = std::string(dgettext(PACKAGE, emoticon_info[i].name)); - PRINTFUNC(DLOG_DEBUG, "[%d]%s", i, text.c_str()); - text = text + " " + gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND"); - elm_access_say(text.c_str()); - } } void ise_show_emoticon_popup_rotary(void *data) @@ -222,13 +190,5 @@ void ise_show_emoticon_popup_rotary(void *data) elm_naviframe_item_pop_cb_set(nf_item, _custom_back_cb, NULL); eext_rotary_object_event_activated_set(rotary_selector, EINA_TRUE); - if (elm_config_access_get()){ - Evas_Object *selector_access = elm_access_object_get(rotary_selector); - elm_access_highlight_set(selector_access); - eext_rotary_object_event_callback_add(rotary_selector, _rotary_selector_rotary_cb, first_it); - -// ea_screen_reader_access_info_append_cb_set(selector_access, ELM_ACCESS_CONTEXT_INFO, _access_info_prepend_cb, NULL); - } - PRINTFUNC(DLOG_DEBUG, "%s", __func__); } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 7033e8f..eee74fc 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -345,8 +345,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, elm_image_file_set(ic, path_ic.c_str(), NULL); elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); - if (elm_config_access_get()) - elm_access_object_unregister(btn); int powerSavingMode = -1; int ret; @@ -367,8 +365,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, elm_image_file_set(ic, path_ic.c_str(), NULL); elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); - if (elm_config_access_get()) - elm_access_object_unregister(btn); } else if (!strcmp(part, "elm.icon.3")){ elm_object_style_set(btn, "anchor"); @@ -377,8 +373,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); evas_object_propagate_events_set(btn, EINA_FALSE); - if (elm_config_access_get()) - elm_access_object_unregister(btn); } return btn; @@ -405,29 +399,19 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, evas_object_layer_set(btn, 32000); evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); - if (elm_config_access_get()){ - elm_access_info_set(btn, ELM_ACCESS_INFO, gettext("IDS_IME_MBODY_VOICE_INPUT")); -// elm_access_chain_end_set(btn, ELM_HIGHLIGHT_DIR_PREVIOUS); - } } else if (!strcmp(part, "elm.icon.2.touch_area")){ evas_object_layer_set(btn, 32000); evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); - if (elm_config_access_get()) - elm_access_info_set(btn, ELM_ACCESS_INFO, gettext("IDS_COM_HEADER_EMOTICON")); } else if (!strcmp(part, "elm.icon.3.touch_area")) { evas_object_layer_set(btn, 32000); evas_object_propagate_events_set(btn, EINA_FALSE); evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); - if (elm_config_access_get()) - elm_access_info_set(btn, ELM_ACCESS_INFO, gettext("IDS_COM_OPT_KEYBOARD")); } return btn; } else if (!strcmp(part, "base")) { Evas_Object* btn = elm_button_add(obj); - if (elm_config_access_get()) - elm_access_object_unregister(btn); elm_object_style_set(btn, "ime_transparent"); return btn; } @@ -522,8 +506,6 @@ static Evas_Object * __ise_gl_1button_content_get(void *data, Evas_Object *obj, elm_image_file_set(ic, path_ic.c_str(), NULL); elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); - if (elm_config_access_get()) - elm_access_object_unregister(btn); return btn; } @@ -783,15 +765,7 @@ void show_popup_toast(const char *text, bool check_img) evas_object_smart_callback_add(popup, "dismissed", _popup_close_cb, NULL); evas_object_smart_callback_add(popup, "block,clicked", _popup_back_cb, NULL); - if(elm_config_access_get() == EINA_FALSE) { - elm_popup_timeout_set(popup, 2.0); - } else { - elm_object_access_info_set(popup, text); -// Evas_Object *ao = elm_object_part_access_object_get(popup, "access.outline"); -// elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _toast_delete_popup_access_info_cb, popup); - elm_popup_timeout_set(popup, 8.0); - } - + elm_popup_timeout_set(popup, 2.0); evas_object_show(popup); } @@ -877,44 +851,6 @@ Eina_Bool _access_action_prev_cb(void *data, Evas_Object *obj, Elm_Access_Action static void _item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { PRINTFUNC(DLOG_DEBUG, "%s", __func__); - if (elm_config_access_get()) { - Elm_Object_Item *item = (Elm_Object_Item *)event_info; - Evas_Object *item_access = elm_object_item_access_object_get(item); - - if (item == it_empty || item == it_title) { - elm_access_object_unregister(item_access); - if (item == it_title) - { - Evas_Object *btn = elm_object_item_part_content_get(item, "elm.icon.1.touch_area"); - PRINTFUNC(DLOG_ERROR, "[TNT] 1st button(%p), type:%s", btn, evas_object_type_get(btn)); - Evas_Object *btn_access = btn;//elm_access_object_get(btn); - PRINTFUNC(DLOG_ERROR, "[TNT] title item realized!!!!, force_highlight_to_top:%d, is_genlist_highlighed:%d", force_highlight_to_top, is_genlist_highlighed); - if (force_highlight_to_top || !is_genlist_highlighed) - { - //highlight to first button. - PRINTFUNC(DLOG_ERROR, "[TNT] force highlight to 1st button(%p), acces_obj:%p", btn, btn_access); - elm_access_highlight_set(btn_access); - force_highlight_to_top = EINA_FALSE; - is_genlist_highlighed = EINA_TRUE; - } - PRINTFUNC(DLOG_ERROR, "[TNT] set highlight pre callback on btn"); - elm_access_action_cb_set(btn_access, ELM_ACCESS_ACTION_HIGHLIGHT_PREV, _access_action_prev_cb, obj); - } - } else if (item == it_plus) { - //elm_access_object_unregister(item_access); // there is no guide line - elm_access_info_cb_set(item_access, ELM_ACCESS_CONTEXT_INFO, _it_plus_access_info_cb, NULL); - PRINTFUNC(DLOG_ERROR, "[TNT] set highlight next callback on plus item"); - elm_access_action_cb_set(item_access, ELM_ACCESS_ACTION_HIGHLIGHT_NEXT, _access_action_next_cb, obj); - if (force_highlight_to_bottom) { - PRINTFUNC(DLOG_ERROR, "[TNT] Forcely set highlight on plus item!!"); - elm_access_highlight_set(item_access); - force_highlight_to_bottom = EINA_FALSE; - is_genlist_highlighed = EINA_TRUE; - } - } else { - elm_access_info_cb_set(item_access, ELM_ACCESS_CONTEXT_INFO, _access_info_cb, NULL); - } - } } Evas_Object* _create_genlist(Evas_Object* navi) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 4d6e8f0..659a7ee 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -509,14 +509,6 @@ static void on_mic_button_press_cb(void *data, Evas_Object *obj, void *event_inf PRINTFUNC(NO_PRINT, ""); VoiceData *voicedata = (VoiceData *)data; - - if (elm_config_access_get()){ - if(bottom_button_access_state == true){ - PRINTFUNC(DLOG_DEBUG, "skip until bottom buttom is being read by accessibility"); - return; - } - } - edje_object_signal_emit(_EDJ(voicedata->layout_main), "mouse,clicked,1", "background"); return; @@ -572,10 +564,6 @@ static Eina_Bool _mic_button_enable_cb(void *data) elm_object_disabled_set(button, EINA_FALSE); - if (elm_config_access_get()){ - bottom_button_access_state = false; - } - return ECORE_CALLBACK_CANCEL; } @@ -588,13 +576,7 @@ static void _mic_highlighted_cb(void *data, Evas_Object * obj, void *event_info) voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) return; - - if (elm_config_access_get()){ - bottom_button_access_state = true; - } else { - elm_object_disabled_set(voicedata->mic_button, EINA_TRUE); - } - + elm_object_disabled_set(voicedata->mic_button, EINA_TRUE); if(voicedata->btn_disabling_timer == NULL){ ecore_timer_del(voicedata->btn_disabling_timer); @@ -1174,9 +1156,6 @@ static Evas_Object *__get_genlist_item_content(void *data, Evas_Object *obj, con evas_object_propagate_events_set(content, EINA_TRUE); evas_object_size_hint_align_set(content, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_style_set(content, "list"); - - if (elm_config_access_get()) - elm_access_object_unregister(content); } return content; } @@ -1441,12 +1420,6 @@ char *_language_list_access_info_cb(void *data, Evas_Object *obj) static void _language_list_item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { PRINTFUNC(DLOG_DEBUG, "%s", __func__); - if (elm_config_access_get()) { - Elm_Object_Item *item = (Elm_Object_Item *)event_info; - Evas_Object *item_access = elm_object_item_access_object_get(item); - - elm_access_info_cb_set(item_access, ELM_ACCESS_CONTEXT_INFO, _language_list_access_info_cb, (void*)item); - } } static Evas_Object *create_language_list(Evas_Object *parent) @@ -2062,12 +2035,6 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) Evas_Object *m_mic_button = elm_button_add(layout_main); elm_object_style_set(m_mic_button, "vic/micbutton"); elm_object_part_content_set(layout_main, "MIC", m_mic_button); - if (elm_config_access_get()){ - elm_access_info_cb_set(m_mic_button, ELM_ACCESS_INFO, _mic_access_info_cb, NULL); - elm_access_info_cb_set(m_mic_button, ELM_ACCESS_TYPE, _mic_access_info_cb, NULL); - elm_access_info_cb_set(m_mic_button, ELM_ACCESS_STATE, _mic_access_info_cb, NULL); - evas_object_smart_callback_add(m_mic_button, "access,highlighted", _mic_highlighted_cb, voicedata); - } elm_object_disabled_set(m_mic_button, EINA_TRUE); evas_object_smart_callback_add(m_mic_button, "clicked", on_mic_button_press_cb, (void *) voicedata); @@ -2134,55 +2101,6 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) mo->SetContentLayout(layout_main); - //accesbility chaining - if (elm_config_access_get()) { - //right cue - Evas_Object *cue_access_right = NULL; - - Evas_Object *panel_right = elm_object_part_content_get(mo->getMoreOptionLayout(), "elm.swallow.right"); - if (!panel_right) { - PRINTFUNC(DLOG_DEBUG, "panel_right == NULL"); - } - Evas_Object *cue_right = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(panel_right), "cue.event"); - if (!cue_right) { - PRINTFUNC(DLOG_DEBUG, "cue_right == NULL"); - } - Evas_Object *_access_right = elm_access_object_get(cue_right); - if (!_access_right){ - PRINTFUNC(DLOG_DEBUG, "_access_right == NULL"); - } - cue_access_right = _access_right; - - //left cue - Evas_Object *cue_access_left = NULL; - Evas_Object *panel_layout = elm_layout_content_get(layout_main, "left_panel_area"); - Evas_Object *panel_left = elm_layout_content_get(panel_layout, "elm.swallow.right"); - if (!panel_left) { - PRINTFUNC(DLOG_DEBUG, "panel_left == NULL"); - } - Evas_Object *cue_left = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(panel_left), "cue.event"); - if (!cue_left) { - PRINTFUNC(DLOG_DEBUG, "cue_left == NULL"); - } - Evas_Object *_access_left = elm_access_object_register(cue_left, panel_left); - if (!_access_left){ - PRINTFUNC(DLOG_DEBUG, "_access_left == NULL"); - } - elm_access_info_cb_set(_access_left, ELM_ACCESS_INFO, _left_cue_access_info_cb, panel_left); - elm_access_activate_cb_set(_access_left, _left_cue_access_activate_cb, panel_left); - - cue_access_left = _access_left; - - elm_access_highlight_next_set(m_mic_button, ELM_HIGHLIGHT_DIR_NEXT, cue_access_right); - elm_access_highlight_next_set(cue_access_right, ELM_HIGHLIGHT_DIR_PREVIOUS, m_mic_button); - - elm_access_highlight_next_set(cue_access_right, ELM_HIGHLIGHT_DIR_NEXT, cue_access_left); - elm_access_highlight_next_set(cue_access_left, ELM_HIGHLIGHT_DIR_PREVIOUS, cue_access_right); - - elm_access_highlight_next_set(cue_access_left, ELM_HIGHLIGHT_DIR_NEXT, m_mic_button); - elm_access_highlight_next_set(m_mic_button, ELM_HIGHLIGHT_DIR_PREVIOUS, cue_access_left); - } - return layout_main; } -- 2.7.4 From 6b9e5df8026b26e09f548a8482faf477634dc029 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 12:06:31 +0900 Subject: [PATCH 07/16] remove the legacy code for power saving mode Change-Id: If28a9bc28548a82dc5594a429724ecb9e5158695 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index eee74fc..b1a95fc 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -346,19 +346,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, elm_object_content_set(btn, ic); evas_object_layer_set(btn, 32000); - int powerSavingMode = -1; - int ret; - // Power Saving mode check - ret = vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &powerSavingMode); - if ( ret != 0 ) - { - PRINTFUNC(DLOG_ERROR, "VCONFKEY_SETAPPL_PSMODE FAILED"); - } - - if (powerSavingMode == SETTING_PSMODE_WEARABLE_ENHANCED) { - PRINTFUNC(DLOG_ERROR, "Power Saving mode, disable stt !!!"); - elm_object_disabled_set(btn, EINA_TRUE); - } } else if (!strcmp(part, "elm.icon.2")){ elm_object_style_set(btn, "anchor"); string path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; @@ -383,20 +370,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); string path = get_resource_path(); if (!strcmp(part, "elm.icon.1.touch_area")) { - int powerSavingMode = -1; - int ret; - // Power Saving mode check - ret = vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &powerSavingMode); - if ( ret != 0 ) - { - PRINTFUNC(DLOG_ERROR, "VCONFKEY_SETAPPL_PSMODE FAILED"); - } - - if (powerSavingMode == SETTING_PSMODE_WEARABLE_ENHANCED) { - PRINTFUNC(DLOG_ERROR, "Power Saving mode, disable stt !!!"); - elm_object_disabled_set(btn, EINA_TRUE); - } - evas_object_layer_set(btn, 32000); evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); -- 2.7.4 From 228788f2b541d0a41c449fcdfd962535542b6068 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 12:14:20 +0900 Subject: [PATCH 08/16] remove the legacy code for samsung log manager Change-Id: I9e19a791636b5f9a37a940afb258d6dd6fb8e731 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 90 ------------------------------------------------ 1 file changed, 90 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index b1a95fc..515a591 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -33,20 +33,12 @@ #include "w-input-emoticon.h" #include "w-input-stt-tos.h" -#ifdef SUPPORT_LOG_MANAGER -#include -#include -#endif - #include using namespace std; App_Data* app_data = NULL; -#ifdef SUPPORT_LOG_MANAGER -static samsung_log_manager_h g_log_manager = NULL; -#endif InputKeyboardData g_input_keyboard_data; @@ -65,11 +57,6 @@ static Eina_Bool is_genlist_highlighed = EINA_FALSE; void _init_app_data(App_Data* app_data); static void _app_language_changed(app_event_info_h event_info, void *user_data); static int _app_control_request_transient_app_cb(void *data); -#ifdef SUPPORT_LOG_MANAGER -static void log_manager_init(void); -static void log_manager_exit(void); -static void log_manager_set(const char *feature, const char *extra, const char *value); -#endif static char *_genlist_text_set_theme_color(const char *str, const char *code); @@ -164,11 +151,6 @@ static void _stt_clicked_cb(void *data, Evas_Object * obj, void *event_info) } else { ise_show_stt_popup(ad); } - - -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "STT", NULL); -#endif } static void _input_smartreply_notify_cb(void *user_data) @@ -194,10 +176,6 @@ static void _emoticon_clicked_cb(void *data, Evas_Object * obj, void *event_info // ise_show_emoticon_popup(ad); ise_show_emoticon_popup_rotary(ad); - -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Emoticon", NULL); -#endif } static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info) @@ -209,10 +187,6 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info if (!ad) return; -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Keypad", NULL); -#endif - if (app_data->app_type == APP_TYPE_KEYBOARD_FROM_SMS) input_keyboard_launch(ad->win_main); else @@ -251,10 +225,6 @@ static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_in int index = (unsigned int) elm_object_item_data_get(item); -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Preset", NULL); - log_manager_set("IM02", "Smart Reply", NULL); -#endif char *reply = input_smartreply_get_nth_item(index); if (reply) { input_smartreply_send_feedback(reply); @@ -316,10 +286,6 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info //@ToDo : should call reply function when any template string is selected and confirmed. // Here reply string will be template_list[index].text.c_str(); if( index < template_list.size()) { -#ifdef SUPPORT_LOG_MANAGER - log_manager_set("IM01", "Preset", NULL); - log_manager_set("IM02", "Preset except smart reply", NULL); -#endif if(app_data->reply_type == REPLY_APP_CONTROL){ reply_to_sender_by_appcontrol((void*)app_data, gettext(template_list[index].text.c_str()), "template"); } else { @@ -1255,9 +1221,6 @@ bool _app_create(void* user_data) } _app_language_changed(NULL, NULL); -#ifdef SUPPORT_LOG_MANAGER - log_manager_init(); -#endif app_data = (App_Data*)user_data; @@ -1423,10 +1386,6 @@ void _app_terminate(void* user_data) input_template_unset_notify(); input_template_deinit(); - -#ifdef SUPPORT_LOG_MANAGER - log_manager_exit(); -#endif } static int init_i18n(const char *domain, const char *dir, char *lang_str) @@ -1498,52 +1457,3 @@ int main(int argc, char* argv[]) return ret; } - -#ifdef SUPPORT_LOG_MANAGER -static void log_manager_init(void) -{ - if (g_log_manager) - return; - - samsung_log_manager_create(&g_log_manager); -} - -static void log_manager_exit(void) -{ - samsung_log_manager_destroy(g_log_manager); - g_log_manager = NULL; -} - -static void log_manager_set(const char *feature, const char *extra, const char *value) -{ - const char *uri = USE_APP_FEATURE_SURVEY_URI; - - unsigned int request_id; - bundle *log_data; - - if (g_log_manager == NULL) { - PRINTFUNC(DLOG_ERROR, "log manager doesn't initialized"); - return; - } - - if (feature == NULL) { - PRINTFUNC(DLOG_ERROR, "feature is empty"); - return; - } - - log_data = bundle_create(); - - bundle_add(log_data, "app_id", PACKAGE); - bundle_add(log_data, "feature", feature); - - if (extra) - bundle_add(log_data, "extra", extra); - if (value) - bundle_add(log_data, "value", value); - - samsung_log_manager_insert(g_log_manager, uri, log_data, NULL, NULL, &request_id); - - bundle_free(log_data); -} -#endif - -- 2.7.4 From 843a2b0025eb07776ff8a6dd99cc2628938638f5 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 17:21:26 +0900 Subject: [PATCH 09/16] remove the legacy code for CSC feature Change-Id: I3cb72e60cd1232d98bf50643f7f679c381af1b88 Signed-off-by: sungwook79.park --- src/CMakeLists.txt | 15 +-------------- src/w-input-selector.cpp | 20 +++++++------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19c5f17..345580f 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,6 @@ PKG_CHECK_MODULES(SQLITE3_PKG REQUIRED sqlite3) #PKG_CHECK_MODULES(GRAPHICS_EXTENSION REQUIRED graphics-extension) #PKG_CHECK_MODULES(WNOTI_SERVICE REQUIRED wnoti-service2) #PKG_CHECK_MODULES(SAP_CLIENT_STUB_API REQUIRED sap-client-stub-api) -#PKG_CHECK_MODULES(CSC_FEATURE REQUIRED csc-feature) SET(W_INPUT_SELECTOR inputdelegator) @@ -41,13 +40,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${DATA_CONTROL_INCLUDE_DIRS} ${SMARTREPLY_INCLUDE_DIRS} ${WNOTI_SERVICE_INCLUDE_DIRS} - ${SAP_CLIENT_STUB_API_INCLUDE_DIRS} - ${CSC_FEATURE_INCLUDE_DIRS}) - -IF(enable_log_manager) - INCLUDE_DIRECTORIES(${LOG_CLIENT_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${BUNDLE_INCLUDE_DIRS}) -ENDIF() + ${SAP_CLIENT_STUB_API_INCLUDE_DIRS}) LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} @@ -67,14 +60,8 @@ LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} ${SMARTREPLY_LIBRARY_DIRS} ${WNOTI_SERVICE_LIBRARY_DIRS} ${SAP_CLIENT_STUB_API_LIBRARY_DIRS} - ${CSC_FEATURE_LIBRARY_DIRS} ) -IF(enable_log_manager) - LINK_DIRECTORIES(${LOG_CLIENT_PKG_LIBRARY_DIRS}) - LINK_DIRECTORIES(${BUNDLE_PKG_LIBRARY_DIRS}) -ENDIF() - ADD_EXECUTABLE(${W_INPUT_SELECTOR} ${W_INPUT_SELECTOR_SRCS}) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 515a591..65c8a0f 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -509,20 +509,14 @@ void set_source_caller_app_id(app_control_h app_control) return; } -// CscFeatureBool is_security_permission_manager = CSC_FEATURE_BOOL_FALSE; -// is_security_permission_manager = csc_feature_get_bool(CSC_FEATURE_DEF_BOOL_SECURITY_PERMISSION_MANAGER); + char *caller = NULL; + app_control_get_caller(app_data->source_app_control, &caller); -// if(is_security_permission_manager == CSC_FEATURE_BOOL_TRUE){ - - char *caller = NULL; - app_control_get_caller(app_data->source_app_control, &caller); - - if(caller){ - PRINTFUNC(DLOG_DEBUG, "caller = %s", caller); - app_control_add_extra_data(app_control, "caller_appid", caller); - free(caller); - } -// } + if(caller){ + PRINTFUNC(DLOG_DEBUG, "caller = %s", caller); + app_control_add_extra_data(app_control, "caller_appid", caller); + free(caller); + } } void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type) -- 2.7.4 From 83308a97987dd0a93652b226d429331a67c8e73d Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 20 Jul 2016 19:09:57 +0900 Subject: [PATCH 10/16] remove the legacy code that is not used Change-Id: Ic3f3bfd5f6dd78b4163b82d7946a2179e0c09c12 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 48 ------- src/w-input-stt-voice.cpp | 322 ++-------------------------------------------- 2 files changed, 14 insertions(+), 356 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 65c8a0f..ea4a41b 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -67,7 +67,6 @@ void _update_smartreply_items(void *user_data); void _update_template_items(void *user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); -char * _toast_delete_popup_access_info_cb(void *data, Evas_Object *obj); @@ -716,14 +715,6 @@ static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info) elm_popup_dismiss(obj); } -char * _toast_delete_popup_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_ERROR, "%s", __func__); - const char * info = elm_object_part_text_get((Evas_Object*)data, "elm.text"); - - return strdup(info); -} - void _back_to_genlist_for_selector() { @@ -742,45 +733,6 @@ void _back_to_genlist_for_selector() eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE); } - -char *_it_plus_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - std::string text = std::string(gettext("IDS_ACCS_BODY_BUTTON_TTS")); - - return strdup(text.c_str()); -} - -char *_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - return strdup(gettext("WDS_TTS_TBBODY_DOUBLE_TAP_TO_SEND")); -} - -Eina_Bool _access_action_next_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info) -{ - Evas_Object *genlist = (Evas_Object*)data; - PRINTFUNC(DLOG_ERROR, "[TNT] _access_action_next_cb called, genlist type:%s", evas_object_type_get(genlist)); - Elm_Object_Item *it = elm_genlist_first_item_get(genlist);//emptry item? - PRINTFUNC(DLOG_ERROR, "[TNT] get first item:%p", it); - it = elm_genlist_item_next_get(it);//title item(3 button?) - PRINTFUNC(DLOG_ERROR, "[TNT] get Second item:%p, title_item:%p", it, it_title); - elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_IN); - force_highlight_to_top = EINA_TRUE; - return EINA_TRUE; -} - -Eina_Bool _access_action_prev_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info) -{ - Evas_Object *genlist = (Evas_Object*)data; - PRINTFUNC(DLOG_ERROR, "[TNT] _access_action_prev_cb called, genlist type:%s", evas_object_type_get(genlist)); - Elm_Object_Item *it = elm_genlist_last_item_get(genlist);//plus button item - PRINTFUNC(DLOG_ERROR, "[TNT] get last item:%p", it); - elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_IN); - force_highlight_to_bottom = EINA_TRUE; - return EINA_TRUE; -} - static void _item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { PRINTFUNC(DLOG_DEBUG, "%s", __func__); diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 659a7ee..ed41fc0 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -73,23 +73,7 @@ static bool g_mic_clicked = false; static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); -char *supported_language[13] = { - "auto", - "de_DE", - "en_GB", - "en_US", - "es_ES", - "es_US", - "fr_FR", - "it_IT", - "pt_BR", - "ru_RU", - "zh_CN", - "ja_JP", - "ko_KR", -}; - -char *supported_language_n66[7] = { +char *supported_language[7] = { "auto", "en_US", "es_US", @@ -100,23 +84,7 @@ char *supported_language_n66[7] = { }; -char *disp_lang_array[13] = { - "", - "Deutsch", - "English (United Kingdom)", - "English (United States)", - "Español (España)", - "Español (América Latina)", - "Français (France)", - "Italiano", - "Português (Brasil)", - "Pусский", - "简体中文", - "日本語", - "한국어", -}; - -char *disp_lang_array_n66[7] = { +char *disp_lang_array[7] = { "", "English (United States)", "Español (América Latina)", @@ -169,72 +137,26 @@ char* get_lang_label(char lang[]) { char *str = NULL; - if (strcmp(lang, "en_US") == 0) - str = disp_lang_array[3]; - - else if (strcmp(lang, "ko_KR") == 0) - str = disp_lang_array[12]; - - else if (strcmp(lang, "de_DE") == 0) - str = disp_lang_array[1]; - - else if (strcmp(lang, "fr_FR") == 0) - str = disp_lang_array[6]; - - else if (strcmp(lang, "it_IT") == 0) - str = disp_lang_array[7]; - - else if (strcmp(lang, "en_GB") == 0) - str = disp_lang_array[2]; - - else if (strcmp(lang, "ja_JP") == 0) - str = disp_lang_array[11]; - - else if (strcmp(lang, "zh_CN") == 0) - str = disp_lang_array[10]; - - else if (strcmp(lang, "ru_RU") == 0) - str = disp_lang_array[9]; - - else if (strcmp(lang, "pt_BR") == 0) - str = disp_lang_array[8]; - - else if (strcmp(lang, "es_ES") == 0) - str = disp_lang_array[4]; - - else if (strcmp(lang, "es_US") == 0) - str = disp_lang_array[5]; - - else - str = disp_lang_array[3]; - - return str; -} - -char* get_lang_label_n66(char lang[]) -{ - char *str = NULL; - if (strcmp (lang, "en_US") == 0) - str = disp_lang_array_n66[1]; + str = disp_lang_array[1]; else if (strcmp (lang, "ko_KR") == 0) - str = disp_lang_array_n66[6]; + str = disp_lang_array[6]; else if (strcmp (lang, "fr_FR") == 0) - str = disp_lang_array_n66[3]; + str = disp_lang_array[3]; else if (strcmp (lang, "ja_JP") == 0) - str = disp_lang_array_n66[5]; + str = disp_lang_array[5]; else if (strcmp (lang, "zh_CN") == 0) - str = disp_lang_array_n66[4]; + str = disp_lang_array[4]; else if (strcmp (lang, "es_US") == 0) - str = disp_lang_array_n66[2]; + str = disp_lang_array[2]; else - str = disp_lang_array_n66[1]; + str = disp_lang_array[1]; return str; } @@ -514,40 +436,6 @@ static void on_mic_button_press_cb(void *data, Evas_Object *obj, void *event_inf return; } -static char *_left_cue_access_info_cb(void *data, Evas_Object *obj) -{ - char text[512]; - - snprintf(text, sizeof(text), "%s, %s", gettext(TTS_SEND), gettext(TTS_BUTTON)); - - return strdup(text); -} - -static void _left_cue_access_activate_cb(void * data, Evas_Object *part_obj, Elm_Object_Item *item) -{ - Evas_Object *obj = (Evas_Object *)data; - elm_layout_signal_emit(obj, "cue,clicked", "elm"); - - elm_panel_toggle(obj); -} - - -static void _send_button_highlighted_cb(void *data, Evas_Object * obj, void *event_info) -{ - PRINTFUNC(DLOG_DEBUG, ""); - VoiceData* voicedata = (VoiceData*)data; - - if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING || - voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) - return; - - std::string text = std::string(gettext(TTS_SEND)); - text = text +" "+ gettext(TTS_BUTTON); - if (elm_object_disabled_get(obj)) - text = text + " " + gettext(TTS_DISABLED); - - elm_access_say(text.c_str()); -} static Eina_Bool _mic_button_enable_cb(void *data) { @@ -567,31 +455,6 @@ static Eina_Bool _mic_button_enable_cb(void *data) return ECORE_CALLBACK_CANCEL; } -static void _mic_highlighted_cb(void *data, Evas_Object * obj, void *event_info) -{ - PRINTFUNC(DLOG_DEBUG, ""); - VoiceData* voicedata = (VoiceData*)data; - - if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING || - voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) - return; - - elm_object_disabled_set(voicedata->mic_button, EINA_TRUE); - - if(voicedata->btn_disabling_timer == NULL){ - ecore_timer_del(voicedata->btn_disabling_timer); - } - voicedata->btn_disabling_timer = ecore_timer_add(3.0, _mic_button_enable_cb, voicedata); - - elm_access_say(gettext(SK_DOUBLE_TAP_TO_SPEAK)); -} - -static char *_mic_access_info_cb(void *data, Evas_Object *obj) -{ - if (data) return strdup((const char*)data); - return NULL; -} - static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { @@ -1079,11 +942,7 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) return strdup(_("IDS_VC_BODY_AUTOMATIC")); } else { char *s = NULL; - if(g_is_n66) { - s = (char *)disp_lang_array_n66[(int)data]; - } else { - s = (char *)disp_lang_array[(int)data]; - } + s = (char *)disp_lang_array[(int)data]; if(s) { char *p = strchr(s, '('); @@ -1114,18 +973,11 @@ char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part) // confirm whether the system language is supported by stt engine or not. // if supported, set the language // otherwise, set language to en_US - if(g_is_n66) { - return strdup(get_lang_label_n66(system_lang)); - } else { - return strdup(get_lang_label(system_lang)); - } + return strdup(get_lang_label(system_lang)); + } else { char *s = NULL; - if(g_is_n66) { - s = (char *)disp_lang_array_n66[(int)data]; - } else { - s = (char *)disp_lang_array[(int)data]; - } + s = (char *)disp_lang_array[(int)data]; if(s) { char *p = strchr(s, '('); @@ -1184,13 +1036,7 @@ static int get_language_value() PRINTFUNC(DLOG_WARN, "vconf lang orig(%d) to be 0", lang); lang = 0; } - PRINTFUNC(DLOG_DEBUG, "n66 current language value for stt (%s).", disp_lang_array_n66[lang]); - } else { - if(lang < 0 || lang > 12) { - PRINTFUNC(DLOG_WARN, "vconf lang orig(%d) to be 0", lang); - lang = 0; - } - PRINTFUNC(DLOG_DEBUG, "current language value for stt (%s).", disp_lang_array[lang]); + PRINTFUNC(DLOG_DEBUG, "n66 current language value for stt (%s).", disp_lang_array[lang]); } return lang; @@ -1275,62 +1121,6 @@ static void get_stt_default_language(VoiceData *my_voicedata) case STT_VOICE_N66_KO_KR : case STT_VOICE_N66_ZH_CN : { - my_voicedata->kbd_lang = strdup(supported_language_n66[stt_lang]); - } - break; - default : - my_voicedata->kbd_lang = strdup("en_US"); - break; - } - } else { - STT_VOICE_LANGUAGE_I stt_lang; - stt_lang = (STT_VOICE_LANGUAGE_I)get_language_value(); - - PRINTFUNC(DLOG_DEBUG, "language type (%d)", stt_lang); - - switch(stt_lang) { - case STT_VOICE_AUTO : - { - stt_get_default_language(my_voicedata->voicefw_handle, &my_voicedata->kbd_lang); - - // get system display language - char* value = NULL; - value = vconf_get_str(VCONFKEY_LANGSET); - if (NULL == value) { - PRINTFUNC(DLOG_ERROR, "Fail to get display language"); - return; - } - PRINTFUNC(DLOG_DEBUG, "system language (%s)", value); - - char system_lang[6] = {0, }; - strncpy(system_lang, value , 5); - free(value); - - // confirm whether the system language is supported by stt engine or not. - // if supported, set the language - // otherwise, set language to en_US - if(is_lang_supported_by_stt(system_lang) == TRUE) { - my_voicedata->kbd_lang = strdup(system_lang); - PRINTFUNC(DLOG_DEBUG, "Set auto language (%s)", system_lang); - } else { - my_voicedata->kbd_lang = strdup("en_US"); - PRINTFUNC(DLOG_DEBUG, "System language is not supported by STT (%s), en_US will be set", system_lang); - } - } - break; - case STT_VOICE_DE_DE : - case STT_VOICE_EN_GB : - case STT_VOICE_EN_US : - case STT_VOICE_ES_ES : - case STT_VOICE_ES_US : - case STT_VOICE_FR_FR : - case STT_VOICE_IT_IT : - case STT_VOICE_JA_JP : - case STT_VOICE_KO_KR : - case STT_VOICE_RU_RU : - case STT_VOICE_ZH_CN : - case STT_VOICE_PT_BR : - { my_voicedata->kbd_lang = strdup(supported_language[stt_lang]); } break; @@ -1389,33 +1179,6 @@ Eina_Bool _ise_keydown_cb(void *data, int type, void *event) return ECORE_CALLBACK_DONE; } -char *_language_list_access_info_cb(void *data, Evas_Object *obj) -{ - PRINTFUNC(DLOG_DEBUG, "%s", __func__); - - int value; - int index; - std::string text = std::string(gettext(TTS_RADIO_BUTTON)); - const Elm_Object_Item *item = (Elm_Object_Item *)data; - - Evas_Object* radio = elm_object_item_part_content_get(item, "elm.icon"); - - index = elm_genlist_item_index_get(item); - - if(index == 1) // title - return NULL; - - - value = elm_radio_value_get(radio); - //PRINTFUNC(DLOG_DEBUG,"index=%d value = %d", index, value); - if(index == value + 2 ){ - text = text + std::string(" ") + std::string(gettext(TTS_SELECTED)); - } else { - text = text + std::string(" ") + std::string(gettext(TTS_NOT_SELECTED)); - } - - return strdup(text.c_str()); -} static void _language_list_item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled { @@ -1484,27 +1247,6 @@ static Evas_Object *create_language_list(Evas_Object *parent) if(g_is_n66) { for (i = 1; i < 7; i++) { - char *s = (char *)disp_lang_array_n66[i]; - - if(strchr(s, '(')){ - item = item_append(genlist, itc_2text, i, language_set_genlist_radio_cb, genlist); - } else { - item = item_append(genlist, itc_1text, i, language_set_genlist_radio_cb, genlist); - } - - if(lang_val == i) { - PRINTFUNC(DLOG_DEBUG, "%d item is choiced.", i); - elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); - } - - if ( item == NULL ) { - PRINTFUNC(DLOG_DEBUG, "elm_genlist_item_append was failed"); - break; - } - } - } else { - for (i = 1; i < 13; i++) - { char *s = (char *)disp_lang_array[i]; if(strchr(s, '(')){ @@ -1637,42 +1379,6 @@ static void language_changed_cb(void *data, Evas_Object * obj, void *event_info) if(!data) return; } -static void get_text_part_width(Evas_Object *window, const char *text, Evas_Coord *calculated_width) -{ - if(!window) return; - if(!text) return; - if(!calculated_width) return; - - Evas_Coord width, height; - - char *strbuf = NULL; - Evas_Object *tb = NULL; - Evas_Textblock_Style *st = NULL; - Evas_Textblock_Cursor *cur = NULL; - - tb = evas_object_textblock_add(evas_object_evas_get(window)); - evas_object_textblock_legacy_newline_set(tb, EINA_FALSE); - - st = evas_textblock_style_new(); - evas_textblock_style_set(st, VIRTUAL_TEXT_AREA_FONT_STYLE); - evas_object_textblock_style_set(tb, st); - - cur = evas_object_textblock_cursor_new(tb); - strbuf = elm_entry_utf8_to_markup(text); - evas_object_resize(tb, 360, 47); - - evas_object_textblock_text_markup_set(tb, strbuf); - evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); - evas_object_textblock_size_formatted_get(tb, &width, &height); - evas_object_resize(tb, width, 47); - - *calculated_width = width; - - if(strbuf) free(strbuf); - if(tb) evas_object_del(tb); - if(st) evas_textblock_style_free(st); - if(cur) evas_textblock_cursor_free(cur); -} void _stt_lang_changed_cb(keynode_t *key, void* data) { -- 2.7.4 From d29826dc4607e2143fe96405935f038f7be3c632 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Thu, 21 Jul 2016 13:35:25 +0900 Subject: [PATCH 11/16] remove the legacy code for sms appcontrol Change-Id: I4f0c1d2dbd5a11355854179156913fe42f566857 Signed-off-by: sungwook79.park --- inc/w-input-keyboard.h | 3 +- inc/w-input-selector.h | 5 -- src/w-input-emoticon.cpp | 5 +- src/w-input-keyboard.cpp | 186 ++++++++++------------------------------------ src/w-input-selector.cpp | 152 ++++++------------------------------- src/w-input-stt-voice.cpp | 29 ++------ 6 files changed, 68 insertions(+), 312 deletions(-) diff --git a/inc/w-input-keyboard.h b/inc/w-input-keyboard.h index 192d005..4cff081 100755 --- a/inc/w-input-keyboard.h +++ b/inc/w-input-keyboard.h @@ -23,7 +23,6 @@ bool input_keyboard_init(app_control_h app_control); void input_keyboard_deinit(void); -bool input_keyboard_launch(Evas_Object *window); -bool input_keyboard_launch_with_ui(Evas_Object *window, void * data); +bool input_keyboard_launch(Evas_Object *window, void * data); #endif diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 5bfbc5e..83c1799 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -45,7 +45,6 @@ enum { APP_TYPE_REPLY, APP_TYPE_HANDWRITING, APP_TYPE_KEYBOARD, - APP_TYPE_KEYBOARD_FROM_SMS, }; enum { @@ -80,9 +79,6 @@ typedef enum struct _InputKeyboardData { - char *app_id; - char **data_array; - int data_array_len; char *guide_text; char *default_text; }; @@ -94,7 +90,6 @@ typedef struct _InputKeyboardData InputKeyboardData; void _app_terminate(void* user_data); void reply_to_sender_by_callback_for_back(); void reply_to_sender_by_callback(const char *value, const char *type); -void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type); char* get_resource_path(); char* get_shared_resource_path(); void show_gl_focus(Eina_Bool bVisible); diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 2240448..db808bd 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -137,10 +137,7 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length); input_smartreply_send_feedback(utf_8); - if(ad->reply_type == REPLY_APP_CONTROL) - reply_to_sender_by_appcontrol(data, (const char*)utf_8, "emoticon"); - else - reply_to_sender_by_callback((const char*)utf_8, "emoticon"); + reply_to_sender_by_callback((const char*)utf_8, "emoticon"); PRINTFUNC(SECURE_DEBUG, "[%d]%s", i, utf_8); if (utf_8) diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 6951c2e..486ffd8 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -36,9 +36,9 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { - char *feedback = NULL; + char *feedback = NULL; if (result == APP_CONTROL_RESULT_SUCCEEDED) { - if (reply) { + if (reply) { int ret; ret = app_control_get_extra_data(reply, "template_feedback", &feedback); @@ -50,7 +50,7 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ } } reply_to_sender_by_callback(feedback, "keyboard"); - free(feedback); + free(feedback); elm_exit(); } } @@ -59,194 +59,84 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ bool input_keyboard_init(app_control_h app_control) { int ret = -1; - - char *app_id = NULL; - char **data_array = NULL; - int data_array_len = -1; - char *default_text = NULL; - char *guide_text = NULL; + char *default_text = NULL; + char *guide_text = NULL; input_keyboard_deinit(); - ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_DEFAULT_TEXT, &default_text); - if (ret == APP_CONTROL_ERROR_NONE) { - g_input_keyboard_data.default_text = default_text; - } - ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_GUIDE_TEXT, &guide_text); - if (ret == APP_CONTROL_ERROR_NONE) { - g_input_keyboard_data.guide_text = guide_text; - } - - ret = app_control_get_extra_data(app_control, - "selector_keyboard_app_id", - &app_id); - - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_WARN, "can not get selector_keyboard_app_id: %d", ret); - return false; + ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_DEFAULT_TEXT, &default_text); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.default_text = default_text; } - - ret = app_control_get_extra_data_array(app_control, - "selector_keyboard_data_array", - &data_array, &data_array_len); - - - if (ret != APP_CONTROL_ERROR_NONE) { - if (app_id) - free(app_id); - - PRINTFUNC(DLOG_WARN, "can not get selector_keyboard_data_array : %d", ret); - return false; + ret = app_control_get_extra_data(app_control, APP_CONTROL_DATA_INPUT_GUIDE_TEXT, &guide_text); + if (ret == APP_CONTROL_ERROR_NONE) { + g_input_keyboard_data.guide_text = guide_text; } - if (app_id) - g_input_keyboard_data.app_id = app_id; - - if (data_array) - g_input_keyboard_data.data_array = data_array; - - g_input_keyboard_data.data_array_len = data_array_len; - - PRINTFUNC(DLOG_WARN, "app_id = %s", app_id); - PRINTFUNC(DLOG_WARN, "data_array = %s", data_array); - return true; } void input_keyboard_deinit(void) { - int i = 0; - char **data_array = NULL; - if (g_input_keyboard_data.guide_text) free(g_input_keyboard_data.guide_text); if (g_input_keyboard_data.default_text) free(g_input_keyboard_data.default_text); - if (g_input_keyboard_data.app_id) - free(g_input_keyboard_data.app_id); - - data_array = g_input_keyboard_data.data_array; - if (data_array) { - for (i = 0; i < g_input_keyboard_data.data_array_len; i++) { - if (*(data_array + i)) - free(*(data_array + i)); - } - - free(data_array); - } - - g_input_keyboard_data.app_id = NULL; - g_input_keyboard_data.data_array = NULL; - g_input_keyboard_data.data_array_len = 0; + g_input_keyboard_data.default_text = NULL; + g_input_keyboard_data.guide_text = NULL; return; } -bool input_keyboard_launch(Evas_Object *window) -{ - int ret; - - char *app_id; - - app_control_h app_control; - - if (window == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get window"); - return false; - } - - ret = app_control_create(&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); - return false; - } - - app_id = g_input_keyboard_data.app_id; - if (app_id == NULL) { - PRINTFUNC(DLOG_INFO, "app id is undefined, use defualt"); - app_id = "com.samsung.message.appcontrol.compose"; - } - - app_control_set_app_id(app_control, app_id); - app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); -/* - ret = app_control_set_window(app_control, - elm_win_xwindow_get(window)); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not app control set window : %d", ret); - app_control_destroy(app_control); - return false; - } -*/ - if (g_input_keyboard_data.data_array && g_input_keyboard_data.data_array_len > 0) { - app_control_add_extra_data_array(app_control, - "selector_keyboard_data_array", - (const char**)(g_input_keyboard_data.data_array), - g_input_keyboard_data.data_array_len); - } - - set_source_caller_app_id(app_control); - - ret = app_control_send_launch_request(app_control, - input_keyboard_app_control_send_reply_cb, - NULL); - if (ret != APP_CONTROL_ERROR_NONE) - PRINTFUNC(DLOG_ERROR, "Can not launch app_control: %d", ret); - - app_control_destroy(app_control); - - return true; -} - void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) { - app_control_h app_control; - int ret = app_control_create(&app_control); + app_control_h app_control; + int ret = app_control_create(&app_control); if (ret != APP_CONTROL_ERROR_NONE) { PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); return; } - const char *getText = elm_entry_entry_get(entry); - LOGD("button key clicked!! : getText = %s", getText); + const char *getText = elm_entry_entry_get(entry); + LOGD("button key clicked!! : getText = %s", getText); - if (getText) - input_smartreply_send_feedback(getText); + if (getText) + input_smartreply_send_feedback(getText); - char *app_id = NULL; - app_control_get_caller(app_data->source_app_control, &app_id); - if (app_id != NULL) - app_control_set_app_id(app_control, app_id); + char *app_id = NULL; + app_control_get_caller(app_data->source_app_control, &app_id); + if (app_id != NULL) + app_control_set_app_id(app_control, app_id); app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); - set_source_caller_app_id(app_control); - free(app_id); + set_source_caller_app_id(app_control); + free(app_id); reply_to_sender_by_callback(getText, "keyboard"); elm_exit(); } static Eina_Bool custom_back_cb(void *data, Elm_Object_Item *it) { - _back_to_genlist_for_selector(); - return EINA_TRUE; + _back_to_genlist_for_selector(); + return EINA_TRUE; } void create_fullscreen_editor(void *data) { App_Data *ad = (App_Data *)data; - Evas_Object *box = elm_box_add(ad->naviframe); - evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(box); - elm_win_resize_object_add(ad->naviframe, box); + Evas_Object *box = elm_box_add(ad->naviframe); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(box); + elm_win_resize_object_add(ad->naviframe, box); - entry = elm_entry_add(box); + entry = elm_entry_add(box); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_scrollable_set(entry, EINA_TRUE); elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); elm_object_part_text_set(entry, "elm.guide", g_input_keyboard_data.guide_text); - elm_entry_entry_set(entry, g_input_keyboard_data.default_text); + elm_entry_entry_set(entry, g_input_keyboard_data.default_text); elm_entry_cursor_end_set(entry); evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -263,16 +153,16 @@ void create_fullscreen_editor(void *data) evas_object_resize(ad->naviframe, 360, 360); evas_object_show(ad->naviframe); - Elm_Object_Item *nf_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, box, "empty"); - elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL); + Elm_Object_Item *nf_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, box, "empty"); + elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL); } -bool input_keyboard_launch_with_ui(Evas_Object *window, void *data) { +bool input_keyboard_launch(Evas_Object *window, void *data) { if (window == NULL) { PRINTFUNC(DLOG_ERROR, "Can not get window"); return false; } - create_fullscreen_editor(data); - return true; + create_fullscreen_editor(data); + return true; } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index ea4a41b..33befa9 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -186,31 +186,27 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info if (!ad) return; - if (app_data->app_type == APP_TYPE_KEYBOARD_FROM_SMS) - input_keyboard_launch(ad->win_main); - else - input_keyboard_launch_with_ui(ad->win_main, data); + input_keyboard_launch(ad->win_main, data); } static void __bt_connection_result_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { - char *val = NULL; - - if (reply == NULL) { - PRINTFUNC(DLOG_ERROR, "service_h is NULL"); - return; - } - - app_control_get_extra_data(reply, "__BT_CONNECTION__", &val); - if (val) { - if ( strcmp(val, "Connected") == 0 ) { - PRINTFUNC(DLOG_ERROR, "BT Connected"); - } else { - PRINTFUNC(DLOG_ERROR, "BT Not Connected"); - } - - free(val); - } + char *val = NULL; + + if (reply == NULL) { + PRINTFUNC(DLOG_ERROR, "service_h is NULL"); + return; + } + + app_control_get_extra_data(reply, "__BT_CONNECTION__", &val); + if (val) { + if ( strcmp(val, "Connected") == 0 ) { + PRINTFUNC(DLOG_ERROR, "BT Connected"); + } else { + PRINTFUNC(DLOG_ERROR, "BT Not Connected"); + } + free(val); + } } @@ -227,14 +223,9 @@ static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_in char *reply = input_smartreply_get_nth_item(index); if (reply) { input_smartreply_send_feedback(reply); - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, reply, "smartreply"); - free(reply); - } else { - reply_to_sender_by_callback(reply, "smartreply"); - free(reply); - elm_exit(); - } + reply_to_sender_by_callback(reply, "smartreply"); + free(reply); + elm_exit(); } } } @@ -285,19 +276,15 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info //@ToDo : should call reply function when any template string is selected and confirmed. // Here reply string will be template_list[index].text.c_str(); if( index < template_list.size()) { - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, gettext(template_list[index].text.c_str()), "template"); - } else { - reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); - elm_exit(); - } + reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); + elm_exit(); } } } static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { - if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { + if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { Evas_Object* btn = elm_button_add(obj); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -518,78 +505,6 @@ void set_source_caller_app_id(app_control_h app_control) } } -void reply_to_sender_by_appcontrol(void *data, const char *value, const char *type) -{ - PRINTFUNC(DLOG_DEBUG, ""); - - int ret; - char *app_id; - - app_control_h app_control; - - App_Data *appdata = (App_Data *)data; - - if(!appdata){ - PRINTFUNC(DLOG_ERROR, "Null pointer"); - return; - } - - ret = app_control_create(&app_control); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not create app_control : %d", ret); - return; - } - - app_id = g_input_keyboard_data.app_id; - if (app_id == NULL) { - PRINTFUNC(DLOG_INFO, "app id is undefined, use defualt"); - app_id = "com.samsung.message.appcontrol.compose"; - } - - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose")){ - app_id = "com.samsung.msg-send"; - } - - app_control_set_app_id(app_control, app_id); - app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); -/* - ret = app_control_set_window(app_control, - elm_win_xwindow_get(appdata->win_main)); - if (ret != APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_ERROR, "Can not app control set window : %d", ret); - app_control_destroy(app_control); - return; - } -*/ - if (g_input_keyboard_data.data_array && g_input_keyboard_data.data_array_len > 0) { - app_control_add_extra_data_array(app_control, - "selector_keyboard_data_array", - (const char**)(g_input_keyboard_data.data_array), - g_input_keyboard_data.data_array_len); - } - - app_control_add_extra_data(app_control, "selector_send_data_array", "sending_popup"); - - if (value) - app_control_add_extra_data(app_control, "selected_context", value); - - if (type) - app_control_add_extra_data(app_control, "reply_type", type); - - set_source_caller_app_id(app_control); - - ret = app_control_send_launch_request(app_control, - _app_control_send_reply_cb, - NULL); - - if (ret != APP_CONTROL_ERROR_NONE) - PRINTFUNC(DLOG_ERROR, "Can not launch app_control: %d", ret); - - app_control_destroy(app_control); - - return; -} - void reply_to_sender_by_callback(const char *value, const char *type) { PRINTFUNC(DLOG_DEBUG, ""); @@ -1228,25 +1143,9 @@ void _app_service(app_control_h service, void* user_data) int ret; bool b_ret; char *context = NULL; - char *app_id = NULL; app_control_clone(&(app_data->source_app_control), service); - app_data->reply_type = REPLY_APP_NORMAL; - ret = app_control_get_extra_data(service, "selector_keyboard_app_id", &app_id); - if (ret == APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_DEBUG, "app_id = %s", app_id); - } - - if(app_id){ - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose") || !strcmp(app_id, "com.samsung.wemail-send")) { - app_data->reply_type = REPLY_APP_CONTROL; - } else { - app_data->reply_type = REPLY_APP_NORMAL; - } - } - if (app_id) - free(app_id); bool is_type_reply = false; ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); @@ -1264,11 +1163,6 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); _keyboard_clicked_cb((void *)app_data, NULL, NULL); goto ACTIVATE; - } else if (!strcmp(context, "keyboard_input_from_sms")) { - app_data->app_type = APP_TYPE_KEYBOARD_FROM_SMS; - input_keyboard_init(service); - _keyboard_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; } else if (!strcmp(context, "input_reply")) { app_data->app_type = APP_TYPE_REPLY; is_type_reply = true; diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index ed41fc0..1fd68c9 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -480,14 +480,10 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve PRINTFUNC(DLOG_DEBUG, "result_text = %s", result_text.c_str()); input_smartreply_send_feedback(result_text.c_str()); - if(app_data->reply_type == REPLY_APP_CONTROL){ - reply_to_sender_by_appcontrol((void*)app_data, result_text.c_str(), "voice"); - } else { - reply_to_sender_by_callback(result_text.c_str(), "voice"); - destroy_voice(); - powerUnlock(); - elm_exit(); - } + reply_to_sender_by_callback(result_text.c_str(), "voice"); + destroy_voice(); + powerUnlock(); + elm_exit(); return; } @@ -1765,22 +1761,7 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) panel = elm_panel_add(panel_layout); elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT); elm_layout_theme_set(panel, "panel", "left_confirm", "default"); - if(app_data->source_app_control){ - int ret; - char *app_id = NULL; - ret = app_control_get_extra_data(app_data->source_app_control, "selector_keyboard_app_id", &app_id); - if (ret == APP_CONTROL_ERROR_NONE) { - PRINTFUNC(DLOG_DEBUG, "app_id = %s", app_id); - } - - if(app_id){ - if(!strcmp(app_id, "com.samsung.message.appcontrol.compose") - || !strcmp(app_id, "com.samsung.wemail-send")){ - elm_layout_theme_set(panel, "panel", "left_sending", "default"); - } - free(app_id); - } - } + elm_layout_theme_set(panel, "panel", "left_sending", "default"); elm_layout_signal_callback_add(panel, "cue,clicked", "elm", _panel_cue_clicked_cb, (void *) voicedata); evas_object_show(panel); -- 2.7.4 From 522eabfda1a07542a5440a035acf6606b51a61e3 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 22 Jul 2016 14:13:25 +0900 Subject: [PATCH 12/16] remove the unused legacy code Change-Id: I114d5084962d7424f631da90dc0812937be3b233 Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 11 ----------- src/w-input-stt-voice.cpp | 39 +++++---------------------------------- 2 files changed, 5 insertions(+), 45 deletions(-) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 33befa9..307af6d 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -50,13 +50,8 @@ static unsigned int g_template_current_number = 0; /* currnetly loaded template Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary -static Eina_Bool force_highlight_to_top = EINA_FALSE; -static Eina_Bool force_highlight_to_bottom = EINA_FALSE; -static Eina_Bool is_genlist_highlighed = EINA_FALSE; - void _init_app_data(App_Data* app_data); static void _app_language_changed(app_event_info_h event_info, void *user_data); -static int _app_control_request_transient_app_cb(void *data); static char *_genlist_text_set_theme_color(const char *str, const char *code); @@ -443,11 +438,6 @@ static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info elm_genlist_realized_items_update(obj); } -static int _app_control_request_transient_app_cb(void *data) -{ - return 0; -} - static char *_genlist_text_set_theme_color(const char *str, const char *code) { @@ -1189,7 +1179,6 @@ void _app_service(app_control_h service, void* user_data) ACTIVATE : elm_win_activate(app_data->win_main); -// app_control_request_transient_app(service, elm_win_xwindow_get(app_data->win_main), _app_control_request_transient_app_cb, NULL); if(context) free(context); } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 1fd68c9..1b90386 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -52,8 +52,6 @@ extern VoiceData *my_voicedata; static bool power_state = false; -static bool bottom_button_access_state = false; - static Evas_Object *radio_gp = NULL; Evas_Object *g_setting_window = NULL; static Evas_Object *g_setting_naviframe = NULL; @@ -67,9 +65,6 @@ static Elm_Genlist_Item_Class itc_title; static Elm_Genlist_Item_Class itc_1text; static Elm_Genlist_Item_Class itc_2text; -static bool g_send_button_clicked = false; -//accessbility -static bool g_mic_clicked = false; static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); @@ -94,23 +89,6 @@ char *disp_lang_array[7] = { "한국어", }; - -typedef enum { - STT_VOICE_AUTO, - STT_VOICE_DE_DE, - STT_VOICE_EN_GB, - STT_VOICE_EN_US, - STT_VOICE_ES_ES, - STT_VOICE_ES_US, - STT_VOICE_FR_FR, - STT_VOICE_IT_IT, - STT_VOICE_PT_BR, - STT_VOICE_RU_RU, - STT_VOICE_ZH_CN, - STT_VOICE_JA_JP, - STT_VOICE_KO_KR -}STT_VOICE_LANGUAGE_I; - typedef enum { STT_VOICE_N66_AUTO, STT_VOICE_N66_EN_US, @@ -458,13 +436,6 @@ static Eina_Bool _mic_button_enable_cb(void *data) static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) { - if(g_send_button_clicked == true){ - PRINTFUNC(DLOG_DEBUG, "skipped seding STT result"); - return; - } - - g_send_button_clicked = true; - if(!data) return; @@ -1597,8 +1568,8 @@ static Evas_Object *create_textblock(void* data) evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); -// elm_scroller_page_size_set(scroller, 0, 50); -// elm_scroller_page_scroll_limit_set(scroller, 0, 1); + elm_scroller_page_size_set(scroller, 0, 50); + elm_scroller_page_scroll_limit_set(scroller, 0, 1); elm_object_scroll_lock_x_set(scroller, EINA_TRUE); @@ -1654,7 +1625,7 @@ static Evas_Object *create_progressbar(Evas_Object *parent) progressbar = elm_progressbar_add(parent); elm_object_style_set(progressbar, "voice_input/process/small"); - //elm_progressbar_pulse(progressbar, EINA_TRUE); + elm_progressbar_pulse(progressbar, EINA_TRUE); evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -1713,11 +1684,11 @@ static Evas_Object *create_fullview(Evas_Object *parent, VoiceData *r_voicedata) elm_layout_file_set(layout_main, edj_path.c_str(), "mic_control"); - //elm_object_content_set(parent, layout_main); + elm_object_content_set(parent, layout_main); //Canvas for Cairo effect Evas_Object *canvas = evas_object_image_filled_add(evas_object_evas_get(layout_main)); -// evas_object_image_alpha_set(canvas, EINA_TRUE); + evas_object_image_alpha_set(canvas, EINA_TRUE); evas_object_size_hint_align_set(canvas, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(canvas, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_move(canvas, 0, 0); -- 2.7.4 From d23da1c0f3e3bffa0adbc0cf79299425d0522601 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Fri, 22 Jul 2016 14:15:38 +0900 Subject: [PATCH 13/16] fix the issue that not showed left cue button Change-Id: I9e8ee6b7961bd294d2f681aa26d0bc2faff1f88f Signed-off-by: sungwook79.park --- src/w-input-stt-voice.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 1b90386..23160a8 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -194,7 +194,7 @@ static inline Evas_Coord get_text_block_size(Evas_Object *obj, std::string text) if(strbuf) free(strbuf); if(tb) evas_object_del(tb); if(st) evas_textblock_style_free(st); - if(cur) evas_textblock_cursor_free(cur); +// if(cur) evas_textblock_cursor_free(cur); return height; } @@ -1819,6 +1819,12 @@ int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata) return FALSE; } + if (NULL != voicedata->textblock_timer) { + PRINTFUNC(DLOG_DEBUG, "delete previous textblock"); + ecore_timer_del(voicedata->textblock_timer); + voicedata->textblock_timer = NULL; + } + return TRUE; } -- 2.7.4 From 89a76f7caba2626b82a9e150551094755bee3b5c Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Mon, 25 Jul 2016 17:11:29 +0900 Subject: [PATCH 14/16] remove the smartreply and template feature Change-Id: I11cc3a5f57c6f88cd60dd379d4a929bd2956400b Signed-off-by: sungwook79.park --- inc/w-input-smartreply.h | 50 ---- inc/w-input-template.h | 46 --- packaging/org.tizen.inputdelegator.spec | 1 - src/CMakeLists.txt | 4 - src/w-input-emoticon.cpp | 2 - src/w-input-keyboard.cpp | 10 - src/w-input-selector.cpp | 481 -------------------------------- src/w-input-smartreply.cpp | 158 ----------- src/w-input-stt-voice.cpp | 2 - src/w-input-template.cpp | 290 ------------------- 10 files changed, 1044 deletions(-) delete mode 100755 inc/w-input-smartreply.h delete mode 100755 inc/w-input-template.h delete mode 100755 src/w-input-smartreply.cpp delete mode 100755 src/w-input-template.cpp diff --git a/inc/w-input-smartreply.h b/inc/w-input-smartreply.h deleted file mode 100755 index 87f8c05..0000000 --- a/inc/w-input-smartreply.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef _W_INPUT_SMARTREPLY_H_ -#define _W_INPUT_SMARTREPLY_H_ - -#include -#include - -typedef void (*input_smartreply_changed)(void *user_data); - - -bool input_smartreply_init(app_control_h app_control); - -void input_smartreply_deinit(void); - -const char *input_smartreply_get_lang(void); - -bool input_smartreply_get_reply(void); - -bool input_smartreply_get_reply_async(void); - -int input_smartreply_get_reply_num(void); - -char *input_smartreply_get_nth_item(int index); - -bool input_smartreply_send_feedback(const char *str); - -void input_smartreply_set_notify(input_smartreply_changed callback, - void *user_data); - -void input_smartreply_unset_notify(void); - -bool input_smartreply_is_enabled(void); - -#endif diff --git a/inc/w-input-template.h b/inc/w-input-template.h deleted file mode 100755 index 1902530..0000000 --- a/inc/w-input-template.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __W_INPUT_TEMPLATE_H_ -#define __W_INPUT_TEMPLATE_H_ - -#include -#include - -#include - -struct TemplateData { - std::string text; - bool use_gettext; -}; - -typedef void (*input_template_changed) (void *user_data); - - -void input_template_init(app_control_h app_control); - -void input_template_deinit(void); - -const std::vector input_template_get_list(void); - -void input_template_set_notify(input_template_changed callback, - void *user_data); - -void input_template_unset_notify(void); - -bool input_template_is_user_template(void); - -#endif diff --git a/packaging/org.tizen.inputdelegator.spec b/packaging/org.tizen.inputdelegator.spec index 75ee232..2af5a00 100755 --- a/packaging/org.tizen.inputdelegator.spec +++ b/packaging/org.tizen.inputdelegator.spec @@ -31,7 +31,6 @@ BuildRequires: pkgconfig(stt) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(sqlite3) -#BuildRequires: pkgconfig(smartreply) %if %{enable_log_manager} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 345580f..5e39c91 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,6 @@ PKG_CHECK_MODULES(STT REQUIRED stt) PKG_CHECK_MODULES(VCONF REQUIRED vconf) PKG_CHECK_MODULES(DB_UTIL_PKG REQUIRED db-util) PKG_CHECK_MODULES(SQLITE3_PKG REQUIRED sqlite3) -#PKG_CHECK_MODULES(SMARTREPLY REQUIRED smartreply) #PKG_CHECK_MODULES(GRAPHICS_EXTENSION REQUIRED graphics-extension) #PKG_CHECK_MODULES(WNOTI_SERVICE REQUIRED wnoti-service2) #PKG_CHECK_MODULES(SAP_CLIENT_STUB_API REQUIRED sap-client-stub-api) @@ -38,7 +37,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${DB_UTIL_PKG_INCLUDE_DIRS} ${SQLITE3_PKG_INCLUDE_DIRS} ${DATA_CONTROL_INCLUDE_DIRS} - ${SMARTREPLY_INCLUDE_DIRS} ${WNOTI_SERVICE_INCLUDE_DIRS} ${SAP_CLIENT_STUB_API_INCLUDE_DIRS}) @@ -57,7 +55,6 @@ LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS} ${DB_UTIL_PKG_LIBRARY_DIRS} ${SQLITE3_PKG_LIBRARY_DIRS} ${VCONF_LIBRARY_DIRS} - ${SMARTREPLY_LIBRARY_DIRS} ${WNOTI_SERVICE_LIBRARY_DIRS} ${SAP_CLIENT_STUB_API_LIBRARY_DIRS} ) @@ -79,7 +76,6 @@ TARGET_LINK_LIBRARIES(${W_INPUT_SELECTOR} ${DB_UTIL_PKG_LIBRARIES} ${SQLITE3_PKG_LIBRARIES} ${VCONF_LIBRARIES} -# ${SMARTREPLY_LIBRARIES} ) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index db808bd..33be4de 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -21,7 +21,6 @@ #include "Debug.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" #define EMOTICON_CNT 27 @@ -136,7 +135,6 @@ static void _rotary_selector_item_clicked(void *data, Evas_Object *obj, void *ev const Eina_Unicode unicode_event[2] = { emoticon_info[i].code, 0 }; char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length); - input_smartreply_send_feedback(utf_8); reply_to_sender_by_callback((const char*)utf_8, "emoticon"); PRINTFUNC(SECURE_DEBUG, "[%d]%s", i, utf_8); diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 486ffd8..ec6393d 100755 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -23,7 +23,6 @@ #include "w-input-keyboard.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" extern InputKeyboardData g_input_keyboard_data; extern App_Data* app_data; @@ -42,12 +41,6 @@ static void input_keyboard_app_control_send_reply_cb(app_control_h request, app_ int ret; ret = app_control_get_extra_data(reply, "template_feedback", &feedback); - - if (ret == APP_CONTROL_ERROR_NONE) { - if (feedback) { - input_smartreply_send_feedback(feedback); - } - } } reply_to_sender_by_callback(feedback, "keyboard"); free(feedback); @@ -102,9 +95,6 @@ void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) const char *getText = elm_entry_entry_get(entry); LOGD("button key clicked!! : getText = %s", getText); - if (getText) - input_smartreply_send_feedback(getText); - char *app_id = NULL; app_control_get_caller(app_data->source_app_control, &app_id); if (app_id != NULL) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 307af6d..5ce1a98 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -26,8 +26,6 @@ //#include "ui_extension.h" #include "w-input-selector.h" -#include "w-input-template.h" -#include "w-input-smartreply.h" #include "w-input-keyboard.h" #include "w-input-stt-ise.h" #include "w-input-emoticon.h" @@ -45,8 +43,6 @@ InputKeyboardData g_input_keyboard_data; static Elm_Object_Item *it_empty; static Elm_Object_Item *it_title; static Elm_Object_Item *it_plus; -static int g_smartreply_current_number = 0; /* currently loaded smartreply number */ -static unsigned int g_template_current_number = 0; /* currnetly loaded template number */ Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary @@ -57,9 +53,6 @@ static char *_genlist_text_set_theme_color(const char *str, const char *code); Evas_Object* _create_genlist(Evas_Object* parent); void _create_genlist_items(void* user_data, bool is_type_reply); -void _update_genlist_items(void *user_data); -void _update_smartreply_items(void *user_data); -void _update_template_items(void *user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); @@ -147,18 +140,6 @@ static void _stt_clicked_cb(void *data, Evas_Object * obj, void *event_info) } } -static void _input_smartreply_notify_cb(void *user_data) -{ - ecore_main_loop_iterate(); - _update_genlist_items((void *)app_data); -} - -static void _input_template_notify_cb(void *user_data) -{ - _update_genlist_items((void *)app_data); -} - - static void _emoticon_clicked_cb(void *data, Evas_Object * obj, void *event_info) { App_Data* ad = (App_Data*)data; @@ -205,78 +186,6 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } -static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - int index = (unsigned int) elm_object_item_data_get(item); - - char *reply = input_smartreply_get_nth_item(index); - if (reply) { - input_smartreply_send_feedback(reply); - reply_to_sender_by_callback(reply, "smartreply"); - free(reply); - elm_exit(); - } - } -} - -static void __ise_template_add_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - if(is_sap_connection() == EINA_TRUE){ - // Show toast popup - show_popup_toast(gettext("WDS_IME_TPOP_ADD_TEMPLATE_ON_YOUR_PHONE_ABB"), true); - - // send message to Host - app_control_h appctrl; - app_control_create(&appctrl); - app_control_set_app_id(appctrl, "com.samsung.w-manager-service"); - app_control_add_extra_data(appctrl, "type", "gm_setting"); - app_control_add_extra_data(appctrl, "data/setting_menu", "texttemplate_setting"); - app_control_send_launch_request(appctrl, NULL, NULL); - app_control_destroy(appctrl); - } else { - app_control_h app_control; - app_control_create(&app_control); - app_control_set_app_id(app_control, "com.samsung.bt-connection-popup"); - app_control_add_extra_data(app_control, "msg", "perform"); - app_control_send_launch_request(app_control, __bt_connection_result_cb, NULL); - app_control_destroy(app_control); - } - } -} - -static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info) -{ - App_Data* app_data = (App_Data*) data; - Elm_Object_Item *item = (Elm_Object_Item *) event_info; - int index = 0; - - if (item) { - elm_genlist_item_selected_set(item, EINA_FALSE); - - index = (unsigned int) elm_object_item_data_get(item); - const std::vector template_list = input_template_get_list(); - - //@ToDo : should call reply function when any template string is selected and confirmed. - // Here reply string will be template_list[index].text.c_str(); - if( index < template_list.size()) { - reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template"); - elm_exit(); - } - } -} - static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) { @@ -338,99 +247,6 @@ static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, return NULL; } -static char * __ise_smartreply_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - int index; - char *reply = NULL; - - index = (int)data; - if (index < 0) - return NULL; - - reply = input_smartreply_get_nth_item(index); - if (reply == NULL) - return NULL; - - /* Set hightlight color on first 3 smartreply items */ - if (index < 3) { - char *colored = _genlist_text_set_theme_color(reply, "AT0113"); - - if (colored == NULL) { - return reply; - } else { - free(reply); - return colored; - } - } - - return reply; - } - return NULL; -} - -static char * __ise_template_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - unsigned int index = (unsigned int)data; - const std::vector template_list = input_template_get_list(); - - if(index < template_list.size()) { - if(template_list[index].use_gettext) { - return strdup(gettext(template_list[index].text.c_str())); - } else { - Eina_Strbuf *buf = NULL; - const char *str = NULL; - char *markup = NULL; - - buf = eina_strbuf_new(); - if(buf) { - eina_strbuf_append(buf, template_list[index].text.c_str()); - eina_strbuf_replace_all(buf, "\n", ""); - eina_strbuf_replace_all(buf, "\r", ""); - - str = eina_strbuf_string_get(buf); - - if (str) { - markup = elm_entry_utf8_to_markup(str); - } - eina_strbuf_free(buf); - } - - return markup; - } - } - } - return NULL; -} - -static char * __ise_addtemplate_gl_text_get(void *data, Evas_Object *obj, const char *part) -{ - if(!strcmp(part, "elm.text")) { - return(strdup(gettext("WDS_IME_MBODY_ADD_TEMPLATE_ABB"))); - } - return NULL; -} - -static Evas_Object * __ise_gl_1button_content_get(void *data, Evas_Object *obj, const char *part) -{ - if (!strcmp(part, "elm.icon")) { - Evas_Object* btn = elm_button_add(obj); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); - Evas_Object* ic = elm_image_add(btn); - elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); - string path = get_resource_path(); - elm_object_style_set(btn, "ime_button_template"); - string path_ic = path + "/images/w_list_add_ic.png"; - elm_image_file_set(ic, path_ic.c_str(), NULL); - elm_object_content_set(btn, ic); - evas_object_layer_set(btn, 32000); - - return btn; - } - return NULL; -} static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info) { @@ -733,7 +549,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) } elm_genlist_clear(app_data->genlist); - g_smartreply_current_number = 0; /* reset previous smartreply size to 0 */ Elm_Genlist_Item_Class * itc0 = elm_genlist_item_class_new(); itc0->item_style = "title"; @@ -765,25 +580,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); } - if (input_smartreply_is_enabled() == false) { - _update_template_items(app_data); - if(g_template_current_number > 0) { - Evas_Object *circle_genlist = (Evas_Object *) evas_object_data_get(app_data->genlist, "circle"); - eext_circle_object_genlist_scroller_policy_set(circle_genlist, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - } - } else { - // dummy title for bottom - Elm_Object_Item *dummy; - - dummy = elm_genlist_item_append(app_data->genlist, itc0, - NULL, NULL, - ELM_GENLIST_ITEM_NONE, - NULL, NULL); - - elm_genlist_item_select_mode_set(dummy, ELM_OBJECT_SELECT_MODE_NONE); - } - Elm_Object_Item *item = elm_genlist_item_next_get(it_title); elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); @@ -794,269 +590,6 @@ void _create_genlist_items(void* user_data, bool is_type_reply) elm_genlist_item_class_free(itc1); } -void _update_genlist_items(void *user_data) -{ - int len = 0; - - if (input_smartreply_is_enabled()) - len = input_smartreply_get_reply_num(); - - if (g_smartreply_current_number != len) - _update_smartreply_items(user_data); - - _update_template_items(user_data); - - g_smartreply_current_number = len; - - if (g_smartreply_current_number > 0 || g_template_current_number > 0) { - Evas_Object *circle_genlist = (Evas_Object *) evas_object_data_get(app_data->genlist, "circle"); - eext_circle_object_genlist_scroller_policy_set(circle_genlist, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - } -} - -void _update_smartreply_items(void *user_data) -{ - App_Data* app_data; - - Elm_Object_Item *first; - Elm_Object_Item *menu; - Elm_Object_Item *pos; - - int len = 0; - int i = 0; - - app_data = (App_Data *)user_data; - - if (app_data == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get app_data"); - return; - } - - if (app_data->genlist == NULL) { - /* smartreply will update when genlist is exist only */ - PRINTFUNC(DLOG_ERROR, "Can not get getlist"); - return; - } - - if (input_smartreply_is_enabled()) - len = input_smartreply_get_reply_num(); - - if (g_smartreply_current_number == len) - return; - - first = elm_genlist_first_item_get(app_data->genlist); - menu = elm_genlist_item_next_get(first); - - /* Remove current smartreply list */ - pos = elm_genlist_item_next_get(menu); - for (i = 0; i < g_smartreply_current_number; i++) { - Elm_Object_Item *next; - - if (pos == NULL) - break; - - next = elm_genlist_item_next_get(pos); - elm_object_item_del(pos); - pos = next; - } - - /* Append newly added smartreply list */ - if (len > 0) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text"; - itc->func.text_get = __ise_smartreply_gl_text_get; - itc->func.content_get = NULL; - itc->func.state_get = NULL; - itc->func.del = NULL; - - pos = menu; - for (i = 0; i < len; i++) { - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - (void *)i, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_smartreply_gl_sel, - app_data); - } - - if (menu) - elm_genlist_item_show(menu, ELM_GENLIST_ITEM_SCROLLTO_TOP); - - elm_genlist_item_class_free(itc); - } - - g_smartreply_current_number = len; -} - - -void _update_template_items(void *user_data) -{ - App_Data* app_data; - - Elm_Object_Item *first; - Elm_Object_Item *menu; - Elm_Object_Item *pos; - Elm_Object_Item *template_pos; - - unsigned int template_len = 0; - unsigned int i = 0; - - app_data = (App_Data *)user_data; - - if (app_data == NULL) { - PRINTFUNC(DLOG_ERROR, "Can not get app_data"); - return; - } - - if (app_data->genlist == NULL) { - /* smartreply will update when genlist is exist only */ - PRINTFUNC(DLOG_ERROR, "Can not get getlist"); - return; - } - - if (app_data->app_type == APP_TYPE_REPLY) { - menu = elm_genlist_first_item_get(app_data->genlist); - } else { - first = elm_genlist_first_item_get(app_data->genlist); - menu = elm_genlist_item_next_get(first); - } - - pos = menu; - /* move to smartreply next if it need */ - if (input_smartreply_is_enabled()) { - int smartreply_len = 0; - - smartreply_len = input_smartreply_get_reply_num(); - if (smartreply_len > 0) { - int j = 0; - - for (j = 0; j < smartreply_len; j++) { - if (pos == NULL) - break; - - pos = elm_genlist_item_next_get(pos); - } - } - } - - /* Remove Current template list */ - template_pos = elm_genlist_item_next_get(pos); - for (i = 0 ; i < g_template_current_number; i++) { - Elm_Object_Item *next; - - if (template_pos == NULL) { - PRINTFUNC(DLOG_ERROR, "Template mismatched, iter : %d, current num: %d", - i, g_template_current_number); - break; - } - - next = elm_genlist_item_next_get(template_pos); - elm_object_item_del(template_pos); - template_pos = next; - } - - /* Remove Add or dummpy button */ - if(template_pos) { - Elm_Object_Item *next; - - next = elm_genlist_item_next_get(template_pos); - elm_object_item_del(template_pos); - template_pos = next; - } - - /* Append New Template list */ - const std::vector template_list = input_template_get_list(); - template_len = 0; - - if (template_list.size() > 0) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text"; - itc->func.text_get = __ise_template_gl_text_get; - itc->func.content_get = NULL; - itc->func.state_get = NULL; - itc->func.del = NULL; - - for (i = 0; i < template_list.size(); i++) { - bool matched = false; - - if(!template_list[i].use_gettext) { - int smartreply_len = 0; - int j = 0; - - smartreply_len = input_smartreply_get_reply_num(); - for (j = 0; j < smartreply_len; j++) { - char *reply = NULL; - - reply = input_smartreply_get_nth_item(j); - if (reply) { - if (!strcmp(reply, template_list[i].text.c_str())) { - matched = true; - free(reply); - break; - } - free(reply); - } - } - } - - if (matched == false) { - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - (void *)i, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_template_gl_sel, - app_data); - template_len++; - } - } - - elm_genlist_item_class_free(itc); - } - - - // template add button (+) -/* if (!input_template_is_user_template()) { - Elm_Genlist_Item_Class *itc; - - itc = elm_genlist_item_class_new(); - - itc->item_style = "1text.1icon"; - itc->func.text_get = __ise_addtemplate_gl_text_get;; - itc->func.content_get = __ise_gl_1button_content_get; - itc->func.state_get = NULL; - itc->func.del = NULL; - - - pos = elm_genlist_item_insert_after(app_data->genlist, - itc, - NULL, - NULL, - pos, - ELM_GENLIST_ITEM_NONE, - __ise_template_add_gl_sel, - app_data); - - elm_genlist_item_class_free(itc); - } -*/ - if (menu) - elm_genlist_item_show(menu, ELM_GENLIST_ITEM_SCROLLTO_TOP); - - g_template_current_number = template_len; -} - - bool _app_create(void* user_data) { int width = 1000, height = 1000; @@ -1164,16 +697,6 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); -// input_smartreply_init(service); -// input_smartreply_set_notify(_input_smartreply_notify_cb, NULL); - -// if (input_smartreply_is_enabled()) -// input_smartreply_get_reply_async(); - - - input_template_init(service); - input_template_set_notify(_input_template_notify_cb, NULL); - _create_genlist_items(app_data, is_type_reply); ACTIVATE : @@ -1211,10 +734,6 @@ void _app_terminate(void* user_data) free(app_data->shared_res_path); input_keyboard_deinit(); - input_smartreply_deinit(); - - input_template_unset_notify(); - input_template_deinit(); } static int init_i18n(const char *domain, const char *dir, char *lang_str) diff --git a/src/w-input-smartreply.cpp b/src/w-input-smartreply.cpp deleted file mode 100755 index d449123..0000000 --- a/src/w-input-smartreply.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Debug.h" - -#include -#include -#include - -#include -#include -//#include - -#include "w-input-smartreply.h" - -#ifndef INPUT_SMARTREPLY_VCONF -#define INPUT_SMARTREPLY_VCONF "db/wms/smart_reply" -#endif - - -typedef struct _InputSmartreplyData InputSmartreplyData; - -struct _InputSmartreplyData -{ - char *caller_id; - char *sender; - char *message; - char *lang; - - int enabled; - - input_smartreply_changed callback; - void *user_data; - -// smartreply_reply_h *candidate_list; - int candidate_list_len; -}; - - -static void _input_smartreply_get_reply_callback(int handle, int error, - int length); -/* Disable smartreply on/off feature -static void _input_smartreply_vconf_changed(keynode_t *key, void *data); -*/ - - -static InputSmartreplyData *g_input_smartreply_data = NULL; - -static void _input_smartreply_get_reply_callback(int handle, int error, - int length) -{ -} - - - -bool input_smartreply_init(app_control_h app_control) -{ - return true; -} - -void input_smartreply_deinit(void) -{ - return; -} - -bool input_smartreply_get_reply(void) -{ - return true; -} - -bool input_smartreply_get_reply_async(void) -{ - return true; -} - -int input_smartreply_get_reply_num(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_ERROR, "InputSmartreplyData uninitialized"); - return 0; - } - - if (g_input_smartreply_data->enabled == 0) { - PRINTFUNC(DLOG_WARN, "Smartreply is disabled"); - return 0; - } - - return g_input_smartreply_data->candidate_list_len; -} - -char *input_smartreply_get_nth_item(int index) -{ - char *message = NULL; - - return message; -} - -bool input_smartreply_send_feedback(const char *str) -{ - return true; -} - - - -void input_smartreply_set_notify(input_smartreply_changed callback, - void *user_data) -{ - if (callback == NULL) { - PRINTFUNC(DLOG_ERROR, "empty callback function"); - return; - } - - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return; - } - - g_input_smartreply_data->callback = callback; - g_input_smartreply_data->user_data = user_data; -} - - -void input_smartreply_unset_notify(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return; - } - - g_input_smartreply_data->callback = NULL; - g_input_smartreply_data->user_data = NULL; -} - -bool input_smartreply_is_enabled(void) -{ - if (g_input_smartreply_data == NULL) { - PRINTFUNC(DLOG_WARN, "InputSmartreplyData uninitialized"); - return false; - } - - if (g_input_smartreply_data->enabled) - return true; - - return false; -} diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 23160a8..a3a2b83 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -28,7 +28,6 @@ #include "Debug.h" #include "w-input-selector.h" -#include "w-input-smartreply.h" #include "w-input-stt-voice.h" #include "w-input-stt-engine.h" #include "w-input-stt-ise.h" @@ -449,7 +448,6 @@ static void on_confirm_button_clicked_cb(void *data, Evas_Object *obj, void *eve } PRINTFUNC(DLOG_DEBUG, "result_text = %s", result_text.c_str()); - input_smartreply_send_feedback(result_text.c_str()); reply_to_sender_by_callback(result_text.c_str(), "voice"); destroy_voice(); diff --git a/src/w-input-template.cpp b/src/w-input-template.cpp deleted file mode 100755 index afe2410..0000000 --- a/src/w-input-template.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Debug.h" - -#include -#include -#include - -#include "w-input-template.h" - - -#define INPUT_TEMPLATE_DB_VCONF "memory/wms/update_text_template_db" - -#define INPUT_TEMPLATE_DB_PATH "/opt/usr/dbspace/.WearableManagerService.db" -#define INPUT_TEMPLATE_QUERY_LEN 1024 - -struct InputTemplate { - std::vector template_list; - bool notify; - bool user_template; - input_template_changed callback; - void *user_data; -}; - -static struct InputTemplate g_input_template; - - -static void _input_template_db_vconf_changed(keynode_t *key, void *data); - -static bool input_template_init_app_control_list(app_control_h app_control); -static bool input_template_init_app_control(app_control_h app_control); -static bool input_template_init_db_util(void); -static bool input_template_init_default(void); - - -static void _input_template_db_vconf_changed(keynode_t *key, void *data) -{ - bool db_status = vconf_keynode_get_bool(key); - - PRINTFUNC(DLOG_DEBUG, "starts :: db_status = %d", db_status); - - if(db_status != 0) - return; - - if (g_input_template.callback) { - // Clear template list and reset to template_list from DB - g_input_template.template_list.clear(); - input_template_init_db_util(); - - g_input_template.callback(g_input_template.user_data); - } -} - -static bool input_template_init_app_control_list(app_control_h app_control) -{ - int ret; - int len; - - char **list = NULL; - - ret = app_control_get_extra_data_array(app_control, - "template_list", &list, &len); - - if (ret != APP_CONTROL_ERROR_NONE) - return false; - - if (list == NULL) - return false; - - for (int i = 0; i < len; i++) { - struct TemplateData data; - - if (*(list + i)) { - // if use_gettext is true, - // it's default template string that requires gettext. - data.use_gettext = false; - data.text = *(list + i); - - g_input_template.template_list.push_back(data); - - free(*(list + i)); - } - } - - free(list); - - g_input_template.user_template = true; - - return true; -} - -static bool input_template_init_app_control(app_control_h app_control) -{ - bool ret; - - if (app_control == NULL) - return false; - - ret = input_template_init_app_control_list(app_control); - if (ret) - return true; - - return false; -} - -static bool input_template_init_db_util(void) -{ - sqlite3 *g_tt_db = NULL; - sqlite3_stmt *stmt = NULL; - - int ret = -1; - - char query[INPUT_TEMPLATE_QUERY_LEN + 1] = {0, }; - - ret = db_util_open(INPUT_TEMPLATE_DB_PATH, &g_tt_db, 0); - - if (ret != SQLITE_OK) { - PRINTFUNC(DLOG_ERROR, "db_util open failed"); - return false; - } - - snprintf(query, INPUT_TEMPLATE_QUERY_LEN, - "select sortId, itemId, checked, message from %s", - "tmpl_msg_table"); - - sqlite3_prepare_v2(g_tt_db, query, strlen(query), &stmt, NULL); - - if (ret != SQLITE_OK) { - PRINTFUNC(DLOG_ERROR, "Can not get query"); - return false; - } - - ret = sqlite3_step(stmt); - - while(ret == SQLITE_ROW) { - struct TemplateData data; - int text_mode; - - // if checked is 0, - // it's default template string that requires gettext. - text_mode = sqlite3_column_int(stmt, 2); - if (text_mode) - data.use_gettext = false; - else - data.use_gettext = true; - - data.text = (char *)sqlite3_column_text(stmt, 3); - PRINTFUNC(DLOG_DEBUG, "db text %s", data.text.c_str()); - g_input_template.template_list.push_back(data); - - ret = sqlite3_step(stmt); - } - - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) - PRINTFUNC(DLOG_ERROR, "Can not finalize sqlite"); - - ret = db_util_close(g_tt_db); - if (ret != SQLITE_OK) - PRINTFUNC(DLOG_ERROR, "Can not close db_util"); - - /* set vconf callback for DB update */ - ret = vconf_notify_key_changed(INPUT_TEMPLATE_DB_VCONF, - _input_template_db_vconf_changed, NULL); - - if (ret < 0) - PRINTFUNC(DLOG_ERROR, "Can not create vconf notify"); - - g_input_template.user_template = false; - return true; -} - -static bool input_template_init_default(void) -{ - struct TemplateData data; - - data.text = "IDS_WMGR_MBODY_HOWS_IT_GOING_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_WHATS_UP_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_ILL_TALK_TO_YOU_SOON_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_WMGR_MBODY_ILL_CALL_YOU_LATER_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_MSG_BODY_WHERE_ARE_YOU_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "IDS_MSG_BODY_WHEN_CAN_WE_MEET_Q_M_TEXT_TEMPLATE"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - - data.text = "WDS_WMGR_MBODY_CALL_ME_LATER"; - data.use_gettext = true; - - g_input_template.template_list.push_back(data); - g_input_template.user_template = false; - - return true; -} - -static void input_template_deinit_db_util(void) -{ - vconf_ignore_key_changed(INPUT_TEMPLATE_DB_VCONF, - _input_template_db_vconf_changed); -} - -void input_template_init(app_control_h app_control) -{ - input_template_unset_notify(); - g_input_template.template_list.clear(); - g_input_template.user_template = false; - - bool ret; - - ret = input_template_init_app_control(app_control); - if (ret) - return; - - ret = input_template_init_db_util(); - if (ret) - return; - - input_template_init_default(); -} - -void input_template_deinit(void) -{ - input_template_unset_notify(); - input_template_deinit_db_util(); - - g_input_template.template_list.clear(); - g_input_template.user_template = false; -} - -const std::vector input_template_get_list(void) -{ - return g_input_template.template_list; -} - -void input_template_set_notify(input_template_changed callback, - void *user_data) -{ - if (callback == NULL) { - PRINTFUNC(DLOG_ERROR, "empty callback function"); - return; - } - - g_input_template.callback = callback; - g_input_template.user_data = user_data; -} - -void input_template_unset_notify(void) -{ - g_input_template.callback = NULL; - g_input_template.user_data = NULL; -} - -bool input_template_is_user_template(void) -{ - return (g_input_template.user_template); -} -- 2.7.4 From a8a44e235a9294633c53150f8d3ec38a9c003e86 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 26 Jul 2016 17:14:03 +0900 Subject: [PATCH 15/16] Show text to textblock in voice input Change-Id: I948fd53fc41452f0b829c54cf763841242449bfc Signed-off-by: sungwook79.park --- src/w-input-stt-voice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index a3a2b83..eefd3db 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1595,7 +1595,7 @@ static Evas_Object *create_textblock(void* data) #define FORMAT_TEXT_AREA_FONT_STYLE \ "DEFAULT='font=Tizen:style=Regular font_size=32 color=#%02x%02x%02x%02x text_class=tizen wrap=mixed align=center' newline='br' b='+ font=Tizen:style=Bold'link='+ underline=on underline_color=#%02x%02x%02x%02x'" - int a, r, g, b; + int a = 0xFF, r = 0xFF, g = 0xFF, b = 0xFF; char customStyle[512]; // ea_theme_color_get("AT02112", &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); snprintf(customStyle, 512, FORMAT_TEXT_AREA_FONT_STYLE, r, g, b, a, r, g, b, a); -- 2.7.4 From fc3850e8fefca87b30bd95be25565cc31046f36b Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 27 Jul 2016 16:59:04 +0900 Subject: [PATCH 16/16] Add the feature to select multi input type Change-Id: I73ac7f7e14e6301a31d687bb6adace79bbeeb46c Signed-off-by: sungwook79.park --- inc/w-input-selector.h | 8 +- res/edje/w-input-selector.edc | 152 +++++++++++++++++++++++++++++++++ src/w-input-selector.cpp | 189 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 311 insertions(+), 38 deletions(-) mode change 100644 => 100755 res/edje/w-input-selector.edc diff --git a/inc/w-input-selector.h b/inc/w-input-selector.h index 83c1799..3fcd43b 100755 --- a/inc/w-input-selector.h +++ b/inc/w-input-selector.h @@ -82,10 +82,14 @@ struct _InputKeyboardData char *guide_text; char *default_text; }; - typedef struct _InputKeyboardData InputKeyboardData; - +struct _InputTypeData +{ + char **input_type_array; + int input_type_array_len; +}; +typedef struct _InputTypeData InputTypeData; void _app_terminate(void* user_data); void reply_to_sender_by_callback_for_back(); diff --git a/res/edje/w-input-selector.edc b/res/edje/w-input-selector.edc old mode 100644 new mode 100755 index 1afb4d2..d9e9fd3 --- a/res/edje/w-input-selector.edc +++ b/res/edje/w-input-selector.edc @@ -580,6 +580,7 @@ collections { } ) } + //Gesture VI program { name: "do_start_expand_0.0"; action: STATE_SET "default" 0.0; @@ -671,4 +672,155 @@ collections { } + group { + name: "elm/genlist/item/2button/default"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "contents" "base elm.icon.1.touch_area elm.icon.2.touch_area elm.icon.1 elm.icon.2 elm.swallow.center_check"; + data.item: "vi_effect" "off"; + + parts { + PART_LIST_BG + PART_LIST_PADDINGS( + LIST_BUTTON_PADDING_LEFT_SIZE_INC, LIST_BUTTON_PADDING_RIGHT_SIZE_INC, + LIST_BUTTON_PADDING_2BUTTON_TOP_SIZE_INC, LIST_BUTTON_PADDING_BOTTOM_SIZE_INC + ) + PART(SWALLOW, "base", + DESC_LRTB("elm.padding.left", "elm.padding.right", "elm.padding.top", "elm.padding.bottom", + min: 360 0; + fixed: 1 0; + visible: 1; + ) + ) + part { name: "elm.icon.1.touch_area"; + type: SWALLOW; + repeat_events, 0; + description { + state: "default" 0.0; + color: 255 0 0 100; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -5 -5;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +5 +5;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -7 -7;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +7 +7;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.1"; offset: -8 -8;} + rel2 { relative: 1.0 1.0; to: "elm.icon.1"; offset: +8 +8;} + } + } + part { name: "elm.icon.2.touch_area"; + type: SWALLOW; + repeat_events, 0; + description { + state: "default" 0.0; + color: 0 0 255 100; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -6 -5;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +6 +5;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -7 -7;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +7 +7;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.icon.2"; offset: -9 -8;} + rel2 { relative: 1.0 1.0; to: "elm.icon.2"; offset: +9 +8;} + } + } + part { name: "elm.icon.1"; + type: SWALLOW; + repeat_events, 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + fixed: 1 1; + min: 114 114; + max: 114 114; + rel1 { relative: 112/360 0; to: "base"; offset: 0 35;} + rel2 { relative: 112/360 0; to: "base"; offset: 0 35;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + min: 114+(198-114)/2 114+(198-114)/2; + max: 114+(198-114)/2 114+(198-114)/2; + rel1 { relative: ((64+112)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + rel2 { relative: ((64+112)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + min: 198 198; + max: 198 198; + rel1 { relative: 128/360 0; to: "base"; offset: 0 12;} + rel2 { relative: 128/360 0; to: "base"; offset: 0 12;} + } + } + part { name: "elm.icon.2"; + type: SWALLOW; + repeat_events, 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + fixed: 1 1; + min: 114 114; + max: 114 114; + rel1 { relative: 249/360 0; to: "base"; offset: 0 35;} + rel2 { relative: 249/360 0; to: "base"; offset: 0 35;} + } + description { + state: "default" 0.1; + inherit: "default" 0.0; + min: 114+(198-114)/2 114+(99-114)/2; + max: 114+(198-114)/2 114+(198-114)/2; + rel1 { relative: ((249+297)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + rel2 { relative: ((249+297)/2)/360 0; to: "base"; offset: 0 (35+12)/2;} + } + description { + state: "default" 0.9; + inherit: "default" 0.0; + min: 198 198; + max: 198 198; + rel1 { relative: 297/360 0; to: "base"; offset: 0 12;} + rel2 { relative: 297/360 0; to: "base"; offset: 0 12;} + } + } + + PART(SPACER, "elm.padding.fake", + DESC_TB("elm.padding.top","elm.padding.bottom", + min: LIST_BUTTON_PADDING_CENTER_SIZE_INC 0; + max: LIST_BUTTON_PADDING_CENTER_SIZE_INC -1; + fixed: 1 0; + ) + ) + PART(SPACER, "elm.padding.center", + DESC_LTB("elm.padding.fake", "elm.padding.top", "elm.padding.bottom", + min: LIST_BUTTON_PADDING_CENTER_SIZE_INC 0; + max: LIST_BUTTON_PADDING_CENTER_SIZE_INC -1; + fixed: 1 0; + ) + ) + PART(SWALLOW, "elm.swallow.center_check", + description { state: "default" 0.0; + align: 0.5 0.5; + } + ) + } } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 5ce1a98..021f6cd 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -39,6 +39,7 @@ using namespace std; App_Data* app_data = NULL; InputKeyboardData g_input_keyboard_data; +InputTypeData g_input_type_data; static Elm_Object_Item *it_empty; static Elm_Object_Item *it_title; @@ -52,9 +53,10 @@ static void _app_language_changed(app_event_info_h event_info, void *user_data); static char *_genlist_text_set_theme_color(const char *str, const char *code); Evas_Object* _create_genlist(Evas_Object* parent); -void _create_genlist_items(void* user_data, bool is_type_reply); +void _create_genlist_items(void* user_data); static void _popup_close_cb(void *data, Evas_Object *obj, void *event_info); static void _popup_back_cb(void *data, Evas_Object *obj, void *event_info); +static void input_type_deinit(void); @@ -185,6 +187,92 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply } } +static Evas_Object * __ise_gl_2button_content_get(void *data, Evas_Object *obj, const char *part) +{ + char *first_input_type = *(g_input_type_data.input_type_array + 0); + char *second_input_type = *(g_input_type_data.input_type_array + 1); + + if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2"))) { + Evas_Object* btn = elm_button_add(obj); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + + Evas_Object* ic = elm_image_add(btn); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + string path = get_resource_path(); + if (!strcmp(part, "elm.icon.1")) { + elm_object_style_set(btn, "anchor"); + string path_ic; + if(!strcmp(first_input_type, "input_voice")) { + path_ic = path + "images/w_mode_stt_ic.png"; + } + else if(!strcmp(first_input_type, "input_emoticon")) { + path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; + } + else if(!strcmp(first_input_type, "input_keyboard")) { + path_ic = path + "images/w_mode_keyboard_ic.png"; + evas_object_propagate_events_set(btn, EINA_FALSE); + } + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + } else if (!strcmp(part, "elm.icon.2")){ + elm_object_style_set(btn, "anchor"); + string path_ic; + if(!strcmp(second_input_type, "input_voice")) { + path_ic = path + "images/w_mode_stt_ic.png"; + } + else if(!strcmp(second_input_type, "input_emoticon")) { + path_ic = path + "images/Delta_w_mode_emoticon_ic.png"; + } + else if(!strcmp(second_input_type, "input_keyboard")) { + path_ic = path + "images/w_mode_keyboard_ic.png"; + evas_object_propagate_events_set(btn, EINA_FALSE); + } + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + } + return btn; + } else if (!strcmp(part, "elm.icon.1.touch_area") || (!strcmp(part, "elm.icon.2.touch_area"))) { + Evas_Object* btn = elm_button_add(obj); + elm_object_style_set(btn, "touch_area"); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + string path = get_resource_path(); + if (!strcmp(part, "elm.icon.1.touch_area")) { + evas_object_layer_set(btn, 32000); + if(!strcmp(first_input_type, "input_voice")) { + evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); + } + else if(!strcmp(first_input_type, "input_emoticon")) { + evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); + } + else if(!strcmp(first_input_type, "input_keyboard")) { + evas_object_propagate_events_set(btn, EINA_FALSE); + evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); + } + } else if (!strcmp(part, "elm.icon.2.touch_area")){ + evas_object_layer_set(btn, 32000); + if(!strcmp(second_input_type, "input_voice")) { + evas_object_smart_callback_add(btn, "clicked", _stt_clicked_cb, app_data); + } + else if(!strcmp(second_input_type, "input_emoticon")) { + evas_object_smart_callback_add(btn, "clicked", _emoticon_clicked_cb, app_data); + } + else if(!strcmp(second_input_type, "input_keyboard")) { + evas_object_propagate_events_set(btn, EINA_FALSE); + evas_object_smart_callback_add(btn, "clicked", _keyboard_clicked_cb, app_data); + } + } + return btn; + } else if (!strcmp(part, "base")) { + Evas_Object* btn = elm_button_add(obj); + elm_object_style_set(btn, "ime_transparent"); + return btn; + } + return NULL; +} static Evas_Object * __ise_gl_3button_content_get(void *data, Evas_Object *obj, const char *part) { @@ -536,7 +624,7 @@ _main_menu_title_text_get(void *data, Evas_Object *obj, const char *part) return strdup(buf); } -void _create_genlist_items(void* user_data, bool is_type_reply) +void _create_genlist_items(void* user_data) { LOGD("[psw] _create_genlist_items"); @@ -558,12 +646,19 @@ void _create_genlist_items(void* user_data, bool is_type_reply) itc0->func.del = NULL; Elm_Genlist_Item_Class * itc1 = elm_genlist_item_class_new(); - itc1->item_style = "3button"; - itc1->func.text_get = NULL; - itc1->func.content_get = __ise_gl_3button_content_get; - itc1->func.state_get = NULL; - itc1->func.del = NULL; - + if(g_input_type_data.input_type_array_len == 2){ + itc1->item_style = "2button"; + itc1->func.text_get = NULL; + itc1->func.content_get = __ise_gl_2button_content_get; + itc1->func.state_get = NULL; + itc1->func.del = NULL; + }else{ + itc1->item_style = "3button"; + itc1->func.text_get = NULL; + itc1->func.content_get = __ise_gl_3button_content_get; + itc1->func.state_get = NULL; + itc1->func.del = NULL; + } // dummy title for empty space it_empty = elm_genlist_item_append(app_data->genlist, itc0, @@ -571,15 +666,13 @@ void _create_genlist_items(void* user_data, bool is_type_reply) ELM_GENLIST_ITEM_NONE, NULL, NULL); - if (!is_type_reply) { - // 3 Buttons - it_title = elm_genlist_item_append(app_data->genlist, itc1, - NULL, NULL, - ELM_GENLIST_ITEM_NONE, - NULL, NULL); + // 3 Buttons + it_title = elm_genlist_item_append(app_data->genlist, itc1, + NULL, NULL, + ELM_GENLIST_ITEM_NONE, + NULL, NULL); - elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); - } + elm_genlist_item_select_mode_set(it_title, ELM_OBJECT_SELECT_MODE_NONE); Elm_Object_Item *item = elm_genlist_item_next_get(it_title); elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); @@ -666,29 +759,37 @@ void _app_service(app_control_h service, void* user_data) int ret; bool b_ret; char *context = NULL; + char **input_type_array = NULL; + int input_type_array_len = -1; + bool is_extra_data_array = false; app_control_clone(&(app_data->source_app_control), service); app_data->reply_type = REPLY_APP_NORMAL; - bool is_type_reply = false; - ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); - if (ret == APP_CONTROL_ERROR_NONE) { - if (!strcmp(context, "input_voice")) { - app_data->app_type = APP_TYPE_STT; - _stt_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_emoticon")) { - app_data->app_type = APP_TYPE_EMOTICON; - _emoticon_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_keyboard")) { - app_data->app_type = APP_TYPE_KEYBOARD; - input_keyboard_init(service); - _keyboard_clicked_cb((void *)app_data, NULL, NULL); - goto ACTIVATE; - } else if (!strcmp(context, "input_reply")) { - app_data->app_type = APP_TYPE_REPLY; - is_type_reply = true; + ret = app_control_is_extra_data_array(service, APP_CONTROL_DATA_INPUT_TYPE, &is_extra_data_array); + if( is_extra_data_array == true) { + ret = app_control_get_extra_data_array(service, APP_CONTROL_DATA_INPUT_TYPE, &input_type_array, &input_type_array_len); + g_input_type_data.input_type_array = input_type_array; + g_input_type_data.input_type_array_len = input_type_array_len; + }else{ + ret = app_control_get_extra_data(service, APP_CONTROL_DATA_INPUT_TYPE, &context); + if (ret == APP_CONTROL_ERROR_NONE) { + if (!strcmp(context, "input_voice")) { + app_data->app_type = APP_TYPE_STT; + _stt_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_emoticon")) { + app_data->app_type = APP_TYPE_EMOTICON; + _emoticon_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_keyboard")) { + app_data->app_type = APP_TYPE_KEYBOARD; + input_keyboard_init(service); + _keyboard_clicked_cb((void *)app_data, NULL, NULL); + goto ACTIVATE; + } else if (!strcmp(context, "input_reply")) { + app_data->app_type = APP_TYPE_REPLY; + } } } @@ -697,7 +798,7 @@ void _app_service(app_control_h service, void* user_data) input_keyboard_init(service); - _create_genlist_items(app_data, is_type_reply); + _create_genlist_items(app_data); ACTIVATE : elm_win_activate(app_data->win_main); @@ -734,6 +835,7 @@ void _app_terminate(void* user_data) free(app_data->shared_res_path); input_keyboard_deinit(); + input_type_deinit(); } static int init_i18n(const char *domain, const char *dir, char *lang_str) @@ -776,7 +878,22 @@ static void _app_language_changed(app_event_info_h event_info, void *user_data) } } +void input_type_deinit(void) +{ + int i = 0; + char **data_array = NULL; + data_array = g_input_type_data.input_type_array; + if (data_array) { + for (i = 0; i < g_input_type_data.input_type_array_len; i++) { + if (*(data_array + i)) + free(*(data_array + i)); + } + free(data_array); + } + g_input_type_data.input_type_array = NULL; + g_input_type_data.input_type_array_len = 0; +} int main(int argc, char* argv[]) { -- 2.7.4