evas_object_data_set(effect_page,
PRIVATE_DATA_KEY_DIVIDE_FACTOR, (void *)divide_factor - 1);
}
-
- vec_x = (end_x - cur_x) / divide_factor;
- vec_y = (end_y - cur_y) / divide_factor;
- vec_w = (end_w - cur_w) / divide_factor;
- vec_h = (end_h - cur_h) / divide_factor;
-
+ if (!divide_factor) {
+ vec_x = (end_x - cur_x);
+ vec_y = (end_y - cur_y);
+ vec_w = (end_w - cur_w);
+ vec_h = (end_h - cur_h);
+ } else {
+ vec_x = (end_x - cur_x) / divide_factor;
+ vec_y = (end_y - cur_y) / divide_factor;
+ vec_w = (end_w - cur_w) / divide_factor;
+ vec_h = (end_h - cur_h) / divide_factor;
+ }
if (!vec_x) vec_x = -1;
if (!vec_y) vec_y = -1;
if (!vec_w) vec_w = 1;
scroller_info_s *scroller_info = NULL;
scroller_info_s *edit_scroller_info = NULL;
Eina_Bool ret;
+ access_info_t *access_info = NULL;
+ Evas_Object *target = NULL;
+ char *name = _("IDS_HS_BODY_ADD_WIDGET");
+ char *role = _("IDS_HS_BODY_BUTTON_T_TTS");
+ Evas_Object *item_ao = NULL;
retv_if(!edit, NULL);
goto_if(!page_info->page_inner, ERROR);
/* Edit Plus Access Object */
- access_info_t *access_info = NULL;
- Evas_Object *target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(plus_item), "mask");
- char *name = _("IDS_HS_BODY_ADD_WIDGET");
- char *role = _("IDS_HS_BODY_BUTTON_T_TTS");
- Evas_Object *item_ao = NULL;
+ target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(plus_item), "mask");
access_info = screen_reader_create_access_info(target, page_info->item, name, role, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION);
if (!access_info) {
evas_object_data_set(effect_page,
PRIVATE_DATA_KEY_DIVIDE_FACTOR, (void *)divide_factor - 1);
}
+ if (!divide_factor) {
+ vec_x = (end_x - cur_x);
+ vec_y = (end_y - cur_y);
+ vec_w = (end_w - cur_w);
+ vec_h = (end_h - cur_h);
+ } else {
+ vec_x = (end_x - cur_x) / divide_factor;
+ vec_y = (end_y - cur_y) / divide_factor;
+ vec_w = (end_w - cur_w) / divide_factor;
+ vec_h = (end_h - cur_h) / divide_factor;
- vec_x = (end_x - cur_x) / divide_factor;
- vec_y = (end_y - cur_y) / divide_factor;
- vec_w = (end_w - cur_w) / divide_factor;
- vec_h = (end_h - cur_h) / divide_factor;
+ }
if (!vec_x) vec_x = 1;
if (!vec_y) vec_y = 1;
}
switch (page_info->direction) {
- case PAGE_DIRECTION_LEFT:
- _D("There is already a pressed item");
- evas_object_data_set(layout_info->pressed_page, DATA_KEY_PAGE_ONHOLD_COUNT, (void*)1);
- retv_if(!edit_create_layout(layout, EDIT_MODE_LEFT), ECORE_CALLBACK_CANCEL);
-
- edit_info = evas_object_data_get(layout_info->edit, DATA_KEY_EDIT_INFO);
- retv_if(!edit_info, ECORE_CALLBACK_CANCEL);
-
- proxy_page = evas_object_data_get(layout_info->pressed_page, DATA_KEY_PROXY_PAGE);
- retv_if(!proxy_page, ECORE_CALLBACK_CANCEL);
-
- effect_page = edit_create_minify_effect_page(proxy_page);
- retv_if(!effect_page, ECORE_CALLBACK_CANCEL);
-
- scroller_region_show_center_of(edit_info->scroller, proxy_page, SCROLLER_FREEZE_OFF, NULL, NULL, edit_minify_effect_page, effect_page);
- break;
- case PAGE_DIRECTION_CENTER:
- if (util_feature_enabled_get(FEATURE_CLOCK_SELECTOR) != 1)
- no_effect = 1;
-
- app_control_h app_control_handle = NULL;
- app_control_create(&app_control_handle);
- app_control_set_app_id(app_control_handle, "org.tizen.watch-setting");
- app_control_add_extra_data(app_control_handle, "launch-type", "watchface");
- app_control_send_launch_request(app_control_handle, NULL, NULL);
- app_control_destroy(app_control_handle);
- break;
- case PAGE_DIRECTION_RIGHT:
- if (layout_info->pressed_item) {
+ case PAGE_DIRECTION_LEFT: {
_D("There is already a pressed item");
- widget_viewer_evas_feed_mouse_up_event(layout_info->pressed_item);
+ evas_object_data_set(layout_info->pressed_page, DATA_KEY_PAGE_ONHOLD_COUNT, (void*)1);
+ retv_if(!edit_create_layout(layout, EDIT_MODE_LEFT), ECORE_CALLBACK_CANCEL);
+
+ edit_info = evas_object_data_get(layout_info->edit, DATA_KEY_EDIT_INFO);
+ retv_if(!edit_info, ECORE_CALLBACK_CANCEL);
+
+ proxy_page = evas_object_data_get(layout_info->pressed_page, DATA_KEY_PROXY_PAGE);
+ retv_if(!proxy_page, ECORE_CALLBACK_CANCEL);
+
+ effect_page = edit_create_minify_effect_page(proxy_page);
+ retv_if(!effect_page, ECORE_CALLBACK_CANCEL);
+
+ scroller_region_show_center_of(edit_info->scroller, proxy_page, SCROLLER_FREEZE_OFF, NULL, NULL, edit_minify_effect_page, effect_page);
+ break;
}
- retv_if(!edit_create_layout(layout, EDIT_MODE_RIGHT), ECORE_CALLBACK_CANCEL);
+ case PAGE_DIRECTION_CENTER: {
+ if (util_feature_enabled_get(FEATURE_CLOCK_SELECTOR) != 1)
+ no_effect = 1;
+
+ app_control_h app_control_handle = NULL;
+ app_control_create(&app_control_handle);
+ app_control_set_app_id(app_control_handle, "org.tizen.watch-setting");
+ app_control_add_extra_data(app_control_handle, "launch-type", "watchface");
+ app_control_send_launch_request(app_control_handle, NULL, NULL);
+ app_control_destroy(app_control_handle);
+ break;
+ }
+ case PAGE_DIRECTION_RIGHT: {
+ if (layout_info->pressed_item) {
+ _D("There is already a pressed item");
+ widget_viewer_evas_feed_mouse_up_event(layout_info->pressed_item);
+ }
+ retv_if(!edit_create_layout(layout, EDIT_MODE_RIGHT), ECORE_CALLBACK_CANCEL);
- scroller_unregister_access_object(layout_info->scroller);
- page_focus(layout_info->scroller, NULL);
+ scroller_unregister_access_object(layout_info->scroller);
+ page_focus(layout_info->scroller, NULL);
- edit_info = evas_object_data_get(layout_info->edit, DATA_KEY_EDIT_INFO);
- retv_if(!edit_info, ECORE_CALLBACK_CANCEL);
+ edit_info = evas_object_data_get(layout_info->edit, DATA_KEY_EDIT_INFO);
+ retv_if(!edit_info, ECORE_CALLBACK_CANCEL);
- proxy_page = evas_object_data_get(layout_info->pressed_page, DATA_KEY_PROXY_PAGE);
- retv_if(!proxy_page, ECORE_CALLBACK_CANCEL);
+ proxy_page = evas_object_data_get(layout_info->pressed_page, DATA_KEY_PROXY_PAGE);
+ retv_if(!proxy_page, ECORE_CALLBACK_CANCEL);
- effect_page = edit_create_minify_effect_page(proxy_page);
- retv_if(!effect_page, ECORE_CALLBACK_CANCEL);
+ effect_page = edit_create_minify_effect_page(proxy_page);
+ retv_if(!effect_page, ECORE_CALLBACK_CANCEL);
- scroller_region_show_center_of(edit_info->scroller, proxy_page, SCROLLER_FREEZE_OFF, NULL, NULL, edit_minify_effect_page, effect_page);
+ scroller_region_show_center_of(edit_info->scroller, proxy_page, SCROLLER_FREEZE_OFF, NULL, NULL, edit_minify_effect_page, effect_page);
- if (layout_info->pressed_page == scroller_info->plus_page)
- evas_object_data_set(layout_info->pressed_item, DATA_KEY_IS_LONGPRESS, (void *)1);
+ if (layout_info->pressed_page == scroller_info->plus_page)
+ evas_object_data_set(layout_info->pressed_item, DATA_KEY_IS_LONGPRESS, (void *)1);
- break;
- default:
- _D("Cannot reach here");
- break;
+ break;
+ }
+ default: {
+ _D("Cannot reach here");
+ break;
+ }
}
if (no_effect == 0)
static Evas_Object *__create_control_button(Evas_Object * base_layout, control_info_t *btn_info)
{
+ char full_path[MAX_FILE_PATH_LEN] = {0};
+ char *resource_path = NULL;
+ Evas_Object *icon = NULL;
Evas_Object *button_layout = elm_layout_add(base_layout);
if (!button_layout || !elm_layout_file_set(button_layout, util_get_res_file_path(CONTROL_BUTTON_LAYOUT_EDJE), controls_btn_group_name[btn_info->btn_type])) {
evas_object_show(button_layout);
- Evas_Object *icon = elm_image_add(button_layout);
-
- char full_path[MAX_FILE_PATH_LEN] = {0};
- char *resource_path = NULL;
+ icon = elm_image_add(button_layout);
resource_path = app_get_resource_path();
if (!resource_path) {
static void _noti_detail_view_open_app_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
int ret;
+ app_control_h app_control_local;
if (_noti_detail_view_data_s.app_control) {
ret = app_control_send_launch_request(_noti_detail_view_data_s.app_control, NULL, NULL);
ret_if(ret != APP_CONTROL_ERROR_NONE);
} else {
- app_control_h app_control_local;
-
ret = app_control_create(&app_control_local);
ret_if(ret != APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(app_control_local, data);
- ret_if(ret != APP_CONTROL_ERROR_NONE);
-
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to set app id");
+ goto ERROR;
+ }
ret = app_control_send_launch_request(app_control_local, NULL, NULL);
- ret_if(ret != APP_CONTROL_ERROR_NONE);
-
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to send launch request");
+ goto ERROR;
+ }
app_control_destroy(app_control_local);
}
return;
+ERROR:
+ if (app_control_local)
+ app_control_destroy(app_control_local);
+ return;
}
static Evas_Object * _noti_detail_view_set_label()
/* Horizontal separator */
Evas_Object *line = _noti_create_detail_view_item_layout("detail_line");
- ret_if(!line);
+ if (!line) {
+ _E("Failed to create detail view ");
+ if (text_time)
+ free(text_time);
+ return;
+ }
_noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list, line);
if (content_text) {
_noti_detail_view_data_s.bottom_spacer = bottom_spacer;
evas_object_data_set(bottom_spacer, DATA_KEY_APP_NAME, app_name);
+ if (text_time)
+ free(text_time);
+
+ return;
}
static Evas_Object* _noti_create_detail_view_circle_scroller(Evas_Object *scroller, Eext_Circle_Surface *surface)
noti = notification_list_get_data(cur_noti);
layout = _stack_view_create_page(scroller, noti);
- if (layout) access_object = elm_access_object_get(layout);
+ if (!layout)
+ _E("Failed to create page");
next_noti = notification_list_get_next(cur_noti);
if (!next_noti) {
Evas_Object *circle_scroller = NULL;
Evas_Object *scroller = NULL;
Evas_Object *box = NULL;
+ bool is_valid_pkg_id = 0;
retv_if(!stack_view, NULL);
retv_if(!pkg_id, NULL);
evas_object_data_set(stack_view, DATA_KEY_APP_ID, pkg_id);
/* If given pkg id is not available id, set DATA_KEY_PKG_VALIDITY with validity for hiding buttons */
- bool is_valid_pkg_id = _stack_view_is_valid_package_id(pkg_id);
+ is_valid_pkg_id = _stack_view_is_valid_package_id(pkg_id);
evas_object_data_set(stack_view, DATA_KEY_PKG_VALIDITY, (const void*)is_valid_pkg_id);
Evas_Object *icon = NULL;
Eina_Bool err = EINA_FALSE;
char unknown_icon_path[PATH_MAX] = { 0, };
+ char *resource_path = NULL;
if (noti_layout == NULL) {
_E("invalid parameter");
}
_D("icon_path [%s]", icon_path);
if (icon_path == NULL) {
- char *resource_path = NULL;
-
resource_path = app_get_resource_path();
if (!resource_path) {
_E("Failed to get resource path");
Evas_Object *icon = NULL;
Eina_Bool err = EINA_FALSE;
char unknown_icon_path[PATH_MAX] = { 0, };
+ char *resource_path = NULL;
if (noti_layout == NULL) {
_E("invalid parameter");
}
if (icon_path == NULL) {
- char *resource_path = NULL;
-
resource_path = app_get_resource_path();
if (!resource_path) {
_E("Failed to get resource path");