diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 131744b9f5..40626dbd91 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -1103,8 +1103,10 @@ EAPI const char * edje_edit_part_drag_confine_get(Evas_Object *obj, const char * * @param obj Object being edited. * @param part Part to set the name that is used as 'confine' for the given draggies. * @param confine The name of the confine part or NULL to unset confine. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_part_drag_confine_set(Evas_Object *obj, const char *part, const char *confine); +EAPI Eina_Bool edje_edit_part_drag_confine_set(Evas_Object *obj, const char *part, const char *confine); /** Get the name of the part that is used as the receiver of the drag event. * @@ -1120,8 +1122,10 @@ EAPI const char * edje_edit_part_drag_event_get(Evas_Object *obj, const char *pa * @param obj Object being edited. * @param part Part to set the name that will receive events from the given draggies. * @param event The name of the part that will receive events, or NULL to unset. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_part_drag_event_set(Evas_Object *obj, const char *part, const char *event); +EAPI Eina_Bool edje_edit_part_drag_event_set(Evas_Object *obj, const char *part, const char *event); //@} diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index e44c076de3..1999f49ef8 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -2592,20 +2592,25 @@ FUNC_PART_DRAG_INT(count, y); p = ed->table_parts[rp->part->dragable.Id##_id]; \ return eina_stringshare_add(p->part->name); \ } \ - EAPI void \ + EAPI Eina_Bool \ edje_edit_part_drag_##Id##_set(Evas_Object *obj, const char *part, const char *e) \ { \ Edje_Real_Part *e_part; \ \ - GET_RP_OR_RETURN(); \ - if (!e) \ + eina_error_set(0); \ + if ((!obj) || (!part)) \ + return EINA_FALSE; \ + \ + GET_RP_OR_RETURN(EINA_FALSE); \ + if (!e) \ { \ rp->part->dragable.Id##_id = -1; \ - return; \ + return EINA_TRUE; \ } \ - \ e_part = _edje_real_part_get(ed, e); \ + if (!e_part) return EINA_FALSE; \ rp->part->dragable.Id##_id = e_part->part->id; \ + return EINA_TRUE; \ } FUNC_PART_DRAG_ID(confine);