Eobj: Added EOBJ_CALLBACK_STOP/CONTINUE macros.

SVN revision: 70408
This commit is contained in:
Tom Hacohen 2012-04-23 08:09:58 +00:00
parent e0f6adbea6
commit b5a1df1270
5 changed files with 20 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -625,6 +625,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
*
@ -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);

View File

@ -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 *