From ad3ccbff6ef8777d98b132d4657dcede93cffa0f Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Fri, 16 Dec 2016 20:24:05 +0900 Subject: [PATCH 01/16] Add gengrid auto click Change-Id: I019e6111e9da7459159365bb0e680d515a3af3ee Signed-off-by: Kwangyoun Kim --- src/vc_elm_core.c | 63 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 3b13c80..6ce2a2d 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -311,6 +311,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa evas_event_feed_mouse_up(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 2, NULL); } else if (1 == click_method) { VC_ELM_LOG_DBG("click method - focus/key"); + bool clicked = false; Object_Info* parent_info = ea_object_dump_parent_widget_data_get(info); if (NULL != parent_info) { if (EINA_TRUE == parent_info->focusable) { @@ -323,44 +324,42 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused"); elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); } - } else { - Object_Info* grand_info = ea_object_dump_parent_widget_data_get(parent_info); - while (NULL != grand_info) { - if (EINA_TRUE == grand_info->focusable) { - VC_ELM_LOG_DBG("Focusable Grand parent"); - Elm_Object_Item* item = elm_genlist_at_xy_item_get((Evas_Object*)(grand_info->address), x + w/2, y + h/2, NULL); - if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { - VC_ELM_LOG_DBG("Click event"); - if (EINA_TRUE == elm_object_item_focus_get(item)) { - VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(0.5, __click_event, NULL); - } else { - evas_object_smart_callback_add((Evas_Object*)(grand_info->address), "item,focused", __focused_cb, "item,focused"); - elm_object_item_focus_set(item, EINA_TRUE); - elm_object_focus_set((Evas_Object*)(grand_info->address), EINA_TRUE); - } + clicked = true; + } + } + + if (false == clicked) { + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + while (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + char* widget_type = elm_widget_type_get((parent_info->address)); + VC_ELM_LOG_DBG("type (%s)", widget_type); + Elm_Object_Item* item = NULL; + if (NULL != widget_type && !strcmp(widget_type, "Elm_Genlist")) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, NULL); + if (NULL == item) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w + w/2, y + h/2, NULL); + } + } else if (NULL != widget_type && !strcmp(widget_type, "Elm_Gengrid")) { + int xposret, yposret; + item = elm_gengrid_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, &xposret, &yposret); + } + if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_item_focus_get(item)) { + VC_ELM_LOG_DBG("Already focused"); + ecoret_timer_add(0.5, __click_event, NULL); } else { - item = elm_genlist_at_xy_item_get((Evas_Object*)(grand_info->address), x + w + w/2, y + h/2, NULL); - if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { - VC_ELM_LOG_DBG("Click event 2"); - if (EINA_TRUE == elm_object_item_focus_get(item)) { - VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(0.5, __click_event, NULL); - } else { - evas_object_smart_callback_add((Evas_Object*)(grand_info->address), "item,focused", __focused_cb, "item,focused"); - elm_object_item_focus_set(item, EINA_TRUE); - elm_object_focus_set((Evas_Object*)(grand_info->address), EINA_TRUE); - } - } + evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); + elm_object_item_focus_set(item, EINA_TRUE); + elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); } break; - } else { - grand_info = ea_object_dump_parent_widget_data_get(grand_info); } } + parent_info = ea_object_dump_parent_widget_data_get(parent_info); } - } else { - VC_ELM_LOG_DBG("No parent info"); } } else { VC_ELM_LOG_DBG("Invalid click method"); -- 2.7.4 From 2a97774cb55a4f5e4b876aad7041bbe6b5e2218a Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Fri, 16 Dec 2016 21:51:57 +0900 Subject: [PATCH 02/16] fix build Change-Id: If8e67d34f836e60a94aabecde593762ab505ef4d --- src/vc_elm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 6ce2a2d..66519d5 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -349,7 +349,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa VC_ELM_LOG_DBG("Click event"); if (EINA_TRUE == elm_object_item_focus_get(item)) { VC_ELM_LOG_DBG("Already focused"); - ecoret_timer_add(0.5, __click_event, NULL); + ecore_timer_add(0.5, __click_event, NULL); } else { evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); elm_object_item_focus_set(item, EINA_TRUE); -- 2.7.4 From 60c88930774e4cd38ac20bbe2b57e04deb201bd6 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Mon, 26 Dec 2016 14:05:23 +0900 Subject: [PATCH 03/16] Apply multi handle for vc widget client Change-Id: I30d166cce513abbf4cd0cf1ea096b9c6b7d4896d (cherry picked from commit 5a7d60345473c0e74792996a9d3757521a2bfd0b) --- src/vc_elm.c | 40 +++------------------ src/vc_elm_core.c | 46 ++---------------------- src/vc_elm_widget_wrapper.c | 85 ++++++++++++++++++++++++++++++++++++++------- src/vc_elm_widget_wrapper.h | 5 +++ 4 files changed, 83 insertions(+), 93 deletions(-) diff --git a/src/vc_elm.c b/src/vc_elm.c index 18acf2f..0870b0b 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -27,7 +27,6 @@ #include "vc_elm_tools.h" #include "vc_elm_tooltip.h" #include "vc_elm_widget_wrapper.h" -#include /** * @brief Internal variable. It can check whether voice control elm is initilaized or not. @@ -232,7 +231,7 @@ int vc_elm_deinitialize() int vc_elm_foreach_supported_languages(vc_elm_supported_language_cb callback, void *user_data) { - int ret; + int ret = 0; if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } @@ -240,27 +239,13 @@ int vc_elm_foreach_supported_languages(vc_elm_supported_language_cb callback, vo return VC_ELM_ERROR_PERMISSION_DENIED; } - ret = vc_widget_foreach_supported_languages(callback, user_data); - switch (ret) { - case VC_ERROR_NONE: - ret = VC_ELM_ERROR_NONE; - break; - case VC_ERROR_INVALID_PARAMETER: - ret = VC_ELM_ERROR_INVALID_PARAMETER; - break; - case VC_ERROR_INVALID_STATE: - ret = VC_ELM_ERROR_INVALID_STATE; - break; - default: - ret = VC_ELM_ERROR_OPERATION_FAILED; - break; - } + ret = _vc_elm_widget_wrapper_foreach_supported_languages(callback, user_data); return ret; } int vc_elm_get_current_language(char **language) { - int ret; + int ret = 0; if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } @@ -268,24 +253,7 @@ int vc_elm_get_current_language(char **language) return VC_ELM_ERROR_PERMISSION_DENIED; } - ret = vc_widget_get_current_language(language); - switch (ret) { - case VC_ERROR_NONE: - ret = VC_ELM_ERROR_NONE; - break; - case VC_ERROR_INVALID_PARAMETER: - ret = VC_ELM_ERROR_INVALID_PARAMETER; - break; - case VC_ERROR_OUT_OF_MEMORY: - ret = VC_ELM_ERROR_OUT_OF_MEMORY; - break; - case VC_ERROR_INVALID_STATE: - ret = VC_ELM_ERROR_INVALID_STATE; - break; - default: - ret = VC_ELM_ERROR_OPERATION_FAILED; - break; - } + ret = _vc_elm_widget_wrapper_get_current_language(language); return ret; } diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 66519d5..42b2060 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -192,8 +192,6 @@ static void __rotation(void *data, Evas_Object *obj, void *event_info); static int __is_hidden_widget(Evas_Object *obj); -static void __vc_elm_core_free_default_actions(); - /** * @brief Function that returns the name of the widget * @param[in] handle to widget's Evas_Object structure @@ -333,7 +331,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa while (NULL != parent_info) { if (EINA_TRUE == parent_info->focusable) { VC_ELM_LOG_DBG("Focusable Parent"); - char* widget_type = elm_widget_type_get((parent_info->address)); + char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); VC_ELM_LOG_DBG("type (%s)", widget_type); Elm_Object_Item* item = NULL; if (NULL != widget_type && !strcmp(widget_type, "Elm_Genlist")) { @@ -416,6 +414,7 @@ static void __widget_info_free_cb(void *entry) unsigned int idx; for (idx = 0; idx < info->actions_count; ++idx) eina_stringshare_del(info->actions[idx].name); + free(info->actions); free(info); } @@ -470,8 +469,6 @@ void _vc_elm_core_fini() g_allowed_text_part_list = NULL; } - __vc_elm_core_free_default_actions(); - eina_hash_free(g_widget_info_hash); g_widget_info_hash = NULL; @@ -1016,45 +1013,6 @@ struct vc_elm_core_widget_info *_vc_elm_core_register_widget(const char *widget_ return info; } -static void __vc_elm_core_free_action(const char* widget_name) -{ - struct vc_elm_core_widget_info *info = NULL; - info = eina_hash_find(g_widget_info_hash, widget_name); - - if (!info) { - VC_ELM_LOG_ERR("Widget was not registered: %s", widget_name); - } else { - free(info->actions); - info->actions = NULL; - VC_ELM_LOG_ERR("Widget action is freed: %s", widget_name); - } -} - -static void __vc_elm_core_free_default_actions() -{ - __vc_elm_core_free_action("Elm_Genlist"); - __vc_elm_core_free_action("Elm_Radio"); - __vc_elm_core_free_action("Elm_Bubble"); - __vc_elm_core_free_action("Elm_Check"); - __vc_elm_core_free_action("Elm_List"); - __vc_elm_core_free_action("Elm_Slider"); - __vc_elm_core_free_action("Elm_Colorselector"); - __vc_elm_core_free_action("simple_hue_colorbar_activator"); - __vc_elm_core_free_action("simple_saturation_colorbar_activator"); - __vc_elm_core_free_action("simple_value_colorbar_activator"); - __vc_elm_core_free_action("Elm_Spinner"); - __vc_elm_core_free_action("Elm_Panes"); - __vc_elm_core_free_action("Elm_Toolbar"); - __vc_elm_core_free_action("Elm_Entry"); - __vc_elm_core_free_action("Elm_Multibuttonentry"); - __vc_elm_core_free_action("elm_item"); - __vc_elm_core_free_action("Elm_Gengrid"); - __vc_elm_core_free_action("Elm_Button"); - __vc_elm_core_free_action("Elm_Scroller"); - __vc_elm_core_free_action("Elm_Hoversel"); - __vc_elm_core_free_action("Elm_Label"); -} - void _vc_elm_core_register_action(struct vc_elm_core_widget_info *info, const char *action_name, void *data, vc_elm_action_activator_cb action_activator_func) { unsigned int idx = 0; diff --git a/src/vc_elm_widget_wrapper.c b/src/vc_elm_widget_wrapper.c index b36b929..26258ce 100644 --- a/src/vc_elm_widget_wrapper.c +++ b/src/vc_elm_widget_wrapper.c @@ -35,6 +35,8 @@ struct __voice_control_wrapper_s { static struct __voice_control_wrapper_s vcw = {0, 0, 0, 0, 0, 0, 0, 0}; +static vc_h g_vc_w; + static void __vc_state_changed_cb(vc_state_e previous, vc_state_e current, void *user_data); static void __vc_service_state_changed_cb(vc_service_state_e previous, vc_service_state_e current, void *user_data); static void __vc_error_cb(vc_error_e reason, void *user_data); @@ -90,15 +92,15 @@ int _vc_elm_widget_wrapper_initialize() } vcw.initialized = 1; - VC_ERROR_CHECK(vc_widget_initialize()); - VC_ERROR_CHECK(vc_widget_set_error_cb(&__vc_error_cb, NULL)); - VC_ERROR_CHECK(vc_widget_set_show_tooltip_cb(&__vc_show_tooltip_callback, NULL)); - VC_ERROR_CHECK(vc_widget_set_result_cb(&__vc_result_cb, NULL)); - VC_ERROR_CHECK(vc_widget_set_state_changed_cb(&__vc_state_changed_cb, NULL)); - VC_ERROR_CHECK(vc_widget_set_service_state_changed_cb(&__vc_service_state_changed_cb, NULL)); - VC_ERROR_CHECK(vc_widget_set_current_language_changed_cb(&__vc_language_changed_cb, NULL)); - VC_ERROR_CHECK(vc_widget_set_send_current_command_list_cb(__vc_widget_send_current_command_group_cb, NULL)); - VC_ERROR_CHECK(vc_widget_prepare()); + VC_ERROR_CHECK(vc_widget_initialize(&g_vc_w)); + VC_ERROR_CHECK(vc_widget_set_error_cb(g_vc_w, &__vc_error_cb, NULL)); + VC_ERROR_CHECK(vc_widget_set_show_tooltip_cb(g_vc_w, &__vc_show_tooltip_callback, NULL)); + VC_ERROR_CHECK(vc_widget_set_result_cb(g_vc_w, &__vc_result_cb, NULL)); + VC_ERROR_CHECK(vc_widget_set_state_changed_cb(g_vc_w, &__vc_state_changed_cb, NULL)); + VC_ERROR_CHECK(vc_widget_set_service_state_changed_cb(g_vc_w, &__vc_service_state_changed_cb, NULL)); + VC_ERROR_CHECK(vc_widget_set_current_language_changed_cb(g_vc_w, &__vc_language_changed_cb, NULL)); + VC_ERROR_CHECK(vc_widget_set_send_current_command_list_cb(g_vc_w, __vc_widget_send_current_command_group_cb, NULL)); + VC_ERROR_CHECK(vc_widget_prepare(g_vc_w)); VC_ELM_LOG_DBG("VC default language used %s", lang); vcw.lang = lang; @@ -117,8 +119,8 @@ int _vc_elm_widget_wrapper_deinitialize() vcw.lang = NULL; } - VC_ERROR_CHECK(vc_widget_unprepare()); - VC_ERROR_CHECK(vc_widget_deinitialize()); + VC_ERROR_CHECK(vc_widget_unprepare(g_vc_w)); + VC_ERROR_CHECK(vc_widget_deinitialize(g_vc_w)); vcw.initialized = 0; return 0; @@ -220,7 +222,7 @@ static void __vc_state_changed_cb(vc_state_e previous, vc_state_e current, void case VC_STATE_READY: curr = "VC_STATE_READY"; //vc_widget_set_foreground(EINA_TRUE); - vc_widget_get_current_language(&tmp_lang); + vc_widget_get_current_language(g_vc_w, &tmp_lang); if (NULL != tmp_lang) { int ret = asprintf(&lang, "%s.UTF-8", tmp_lang); if (-1 == ret) { @@ -382,10 +384,67 @@ int _vc_elm_widget_wrapper_cancel() int ret = VC_ELM_ERROR_NONE; VC_ELM_LOG_DBG("==========="); - ret = vc_widget_cancel(); + ret = vc_widget_cancel(g_vc_w); if (VC_ELM_ERROR_NONE != ret) { VC_ELM_LOG_ERR("Error while widget cancel (%d)", ret); } return ret; } +int _vc_elm_widget_wrapper_foreach_supported_languages(vc_elm_supported_language_cb callback, void *data) +{ + int ret = VC_ELM_ERROR_NONE; + VC_ELM_LOG_DBG("=========="); + + ret = vc_widget_foreach_supported_languages(g_vc_w, callback, data); + switch (ret) { + case VC_ERROR_NONE: + ret = VC_ELM_ERROR_NONE; + break; + case VC_ERROR_INVALID_PARAMETER: + ret = VC_ELM_ERROR_INVALID_PARAMETER; + break; + case VC_ERROR_INVALID_STATE: + ret = VC_ELM_ERROR_INVALID_STATE; + break; + default: + ret = VC_ELM_ERROR_OPERATION_FAILED; + break; + } + + if (VC_ELM_ERROR_NONE != ret) { + VC_ELM_LOG_ERR("[ERROR] Fail to foreach supported langauge(%d)", ret); + } + + return ret; +} + +int _vc_elm_widget_wrapper_get_current_language(char** language) +{ + int ret = VC_ELM_ERROR_NONE; + VC_ELM_LOG_DBG("=========="); + + ret = vc_widget_get_current_language(g_vc_w, language); + switch (ret) { + case VC_ERROR_NONE: + ret = VC_ELM_ERROR_NONE; + break; + case VC_ERROR_INVALID_PARAMETER: + ret = VC_ELM_ERROR_INVALID_PARAMETER; + break; + case VC_ERROR_OUT_OF_MEMORY: + ret = VC_ELM_ERROR_OUT_OF_MEMORY; + break; + case VC_ERROR_INVALID_STATE: + ret = VC_ELM_ERROR_INVALID_STATE; + break; + default: + ret = VC_ELM_ERROR_OPERATION_FAILED; + break; + } + + if (VC_ELM_ERROR_NONE != ret) { + VC_ELM_LOG_ERR("[ERROR] Fail to get current language(%d)", ret); + } + return ret; +} \ No newline at end of file diff --git a/src/vc_elm_widget_wrapper.h b/src/vc_elm_widget_wrapper.h index 64f6298..cb357f4 100644 --- a/src/vc_elm_widget_wrapper.h +++ b/src/vc_elm_widget_wrapper.h @@ -24,6 +24,7 @@ extern "C" { #include +#include "vc_elm.h" typedef int (*vc_elm_widget_wrapper_result_cb)(const char *cmd, const char *param1, const char *param2, void *data); @@ -69,6 +70,10 @@ void _vc_elm_widget_wrapper_clear_commands(); int _vc_elm_widget_wrapper_cancel(); +int _vc_elm_widget_wrapper_foreach_supported_languages(vc_elm_supported_language_cb callback, void *data); + +int _vc_elm_widget_wrapper_get_current_language(char** language); + #ifdef __cplusplus } #endif -- 2.7.4 From 377c400f786113e5a0f84b136d8aae3032af0d93 Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Mon, 2 Jan 2017 08:45:19 +0900 Subject: [PATCH 04/16] Set NULL after evas_object_del() Change-Id: I073c12c8a126fb4316bf1979e469e231a9112ce1 Signed-off-by: Wonnam Jang (cherry picked from commit 95075b3f9f213db30eaa7dcb70ad5e355ec991ee) --- src/vc_elm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 66519d5..1533ca7 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -1311,7 +1311,7 @@ static void __dismissed_cb(void *data, Evas_Object *obj, void *event_info) elm_ctxpopup_dismiss(obj); elm_ctxpopup_clear(obj); evas_object_del(obj); - + obj = NULL; } static void __unwrap_universal_item_command(struct Wrapped_Command *wrapper, const char *action, const char *param) -- 2.7.4 From 1371d3dab7ced37927f8f09a1ef6c39810536137 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 12 Jan 2017 20:53:30 +0900 Subject: [PATCH 05/16] Fix memory leak Change-Id: I244573c4a45fca831f5dff56657b6579406d085d Signed-off-by: Suyeon Hwang --- src/vc_elm_efl_dump.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index e25e882..8406655 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -166,6 +166,7 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent) const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; Edje_Info *edje_info = NULL; Object_Info *object_info = NULL; + char* temp = NULL; // visible check if (!evas_object_is_visible_get(obj)) return; @@ -280,7 +281,13 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent) text = eina_stringshare_add(evas_object_text_text_get(obj)); else if (!strcmp(evas_object_type_get(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } } if (text && strlen(text) > 0) { object_info->text = calloc(1, strlen(text) + 1); @@ -309,6 +316,7 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; Edje_Info *edje_info = NULL; Object_Info *object_info = NULL; + char* temp = NULL; // visible check if (!evas_object_is_visible_get(obj)) return; @@ -434,7 +442,13 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj text = eina_stringshare_add(evas_object_text_text_get(obj)); else if (!strcmp(evas_object_type_get(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } } if (text && strlen(text) > 0) { object_info->text = calloc(1, strlen(text) + 1); @@ -459,6 +473,7 @@ _obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj) Eina_Bool is_clip = EINA_FALSE; const char *ret = NULL; const char *text = NULL; + char* temp = NULL; char* data = NULL; Eina_Bool check; @@ -479,7 +494,13 @@ _obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj) text = eina_stringshare_add(evas_object_text_text_get(obj)); else if (!strcmp(evas_object_type_get(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } } if (text && strlen(text) > 0) { check = EINA_TRUE; @@ -510,6 +531,7 @@ _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object const char *ret = NULL; const char *text = NULL; char* data = NULL; + char* temp = NULL; Eina_Bool check; // visible check @@ -536,7 +558,13 @@ _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object } else if (!strcmp(evas_object_type_get(obj), "textblock")) { if (!parent_widget_focusable) goto next; ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } } if (text && strlen(text) > 0) { check = EINA_TRUE; -- 2.7.4 From 962fc91f275eaa4ee9a40ef1c6c2aae63b259b5a Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Thu, 12 Jan 2017 21:06:43 +0900 Subject: [PATCH 06/16] Add internal method for set object geometry info Change-Id: Idf03f86c2229f4e1a3f1f81b65c175e633a1c4c4 Signed-off-by: Kwangyoun Kim (cherry picked from commit 8d8ab28f6c8d64910cfd510ae0d1b8111f5bfae4) --- include/voice_control_elm_private.h | 4 ++++ src/vc_elm.c | 32 ++++++++++++++++++++++++++++++++ src/vc_elm_core.c | 14 ++++++++++++++ src/vc_elm_core.h | 4 ++++ src/vc_elm_efl_dump.c | 36 ++++++++++++++++++++++++++++++++---- src/vc_elm_efl_dump.h | 2 ++ 6 files changed, 88 insertions(+), 4 deletions(-) diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index 494d612..0e96735 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -110,6 +110,10 @@ int vc_elm_add_allowed_text_part(const char* text_part); */ int vc_elm_remove_allowed_text_part(void); +int vc_elm_set_geometry_info(int x, int y, int w, int h); + +int vc_elm_unset_geometry_info(); + #ifdef __cplusplus } #endif diff --git a/src/vc_elm.c b/src/vc_elm.c index 0870b0b..b6da248 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -1010,6 +1010,38 @@ int vc_elm_remove_allowed_text_part(void) return VC_ELM_ERROR_NONE; } +int vc_elm_set_geometry_info(int x, int y, int w, int h) +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + if (0 != __vc_elm_check_privilege()) { + return VC_ELM_ERROR_PERMISSION_DENIED; + } + + if (0 != _vc_elm_core_set_geometry_info(x, y, w, h)) { + return VC_ELM_ERROR_OPERATION_FAILED; + } + + return VC_ELM_ERROR_NONE; +} + +int vc_elm_unset_geometry_info() +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + if (0 != __vc_elm_check_privilege()) { + return VC_ELM_ERROR_PERMISSION_DENIED; + } + + if (0 != _vc_elm_core_unset_geometry_info()) { + return VC_ELM_ERROR_OPERATION_FAILED; + } + + return VC_ELM_ERROR_NONE; +} + #ifdef SRPOL_DEBUG /** * @brief Wrapper for making internal function public - for automated test purposes diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 86dabd0..009ee64 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -2071,3 +2071,17 @@ int _vc_elm_core_remove_allowed_text_part() VC_ELM_LOG_DBG("Remove Allowed text part"); return 0; } + +int _vc_elm_core_set_geometry_info(int x, int y, int w, int h) +{ + ea_object_dump_set_geometry_info(x, y, w, h); + VC_ELM_LOG_INFO("Set geometry info %d, %d, %d, %d", x, y, w, h); + return 0; +} + +int _vc_elm_core_unset_geometry_info() +{ + ea_object_dump_unset_geometry_info(); + VC_ELM_LOG_INFO("Unset geometry info"); + return 0; +} \ No newline at end of file diff --git a/src/vc_elm_core.h b/src/vc_elm_core.h index c014e7e..18e78b7 100644 --- a/src/vc_elm_core.h +++ b/src/vc_elm_core.h @@ -513,6 +513,10 @@ int _vc_elm_core_add_allowed_text_part(const char* text_part); int _vc_elm_core_remove_allowed_text_part(); +int _vc_elm_core_set_geometry_info(int x, int y, int w, int h); + +int _vc_elm_core_unset_geometry_info(); + #ifdef __cplusplus } #endif diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index 8406655..c8e34ab 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -48,6 +48,9 @@ typedef struct _Edje_Info { Eina_List *ret_list = NULL; Eina_List *ret_text_list = NULL; +static Eina_Bool g_set_geometry = EINA_FALSE; +static int g_geo_x = 0, g_geo_y = 0, g_geo_w = 0, g_geo_h = 0; + static Eina_Bool evas_object_is_visible_get(Evas_Object *obj) { @@ -540,7 +543,7 @@ _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object // viewport check evas_object_geometry_get(obj, &x, &y, &w, &h); - if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) /*return;*/ goto next; // clipper check if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; @@ -645,10 +648,17 @@ ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) util_mgr->evas = evas; ecore_wl_sync(); - util_mgr->x = 0; - util_mgr->y = 0; - ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + if (EINA_TRUE == g_set_geometry) { + util_mgr->x = g_geo_x; + util_mgr->y = g_geo_y; + util_mgr->w = g_geo_w; + util_mgr->h = g_geo_h; + } else { + util_mgr->x = 0; + util_mgr->y = 0; + ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + } _object_tree(util_mgr, 1, exclude_unfocusable_text); } @@ -762,3 +772,21 @@ ea_object_dump_parent_widget_data_get(const Object_Info *obj_info) } return NULL; } + +void ea_object_dump_set_geometry_info(int x, int y, int w, int h) +{ + g_set_geometry = EINA_TRUE; + g_geo_x = x; + g_geo_y = y; + g_geo_w = w; + g_geo_h = h; +} + +void ea_object_dump_unset_geometry_info() +{ + g_set_geometry = EINA_FALSE; + g_geo_x = 0; + g_geo_y = 0; + g_geo_w = 0; + g_geo_h = 0; +} diff --git a/src/vc_elm_efl_dump.h b/src/vc_elm_efl_dump.h index b0b923b..956c05e 100644 --- a/src/vc_elm_efl_dump.h +++ b/src/vc_elm_efl_dump.h @@ -73,6 +73,8 @@ Eina_List *ea_object_dump_full_list_get(Eina_Bool); Eina_List *ea_object_dump_text_list_get(Eina_Bool); Eina_List *ea_object_dump_find_data(Eina_List*, const char*, const char*); Object_Info *ea_object_dump_parent_widget_data_get(const Object_Info*); +void ea_object_dump_set_geometry_info(int x, int y, int w, int h); +void ea_object_dump_unset_geometry_info(); #ifdef __cplusplus } -- 2.7.4 From b5c367693594497fb3e7ce7cee95114b9ac10c9a Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Wed, 18 Jan 2017 16:22:22 +0900 Subject: [PATCH 07/16] Add logic to change clicking time Change-Id: I53834fc8c953f65f7a39fbbb9efdf5df144eeadc Signed-off-by: Wonnam Jang (cherry picked from commit 0945c3f1a2dece209853673163300fefc28a3631) --- include/voice_control_elm_private.h | 4 ++++ src/vc_elm.c | 32 ++++++++++++++++++++++++++++++++ src/vc_elm_core.c | 25 +++++++++++++++++++++---- src/vc_elm_core.h | 5 +++++ 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index 0e96735..bb9a1da 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -114,6 +114,10 @@ int vc_elm_set_geometry_info(int x, int y, int w, int h); int vc_elm_unset_geometry_info(); +int vc_elm_set_click_time(float time); + +int vc_elm_unset_click_time(); + #ifdef __cplusplus } #endif diff --git a/src/vc_elm.c b/src/vc_elm.c index b6da248..6e396d3 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -1042,6 +1042,38 @@ int vc_elm_unset_geometry_info() return VC_ELM_ERROR_NONE; } +int vc_elm_set_click_time(float time) +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + if (0 != __vc_elm_check_privilege()) { + return VC_ELM_ERROR_PERMISSION_DENIED; + } + + if (0 != _vc_elm_core_set_click_time(time)) { + return VC_ELM_ERROR_OPERATION_FAILED; + } + + return VC_ELM_ERROR_NONE; +} + +int vc_elm_unset_click_time() +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + if (0 != __vc_elm_check_privilege()) { + return VC_ELM_ERROR_PERMISSION_DENIED; + } + + if (0 != _vc_elm_core_unset_click_time()) { + return VC_ELM_ERROR_OPERATION_FAILED; + } + + return VC_ELM_ERROR_NONE; +} + #ifdef SRPOL_DEBUG /** * @brief Wrapper for making internal function public - for automated test purposes diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 009ee64..c442fb0 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -71,6 +71,9 @@ static Eina_List *g_dump_list = NULL; static Eina_List *g_allowed_text_part_list = NULL; +#define DEFAULT_CLICK_TIME 0.5 +static float g_click_time = DEFAULT_CLICK_TIME; + #define HIDE 0xa #define X_VISIBILITY_TOLERANCE 32.0 #define Y_VISIBILITY_TOLERANCE 54.0 @@ -235,7 +238,7 @@ static void __focused_cb(void *data, Evas_Object *obj, void *event_info) evas_object_smart_callback_del(obj, "item,focused", __focused_cb); } - ecore_timer_add(0.5, __click_event, NULL); + ecore_timer_add(g_click_time, __click_event, NULL); } } @@ -317,7 +320,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa VC_ELM_LOG_DBG("Click event"); if (EINA_TRUE == elm_object_focus_get((Evas_Object*)parent_info->address)) { VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(0.5, __click_event, NULL); + ecore_timer_add(g_click_time, __click_event, NULL); } else { evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused"); elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); @@ -347,7 +350,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa VC_ELM_LOG_DBG("Click event"); if (EINA_TRUE == elm_object_item_focus_get(item)) { VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(0.5, __click_event, NULL); + ecore_timer_add(g_click_time, __click_event, NULL); } else { evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); elm_object_item_focus_set(item, EINA_TRUE); @@ -2084,4 +2087,18 @@ int _vc_elm_core_unset_geometry_info() ea_object_dump_unset_geometry_info(); VC_ELM_LOG_INFO("Unset geometry info"); return 0; -} \ No newline at end of file +} + +int _vc_elm_core_set_click_time(float time) +{ + g_click_time = time; + VC_ELM_LOG_INFO("Set click time (%f)sec", time); + return 0; +} + +int _vc_elm_core_unset_click_time() +{ + g_click_time = DEFAULT_CLICK_TIME; + VC_ELM_LOG_INFO("Unset click time, time will be (%f) sec", DEFAULT_CLICK_TIME); + return 0; +} diff --git a/src/vc_elm_core.h b/src/vc_elm_core.h index 18e78b7..f2ca41a 100644 --- a/src/vc_elm_core.h +++ b/src/vc_elm_core.h @@ -517,6 +517,11 @@ int _vc_elm_core_set_geometry_info(int x, int y, int w, int h); int _vc_elm_core_unset_geometry_info(); +int _vc_elm_core_set_click_time(float time); + +int _vc_elm_core_unset_click_time(); + + #ifdef __cplusplus } #endif -- 2.7.4 From ff9c92ecf7b87f1c5048472806928a00883ee996 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Tue, 24 Jan 2017 20:04:14 +0900 Subject: [PATCH 08/16] Remove duplicated command on popup Change-Id: I85625c01ce525ebf01a06ecf3f38098db2ba23ac Signed-off-by: Kwangyoun Kim (cherry picked from commit 3cfe72159ac16bb39b488ad116b417d4ab043d4c) --- src/vc_elm_efl_dump.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index c8e34ab..59d04f3 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -50,6 +50,8 @@ Eina_List *ret_text_list = NULL; static Eina_Bool g_set_geometry = EINA_FALSE; static int g_geo_x = 0, g_geo_y = 0, g_geo_w = 0, g_geo_h = 0; +static int find_popup = 0; +static int skip_text = 0; static Eina_Bool evas_object_is_visible_get(Evas_Object *obj) @@ -324,6 +326,8 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj // visible check if (!evas_object_is_visible_get(obj)) return; + if (find_popup) return; + // viewport check evas_object_geometry_get(obj, &x, &y, &w, &h); @@ -333,8 +337,17 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; if (is_clip) goto next; + if (evas_object_type_match(obj, "elm_popup")) { + if (elm_object_part_text_get(obj, "title,text")) skip_text = 1; + eina_list_free(ret_list); + } + if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) { if (!parent_widget_focusable && !list_type) goto next; + if (skip_text) { + skip_text = 0; + return; + } } object_info = calloc(1, sizeof(Object_Info)); @@ -464,6 +477,7 @@ next: children = evas_object_smart_members_get(obj); EINA_LIST_FREE(children, child) _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable, list_type); + if (evas_object_type_match(obj, "elm_popup")) find_popup = 1; } } @@ -646,6 +660,8 @@ ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) EINA_LIST_FREE(ecore_evas_list, ee) { evas = ecore_evas_get(ee); util_mgr->evas = evas; + find_popup = 0; + skip_text = 0; ecore_wl_sync(); -- 2.7.4 From 9ee87add54dc337bb332d801a549908d5ba02d6e Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 18 Jan 2017 17:09:32 +0900 Subject: [PATCH 09/16] Remove a privilege and an error Change-Id: Iac7f00b4404ce077fc31778e9db6ca1fc304e9d4 Signed-off-by: sooyeon.kim (cherry picked from commit ab5024f6a410ea0684495488d2f9abdae13d2838) --- include/voice_control_elm.h | 6 ------ include/voice_control_elm_private.h | 8 -------- src/vc_elm.c | 30 ------------------------------ 3 files changed, 44 deletions(-) diff --git a/include/voice_control_elm.h b/include/voice_control_elm.h index 253bacc..5b02ac8 100644 --- a/include/voice_control_elm.h +++ b/include/voice_control_elm.h @@ -142,8 +142,6 @@ typedef bool (*vc_elm_action_cb)(const char* action, void* user_data); /** * @brief Initializes voice control elementary module. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* @privlevel public -* @privilege %http://tizen.org/privilege/recorder * * @remarks If the function succeeds, the voice control elementary must be released with vc_elm_deinitialize(). * @@ -152,7 +150,6 @@ typedef bool (*vc_elm_action_cb)(const char* action, void* user_data); * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @see vc_elm_deinitialize() @@ -162,15 +159,12 @@ int vc_elm_initialize(void); /** * @brief Deinitializes voice control elementary module. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* @privlevel public -* @privilege %http://tizen.org/privilege/recorder * * @return 0 on success, otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @pre vc_elm_initialize() should be successful. diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index bb9a1da..6077ad6 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -31,7 +31,6 @@ extern "C" { /** * @brief Set auto command-register mode and click method for recognized object. * @since_tizen 3.0 -* @privilege %http://tizen.org/privilege/recorder * * @param[in] mode The mode of auto register * @param[in] click_method The click method for recognized object @@ -40,7 +39,6 @@ extern "C" { * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @pre vc_elm_initialize() should be successful. @@ -52,7 +50,6 @@ int vc_elm_set_auto_register_mode(int mode, int click_method); /** * @brief Get auto command-register mode and click method for recognized object. * @since_tizen 3.0 -* @privilege %http://tizen.org/privilege/recorder * * @param[out] mode The mode of auto register * @param[out] click_method The click method for recognized object @@ -61,7 +58,6 @@ int vc_elm_set_auto_register_mode(int mode, int click_method); * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @pre vc_elm_initialize() should be successful. @@ -73,7 +69,6 @@ int vc_elm_get_auto_register_mode(int* mode, int* click_method); /** * @brief Add allowed text part for auto command register. * @since_tizen 3.0 -* @privilege %http://tizen.org/privilege/recorder * * @param[in] text_part The text part of elemenatry widget * @@ -82,7 +77,6 @@ int vc_elm_get_auto_register_mode(int* mode, int* click_method); * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @pre vc_elm_initialize() should be successful. @@ -94,14 +88,12 @@ int vc_elm_add_allowed_text_part(const char* text_part); /** * @brief Remove the list of additional allowed text part for auto command register. * @since_tizen 3.0 -* @privilege %http://tizen.org/privilege/recorder * * * @return 0 on success, otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state -* @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported * * @pre vc_elm_initialize() should be successful. diff --git a/src/vc_elm.c b/src/vc_elm.c index 6e396d3..b89a392 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -170,9 +170,6 @@ int vc_elm_initialize() if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (true == is_vc_elm_initialized) { VC_ELM_LOG_DBG("vc elm is already initialized"); @@ -201,9 +198,6 @@ int vc_elm_deinitialize() if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (false == is_vc_elm_initialized) { VC_ELM_LOG_DBG("vc elm is already deinitialized"); @@ -954,9 +948,6 @@ int vc_elm_set_auto_register_mode(int mode, int click_method) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } return _vc_elm_set_auto_register_mode(mode, click_method); } @@ -966,9 +957,6 @@ int vc_elm_get_auto_register_mode(int* mode, int* click_method) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } return _vc_elm_get_auto_register_mode(mode, click_method); } @@ -978,9 +966,6 @@ int vc_elm_add_allowed_text_part(const char* text_part) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (NULL == text_part) { VC_ELM_LOG_ERR("Invalid parameter"); @@ -999,9 +984,6 @@ int vc_elm_remove_allowed_text_part(void) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (0 != _vc_elm_core_remove_allowed_text_part()) { return VC_ELM_ERROR_OPERATION_FAILED; @@ -1015,9 +997,6 @@ int vc_elm_set_geometry_info(int x, int y, int w, int h) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (0 != _vc_elm_core_set_geometry_info(x, y, w, h)) { return VC_ELM_ERROR_OPERATION_FAILED; @@ -1031,9 +1010,6 @@ int vc_elm_unset_geometry_info() if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (0 != _vc_elm_core_unset_geometry_info()) { return VC_ELM_ERROR_OPERATION_FAILED; @@ -1047,9 +1023,6 @@ int vc_elm_set_click_time(float time) if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (0 != _vc_elm_core_set_click_time(time)) { return VC_ELM_ERROR_OPERATION_FAILED; @@ -1063,9 +1036,6 @@ int vc_elm_unset_click_time() if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } - if (0 != __vc_elm_check_privilege()) { - return VC_ELM_ERROR_PERMISSION_DENIED; - } if (0 != _vc_elm_core_unset_click_time()) { return VC_ELM_ERROR_OPERATION_FAILED; -- 2.7.4 From 578a1de645d220d39507aac1360e9a5fb4c828b0 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Thu, 2 Feb 2017 17:34:56 +0900 Subject: [PATCH 10/16] Fix object dump logic for popup Change-Id: I5b22b2ef482ed0808dffaf8a3e226e9de12ab5ea (cherry picked from commit 3e61aa680152704e50f262981dae461f4d0e6c83) --- src/vc_elm_efl_dump.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index 59d04f3..03d4e4b 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -326,6 +326,12 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj // visible check if (!evas_object_is_visible_get(obj)) return; + if (evas_object_type_match(obj, "elm_popup")) { + if (elm_object_part_text_get(obj, "title,text")) skip_text = 1; + eina_list_free(ret_list); + find_popup = 0; + } + if (find_popup) return; // viewport check @@ -337,11 +343,6 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; if (is_clip) goto next; - if (evas_object_type_match(obj, "elm_popup")) { - if (elm_object_part_text_get(obj, "title,text")) skip_text = 1; - eina_list_free(ret_list); - } - if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) { if (!parent_widget_focusable && !list_type) goto next; if (skip_text) { -- 2.7.4 From 2abc7fee0954875dde6b036a83fb101d987d32ef Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Tue, 7 Feb 2017 15:18:00 +0900 Subject: [PATCH 11/16] Make function to simplify Change-Id: I751a1412b2657738f178beb39a5e93dde14161be Signed-off-by: Wonnam Jang (cherry picked from commit 11993207ffaa39f13e91734d7d42ac1018c9a04a) --- src/vc_elm_core.c | 244 +++++++++++++++++++++++++++++------------------------- 1 file changed, 133 insertions(+), 111 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index c442fb0..26c6f85 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -242,6 +242,106 @@ static void __focused_cb(void *data, Evas_Object *obj, void *event_info) } } +static Eina_Bool _vc_elm_click_matched_object(const char* cmd, int click_method) +{ + + VC_ELM_LOG_DBG("cmd(%s), click_method(%d)", cmd, click_method); + + Eina_List *dump_iter = NULL; + void *data = NULL; + Eina_Bool text_found = EINA_FALSE; + EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { + Object_Info* info = (Object_Info*)data; + + if (NULL != info && NULL != info->text && NULL != info->part_name) { + VC_ELM_LOG_DBG("info->text(%s)", info->text); + Eina_List *iter = NULL; + char *part_name = NULL; + EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { + if (NULL != part_name && !strcmp(part_name, info->part_name)) { + if (!strcmp(info->text, cmd)) { + int x = info->geometry_info.x; + int y = info->geometry_info.y; + int w = info->geometry_info.w; + int h = info->geometry_info.h; + VC_ELM_LOG_DBG("Click event : %s x(%d) y(%d) w(%d) h(%d), address(%p) type(%s)", info->text, x, y, w, h, info->address, info->type); + if (0 == click_method) { + evas_event_feed_mouse_move(evas_object_evas_get((Evas_Object*)(info->address)), x + w/2, y + h/2, 0, NULL); + evas_event_feed_mouse_down(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 1, NULL); + evas_event_feed_mouse_up(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 2, NULL); + VC_ELM_LOG_INFO("click!!!!!"); + } else if (1 == click_method) { + VC_ELM_LOG_DBG("click method - focus/key"); + bool clicked = false; + Object_Info* parent_info = ea_object_dump_parent_widget_data_get(info); + if (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_focus_get((Evas_Object*)parent_info->address)) { + VC_ELM_LOG_DBG("Already focused"); + ecore_timer_add(g_click_time, __click_event, NULL); + } else { + evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused"); + elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); + } + clicked = true; + break; + } + } + + if (false == clicked) { + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + while (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); + VC_ELM_LOG_DBG("type (%s)", widget_type); + Elm_Object_Item* item = NULL; + if (NULL != widget_type && !strcmp(widget_type, "Elm_Genlist")) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, NULL); + if (NULL == item) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w + w/2, y + h/2, NULL); + } + } else if (NULL != widget_type && !strcmp(widget_type, "Elm_Gengrid")) { + int xposret, yposret; + item = elm_gengrid_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, &xposret, &yposret); + } + VC_ELM_LOG_DBG("item(%p)(%d)", item, elm_object_item_disabled_get(item)); + + if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_item_focus_get(item)) { + VC_ELM_LOG_DBG("Already focused"); + ecore_timer_add(g_click_time, __click_event, NULL); + } else { + evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); + elm_object_item_focus_set(item, EINA_TRUE); + elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); + } + break; + } + } + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + } + } + } else { + VC_ELM_LOG_DBG("Invalid click method"); + } + + /* Propagation */ + //return EINA_TRUE; + text_found = EINA_TRUE; + } + } + } + } + } + ea_object_dump_list_clear(); + g_dump_list = NULL; + return text_found; +} + /** * @brief Function that matches recognition result to the registered actions * and calls for action execution @@ -289,94 +389,8 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa int click_method = 0; _vc_elm_get_auto_register_mode(&auto_mode, &click_method); if (1 == auto_mode) { - Eina_List *dump_iter = NULL; - void *data = NULL; - Eina_Bool text_found = EINA_FALSE; - EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { - Object_Info* info = (Object_Info*)data; - - if (NULL != info && NULL != info->text && NULL != info->part_name) { - Eina_List *iter = NULL; - char *part_name = NULL; - EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { - if (NULL != part_name && !strcmp(part_name, info->part_name)) { - if (!strcmp(info->text, cmd)) { - int x = info->geometry_info.x; - int y = info->geometry_info.y; - int w = info->geometry_info.w; - int h = info->geometry_info.h; - VC_ELM_LOG_DBG("Click event : %s x(%d) y(%d) w(%d) h(%d), address(%d) type(%s)", info->text, x, y, w, h, info->address, info->type); - if (0 == click_method) { - evas_event_feed_mouse_move(evas_object_evas_get((Evas_Object*)(info->address)), x + w/2, y + h/2, 0, NULL); - evas_event_feed_mouse_down(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 1, NULL); - evas_event_feed_mouse_up(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 2, NULL); - } else if (1 == click_method) { - VC_ELM_LOG_DBG("click method - focus/key"); - bool clicked = false; - Object_Info* parent_info = ea_object_dump_parent_widget_data_get(info); - if (NULL != parent_info) { - if (EINA_TRUE == parent_info->focusable) { - VC_ELM_LOG_DBG("Focusable Parent"); - VC_ELM_LOG_DBG("Click event"); - if (EINA_TRUE == elm_object_focus_get((Evas_Object*)parent_info->address)) { - VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(g_click_time, __click_event, NULL); - } else { - evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused"); - elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); - } - clicked = true; - } - } - - if (false == clicked) { - parent_info = ea_object_dump_parent_widget_data_get(parent_info); - while (NULL != parent_info) { - if (EINA_TRUE == parent_info->focusable) { - VC_ELM_LOG_DBG("Focusable Parent"); - char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); - VC_ELM_LOG_DBG("type (%s)", widget_type); - Elm_Object_Item* item = NULL; - if (NULL != widget_type && !strcmp(widget_type, "Elm_Genlist")) { - item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, NULL); - if (NULL == item) { - item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w + w/2, y + h/2, NULL); - } - } else if (NULL != widget_type && !strcmp(widget_type, "Elm_Gengrid")) { - int xposret, yposret; - item = elm_gengrid_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, &xposret, &yposret); - } - if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { - VC_ELM_LOG_DBG("Click event"); - if (EINA_TRUE == elm_object_item_focus_get(item)) { - VC_ELM_LOG_DBG("Already focused"); - ecore_timer_add(g_click_time, __click_event, NULL); - } else { - evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); - elm_object_item_focus_set(item, EINA_TRUE); - elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); - } - break; - } - } - parent_info = ea_object_dump_parent_widget_data_get(parent_info); - } - } - } else { - VC_ELM_LOG_DBG("Invalid click method"); - } - - /* Propagation */ - //return EINA_TRUE; - text_found = EINA_TRUE; - } - } - } - } - } - ea_object_dump_list_clear(); - g_dump_list = NULL; - return text_found; + Eina_Bool ret = _vc_elm_click_matched_object(cmd, click_method); + return ret; } } @@ -1037,6 +1051,35 @@ void _vc_elm_core_register_action(struct vc_elm_core_widget_info *info, const ch } } +static int __vc_add_commands_for_automode() +{ + if (NULL != g_dump_list) { + ea_object_dump_list_clear(); + g_dump_list = NULL; + } + g_dump_list = ea_object_dump_full_list_get(EINA_TRUE); + VC_ELM_LOG_DBG("Count (%d)", eina_list_count(g_dump_list)); + + Eina_List *dump_iter = NULL; + void *data = NULL; + EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { + Object_Info* info = (Object_Info*)data; + + if (NULL != info && NULL != info->text && NULL != info->part_name) { + Eina_List *iter = NULL; + char *part_name = NULL; + EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { + if (NULL != part_name && !strcmp(part_name, info->part_name)) { + VC_ELM_LOG_DBG("Text (%s), Part(%s)", info->text, info->part_name); + VC_ELM_LOG_DBG("x(%d) y(%d) w(%d) h(%d)", info->geometry_info.x, info->geometry_info.y, info->geometry_info.w, info->geometry_info.h); + _vc_elm_widget_wrapper_add_command(info->text, NULL); + } + } + } + } + return 0; +} + static void __vc_add_commands() { Eina_List *_l; @@ -1157,29 +1200,8 @@ static void __vc_add_commands() _vc_elm_get_auto_register_mode(&auto_mode, &click_method); VC_ELM_LOG_DBG("Auto mode (%d) Click method (%d)", auto_mode, click_method); if (1 == auto_mode) { - if (NULL != g_dump_list) { - ea_object_dump_list_clear(); - g_dump_list = NULL; - } - g_dump_list = ea_object_dump_full_list_get(EINA_TRUE); - VC_ELM_LOG_DBG("Count (%d)", eina_list_count(g_dump_list)); - - Eina_List *dump_iter = NULL; - void *data = NULL; - EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { - Object_Info* info = (Object_Info*)data; - - if (NULL != info && NULL != info->text && NULL != info->part_name) { - Eina_List *iter = NULL; - char *part_name = NULL; - EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { - if (NULL != part_name && !strcmp(part_name, info->part_name)) { - VC_ELM_LOG_DBG("Text (%s), Part(%s)", info->text, info->part_name); - VC_ELM_LOG_DBG("x(%d) y(%d) w(%d) h(%d)", info->geometry_info.x, info->geometry_info.y, info->geometry_info.w, info->geometry_info.h); - _vc_elm_widget_wrapper_add_command(info->text, NULL); - } - } - } + if (0 != __vc_add_commands_for_automode()) { + VC_ELM_LOG_ERR("Fail to add command in auto mode"); } } -- 2.7.4 From 1494bbc81258b45f903e8b478c85354b17112b88 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Wed, 15 Feb 2017 16:47:55 +0900 Subject: [PATCH 12/16] Update header and doc files written in English Change-Id: Iab290457fffb2a77281036bbfc74f4a0f9859c82 Signed-off-by: Suyeon Hwang (cherry picked from commit 4686c1f270ef7ca31203e36367e44fdb25bc09ca) --- doc/uix_voice_control_elm_doc.h | 14 +-- include/voice_control_elm.h | 257 +++++++++++++++++----------------------- 2 files changed, 112 insertions(+), 159 deletions(-) diff --git a/doc/uix_voice_control_elm_doc.h b/doc/uix_voice_control_elm_doc.h index f725d57..cf9bfe9 100644 --- a/doc/uix_voice_control_elm_doc.h +++ b/doc/uix_voice_control_elm_doc.h @@ -16,22 +16,19 @@ /** - * @defgroup VOICE_CONTROL_ELEMENTARY_MODULE Voice control elementary * @ingroup CAPI_UIX_FRAMEWORK + * @defgroup VOICE_CONTROL_ELEMENTARY_MODULE Voice control elementary * @brief The @ref VOICE_CONTROL_ELEMENTARY_MODULE API provides functions to control widget by voice commands. - * * @section VOICE_CONTROL_ELEMENTARY_MODULE_HEADER Required Header - * \#include + * \#include * * @section VOICE_CONTROL_ELEMENTARY_MODULE_OVERVIEW Overview * The voice control elementary API is provided for controlling widgets by voice commands. * The voice UI control provided by voice control elementary is done the following way: - * * - Each widget supported and currently visible in the application is given a text hint.
* - Widget hints are shown on the User's wish.
* - User speaks the hint name of the widget he/she wants to trigger and the action he/she wants to perform on that widget.
* - The voice command is interpreted and the requested action on the widget is performed.
- * * To use of voice control elementary, use the following steps:
* 1. Initialize voice control elementary
* 2. Register callback functions for notifications
@@ -41,7 +38,6 @@ * 6. Run action mapped widget which is spoken by user
* 7. Destroy handle
* 8. Uninitialize voice control elementary
- * * When window is updated by user's operation with touch, key or etc, it is needed to set command and hint creating evas object or elementary object item.
* And the callback function of action related to widget is called internally, when user speaks a particular widget's hint. * @@ -121,14 +117,12 @@ * * @section VOICE_CONTROL_ELEMENTARY_MODULE_FEATURE Related Features * This API is related with the following features:
- * - http://tizen.org/feature/microphone
- * - http://tizen.org/feature/speech.control
- * + * - http://tizen.org/feature/microphone
+ * - http://tizen.org/feature/speech.control
* It is recommended to design feature related codes in your application for reliability.
* You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
* More details on featuring your application can be found from Feature Element. - * */ diff --git a/include/voice_control_elm.h b/include/voice_control_elm.h index 5b02ac8..e11ea7d 100644 --- a/include/voice_control_elm.h +++ b/include/voice_control_elm.h @@ -23,117 +23,116 @@ #include #include + /** * @addtogroup VOICE_CONTROL_ELEMENTARY_MODULE * @{ */ + #ifdef __cplusplus extern "C" { #endif + /** * @file voice_control_elm.h * @brief This file contains the voice control elementary API and related handle definitions and enums. */ + /** -* @brief This enum describes status of voice control elementary after API call +* @brief Enumeration for status of voice control elementary after API call. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif */ typedef enum { - VC_ELM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ - VC_ELM_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */ - VC_ELM_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */ - VC_ELM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - VC_ELM_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ - VC_ELM_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< voice control elementary NOT supported */ - VC_ELM_ERROR_INVALID_STATE = TIZEN_ERROR_VOICE_CONTROL | 0x021, /**< Invalid state */ - VC_ELM_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_VOICE_CONTROL | 0x022, /**< Invalid language */ - VC_ELM_ERROR_OPERATION_FAILED = TIZEN_ERROR_VOICE_CONTROL | 0x023, /**< Operation failed */ + VC_ELM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + VC_ELM_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */ + VC_ELM_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */ + VC_ELM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + VC_ELM_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ + VC_ELM_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< voice control elementary NOT supported */ + VC_ELM_ERROR_INVALID_STATE = TIZEN_ERROR_VOICE_CONTROL | 0x021, /**< Invalid state */ + VC_ELM_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_VOICE_CONTROL | 0x022, /**< Invalid language */ + VC_ELM_ERROR_OPERATION_FAILED = TIZEN_ERROR_VOICE_CONTROL | 0x023, /**< Operation failed */ VC_ELM_ERROR_OPERATION_REJECTED = TIZEN_ERROR_VOICE_CONTROL | 0x024 /**< Operation rejected */ } vc_elm_error_e; + /** -* @brief This enum describes directions of the widget hints. +* @brief Enumeration for directions of the widget hints. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* * @see vc_elm_set_command_hint_direction() -* * @image html hints_orientation.png Example: various hints orientations. */ typedef enum { - VC_ELM_DIRECTION_CENTER = 0, /**< Direction displayed to the center of the widget */ - VC_ELM_DIRECTION_LEFT = 1, /**< Direction displayed to the left of the widget */ - VC_ELM_DIRECTION_RIGHT = 2, /**< Direction displayed to the right of the widget */ - VC_ELM_DIRECTION_TOP = 3, /**< Direction displayed to the top of the widget */ - VC_ELM_DIRECTION_BOTTOM = 4, /**< Direction displayed to the bottom of the widget */ - VC_ELM_DIRECTION_LEFT_TOP = 5, /**< Direction displayed to the top left corner of the widget */ - VC_ELM_DIRECTION_LEFT_BOTTOM = 6, /**< Direction displayed to the bottom left corner of the widget */ - VC_ELM_DIRECTION_RIGHT_TOP = 7, /**< Direction displayed to the top right corner of the widget */ - VC_ELM_DIRECTION_RIGHT_BOTTOM = 8 /**< Direction displayed to the bottom right corner of the widget */ + VC_ELM_DIRECTION_CENTER = 0, /**< Direction displayed to the center of the widget */ + VC_ELM_DIRECTION_LEFT = 1, /**< Direction displayed to the left of the widget */ + VC_ELM_DIRECTION_RIGHT = 2, /**< Direction displayed to the right of the widget */ + VC_ELM_DIRECTION_TOP = 3, /**< Direction displayed to the top of the widget */ + VC_ELM_DIRECTION_BOTTOM = 4, /**< Direction displayed to the bottom of the widget */ + VC_ELM_DIRECTION_LEFT_TOP = 5, /**< Direction displayed to the top left corner of the widget */ + VC_ELM_DIRECTION_LEFT_BOTTOM = 6, /**< Direction displayed to the bottom left corner of the widget */ + VC_ELM_DIRECTION_RIGHT_TOP = 7, /**< Direction displayed to the top right corner of the widget */ + VC_ELM_DIRECTION_RIGHT_BOTTOM = 8 /**< Direction displayed to the bottom right corner of the widget */ } vc_elm_direction_e; + /** -* @brief A handle to the voice control elementary for object or item object +* @brief The voice control elementary for object or item object handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif */ typedef struct vc_elm_s* vc_elm_h; + /** * @brief Called to retrieve supported language. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* -* @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n -* followed by ISO 639-1 for the two-letter language code \n -* For example, "ko_KR" for Korean, "en_US" for American English +* @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code +* followed by ISO 639-1 for the two-letter language code +* For example, "ko_KR" for Korean, "en_US" for American English * @param[in] user_data The user data passed from the foreach function -* -* @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop +* @return @c true to continue with the next iteration of the loop, +* @c false to break out of the loop * @pre The function will invoke this callback. -* * @see vc_elm_foreach_supported_languages() */ typedef bool (*vc_elm_supported_language_cb)(const char* language, void* user_data); + /** * @brief Called when default language is changed. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* * @param[in] previous Previous language * @param[in] current Current language * @param[in] user_data The user data passed from the callback registration function -* * @pre An application registers this callback to detect changing language. -* * @see vc_elm_set_current_language_changed_cb() */ typedef void (*vc_elm_current_language_changed_cb)(const char* previous, const char* current, void* user_data); + /** * @brief Called to retrieve supported widget. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* * @param[in] widget Widget name * @param[in] user_data The user data passed from the callback registration function -* -* @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop +* @return @c true to continue with the next iteration of the loop, +* @c false to break out of the loop * @pre The function will invoke this callback. -* * @see vc_elm_foreach_supported_widgets() */ typedef bool (*vc_elm_widget_cb)(const char* widget, void* user_data); + /** * @brief Called to retrieve supported action. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* * @param[in] action Action name * @param[in] user_data The user data passed from the callback registration function -* -* @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop +* @return @c true to continue with the next iteration of the loop, +* @c false to break out of the loop * @pre The function will invoke this callback. -* * @see vc_elm_foreach_supported_actions() */ typedef bool (*vc_elm_action_cb)(const char* action, void* user_data); @@ -142,75 +141,69 @@ typedef bool (*vc_elm_action_cb)(const char* action, void* user_data); /** * @brief Initializes voice control elementary module. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* * @remarks If the function succeeds, the voice control elementary must be released with vc_elm_deinitialize(). -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @see vc_elm_deinitialize() */ int vc_elm_initialize(void); + /** * @brief Deinitializes voice control elementary module. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. -* * @see vc_elm_initialize() */ int vc_elm_deinitialize(void); + /** * @brief Retrieves all supported languages using callback function. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] callback Callback function to invoke * @param[in] user_data The user data to be passed to the callback function -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. * @post This function invokes vc_supported_language_cb() repeatedly for getting languages. -* * @see vc_elm_supported_language_cb() * @see vc_elm_get_current_language() */ int vc_elm_foreach_supported_languages(vc_elm_supported_language_cb callback, void* user_data); + /** * @brief Gets current language. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @remark If the function succeeds, @a language must be released with free() by you when you no longer need it. -* -* @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n -* followed by ISO 639-1 for the two-letter language code \n -* For example, "ko_KR" for Korean, "en_US" for American English -* -* @return 0 on success, otherwise a negative error value +* @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code +* followed by ISO 639-1 for the two-letter language code +* For example, "ko_KR" for Korean, "en_US" for American English +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory @@ -218,75 +211,69 @@ int vc_elm_foreach_supported_languages(vc_elm_supported_language_cb callback, vo * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. */ int vc_elm_get_current_language(char** language); + /** * @brief Retrieves all supported widget using callback function. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] callback Callback function to invoke * @param[in] user_data The user data to be passed to the callback function -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. * @post This function invokes vc_elm_widget_cb() repeatedly for getting widgets. -* * @see vc_elm_widget_cb() * @see vc_elm_foreach_supported_actions() */ int vc_elm_foreach_supported_widgets(vc_elm_widget_cb callback, void* user_data); + /** * @brief Retrieves all supported actions of widget using callback function. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] widget Widget name * @param[in] callback Callback function to invoke * @param[in] user_data The user data to be passed to the callback function -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful and widget name can get from vc_elm_foreach_supported_widgets(). * @post This function invokes vc_elm_action_cb() repeatedly for getting actions. -* * @see vc_elm_action_cb() * @see vc_elm_foreach_supported_widgets() */ int vc_elm_foreach_supported_actions(const char* widget, vc_elm_action_cb callback, void* user_data); + /** * @brief Gets action command of action. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* -* @remark If the function succeeds, @a command must be released with free() by you when you no longer need it. \n -* If command is NULL, the action is default action. The default action works by only command of widget. -* +* @remark If the function succeeds, @a command must be released with free() by you when you no longer need it. +* If command is NULL, the action is default action. The default action works by only command of widget. * @param[in] action Action name * @param[out] command Command for action -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory @@ -294,23 +281,21 @@ int vc_elm_foreach_supported_actions(const char* widget, vc_elm_action_cb callba * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. */ int vc_elm_get_action_command(const char* action, char** command); + /** -* @brief Creates vc elm handle for evas object. +* @brief Creates vc elm handle for Evas object. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @remarks If the function succeeds, The vc elm handle must be released with vc_elm_destroy(). -* * @param[in] object Evas object included in handle * @param[out] vc_elm The voice control elementary handle -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter @@ -318,244 +303,220 @@ int vc_elm_get_action_command(const char* action, char** command); * @retval #VC_ELM_ERROR_OPERATION_REJECTED Operation rejected when widget is not supported * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. -* * @see vc_elm_destroy() */ int vc_elm_create_object(Evas_Object* object, vc_elm_h* vc_elm); + /** * @brief Creates vc elm handle for elm object item. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @remarks If the function succeeds, The vc elm handle must be released with vc_elm_destroy(). -* * @param[in] item The elm Object item included in handle * @param[out] vc_elm Handle containing pointer to widget -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_OUT_OF_MEMORY Out of memory * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. -* * @see vc_elm_destroy() */ int vc_elm_create_item(Elm_Object_Item* item, vc_elm_h* vc_elm); + /** * @brief Destroys the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_create_object() * @see vc_elm_create_item() */ int vc_elm_destroy(vc_elm_h vc_elm); + /** * @brief Sets command to the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget * @param[in] command Command's text -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful. * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_unset_command() */ int vc_elm_set_command(vc_elm_h vc_elm, const char* command); + /** * @brief Unsets command from the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle to include pointer to widget -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command() */ int vc_elm_unset_command(vc_elm_h vc_elm); + /** -* @brief Set command hint for the handle. +* @brief Sets command hint for the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget * @param[in] hint Hint's text -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_unset_command_hint() */ int vc_elm_set_command_hint(vc_elm_h vc_elm, const char* hint); + /** -* @brief Unset command hint for the handle. +* @brief Unsets command hint for the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command_hint() */ int vc_elm_unset_command_hint(vc_elm_h vc_elm); + /** * @brief Sets the direction of hint to the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @remarks If direction is not set, default direction is pre-configured will be used. -* * @param[in] vc_elm Handle containing pointer to widget * @param[in] direction Direction of hint defined by #vc_elm_direction_e -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command_hint() * @see vc_elm_get_command_hint_direction() */ int vc_elm_set_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e direction); + /** * @brief Unsets the direction of hint from the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget * @param[out] direction Direction of hint defined by #vc_elm_direction_e -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command_hint_direction() */ int vc_elm_get_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e* direction); + /** * @brief Sets command hint's x,y position to the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget * @param[in] pos_x The x position of hint * @param[in] pos_y The y position of hint -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command_hint() * @see vc_elm_get_command_hint_offset() */ int vc_elm_set_command_hint_offset(vc_elm_h vc_elm, int pos_x, int pos_y); + /** * @brief Gets command hint's x,y position from the handle. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] vc_elm Handle containing pointer to widget * @param[out] pos_x The x position of hint * @param[out] pos_y The y position of hint -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_OPERATION_FAILED Operation failed * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre The vc_elm handle should be valid with vc_elm_create_object() or vc_elm_create_item(). -* * @see vc_elm_set_command_hint_offset() */ int vc_elm_get_command_hint_offset(vc_elm_h vc_elm, int* pos_x, int* pos_y); @@ -566,37 +527,33 @@ int vc_elm_get_command_hint_offset(vc_elm_h vc_elm, int* pos_x, int* pos_y); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_PARAMETER Invalid parameter * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. -* * @see vc_elm_unset_current_language_changed_cb() */ int vc_elm_set_current_language_changed_cb(vc_elm_current_language_changed_cb callback, void* user_data); + /** * @brief Unregisters the callback function. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder -* -* @return 0 on success, otherwise a negative error value +* @return @c 0 on success, +* otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful * @retval #VC_ELM_ERROR_INVALID_STATE Invalid state * @retval #VC_ELM_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ELM_ERROR_NOT_SUPPORTED Not supported -* * @pre vc_elm_initialize() should be successful. -* * @see vc_elm_set_current_language_changed_cb() */ int vc_elm_unset_current_language_changed_cb(void); @@ -606,8 +563,10 @@ int vc_elm_unset_current_language_changed_cb(void); } #endif + /** * @}@} */ + #endif /* VOICE_CONTROL_ELEMENTARY_H_ */ -- 2.7.4 From f366adffe27825e6b8d9cd8930efb089a0d6b87f Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 23 Feb 2017 17:33:21 +0900 Subject: [PATCH 13/16] Add null check Change-Id: I797b00c8c9c3632ffb9876d618b6da586fd74ee1 Signed-off-by: Suyeon Hwang (cherry picked from commit 3d606974ada9a1dac33c299c7918f13b78fc75f2) --- src/vc_elm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 26c6f85..0990910 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -290,7 +290,7 @@ static Eina_Bool _vc_elm_click_matched_object(const char* cmd, int click_method) } } - if (false == clicked) { + if (false == clicked && NULL != parent_info) { parent_info = ea_object_dump_parent_widget_data_get(parent_info); while (NULL != parent_info) { if (EINA_TRUE == parent_info->focusable) { -- 2.7.4 From 6e631c114463242852d744ce58c619c597318fcf Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Mon, 20 Mar 2017 15:31:07 +0900 Subject: [PATCH 14/16] check eina_hash is empty Change-Id: I5992f81a0ac91dda34dd5ea3264766ba0a97c600 Signed-off-by: Wonnam Jang --- src/vc_elm_core.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 0990910..c1130ac 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -486,17 +486,25 @@ void _vc_elm_core_fini() g_allowed_text_part_list = NULL; } - eina_hash_free(g_widget_info_hash); - g_widget_info_hash = NULL; + if (0 != eina_hash_population(g_widget_info_hash)) { + eina_hash_free(g_widget_info_hash); + g_widget_info_hash = NULL; + } - eina_hash_free_buckets(registered_item_map); - eina_hash_free(registered_item_map); - registered_item_map = NULL; + if (0 != eina_hash_population(registered_item_map)) { + eina_hash_free_buckets(registered_item_map); + eina_hash_free(registered_item_map); + registered_item_map = NULL; + } - eina_hash_free(g_config_action_map); - g_config_action_map = NULL; - eina_hash_free(g_config_widget_map); - g_config_widget_map = NULL; + if (0 != eina_hash_population(g_config_action_map)) { + eina_hash_free(g_config_action_map); + g_config_action_map = NULL; + } + if (0 != eina_hash_population(g_config_widget_map)) { + eina_hash_free(g_config_widget_map); + g_config_widget_map = NULL; + } _vc_elm_core_destroy_xml_data(); #ifndef SRPOL_DEBUG -- 2.7.4 From df19dd7f8eeeac9a6ce4757df5e72ef1449faff6 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 15 Mar 2017 19:40:38 +0900 Subject: [PATCH 15/16] Add to set voice touch as auto mode Change-Id: Id283dd5a9740a639d87c6be0f7cb7b9c9d4f2714 Signed-off-by: sooyeon.kim --- CMakeLists.txt | 3 + include/voice_control_elm_private.h | 7 ++ packaging/voice-control-elm.spec | 3 +- src/CMakeLists.txt | 1 + src/vc_elm.c | 72 +++++++++++++- src/vc_elm_core.c | 181 +++++++++++++++++++++++++++++++++++- 6 files changed, 259 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f124b6e..a8ce164 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,9 @@ SET(VERSION 0.2.0) # pkg config tool INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + vconf +) # Build type SET(CMAKE_BUILD_TYPE "Release") diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index 6077ad6..5b55088 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -18,6 +18,7 @@ #ifndef VOICE_CONTROL_ELEMENTARY_PRIVATE_H_ #define VOICE_CONTROL_ELEMENTARY_PRIVATE_H_ + /** * @internal * @addtogroup VOICE_CONTROL_ELEMENTARY_PRIVATE_MODULE @@ -110,6 +111,12 @@ int vc_elm_set_click_time(float time); int vc_elm_unset_click_time(); +/** + * @brief Function that check whether voice touch is set as auto mode or not + * @param[out] is_vt_automode a parameter for checking whether voice touch is set as auto mode or not + */ +int vc_elm_is_supported_vt_auto(bool* is_vt_automode); + #ifdef __cplusplus } #endif diff --git a/packaging/voice-control-elm.spec b/packaging/voice-control-elm.spec index 2b498ba..00a4ed5 100644 --- a/packaging/voice-control-elm.spec +++ b/packaging/voice-control-elm.spec @@ -25,6 +25,7 @@ BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(voice-control-widget) +BuildRequires: pkgconfig(vconf) BuildRequires: gettext-tools %description @@ -98,4 +99,4 @@ mkdir -p %{TZ_SYS_RO_SHARE}/voice %manifest %{name}-devel.manifest %{_includedir}/voice_control_elm.h %{_includedir}/voice_control_elm_private.h -%{_libdir}/pkgconfig/%{name}.pc \ No newline at end of file +%{_libdir}/pkgconfig/%{name}.pc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c00e5ee..c71fa62 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,7 @@ SET(VC_ELM_PKGS elementary dlog libxml-2.0 + vconf ) IF(${SRPOL_DEBUG} EQUAL "1") diff --git a/src/vc_elm.c b/src/vc_elm.c index b89a392..19fd3ec 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -21,6 +21,7 @@ #include "vc_elm_main.h" #include #include +#include #include "vc_elm.h" #include "vc_elm_core.h" @@ -28,6 +29,15 @@ #include "vc_elm_tooltip.h" #include "vc_elm_widget_wrapper.h" +//#define VC_VOICE_TOUCH_AUTOMODE VCONFKEY_VC_VOICE_TOUCH_AUTOMODE +#define VC_VOICE_TOUCH_AUTOMODE "db/voice/vc/voice_touch/automode" + +#define VC_ELM_MODE_MANUAL 0 + +#define VC_ELM_MODE_AUTO_APP 1 + +#define VC_ELM_MODE_AUTO_APPFW 2 + /** * @brief Internal variable. It can check whether voice control elm is initilaized or not. */ @@ -928,17 +938,62 @@ int _vc_elm_get_text_domain(char **domain) return VC_ELM_ERROR_NONE; } +int _vc_elm_is_supported_vt_auto(bool* is_vt_automode) +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + + int ret = -1; + ret = vconf_get_bool(VC_VOICE_TOUCH_AUTOMODE, is_vt_automode); + + if (0 != ret) { + VC_ELM_LOG_DBG("Fail to get vconfkey"); + return VC_ELM_ERROR_OPERATION_FAILED; + } + + VC_ELM_LOG_DBG("Success to get vconfkey(%d)", (int)(*is_vt_automode)); + + return ret; +} + +int vc_elm_is_supported_vt_auto(bool* is_vt_automode) +{ + if (0 != __vc_elm_get_feature_enabled()) { + return VC_ELM_ERROR_NOT_SUPPORTED; + } + + return _vc_elm_is_supported_vt_auto(is_vt_automode); +} + int _vc_elm_set_auto_register_mode(int mode, int click_method) { g_auto_mode = mode; g_click_method = click_method; + VC_ELM_LOG_DBG("g_auto_mode: %d, g_click_method: %d", g_auto_mode, g_click_method); + return 0; } + int _vc_elm_get_auto_register_mode(int* mode, int* click_method) { - *mode = g_auto_mode; - *click_method = g_click_method; + bool is_vt_auto; + if (0 != _vc_elm_is_supported_vt_auto(&is_vt_auto)) { + return VC_ELM_ERROR_OPERATION_FAILED; + } else { + if (false == is_vt_auto) { + VC_ELM_LOG_DBG("vt_automode is FALSE"); + *mode = g_auto_mode; + *click_method = g_click_method; + } else { + VC_ELM_LOG_DBG("vt_automode is TRUE"); + *mode = (int)VC_ELM_MODE_AUTO_APPFW; + *click_method = g_click_method; + } + } + + VC_ELM_LOG_DBG("mode: %d, click_method: %d", *mode, *click_method); return 0; } @@ -949,6 +1004,19 @@ int vc_elm_set_auto_register_mode(int mode, int click_method) return VC_ELM_ERROR_NOT_SUPPORTED; } + bool is_vt_auto; + if (0 != _vc_elm_is_supported_vt_auto(&is_vt_auto)) { + return VC_ELM_ERROR_OPERATION_FAILED; + } else { + if (false == is_vt_auto) { + VC_ELM_LOG_DBG("vt_automode is FALSE"); + return _vc_elm_set_auto_register_mode(mode, click_method); + } else { + VC_ELM_LOG_DBG("vt_automode is TRUE"); + return _vc_elm_set_auto_register_mode((int)VC_ELM_MODE_AUTO_APPFW, click_method); + } + } + return _vc_elm_set_auto_register_mode(mode, click_method); } diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 0990910..83df073 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -342,6 +342,128 @@ static Eina_Bool _vc_elm_click_matched_object(const char* cmd, int click_method) return text_found; } +static Eina_Bool _vc_elm_click_matched_object_vt_auto(const char* cmd, int click_method) +{ + VC_ELM_LOG_DBG("inside _vc_elm_click_matched_object_vt_auto()"); + VC_ELM_LOG_DBG("cmd(%s), click_method(%d)", cmd, click_method); + + Eina_List *dump_iter = NULL; + void *data = NULL; + Eina_Bool text_found = EINA_FALSE; + EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { + Object_Info* info = (Object_Info*)data; + + if (NULL != info && NULL != info->text /*&& NULL != info->part_name*/) { + VC_ELM_LOG_DBG("info->text(%s)", info->text); +// Eina_List *iter = NULL; +// char *part_name = NULL; +// EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { +// if (NULL != part_name && !strcmp(part_name, info->part_name)) { + if (!strcmp(info->text, cmd)) { + int x = info->geometry_info.x; + int y = info->geometry_info.y; + int w = info->geometry_info.w; + int h = info->geometry_info.h; + VC_ELM_LOG_DBG("Click event : %s x(%d) y(%d) w(%d) h(%d), address(%p) type(%s)", info->text, x, y, w, h, info->address, info->type); + if (0 == click_method) { + evas_event_feed_mouse_move(evas_object_evas_get((Evas_Object*)(info->address)), x + w/2, y + h/2, 0, NULL); + evas_event_feed_mouse_down(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 1, NULL); + evas_event_feed_mouse_up(evas_object_evas_get((Evas_Object*)(info->address)), 1, EVAS_BUTTON_NONE, 2, NULL); + VC_ELM_LOG_INFO("click!!!!!"); + } else if (1 == click_method) { + VC_ELM_LOG_DBG("click method - focus/key"); + bool clicked = false; + if (0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "text") && 0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "textblock")) { + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_focus_get((Evas_Object*)info->address)) { + VC_ELM_LOG_DBG("Already focused"); + ecore_timer_add(g_click_time, __click_event, NULL); + } else { + evas_object_smart_callback_add((Evas_Object*)(info->address), "focused", __focused_cb, "focused"); + elm_object_focus_set((Evas_Object*)(info->address), EINA_TRUE); + } + clicked = true; + } + + if (false == clicked) { + Object_Info* parent_info = ea_object_dump_parent_widget_data_get(info); + if (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_focus_get((Evas_Object*)parent_info->address)) { + VC_ELM_LOG_DBG("Already focused"); + ecore_timer_add(g_click_time, __click_event, NULL); + } else { + evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused"); + elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); + } + clicked = true; + } + } + + if (false == clicked && NULL != parent_info) { + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + while (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + const char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); + VC_ELM_LOG_DBG("type (%s)", widget_type); + Elm_Object_Item* item = NULL; + if (NULL != widget_type && !strcmp(widget_type, "Elm_Genlist")) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, NULL); + if (NULL == item) { + item = elm_genlist_at_xy_item_get((Evas_Object*)(parent_info->address), x + w + w/2, y + h/2, NULL); + } + } else if (NULL != widget_type && !strcmp(widget_type, "Elm_List")) { + item = elm_list_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, NULL); + if (NULL == item) { + item = elm_list_at_xy_item_get((Evas_Object*)(parent_info->address), x + w + w/2, y + h/2, NULL); + } + } else if (NULL != widget_type && !strcmp(widget_type, "Elm_Gengrid")) { + int xposret, yposret; + item = elm_gengrid_at_xy_item_get((Evas_Object*)(parent_info->address), x + w/2, y + h/2, &xposret, &yposret); + } + VC_ELM_LOG_DBG("item(%p)(%d)", item, elm_object_item_disabled_get(item)); + + if (NULL != item && EINA_FALSE == elm_object_item_disabled_get(item)) { + VC_ELM_LOG_DBG("Click event"); + if (EINA_TRUE == elm_object_item_focus_get(item)) { + VC_ELM_LOG_DBG("Already focused"); + ecore_timer_add(g_click_time, __click_event, NULL); + } else { + evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused"); + elm_object_item_focus_set(item, EINA_TRUE); + elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE); + } + text_found = EINA_TRUE; + break; + } + } + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + } + } + } + } else { + VC_ELM_LOG_DBG("Invalid click method"); + } + + /* Propagation */ + //return EINA_TRUE; + text_found = EINA_TRUE; + } + // } + // } + } + } + ea_object_dump_list_clear(); + g_dump_list = NULL; + + return text_found; +} + + + /** * @brief Function that matches recognition result to the registered actions * and calls for action execution @@ -388,10 +510,18 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa int auto_mode = 0; int click_method = 0; _vc_elm_get_auto_register_mode(&auto_mode, &click_method); + + Eina_Bool ret; if (1 == auto_mode) { - Eina_Bool ret = _vc_elm_click_matched_object(cmd, click_method); - return ret; + /* for Apps */ + VC_ELM_LOG_DBG("for App : vt_auto is FALSE"); + ret = _vc_elm_click_matched_object(cmd, click_method); + } else if (2 == auto_mode) { + /* for App FW */ + VC_ELM_LOG_DBG("for AppFW : vt_auto is TRUE"); + ret = _vc_elm_click_matched_object_vt_auto(cmd, click_method); } + return ret; } return EINA_FALSE; @@ -1053,6 +1183,8 @@ void _vc_elm_core_register_action(struct vc_elm_core_widget_info *info, const ch static int __vc_add_commands_for_automode() { + VC_ELM_LOG_DBG("inside __vc_add_commands_for_automode()"); + if (NULL != g_dump_list) { ea_object_dump_list_clear(); g_dump_list = NULL; @@ -1080,8 +1212,40 @@ static int __vc_add_commands_for_automode() return 0; } +static int __vc_add_commands_for_automode_vt_auto() +{ + VC_ELM_LOG_DBG("inside __vc_add_commands_for_automode_vt_auto()"); + if (NULL != g_dump_list) { + ea_object_dump_list_clear(); + g_dump_list = NULL; + } + g_dump_list = ea_object_dump_full_list_get(EINA_TRUE); + VC_ELM_LOG_DBG("Count (%d)", eina_list_count(g_dump_list)); + + Eina_List *dump_iter = NULL; + void *data = NULL; + EINA_LIST_FOREACH(g_dump_list, dump_iter, data) { + Object_Info* info = (Object_Info*)data; + + if (NULL != info && NULL != info->text /*&& NULL != info->part_name*/) { +// Eina_List *iter = NULL; +// char *part_name = NULL; +// EINA_LIST_FOREACH(g_allowed_text_part_list, iter, part_name) { +// if (NULL != part_name && !strcmp(part_name, info->part_name)) { + VC_ELM_LOG_DBG("Text (%s), Part(%s)", info->text, info->part_name); + VC_ELM_LOG_DBG("x(%d) y(%d) w(%d) h(%d)", info->geometry_info.x, info->geometry_info.y, info->geometry_info.w, info->geometry_info.h); + _vc_elm_widget_wrapper_add_command(info->text, NULL); +// } +// } + } + } + return 0; +} + static void __vc_add_commands() { + VC_ELM_LOG_DBG("inside __vc_add_commands()"); + Eina_List *_l; Evas_Object *obj; size_t idx; @@ -1200,10 +1364,17 @@ static void __vc_add_commands() _vc_elm_get_auto_register_mode(&auto_mode, &click_method); VC_ELM_LOG_DBG("Auto mode (%d) Click method (%d)", auto_mode, click_method); if (1 == auto_mode) { - if (0 != __vc_add_commands_for_automode()) { - VC_ELM_LOG_ERR("Fail to add command in auto mode"); - } + /* for Apps */ + VC_ELM_LOG_DBG("for App : vt_auto is FALSE"); + __vc_add_commands_for_automode(); + } else if (2 == auto_mode) { + /* for App FW */ + VC_ELM_LOG_DBG("for AppFW : vt_auto is TRUE"); + __vc_add_commands_for_automode_vt_auto(); } +// if (0 != __vc_add_commands_for_automode()) { +// VC_ELM_LOG_ERR("Fail to add command in auto mode"); +// } _vc_elm_widget_wrapper_commit_commands(&__result_cb, NULL); } -- 2.7.4 From 4590b7158613ef0175cd893089c7b11e8be8a394 Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Wed, 22 Mar 2017 17:33:24 +0900 Subject: [PATCH 16/16] Update coverage for voice touch Change-Id: Ia42851acdc60b20717816995da3edf0c2bd2a3a3 Signed-off-by: Wonnam Jang --- src/vc_elm_efl_dump.c | 155 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 131 insertions(+), 24 deletions(-) diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index 03d4e4b..c4f6b36 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -23,6 +23,13 @@ #include "vc_elm_tools.h" #include "vc_elm_efl_dump.h" +#define EVAS_OBJECT_DUMP_DEBUG +#ifdef EVAS_OBJECT_DUMP_DEBUG +#define VC_ELM_LOG_DUMP(fmt, ...) SLOGD("\033[0;32m" fmt "\033[m", ## __VA_ARGS__) +#else +#define VC_ELM_LOG_DUMP(fmt, ...) +#endif + typedef struct _Ea_Util_Mgr { Evas *evas; FILE *fp; @@ -40,7 +47,7 @@ typedef struct _Edje_Info { } Edje_Info; #define SPANS_COMMON(x1, w1, x2, w2) \ - (!(((int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1))))) + (!(((int)((x2) + (int)(w2)) < (int)(x1)) || (int)((x2) > (int)((x1) + (int)(w1))))) #define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \ ((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh)))) @@ -53,6 +60,17 @@ static int g_geo_x = 0, g_geo_y = 0, g_geo_w = 0, g_geo_h = 0; static int find_popup = 0; static int skip_text = 0; +bool vc_elm_efl_dump_is_vt_auto_enabled() +{ + bool is_vt_automode = false; + int ret = vc_elm_is_supported_vt_auto(&is_vt_automode); + if (0 != ret) { + VC_ELM_LOG_DUMP("Fail to check vt auto mode"); + } + + return is_vt_automode; +} + static Eina_Bool evas_object_is_visible_get(Evas_Object *obj) { @@ -308,8 +326,49 @@ next: } } +static Eina_Bool _is_clickable_object(Evas_Object *obj) +{ + if (!strcmp(evas_object_type_get(obj), "elm_win") || !strcmp(evas_object_type_get(obj), "elm_naviframe") || !strcmp(evas_object_type_get(obj), "elm_label") + || !strcmp(evas_object_type_get(obj), "elm_ctxpopup") || !strcmp(evas_object_type_get(obj), "elm_popup")) { + VC_ELM_LOG_DUMP("Not clickable object(%s)", evas_object_type_get(obj)); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +static Eina_Bool _is_descendant_of_list(Object_Info *object_info) +{ + Object_Info* parent_info = ea_object_dump_parent_widget_data_get(object_info); + while (NULL != parent_info) { + const char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); + if (NULL != widget_type) { + VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type); + if (!strcmp(widget_type, "Elm_Genlist") || !strcmp(widget_type, "Elm_Gengrid") || !strcmp(widget_type, "Elm_List") || !strcmp(widget_type, "Elm_Ctxpopup") || !strcmp(widget_type, "Elm_Index")) + return EINA_TRUE; + } + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + } + return EINA_FALSE; +} + +static Eina_Bool _is_descendant_of_toolbar(Object_Info *object_info) +{ + Object_Info* parent_info = ea_object_dump_parent_widget_data_get(object_info); + while (NULL != parent_info) { + const char* widget_type = elm_widget_type_get((Evas_Object*)(parent_info->address)); + if (NULL != widget_type) { + VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type); + if (!strcmp(widget_type, "Elm_Toolbar")) + return EINA_TRUE; + } + parent_info = ea_object_dump_parent_widget_data_get(parent_info); + } + return EINA_FALSE; +} + static void -_obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent, Eina_Bool parent_widget_focusable, Eina_Bool list_type) +_obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent, Eina_Bool parent_widget_focusable, Eina_Bool list_type, int cnt) { Eina_List *children = NULL, *l = NULL; Evas_Object *child, *smart_parent_obj = NULL; @@ -323,30 +382,51 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj Object_Info *object_info = NULL; char* temp = NULL; + VC_ELM_LOG_DUMP("[%d] Object(%s), text(%s)(%s)", cnt, evas_object_type_get(obj), (!evas_object_text_text_get(obj)) ? " " : evas_object_text_text_get(obj), !elm_atspi_accessible_name_get(obj) ? " " : elm_atspi_accessible_name_get(obj)); + // visible check - if (!evas_object_is_visible_get(obj)) return; + if (!evas_object_is_visible_get(obj)) { + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Invisible)", cnt, evas_object_type_get(obj)); + return; + } - if (evas_object_type_match(obj, "elm_popup")) { + if (evas_object_type_match(obj, "elm_popup") || evas_object_type_match(obj, "elm_ctxpopup")) { if (elm_object_part_text_get(obj, "title,text")) skip_text = 1; eina_list_free(ret_list); + ret_list = NULL; find_popup = 0; } - if (find_popup) return; + if (find_popup) { + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Find_popup", cnt, evas_object_type_get(obj)); + return; + } // viewport check evas_object_geometry_get(obj, &x, &y, &w, &h); - if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) { + VC_ELM_LOG_DUMP("## x(%d), y(%d), w(%d), h(%d), util_mgr->x(%d), util_mgr->y(%d), util_mgr->w(%d), util_mgr->h(%d)", x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h); + VC_ELM_LOG_DUMP("## RECTS_INTERSECT(%d), SPANS_COMMON_X(%d), SPANS_COMMON_Y(%d)", RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h), + SPANS_COMMON(x, w, util_mgr->x, util_mgr->w), SPANS_COMMON(y, h, util_mgr->y, util_mgr->h)); + return; + } // clipper check if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; - if (is_clip) goto next; + if (is_clip) { + VC_ELM_LOG_DUMP("is_clip(%d)", is_clip); + goto next; + } if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) { - if (!parent_widget_focusable && !list_type) goto next; + if (!parent_widget_focusable && !list_type) { + VC_ELM_LOG_DUMP("## parent_widget_focusable(%d), list_type(%d)", parent_widget_focusable, list_type); + goto next; + } if (skip_text) { skip_text = 0; + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Skip_text", cnt, evas_object_type_get(obj)); return; } } @@ -377,7 +457,7 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj } } if (!list_type) { - if (evas_object_type_match(obj, "elm_genlist") || evas_object_type_match(obj, "elm_gengrid") || evas_object_type_match(obj, "elm_list")) + if (evas_object_type_match(obj, "elm_genlist") || evas_object_type_match(obj, "elm_gengrid") || evas_object_type_match(obj, "elm_list") || evas_object_type_match(obj, "elm_ctxpopup") || evas_object_type_match(obj, "elm_index")) list_type = EINA_TRUE; } @@ -455,31 +535,56 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj } text = NULL; - if (!strcmp(evas_object_type_get(obj), "text")) - text = eina_stringshare_add(evas_object_text_text_get(obj)); - else if (!strcmp(evas_object_type_get(obj), "textblock")) { - ret = evas_object_textblock_text_markup_get(obj); - temp = evas_textblock_text_markup_to_utf8(obj, ret); - text = eina_stringshare_add(temp); - - if (NULL != temp) { - free(temp); - temp = NULL; + if (false == vc_elm_efl_dump_is_vt_auto_enabled()) { + if (!strcmp(evas_object_type_get(obj), "text")) + text = eina_stringshare_add(evas_object_text_text_get(obj)); + else if (!strcmp(evas_object_type_get(obj), "textblock")) { + ret = evas_object_textblock_text_markup_get(obj); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } + } + } else { + if (!strcmp(evas_object_type_get(obj), "text") && EINA_TRUE == _is_descendant_of_list(object_info)) { + text = eina_stringshare_add(evas_object_text_text_get(obj)); + VC_ELM_LOG_DUMP("####### [DEBUG] text(%s), atspi_text(%s)", text, elm_atspi_accessible_name_get(obj)); + } else if (!strcmp(evas_object_type_get(obj), "textblock") && EINA_TRUE == _is_descendant_of_list(object_info)) { + ret = evas_object_textblock_text_markup_get(obj); + temp = evas_textblock_text_markup_to_utf8(obj, ret); + text = eina_stringshare_add(temp); + + if (NULL != temp) { + free(temp); + temp = NULL; + } + VC_ELM_LOG_DUMP("####### [DEBUG] textblock(%s), atspi_text(%s)", text, elm_atspi_accessible_name_get(obj)); + } else if (elm_atspi_accessible_name_get(obj) && EINA_TRUE == object_info->focusable && EINA_TRUE == _is_clickable_object(obj)) { + text = elm_atspi_accessible_name_get(obj); + VC_ELM_LOG_DUMP("####### [DEBUG] atspi_text(%s)", text); + } else if (elm_atspi_accessible_name_get(obj) && !strcmp(evas_object_type_get(obj), "elm_layout") && EINA_TRUE == _is_descendant_of_toolbar(object_info)) { + text = elm_atspi_accessible_name_get(obj); + VC_ELM_LOG_DUMP("####### [DEBUG] toolbar(%s)", text); } } if (text && strlen(text) > 0) { object_info->text = calloc(1, strlen(text) + 1); strncpy(object_info->text, text, strlen(text) + 1); + + ret_list = eina_list_append(ret_list, object_info); } - ret_list = eina_list_append(ret_list, object_info); next: if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) { children = evas_object_smart_members_get(obj); EINA_LIST_FREE(children, child) - _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable, list_type); - if (evas_object_type_match(obj, "elm_popup")) find_popup = 1; + _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable, list_type, cnt + 1); + if (evas_object_type_match(obj, "elm_popup") || evas_object_type_match(obj, "elm_ctxpopup")) find_popup = 1; } + VC_ELM_LOG_DUMP(" [%d] %s : return", cnt, evas_object_type_get(obj)); } static void @@ -613,8 +718,10 @@ _object_tree(Ea_Util_Mgr *util_mgr, int val, Eina_Bool exclude_unfocusable_text) if (val == 1) { if (exclude_unfocusable_text) { - EINA_LIST_FREE(objs, obj) - _obj_tree_items_exclude_unfocusable_text(util_mgr, obj, NULL, EINA_FALSE, EINA_FALSE); + EINA_LIST_FREE(objs, obj) { + VC_ELM_LOG_DUMP("###################### start ########################"); + _obj_tree_items_exclude_unfocusable_text(util_mgr, obj, NULL, EINA_FALSE, EINA_FALSE, 0); + } } else { EINA_LIST_FREE(objs, obj) _obj_tree_items(util_mgr, obj, NULL); -- 2.7.4