From: Kwangyoun Kim Date: Mon, 19 Sep 2016 07:24:49 +0000 (+0900) Subject: Fix memory check bug and Add description X-Git-Tag: submit/tizen/20160919.105405~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44fe1828a52b98ccfb884b25e7ce1bb947cdb89c;p=platform%2Fcore%2Fuifw%2Fvoice-control-elm.git Fix memory check bug and Add description Change-Id: I65240815e1045634612b8620d99938e388948bb8 --- diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index 2628fbe..efdd4ef 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -28,12 +28,85 @@ extern "C" { #endif +/** +* @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 +* +* @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. +* +* @see vc_elm_get_auto_register_mode() +*/ 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 +* +* @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. +* +* @see vc_elm_set_auto_register_mode() +*/ 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 +* +* @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. +* +* @see vc_elm_remove_allowed_text_part() +*/ 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. +* +* @see vc_elm_add_allowed_text_part() +*/ int vc_elm_remove_allowed_text_part(void); #ifdef __cplusplus diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 6001b57..4ba91e0 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -305,39 +305,41 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa } else if (1 == click_method) { VC_ELM_LOG_DBG("click method - focus/key"); Object_Info* parent_info = ea_object_dump_parent_widget_data_get(info); - - if (NULL != parent_info && EINA_TRUE == parent_info->focusable) { - VC_ELM_LOG_DBG("Focusable Parent"); - VC_ELM_LOG_DBG("Click event"); - 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"); - 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); - } else { - item = elm_genlist_at_xy_item_get((Evas_Object*)(grand_info->address), x + w + w/2, y + h/2, NULL); + if (NULL != parent_info) { + if (EINA_TRUE == parent_info->focusable) { + VC_ELM_LOG_DBG("Focusable Parent"); + VC_ELM_LOG_DBG("Click event"); + 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 2"); + VC_ELM_LOG_DBG("Click event"); 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); + } 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"); + 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); + } } + break; + } else { + grand_info = ea_object_dump_parent_widget_data_get(grand_info); } - break; - } else { - grand_info = ea_object_dump_parent_widget_data_get(grand_info); } } + } else { + VC_ELM_LOG_DBG("No parent info"); } - VC_ELM_LOG_DBG("Nothing"); } else { VC_ELM_LOG_DBG("Invalid click method"); } @@ -427,7 +429,7 @@ void _vc_elm_core_init() if (NULL == g_allowed_text_part_list) { - g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, "elm.text"); + g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, strdup("elm.text")); } ret = _vc_elm_core_read_xml_data(); @@ -2045,7 +2047,7 @@ int _vc_elm_core_remove_allowed_text_part() data = NULL; } - g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, "elm.text"); + g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, strdup("elm.text")); VC_ELM_LOG_DBG("Remove Allowed text part"); return 0; }