eo2: set eo2_constructor and eo2_destructor chaining

This commit is contained in:
Jérémy Zurcher 2013-12-25 16:13:14 +01:00 committed by Tom Hacohen
parent 7621758c80
commit 2edd305507
3 changed files with 22 additions and 1 deletions

View File

@ -812,6 +812,11 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
const Eo_Class *_tmp_klass = klass; \
eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \
})
#define eo2_add(klass, parent, ...) \
({ \
const Eo_Class *_tmp_klass = klass; \
eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \
})
/**
* @def eo_add_custom

View File

@ -1362,6 +1362,9 @@ eo_add_internal(const char *file, int line, const Eo_Class *klass_id, Eo *parent
_eo_parent_internal_set(obj, parent_id);
if (klass->desc->version == EO2_VERSION)
eo2_do((Eo *)obj_id, eo2_constructor());
/* Run the relevant do stuff. */
{
va_list p_list;

View File

@ -216,9 +216,22 @@ _eo_del_internal(const char *file, int line, _Eo_Object *obj)
const _Eo_Class *klass = obj->klass;
if (klass->desc->version == EO2_VERSION)
eo2_do((Eo *)obj->obj_id, eo2_event_callback_call(EO_EV_DEL, NULL););
else
eo_do((Eo *) obj->obj_id, eo_event_callback_call(EO_EV_DEL, NULL, NULL));
_eo_condtor_reset(obj);
do_err = eo_do(_eo_id_get(obj), eo_destructor());
if (klass->desc->version == EO2_VERSION)
{
// FIXME: eo2
do_err = EINA_TRUE;
eo2_do((Eo *)obj->obj_id, eo2_destructor(););
}
else
do_err = eo_do((Eo *)obj->obj_id, eo_destructor());
if (EINA_UNLIKELY(!do_err))
{
ERR("in %s:%d: Object of class '%s' - One of the object destructors have failed.",