Eo: unify the class func and normal func prototypes.

Conflicts:
	src/lib/eo/eo.c
This commit is contained in:
Tom Hacohen 2013-09-25 18:10:03 +01:00
parent 298527191e
commit 2a82ff95e4
7 changed files with 20 additions and 27 deletions

View File

@ -255,16 +255,6 @@ typedef unsigned int Eo_Op;
*/
typedef void (*eo_op_func_type)(Eo *, void *class_data, va_list *list);
/**
* @typedef eo_op_func_type_class
* The type of the class Op functions. This is the same as #eo_op_func_type,\
* exepct that it's for usage with class functions, and not with object
* functions.
*
* @see eo_op_func_type
*/
typedef void (*eo_op_func_type_class)(const Eo *, va_list *list);
/**
* @addtogroup Eo_Events Eo's Event Handling
* @{
@ -416,7 +406,7 @@ typedef struct _Eo_Op_Func_Description Eo_Op_Func_Description;
*
* @see EO_OP_FUNC
*/
#define EO_OP_FUNC_CLASS(op, func) { op, (eo_op_func_type) EO_TYPECHECK(eo_op_func_type_class, func), EO_OP_TYPE_CLASS }
#define EO_OP_FUNC_CLASS(op, func) { op, EO_TYPECHECK(eo_op_func_type, func), EO_OP_TYPE_CLASS }
/**
* @def EO_OP_FUNC_SENTINEL

View File

@ -301,15 +301,18 @@ _eo_op_internal(const char *file, int line, _Eo eo_ptr, const _Eo_Class *cur_kla
const op_type_funcs *func = _eo_kls_itr_func_get(cur_klass, op);
if (EINA_LIKELY(func != NULL))
{
void *func_data = NULL;
Eo *calling_obj;
if (op_type == EO_OP_TYPE_REGULAR)
{
void *func_data = _eo_data_scope_get(eo_ptr.obj, func->src);
func->func((Eo *)eo_ptr.obj->obj_id, func_data, p_list);
func_data = _eo_data_scope_get(eo_ptr.obj, func->src);
calling_obj = (Eo *)eo_ptr.obj->obj_id;
}
else
{
((eo_op_func_type_class) func->func)(_eo_class_id_get(cur_klass), p_list);
calling_obj = _eo_class_id_get(cur_klass);
}
func->func(calling_obj, func_data, p_list);
return EINA_TRUE;
}
}

View File

@ -744,13 +744,13 @@ _ev_freeze_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
}
static void
_ev_global_freeze(const Eo *klass EINA_UNUSED, va_list *list EINA_UNUSED)
_ev_global_freeze(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
{
event_freeze_count++;
}
static void
_ev_global_thaw(const Eo *klass EINA_UNUSED, va_list *list EINA_UNUSED)
_ev_global_thaw(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
{
if (event_freeze_count > 0)
{
@ -763,7 +763,7 @@ _ev_global_thaw(const Eo *klass EINA_UNUSED, va_list *list EINA_UNUSED)
}
static void
_ev_global_freeze_get(const Eo *klass EINA_UNUSED, va_list *list)
_ev_global_freeze_get(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list)
{
EO_PARAMETER_GET(int *, ret, list);

View File

@ -39,7 +39,7 @@ _print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UN
}
static void
_class_print(const Eo *klass, va_list *list)
_class_print(Eo *klass, void *data EINA_UNUSED, va_list *list)
{
(void) list;
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));

View File

@ -30,7 +30,7 @@ _a_print(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
}
static void
_class_print(const Eo *klass, va_list *list)
_class_print(Eo *klass, void *data EINA_UNUSED, va_list *list)
{
(void) list;
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
@ -39,7 +39,7 @@ _class_print(const Eo *klass, va_list *list)
}
static void
_class_print2(const Eo *klass, va_list *list)
_class_print2(Eo *klass, void *data EINA_UNUSED, va_list *list)
{
(void) list;
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));

View File

@ -402,12 +402,12 @@ static void
_const_ops_class_constructor(Eo *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), (eo_op_func_type) _const_ops_a_set),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), (eo_op_func_type) _const_ops_a_print),
EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), (eo_op_func_type_class) _const_ops_a_set),
EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), (eo_op_func_type_class) _const_ops_a_print),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_HI_PRINT), (eo_op_func_type) _const_ops_class_hi_print),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_HI_PRINT), (eo_op_func_type) _const_ops_class_hi_print),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _const_ops_a_set),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), _const_ops_a_print),
EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _const_ops_a_set),
EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), _const_ops_a_print),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_HI_PRINT), _const_ops_class_hi_print),
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_HI_PRINT), _const_ops_class_hi_print),
EO_OP_FUNC_SENTINEL
};

View File

@ -33,7 +33,7 @@ _a_print(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
}
static void
_class_hi_print(const Eo *klass, va_list *list)
_class_hi_print(Eo *klass, void *data EINA_UNUSED, va_list *list)
{
(void) list;
printf("Hi Print %s\n", eo_class_name_get(klass));