/* Find the kls itr. */
kls_itr = orig_kls->mro;
while (*kls_itr && (*kls_itr != cur_klass))
- kls_itr++;
+ kls_itr++;
if (*kls_itr)
- return *(++kls_itr);
+ return *(++kls_itr);
return NULL;
}
#define EO2_CALL_STACK_DEPTH 5
typedef struct _Eo2_Stack_Frame
{
- Eo *obj_id;
- _Eo *obj;
+ Eo *obj_id;
+ _Eo_Object *obj;
const _Eo_Class *klass;
void *obj_data;
EAPI int
eo2_call_stack_depth()
{
- return ((eo2_call_stack.frame_ptr == NULL) ? 0 :
- 1 + (eo2_call_stack.frame_ptr - eo2_call_stack.stack));
+ if (eo2_call_stack.frame_ptr == NULL)
+ return 0;
+ else
+ return (1 + (eo2_call_stack.frame_ptr - eo2_call_stack.stack));
}
EAPI Eina_Bool
eo2_do_start(Eo *obj_id, const Eina_Bool do_super, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED)
{
- _Eo * obj;
+ _Eo_Object * obj;
const _Eo_Class *klass;
Eo2_Stack_Frame *fptr;
Eo2_Stack_Frame *fptr;
const _Eo_Class *klass;
+ klass = NULL;
fptr = eo2_call_stack.frame_ptr;
- if ((fptr != NULL) && (fptr->klass->class_id == (Eo_Class_Id) klass_id))
+
+ if ((fptr != NULL) && (_eo_class_id_get(fptr->klass) == (Eo *)klass_id))
{
if (do_super)
klass = _eo2_kls_itr_next(fptr->klass, fptr->klass);
}
else
{
- klass = _eo_class_pointer_get(klass_id);
- EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE);
+ EO_CLASS_POINTER_RETURN_VAL(klass_id, _klass, EINA_FALSE);
if (do_super)
- klass = _eo2_kls_itr_next(klass, klass);
+ klass = _eo2_kls_itr_next(_klass, _klass);
+ else
+ klass = _klass;
if (fptr == NULL)
eo2_call_stack.frame_ptr = &eo2_call_stack.stack[0];
else
eo2_call_resolve_internal(const Eo_Class *klass_id, const Eo_Op op, Eo2_Op_Call_Data *call)
{
Eo2_Stack_Frame *fptr;
- const _Eo * obj;
+ const _Eo_Object * obj;
const _Eo_Class *klass;
const op_type_funcs *func;
fptr = eo2_call_stack.frame_ptr;
obj = fptr->obj;
+ klass = NULL;
if (klass_id)
{
- klass = _eo_class_pointer_get(klass_id);
- EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE);
+ EO_CLASS_POINTER_RETURN_VAL(klass_id, _klass, EINA_FALSE);
+ klass = _klass;
}
else
{
EAPI Eo *
eo2_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id)
{
- _Eo_Class *klass = _eo_class_pointer_get(klass_id);
- EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, NULL);
+ EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, NULL);
if (parent_id)
{
return NULL;
}
- _Eo *obj = calloc(1, klass->obj_size);
+ _Eo_Object *obj = calloc(1, klass->obj_size);
obj->refcount++;
obj->klass = klass;
EINA_MAGIC_SET(obj, EO_EINA_MAGIC);
#endif
Eo_Id obj_id = _eo_id_allocate(obj);
- obj->obj_id = obj_id;
+ obj->header.id = obj_id;
eo_parent_set((Eo *)obj_id, parent_id);
_eo_condtor_reset(obj);
/* We need that for the event callbacks that may ref/unref. */
obj->refcount++;
- eo_do(_eo_id_get(obj), eo_event_callback_call(EO_EV_DEL, NULL, NULL));
-
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););
+ eo2_do(_eo_id_get(obj), 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_do(_eo_id_get(obj), eo_event_callback_call(EO_EV_DEL, NULL, NULL));
_eo_condtor_reset(obj);
{
// FIXME: eo2
do_err = EINA_FALSE;
- eo2_do((Eo *)obj->obj_id, eo2_destructor(););
+ eo2_do(_eo_id_get(obj), eo2_destructor(););
}
else
- do_err = !eo_do((Eo *)obj->obj_id, eo_destructor());
+ do_err = !eo_do(_eo_id_get(obj), eo_destructor());
if (EINA_UNLIKELY(do_err))
{