forked from enlightenment/efl
edje: return Eina_Bool values in setters for dragable confine and event params in Edje_Edit API.
Many Edje_Edit API can fail and don't return any error information. This patch start returning Eina_Bool for setters on dragable confine and event params to catch those error. Reviewers: cedric Reviewed By: cedric CC: seoz Differential Revision: https://phab.enlightenment.org/D274 Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
This commit is contained in:
parent
ccdeae7ce4
commit
73c2ae44e0
|
@ -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);
|
||||
|
||||
|
||||
//@}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue