From: tasn Date: Mon, 23 Apr 2012 08:09:58 +0000 (+0000) Subject: Eobj: Added EOBJ_CALLBACK_STOP/CONTINUE macros. X-Git-Tag: submit/2.0alpha-wayland/20121127.222020~176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71a4a0e395624a4a4ef028b6e92770196820c610;p=profile%2Fivi%2Feobj.git Eobj: Added EOBJ_CALLBACK_STOP/CONTINUE macros. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70408 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/examples/composite_objects/main.c b/examples/composite_objects/main.c index a1101b7..0ebddcd 100644 --- a/examples/composite_objects/main.c +++ b/examples/composite_objects/main.c @@ -16,7 +16,7 @@ _a_changed_cb(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *e cb_called = EINA_TRUE; - return EINA_TRUE; + return EOBJ_CALLBACK_CONTINUE; } int diff --git a/examples/evas/test.c b/examples/evas/test.c index 0145cbb..c442e90 100644 --- a/examples/evas/test.c +++ b/examples/evas/test.c @@ -14,7 +14,7 @@ _btn_clicked_cb(void *data, Eobj *obj, const Eobj_Event_Description *desc, void const Eobj_Class *klass = eobj_class_get(obj); printf("%s obj-type:'%s' data:'%s'\n", desc->name, eobj_class_name_get(klass), (const char *) data); - return EINA_TRUE; + return EOBJ_CALLBACK_CONTINUE; } int diff --git a/examples/signals/simple.c b/examples/signals/simple.c index 5635670..0a23d59 100644 --- a/examples/signals/simple.c +++ b/examples/signals/simple.c @@ -42,7 +42,7 @@ _cb_added(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event pd->cb_count++; printf("Added SIG_A_CHANGED callback to %p. Count: %d\n", obj, pd->cb_count); - return EINA_TRUE; + return EOBJ_CALLBACK_CONTINUE; } Eina_Bool @@ -59,7 +59,7 @@ _cb_deled(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event pd->cb_count--; printf("Removed SIG_A_CHANGED callback from %p. Count: %d\n", obj, pd->cb_count); - return EINA_TRUE; + return EOBJ_CALLBACK_CONTINUE; } static void diff --git a/lib/Eobj.h b/lib/Eobj.h index 46667ff..076a21a 100644 --- a/lib/Eobj.h +++ b/lib/Eobj.h @@ -626,6 +626,20 @@ EAPI Eina_Bool eobj_composite_is(Eobj *comp_obj); typedef short Eobj_Callback_Priority; /** + * @def EOBJ_CALLBACK_STOP + * Stop calling callbacks for the even of which the callback was called for. + * @see EOBJ_CALLBACK_CONTINUE + */ +#define EOBJ_CALLBACK_STOP EINA_FALSE + +/** + * @def EOBJ_CALLBACK_CONTINUE + * Continue calling callbacks for the even of which the callback was called for. + * @see EOBJ_CALLBACK_STOP + */ +#define EOBJ_CALLBACK_CONTINUE EINA_TRUE + +/** * @typedef Eobj_Event_Cb * * An event callback prototype. @@ -634,7 +648,7 @@ typedef short Eobj_Callback_Priority; * @param obj The object which initiated the event. * @param desc The event's description. * @param event_info additional data passed with the event. - * @return #EINA_FALSE to stop calling additional callbacks for the event, #EINA_TRUE to continue. + * @return #EOBJ_CALLBACK_STOP to stop calling additional callbacks for the event, #EOBJ_CALLBACK_CONTINUE to continue. */ typedef Eina_Bool (*Eobj_Event_Cb)(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event_info); diff --git a/lib/eobj.c b/lib/eobj.c index 66e233e..8a29264 100644 --- a/lib/eobj.c +++ b/lib/eobj.c @@ -1031,7 +1031,7 @@ _eobj_weak_ref_cb(void *data, Eobj *obj EINA_UNUSED, const Eobj_Event_Descriptio Eobj_Weak_Ref *wref = data; wref->obj = NULL; - return EINA_TRUE; + return EOBJ_CALLBACK_CONTINUE; } EAPI Eobj_Weak_Ref *