edje: make mouse_events, repeat_events, ignore_flags and scale setters return Eina_Bool.

Make the following function return Eina_Bool so the caller can detect errors :
edje_edit_part_mouse_events_set
edje_edit_part_repeat_events_set
edje_edit_part_ignore_flags_set
edje_edit_part_scale_set

Reviewers: cedric, seoz

Reviewed By: cedric

CC: reutskiy.v.v

Differential Revision: https://phab.enlightenment.org/D303

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
This commit is contained in:
Andrii Kroitor 2013-11-01 11:30:23 +09:00 committed by Cedric Bail
parent 6f8b1c1b02
commit d00721a3d7
2 changed files with 36 additions and 31 deletions

View File

@ -946,7 +946,7 @@ EAPI Eina_Bool edje_edit_part_selected_state_set(Evas_Object *obj, const char *p
* @param obj Object being edited. * @param obj Object being edited.
* @param part Part to get if the mouse events is accepted. * @param part Part to get if the mouse events is accepted.
* *
* @return EINA_TRUE if successful, EINA_FALSE otherwise. * @return EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise.
*/ */
EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part); EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part);
@ -955,15 +955,17 @@ EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *par
* @param obj Object being edited. * @param obj Object being edited.
* @param part The part to set if the mouse events is accepted. * @param part The part to set if the mouse events is accepted.
* @param mouse_events EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise. * @param mouse_events EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/ */
EAPI void edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events); EAPI Eina_Bool edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events);
/** Get repeat_events for part. /** Get repeat_events for part.
* *
* @param obj Object being edited. * @param obj Object being edited.
* @param part Part to set if will pass all events to the other parts. * @param part Part to get if it will pass all events to the other parts.
* *
* @return EINA_TRUE if successful, EINA_FALSE otherwise. * @return EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise
*/ */
EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part); EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part);
@ -972,8 +974,10 @@ EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *pa
* @param obj Object being edited. * @param obj Object being edited.
* @param part Part to set if will repeat all the received mouse events to other parts. * @param part Part to set if will repeat all the received mouse events to other parts.
* @param repeat_events EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise * @param repeat_events EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/ */
EAPI void edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events); EAPI Eina_Bool edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events);
/** Get ignore_flags for part. /** Get ignore_flags for part.
* *
@ -989,8 +993,10 @@ EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const ch
* @param obj Object being edited. * @param obj Object being edited.
* @param part Part to set which event flags will be ignored. * @param part Part to set which event flags will be ignored.
* @param ignore_flags The Event flags to be ignored by the part. * @param ignore_flags The Event flags to be ignored by the part.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/ */
EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags); EAPI Eina_Bool edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags);
/** Set scale property for the part. /** Set scale property for the part.
* *
@ -1000,8 +1006,10 @@ EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Ev
* @param obj Object being edited. * @param obj Object being edited.
* @param part Part to set scale for. * @param part Part to set scale for.
* @param scale Scale value to set. * @param scale Scale value to set.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/ */
EAPI void edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale); EAPI Eina_Bool edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale);
/** Get scale for the part. /** Get scale for the part.
* *

View File

@ -2371,18 +2371,15 @@ EAPI Eina_Bool
edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part) edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part)
{ {
GET_RP_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get mouse_events for part: %s [%d]\n", part, rp->part->mouse_events);
return rp->part->mouse_events; return rp->part->mouse_events;
} }
EAPI void EAPI Eina_Bool
edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events) edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events)
{ {
GET_RP_OR_RETURN(); GET_RP_OR_RETURN(EINA_FALSE);
if (!rp->object) return; if (!rp->object) return EINA_FALSE;
//printf("Set mouse_events for part: %s [%d]\n", part, mouse_events);
rp->part->mouse_events = mouse_events ? 1 : 0; rp->part->mouse_events = mouse_events ? 1 : 0;
@ -2396,25 +2393,22 @@ edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mo
evas_object_pass_events_set(rp->object, 1); evas_object_pass_events_set(rp->object, 1);
_edje_callbacks_del(rp->object, ed); _edje_callbacks_del(rp->object, ed);
} }
return EINA_TRUE;
} }
EAPI Eina_Bool EAPI Eina_Bool
edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part) edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part)
{ {
GET_RP_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get repeat_events for part: %s [%d]\n", part, rp->part->repeat_events);
return rp->part->repeat_events; return rp->part->repeat_events;
} }
EAPI void EAPI Eina_Bool
edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events) edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events)
{ {
GET_RP_OR_RETURN(); GET_RP_OR_RETURN(EINA_FALSE);
if (!rp->object) return; if (!rp->object) return EINA_FALSE;
//printf("Set repeat_events for part: %s [%d]\n", part, repeat_events);
rp->part->repeat_events = repeat_events ? 1 : 0; rp->part->repeat_events = repeat_events ? 1 : 0;
@ -2422,6 +2416,8 @@ edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool r
evas_object_repeat_events_set(rp->object, 1); evas_object_repeat_events_set(rp->object, 1);
else else
evas_object_repeat_events_set(rp->object, 0); evas_object_repeat_events_set(rp->object, 0);
return EINA_TRUE;
} }
EAPI Evas_Event_Flags EAPI Evas_Event_Flags
@ -2432,24 +2428,25 @@ edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part)
return rp->part->ignore_flags; return rp->part->ignore_flags;
} }
EAPI void EAPI Eina_Bool
edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags) edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags)
{ {
GET_RP_OR_RETURN(); GET_RP_OR_RETURN(EINA_FALSE);
if (!rp->object) return; if (!rp->object) return EINA_FALSE;
//printf("Set ignore_flags for part: %s [%#x]\n", part, ignore_flags);
rp->part->ignore_flags = ignore_flags; rp->part->ignore_flags = ignore_flags;
return EINA_TRUE;
} }
EAPI void EAPI Eina_Bool
edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale) edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale)
{ {
GET_RP_OR_RETURN(); GET_RP_OR_RETURN(EINA_FALSE);
rp->part->scale = scale; rp->part->scale = scale ? 1 : 0;
edje_object_calc_force(obj); edje_object_calc_force(obj);
return EINA_TRUE;
} }
EAPI Eina_Bool EAPI Eina_Bool