// to fetch internal function and object data at once
typedef struct _Eo2_Op_Call_Data
{
- Eo *obj_id;
- Eo_Class *klass_id;
+ Eo *obj;
+ Eo_Class *klass;
void *func;
void *data;
} Eo2_Op_Call_Data;
-typedef void (*Eo2_Hook_Call)(const Eo_Class *klass_id, const Eo *obj_id, void *func, ...);
+typedef void (*Eo2_Hook_Call)(const Eo_Class *klass_id, const Eo *obj, void *func, ...);
EAPI extern Eo2_Hook_Call eo2_hook_call_pre;
EAPI extern Eo2_Hook_Call eo2_hook_call_post;
#define EO2_HOOK_CALL_PREPARE(Hook) \
if (Hook) \
- Hook(call.klass_id, call.obj_id, call.func);
+ Hook(call.klass, call.obj, call.func);
#define EO2_HOOK_CALL_PREPAREV(Hook, ...) \
if (Hook) \
- Hook(call.klass_id, call.obj_id, call.func, __VA_ARGS__);
+ Hook(call.klass, call.obj, call.func, __VA_ARGS__);
// cache OP id, get real fct and object data then do the call
#define EO2_FUNC_COMMON_OP(Name, DefRet, Type) \
Name(void) \
{ \
typedef Ret (*__##Name##_func)(Eo *, void *obj_data); \
- Ret _r; \
+ Ret _r; \
EO2_FUNC_COMMON_OP(Name, DefRet, EO_OP_TYPE_REGULAR); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_pre); \
- _r = _func_(call.obj_id, call.data); \
+ _r = _func_(call.obj, call.data); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_post); \
return _r; \
}
typedef void (*__##Name##_func)(Eo *, void *obj_data); \
EO2_FUNC_COMMON_OP(Name, , EO_OP_TYPE_REGULAR); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_pre); \
- _func_(call.obj_id, call.data); \
+ _func_(call.obj, call.data); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_post); \
}
Name(__VA_ARGS__) \
{ \
typedef Ret (*__##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \
- Ret _r; \
+ Ret _r; \
EO2_FUNC_COMMON_OP(Name, DefRet, EO_OP_TYPE_REGULAR); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_pre, Arguments); \
- _r = _func_(call.obj_id, call.data, Arguments); \
+ _r = _func_(call.obj, call.data, Arguments); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_post, Arguments); \
return _r; \
}
typedef void (*__##Name##_func)(Eo *, void *obj_data, __VA_ARGS__);\
EO2_FUNC_COMMON_OP(Name, , EO_OP_TYPE_REGULAR); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_pre, Arguments); \
- _func_(call.obj_id, call.data, Arguments); \
+ _func_(call.obj, call.data, Arguments); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_post, Arguments); \
}
Ret _r; \
EO2_FUNC_COMMON_OP(Name, DefRet, EO_OP_TYPE_CLASS); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_pre); \
- _r = _func_(call.klass_id); \
+ _r = _func_(call.klass); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_post); \
return _r; \
}
Ret _r; \
EO2_FUNC_COMMON_OP(Name, , EO_OP_TYPE_CLASS); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_pre); \
- _func_(call.klass_id); \
+ _func_(call.klass); \
EO2_HOOK_CALL_PREPARE(eo2_hook_call_post); \
return _r; \
}
Ret _r; \
EO2_FUNC_COMMON_OP(Name, DefRet, EO_OP_TYPE_CLASS); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_pre, Arguments); \
- _r = _func_(call.klass_id, Arguments); \
+ _r = _func_(call.klass, Arguments); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_post, Arguments); \
return _r; \
}
typedef void (*__##Name##_func)(Eo_Class *, __VA_ARGS__); \
EO2_FUNC_COMMON_OP(Name, , EO_OP_TYPE_CLASS); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_pre, Arguments); \
- _func_(call.klass_id, Arguments); \
+ _func_(call.klass, Arguments); \
EO2_HOOK_CALL_PREPAREV(eo2_hook_call_post, Arguments); \
}
EAPI Eina_Bool eo2_call_resolve_internal(const Eo_Class *klass, const Eo_Op op, Eo2_Op_Call_Data *call);
// start of eo2_do barrier, gets the object pointer and ref it, put it on the stask
-EAPI Eina_Bool eo2_do_start(Eo *obj_id, const Eina_Bool do_super, const char *file, const char *func, int line);
+EAPI Eina_Bool eo2_do_start(Eo *obj, const Eina_Bool do_super, const char *file, const char *func, int line);
EAPI Eina_Bool eo2_class_do_start(const Eo_Class *klass_id, const Eina_Bool do_super, const char *file, const char *func, int line);
// end of the eo2_do barrier, unref the obj, move the stack pointer
* @see #eo_add
*/
EAPI Eo *eo_add_internal(const char *file, int line, const Eo_Class *klass, Eo *parent, ...);
-EAPI Eo * eo2_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id);
+EAPI Eo * eo2_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent);
EAPI Eo * eo2_add_internal_end(const char *file, int line, const Eo *obj);
/**
*/
#define eo_parent_set(parent) EO_BASE_ID(EO_BASE_SUB_ID_PARENT_SET), EO_TYPECHECK(Eo *, parent)
EAPI void
-eo2_parent_set(Eo *parent_id);
+eo2_parent_set(Eo *parent);
/**
* @def eo_parent_get
static inline Eina_Bool
-_eo_is_a_class(const Eo *obj_id)
+_eo_is_a_class(const Eo *eo_id)
{
Eo_Id oid;
#ifdef HAVE_EO_ID
- oid = (Eo_Id) obj_id;
+ oid = (Eo_Id) eo_id;
#else
- /* fortunately EO_OBJ_POINTER_RETURN* will handle NULL obj_id */
- if (!obj_id) return EINA_FALSE;
- oid = ((Eo_Base *) obj_id)->id;
+ /* fortunately EO_OBJ_POINTER_RETURN* will handle NULL eo_id */
+ if (!eo_id) return EINA_FALSE;
+ oid = ((Eo_Base *) eo_id)->id;
#endif
return (((oid >> REF_TAG_SHIFT) & 0x1) == 0x0);
}
#define EO2_CALL_STACK_DEPTH 5
typedef struct _Eo2_Stack_Frame
{
- Eo *obj_id;
+ Eo *eo_id;
_Eo_Object *obj;
const _Eo_Class *klass;
void *obj_data;
}
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)
+eo2_do_start(Eo *eo_id, const Eina_Bool do_super, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED)
{
_Eo_Object * obj;
const _Eo_Class *klass;
Eo2_Stack_Frame *fptr;
fptr = eo2_call_stack.frame_ptr;
- if ((fptr != NULL) && (fptr->obj_id == obj_id))
+ if ((fptr != NULL) && (fptr->eo_id == eo_id))
{
obj = fptr->obj;
if (do_super)
}
else
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, _obj, EINA_FALSE);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, _obj, EINA_FALSE);
obj = _obj;
if (!obj) return EINA_FALSE;
if (do_super)
_eo_ref(obj);
fptr->obj = obj;
- fptr->obj_id = obj_id;
+ fptr->eo_id = eo_id;
fptr->klass = klass;
fptr->obj_data = EO2_INVALID_DATA;
ERR("eo2 call stack overflow !!!");
fptr->obj = NULL;
- fptr->obj_id = NULL;
+ fptr->eo_id = NULL;
fptr->klass = klass;
fptr->obj_data = EO2_INVALID_DATA;
}
EAPI void
-eo2_do_end(Eo **obj_id EINA_UNUSED)
+eo2_do_end(Eo **eo_id EINA_UNUSED)
{
_eo2_do_end(EINA_TRUE);
}
ERR("you called a pure virtual func");
return EINA_FALSE;
}
- call->klass_id = _eo_class_id_get(klass);
- call->obj_id = fptr->obj_id;
+ call->klass = _eo_class_id_get(klass);
+ call->obj = fptr->eo_id;
call->func = func->func;
if (obj)
#ifndef HAVE_EO_ID
EINA_MAGIC_SET(obj, EO_EINA_MAGIC);
#endif
- Eo_Id obj_id = _eo_id_allocate(obj);
- obj->header.id = obj_id;
+ Eo_Id eo_id = _eo_id_allocate(obj);
+ obj->header.id = eo_id;
_eo_condtor_reset(obj);
- eo2_do((Eo *)obj_id, eo2_parent_set(parent_id));
+ eo2_do((Eo *)eo_id, eo2_parent_set(parent_id));
- return (Eo *)obj_id;
+ return (Eo *)eo_id;
}
EAPI Eo *
-eo2_add_internal_end(const char *file, int line, const Eo *obj_id)
+eo2_add_internal_end(const char *file, int line, const Eo *eo_id)
{
Eo2_Stack_Frame *fptr;
fptr = eo2_call_stack.frame_ptr;
- if ((fptr == NULL) || (fptr->obj_id != obj_id))
+ if ((fptr == NULL) || (fptr->eo_id != eo_id))
{
ERR("in %s:%d - Something very wrong happend to the call stack.", file, line);
return NULL;
return NULL;
}
- return (Eo *)fptr->obj_id;
+ return (Eo *)fptr->eo_id;
}
/*****************************************************************************/
}
EAPI Eina_Bool
-eo_do_internal(const char *file, int line, const Eo *obj_id, ...)
+eo_do_internal(const char *file, int line, const Eo *eo_id, ...)
{
Eina_Bool ret = EINA_TRUE;
va_list p_list;
- Eina_Bool class_ref = _eo_is_a_class(obj_id);
+ Eina_Bool class_ref = _eo_is_a_class(eo_id);
if (class_ref)
{
- EO_CLASS_POINTER_RETURN_VAL(obj_id, klass, EINA_FALSE);
+ EO_CLASS_POINTER_RETURN_VAL(eo_id, klass, EINA_FALSE);
- va_start(p_list, obj_id);
+ va_start(p_list, eo_id);
ret = _eo_class_dov_internal(file, line, klass, &p_list);
va_end(p_list);
}
else
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
- va_start(p_list, obj_id);
+ va_start(p_list, eo_id);
ret = _eo_obj_dov_internal(file, line, obj, &p_list);
va_end(p_list);
}
}
EAPI Eina_Bool
-eo_vdo_internal(const char *file, int line, const Eo *obj_id, va_list *ops)
+eo_vdo_internal(const char *file, int line, const Eo *eo_id, va_list *ops)
{
- Eina_Bool class_ref = _eo_is_a_class(obj_id);
+ Eina_Bool class_ref = _eo_is_a_class(eo_id);
if (class_ref)
{
- EO_CLASS_POINTER_RETURN_VAL(obj_id, klass, EINA_FALSE);
+ EO_CLASS_POINTER_RETURN_VAL(eo_id, klass, EINA_FALSE);
return _eo_class_dov_internal(file, line, klass, ops);
}
else
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
return _eo_obj_dov_internal(file, line, obj, ops);
}
}
EAPI Eina_Bool
-eo_do_super_internal(const char *file, int line, const Eo *obj_id, const Eo_Class *cur_klass_id, Eo_Op op, ...)
+eo_do_super_internal(const char *file, int line, const Eo *eo_id, const Eo_Class *cur_klass_id, Eo_Op op, ...)
{
const _Eo_Class *nklass;
Eina_Bool op_ret = EINA_TRUE;
EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE);
- if (_eo_is_a_class(obj_id))
+ if (_eo_is_a_class(eo_id))
{
- EO_CLASS_POINTER_RETURN_VAL(obj_id, klass, EINA_FALSE);
+ EO_CLASS_POINTER_RETURN_VAL(eo_id, klass, EINA_FALSE);
va_start(p_list, op);
nklass = _eo_kls_itr_next(klass, cur_klass, op);
}
else
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
va_start(p_list, op);
nklass = _eo_kls_itr_next(obj->klass, cur_klass, op);
}
EAPI const Eo_Class *
-eo_class_get(const Eo *obj_id)
+eo_class_get(const Eo *eo_id)
{
- if (_eo_is_a_class(obj_id))
+ if (_eo_is_a_class(eo_id))
{
- EO_CLASS_POINTER_RETURN_VAL(obj_id, _klass, NULL);
+ EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, NULL);
return eo_class_class_get();
}
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, NULL);
if (obj->klass)
return _eo_class_id_get(obj->klass);
}
EAPI const char *
-eo_class_name_get(const Eo_Class *obj_id)
+eo_class_name_get(const Eo_Class *eo_id)
{
const _Eo_Class *klass;
- if (_eo_is_a_class(obj_id))
+ if (_eo_is_a_class(eo_id))
{
- EO_CLASS_POINTER_RETURN_VAL(obj_id, _klass, NULL);
+ EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, NULL);
klass = _klass;
}
else
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, NULL);
klass = obj->klass;
}
/* Not really called, just used for the ptr... */
static void
-_eo_class_isa_func(Eo *obj_id EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
+_eo_class_isa_func(Eo *eo_id EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
/* Do nonthing. */
}
}
EAPI Eina_Bool
-eo_isa(const Eo *obj_id, const Eo_Class *klass_id)
+eo_isa(const Eo *eo_id, const Eo_Class *klass_id)
{
- EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
+ EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EINA_FALSE);
const op_type_funcs *func = _dich_func_get(obj->klass,
klass->base_id + klass->desc->ops.count);