forked from enlightenment/efl
Eo: Make function overrides implicit.
Before this commit, function overrides were explicit. That is, you'd have to explicitly state you were overriding a function instead of creating a new one. This made the code a tad more complex, and was also a bit more annoying to use. This commit removes this extra piece of information. This means we now store much less information per function, that will let us further optimise out structures in the future.
This commit is contained in:
parent
0f8fb7ef88
commit
bd3801247e
|
@ -62,7 +62,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _a_set),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -178,7 +178,7 @@ static void
|
|||
custom_check_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
EFL_OPS_DEFINE(custom_layout_ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_pack_layout_update, _custom_layout_update));
|
||||
EFL_OBJECT_OP_FUNC(efl_pack_layout_update, _custom_layout_update));
|
||||
|
||||
Eina_Bool chk = elm_check_selected_get(event->object);
|
||||
Eo *obj = data;
|
||||
|
|
|
@ -23,7 +23,7 @@ static Eina_Bool
|
|||
_custom_engine_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(efl_pack_layout_do, _custom_engine_layout_do),
|
||||
EFL_OBJECT_OP_CLASS_FUNC(efl_pack_layout_do, _custom_engine_layout_do),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -822,7 +822,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
|
|||
if (ftype != EOLIAN_PROP_GET)
|
||||
{
|
||||
Eina_Stringshare *rets = eolian_function_full_c_name_get(fnid, EOLIAN_PROP_SET, EINA_FALSE);
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC_OVERRIDE(%s, %s_%s_set),",
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC(%s, %s_%s_set),",
|
||||
class_str, rets, implname, funcname);
|
||||
eo_bind_func_generate(class, fnid, EOLIAN_PROP_SET, str_bodyf, impl_desc, &impl_env);
|
||||
eina_stringshare_del(rets);
|
||||
|
@ -831,7 +831,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
|
|||
if (ftype != EOLIAN_PROP_SET)
|
||||
{
|
||||
Eina_Stringshare *rets = eolian_function_full_c_name_get(fnid, EOLIAN_PROP_GET, EINA_FALSE);
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC_OVERRIDE(%s, %s_%s_get),",
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC(%s, %s_%s_get),",
|
||||
class_str, rets, implname, funcname);
|
||||
eo_bind_func_generate(class, fnid, EOLIAN_PROP_GET, str_bodyf, impl_desc, &impl_env);
|
||||
eina_stringshare_del(rets);
|
||||
|
@ -840,7 +840,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
|
|||
default:
|
||||
{
|
||||
Eina_Stringshare *rets = eolian_function_full_c_name_get(fnid, ftype, EINA_FALSE);
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC_OVERRIDE(%s, %s_%s),",
|
||||
eina_strbuf_append_printf(str_op, "\n EFL_OBJECT_OP_%sFUNC(%s, %s_%s),",
|
||||
class_str, rets, implname, funcname);
|
||||
eo_bind_func_generate(class, fnid, ftype, str_bodyf, impl_desc, &impl_env);
|
||||
eina_stringshare_del(rets);
|
||||
|
|
|
@ -169,7 +169,7 @@ static Eina_Bool
|
|||
_custom_table_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(efl_canvas_group_calculate, _custom_table_calc)
|
||||
EFL_OBJECT_OP_CLASS_FUNC(efl_canvas_group_calculate, _custom_table_calc)
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -148,8 +148,6 @@ enum _Efl_Object_Op_Type
|
|||
EFL_OBJECT_OP_TYPE_INVALID = -1, /**< Invalid op. */
|
||||
EFL_OBJECT_OP_TYPE_REGULAR = 0, /**< Regular op. */
|
||||
EFL_OBJECT_OP_TYPE_CLASS, /**< Class op - a class op. Like static in Java/C++. */
|
||||
EFL_OBJECT_OP_TYPE_REGULAR_OVERRIDE, /**< Regular op override (previously defined) */
|
||||
EFL_OBJECT_OP_TYPE_CLASS_OVERRIDE, /**< Class op override (previously defined) */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -458,11 +456,11 @@ EAPI Eina_Bool efl_object_override(Eo *obj, const Efl_Object_Ops *ops);
|
|||
* @brief Define an array of override functions for @ref efl_object_override
|
||||
* @param ops A name for the Efl_Object_Ops local variable to define
|
||||
* @param ... A comma separated list of Efl_Object_Op overrides, using
|
||||
* #EFL_OBJECT_OP_FUNC_OVERRIDE or #EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE
|
||||
* #EFL_OBJECT_OP_FUNC or #EFL_OBJECT_OP_CLASS_FUNC
|
||||
*
|
||||
* This can be used as follows:
|
||||
* @code
|
||||
* EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC_OVERRIDE(public_func, _my_func));
|
||||
* EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(public_func, _my_func));
|
||||
* efl_object_override(obj, &ops);
|
||||
* @endcode
|
||||
*
|
||||
|
@ -848,8 +846,6 @@ typedef struct _Efl_Object_Call_Cache
|
|||
|
||||
#define EFL_OBJECT_OP_FUNC(_api, _private) { _EFL_OBJECT_OP_API_ENTRY(_api), (void*)_private, EFL_OBJECT_OP_TYPE_REGULAR }
|
||||
#define EFL_OBJECT_OP_CLASS_FUNC(_api, _private) { _EFL_OBJECT_OP_API_ENTRY(_api), (void*)_private, EFL_OBJECT_OP_TYPE_CLASS }
|
||||
#define EFL_OBJECT_OP_FUNC_OVERRIDE(_api, _private) { _EFL_OBJECT_OP_API_ENTRY(_api), (void*)_private, EFL_OBJECT_OP_TYPE_REGULAR_OVERRIDE }
|
||||
#define EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(_api, _private) { _EFL_OBJECT_OP_API_ENTRY(_api), (void*)_private, EFL_OBJECT_OP_TYPE_CLASS_OVERRIDE }
|
||||
|
||||
// returns the OP id corresponding to the given api_func
|
||||
EAPI Efl_Object_Op _efl_object_api_op_id_get(const void *api_func);
|
||||
|
|
|
@ -578,8 +578,8 @@ _eo_api_func_equal(const void *api_func1, const void *api_func2)
|
|||
#endif
|
||||
}
|
||||
|
||||
EAPI Efl_Object_Op
|
||||
_efl_object_api_op_id_get(const void *api_func)
|
||||
static inline Efl_Object_Op
|
||||
_efl_object_api_op_id_get_internal(const void *api_func)
|
||||
{
|
||||
eina_spinlock_take(&_ops_storage_lock);
|
||||
#ifndef _WIN32
|
||||
|
@ -589,6 +589,14 @@ _efl_object_api_op_id_get(const void *api_func)
|
|||
#endif
|
||||
eina_spinlock_release(&_ops_storage_lock);
|
||||
|
||||
return op;
|
||||
}
|
||||
|
||||
EAPI Efl_Object_Op
|
||||
_efl_object_api_op_id_get(const void *api_func)
|
||||
{
|
||||
Efl_Object_Op op = _efl_object_api_op_id_get_internal(api_func);
|
||||
|
||||
if (op == EFL_NOOP)
|
||||
{
|
||||
ERR("Unable to resolve op for api func %p", api_func);
|
||||
|
@ -600,7 +608,7 @@ _efl_object_api_op_id_get(const void *api_func)
|
|||
/* klass is the klass we are working on. hierarchy_klass is the class whe should
|
||||
* use when validating. */
|
||||
static Eina_Bool
|
||||
_eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Class *hierarchy_klass, const _Efl_Class *klass, Eina_Bool override_only)
|
||||
_eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Class *hierarchy_klass, const _Efl_Class *klass, Eina_Bool override_only EINA_UNUSED)
|
||||
{
|
||||
unsigned int i;
|
||||
int op_id;
|
||||
|
@ -629,12 +637,6 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
|
|||
|
||||
if ((op_desc->op_type == EFL_OBJECT_OP_TYPE_REGULAR) || (op_desc->op_type == EFL_OBJECT_OP_TYPE_CLASS))
|
||||
{
|
||||
if (override_only)
|
||||
{
|
||||
ERR("Creation of new functions is not allowed when overriding an object's vtable.");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
if (_eo_api_func_equal(op_desc->api_func, last_api_func))
|
||||
{
|
||||
ERR("Class '%s': API previously defined (%p->%p '%s').",
|
||||
|
@ -642,21 +644,21 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
op = op_id;
|
||||
eina_spinlock_take(&_ops_storage_lock);
|
||||
#ifndef _WIN32
|
||||
eina_hash_add(_ops_storage, &op_desc->api_func, (void *) (uintptr_t) op);
|
||||
#else
|
||||
eina_hash_add(_ops_storage, op_desc->api_func, (void *) (uintptr_t) op);
|
||||
#endif
|
||||
eina_spinlock_release(&_ops_storage_lock);
|
||||
op = _efl_object_api_op_id_get_internal(op_desc->api_func);
|
||||
|
||||
op_id++;
|
||||
}
|
||||
else if ((op_desc->op_type == EFL_OBJECT_OP_TYPE_REGULAR_OVERRIDE) || (op_desc->op_type == EFL_OBJECT_OP_TYPE_CLASS_OVERRIDE))
|
||||
{
|
||||
/* We allow any overrides, we don't check if in hierarchy. */
|
||||
op = _efl_object_api_op_id_get(op_desc->api_func);
|
||||
if (op == EFL_NOOP)
|
||||
{
|
||||
op = op_id;
|
||||
eina_spinlock_take(&_ops_storage_lock);
|
||||
#ifndef _WIN32
|
||||
eina_hash_add(_ops_storage, &op_desc->api_func, (void *) (uintptr_t) op);
|
||||
#else
|
||||
eina_hash_add(_ops_storage, op_desc->api_func, (void *) (uintptr_t) op);
|
||||
#endif
|
||||
eina_spinlock_release(&_ops_storage_lock);
|
||||
|
||||
op_id++;
|
||||
}
|
||||
}
|
||||
|
||||
if (op == EFL_NOOP)
|
||||
|
|
|
@ -40,8 +40,8 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _a_get),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -42,8 +42,8 @@ _class_initializer(Efl_Class *klass)
|
|||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC(mixin_add_and_print, _add_and_print_set),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -89,9 +89,9 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_finalize, _finalize),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_finalize, _finalize),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
EFL_OBJECT_OP_FUNC(simple_b_set, _b_set),
|
||||
|
|
|
@ -20,7 +20,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -18,7 +18,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -18,7 +18,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -18,7 +18,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -22,7 +22,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -65,8 +65,8 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC(inherit2_print, _print),
|
||||
EFL_OBJECT_OP_FUNC(inherit2_print2, _print2),
|
||||
EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(simple_class_print, _class_print),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _a_set),
|
||||
EFL_OBJECT_OP_CLASS_FUNC(simple_class_print, _class_print),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -20,7 +20,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _a_set),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -64,8 +64,8 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
EFL_OBJECT_OP_FUNC(simple_b_set, _b_set),
|
||||
EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(interface_ab_sum_get, _ab_sum_get),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(interface2_ab_sum_get2, _ab_sum_get2),
|
||||
EFL_OBJECT_OP_FUNC(interface_ab_sum_get, _ab_sum_get),
|
||||
EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, _ab_sum_get2),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -23,7 +23,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _a_get),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -36,8 +36,8 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
|
|
|
@ -50,9 +50,9 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(mixin_ab_sum_get, _ab_sum_get),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -49,9 +49,9 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(mixin_ab_sum_get, _ab_sum_get),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -75,7 +75,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ static Eina_Bool
|
|||
_destructor_unref_class_initializer(Efl_Class *klass2)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor_unref),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor_unref),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass2, &ops);
|
||||
|
|
|
@ -240,39 +240,6 @@ START_TEST(eo_null_api)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
static Eina_Bool
|
||||
_wrong_override_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(null_fct, _null_fct),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
}
|
||||
|
||||
START_TEST(eo_wrong_override)
|
||||
{
|
||||
efl_object_init();
|
||||
|
||||
const Efl_Class *klass;
|
||||
|
||||
static Efl_Class_Description class_desc = {
|
||||
EO_VERSION,
|
||||
"Simple",
|
||||
EFL_CLASS_TYPE_REGULAR,
|
||||
0,
|
||||
_wrong_override_class_initializer,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
klass = efl_class_new(&class_desc, NULL, NULL);
|
||||
fail_if(klass);
|
||||
|
||||
efl_object_shutdown();
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static Eina_Bool
|
||||
_redefined_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
|
@ -316,8 +283,8 @@ static Eina_Bool
|
|||
_dich_func_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _null_fct),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, NULL),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _null_fct),
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, NULL),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
@ -340,7 +307,7 @@ START_TEST(eo_dich_func_override)
|
|||
NULL
|
||||
};
|
||||
|
||||
TEST_EO_ERROR("_vtable_func_set", "Class '%s': Overriding already set func %p for op %d (%s) with %p.");
|
||||
TEST_EO_ERROR("_eo_class_funcs_set", "Class '%s': API previously defined (%p->%p '%s').");
|
||||
klass = efl_class_new(&class_desc, SIMPLE_CLASS, NULL);
|
||||
fail_if(klass);
|
||||
fail_unless(ctx.did);
|
||||
|
@ -360,7 +327,6 @@ void eo_test_class_errors(TCase *tc)
|
|||
/* This test is not relevant for WIN32. */
|
||||
tcase_add_test(tc, eo_null_api);
|
||||
#endif
|
||||
tcase_add_test(tc, eo_wrong_override);
|
||||
tcase_add_test(tc, eo_api_redefined);
|
||||
tcase_add_test(tc, eo_dich_func_override);
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_recursive, _recursive),
|
||||
EFL_OBJECT_OP_FUNC(simple_part_get, _part_get),
|
||||
EFL_OBJECT_OP_FUNC(simple_pure_virtual, NULL),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_dbg_info_get, _dbg_info_get),
|
||||
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _dbg_info_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
@ -160,7 +160,7 @@ static Eina_Bool
|
|||
_searchable_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_provider_find, _interface_get)
|
||||
EFL_OBJECT_OP_FUNC(efl_provider_find, _interface_get)
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -29,7 +29,7 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _singleton_efl_constructor),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _singleton_efl_constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -76,7 +76,7 @@ START_TEST(efl_object_override_tests)
|
|||
|
||||
EFL_OPS_DEFINE(
|
||||
overrides,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _simple_obj_override_a_get));
|
||||
EFL_OBJECT_OP_FUNC(simple_a_get, _simple_obj_override_a_get));
|
||||
fail_if(!efl_object_override(obj, &overrides));
|
||||
|
||||
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A);
|
||||
|
@ -88,7 +88,7 @@ START_TEST(efl_object_override_tests)
|
|||
/* Override again. */
|
||||
EFL_OPS_DEFINE(
|
||||
overrides2,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _simple_obj_override_a_double_set));
|
||||
EFL_OBJECT_OP_FUNC(simple_a_set, _simple_obj_override_a_double_set));
|
||||
fail_if(!efl_object_override(obj, NULL));
|
||||
fail_if(!efl_object_override(obj, &overrides2));
|
||||
|
||||
|
@ -104,7 +104,7 @@ START_TEST(efl_object_override_tests)
|
|||
overrides3,
|
||||
EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
|
||||
fail_if(!efl_object_override(obj, NULL));
|
||||
fail_if(efl_object_override(obj, &overrides3));
|
||||
fail_if(!efl_object_override(obj, &overrides3));
|
||||
|
||||
/* Test override reset */
|
||||
fail_if(!efl_object_override(obj, NULL));
|
||||
|
@ -432,8 +432,8 @@ static Eina_Bool
|
|||
_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _man_con),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _man_des),
|
||||
EFL_OBJECT_OP_FUNC(efl_constructor, _man_con),
|
||||
EFL_OBJECT_OP_FUNC(efl_destructor, _man_des),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
@ -1166,7 +1166,7 @@ static Eina_Bool
|
|||
_add_failures_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_finalize, _efl_add_failures_finalize),
|
||||
EFL_OBJECT_OP_FUNC(efl_finalize, _efl_add_failures_finalize),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops);
|
||||
|
|
|
@ -57,9 +57,9 @@ static Eina_Bool
|
|||
_override_class_initializer(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops,
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(base_constructor, _override_base_constructor),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(base_z_get, __eolian_override_base_z_get),
|
||||
EFL_OBJECT_OP_FUNC_OVERRIDE(base_z_set, __eolian_override_base_z_set),
|
||||
EFL_OBJECT_OP_FUNC(base_constructor, _override_base_constructor),
|
||||
EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
|
||||
EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
|
||||
EFL_OBJECT_OP_FUNC(override_b_set, __eolian_override_b_set),
|
||||
EFL_OBJECT_OP_FUNC(override_bar, __eolian_override_bar),
|
||||
EFL_OBJECT_OP_FUNC(override_c_get, __eolian_override_c_get),
|
||||
|
|
Loading…
Reference in New Issue