EFL_OBJECT_OP_FUNC(simple_other_call, _other_call),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static void
eina_strbuf_append(buf, "#endif\n\n");
}
- eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, NULL, NULL);\n");
+ eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, NULL);\n");
eina_strbuf_free(ops);
static Eina_Bool
_custom_table_initializer(Efl_Class *klass)
{
- EFL_OPS_DEFINE(class_ops,
+ EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc)
);
- return efl_class_functions_set(klass, NULL, &class_ops, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
};
static const Efl_Class_Description custom_table_class_desc = {
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox)
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description _elm_combobox_class_desc = {
* efl_property_reflection_set() or efl_property_reflection_get() is called.
* @see #EFL_DEFINE_CLASS
*/
-EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table);
+EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table);
/**
* @brief Override Eo functions of this object.
}
EAPI Eina_Bool
-efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table)
+efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table)
{
EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass);
Efl_Object_Ops empty_ops = { 0 };
if (!object_ops) object_ops = &empty_ops;
- if (!class_ops) class_ops = &empty_ops;
-
klass->reflection = reflection_table;
- klass->ops_count = object_ops->count + class_ops->count;
+ klass->ops_count = object_ops->count;
klass->base_id = _eo_ops_last_id;
_eo_ops_last_id += klass->ops_count + 1;
_vtable_copy_all(&klass->vtable, &(*mro_itr)->vtable);
}
- return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE) &&
- _eo_class_funcs_set(&klass->vtable, class_ops, klass, klass, object_ops->count, EINA_FALSE);
+ return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE);
err_funcs:
ERR("Class %s already had its functions set..", klass->desc->name);
/* If functions haven't been set, invoke it with an empty ops structure. */
if (!klass->functions_set)
{
- efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL, NULL);
+ efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL);
}
/* Mark which classes we implement */
EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
return EINA_TRUE;
}
-static Eina_Bool
-_class_print(Efl_Class *klass, void *data EINA_UNUSED)
-{
- Eina_Bool called = EINA_FALSE;
- printf("Print %s-%s\n", efl_class_name_get(klass), efl_class_name_get(MY_CLASS));
- called = simple_class_print(efl_super(klass, MY_CLASS));
- fail_if(!called);
-
- called = simple_class_print2(efl_super(klass, MY_CLASS));
- fail_if(!called);
-
- return EINA_TRUE;
-}
-
EAPI EFL_FUNC_BODY(inherit2_print, Eina_Bool, EINA_FALSE);
EAPI EFL_FUNC_BODY(inherit2_print2, Eina_Bool, EINA_FALSE);
EFL_OBJECT_OP_FUNC(inherit2_print2, _print2),
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- EFL_OPS_DEFINE(cops,
- EFL_OBJECT_OP_FUNC(simple_class_print, _class_print),
- );
- return efl_class_functions_set(klass, &ops, &cops, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_class_print2, _class_print2),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(interface_ab_sum_get, NULL),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, NULL),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, _ab_sum_get2),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_error_test, _test),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description errorcase_class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor_unref),
);
- return efl_class_functions_set(klass2, &ops, NULL, NULL);
+ return efl_class_functions_set(klass2, &ops, NULL);
}
EFL_START_TEST(efl_destructor_unref)
EFL_OBJECT_OP_FUNC(NULL, _null_fct),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(eo_null_api)
EFL_OBJECT_OP_FUNC(null_fct, NULL),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(eo_api_redefined)
EFL_OBJECT_OP_FUNC(simple_a_set, NULL),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(eo_dich_func_override)
return EINA_TRUE;
}
-static Eina_Bool
-_class_hi_print(Efl_Class *klass, void *data EINA_UNUSED)
-{
- printf("Hi Print %s\n", efl_class_name_get(klass));
-
- return EINA_TRUE;
-}
-
EFL_FUNC_BODYV(simple_part_get, Eo *, NULL, EFL_FUNC_CALL(name), const char *name);
static Eo *
EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a);
EFL_FUNC_BODY(simple_a_get, int, 0);
EFL_FUNC_BODY(simple_a_print, Eina_Bool, EINA_FALSE);
-EFL_FUNC_BODY_CONST(simple_class_hi_print, Eina_Bool, EINA_FALSE);
EFL_VOID_FUNC_BODY(simple_pure_virtual);
EFL_VOID_FUNC_BODY(simple_no_implementation);
EFL_OBJECT_OP_FUNC(simple_pure_virtual, NULL),
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _dbg_info_get),
);
- EFL_OPS_DEFINE(cops,
- EFL_OBJECT_OP_FUNC(simple_class_hi_print, _class_hi_print),
- );
static const Efl_Object_Property_Reflection reflection_table[] = {
{"simple_a", _a_set_reflect, _a_get_reflect},
};
reflection_table, EINA_C_ARRAY_LENGTH(reflection_table)
};
- return efl_class_functions_set(klass, &ops, &cops, &ref_ops);
+ return efl_class_functions_set(klass, &ops, &ref_ops);
}
static const Efl_Class_Description class_desc = {
};
EFL_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, NULL)
-
-
-static int
-_beef_get(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED)
-{
- return 0xBEEF;
-}
-
EFL_FUNC_BODY_CONST(simple2_class_beef_get, int, 0);
static Eina_Bool
_class_initializer2(Efl_Class *klass)
{
- EFL_OPS_DEFINE(cops,
- EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _beef_get),
- );
- return efl_class_functions_set(klass, NULL, &cops, NULL);
+ return efl_class_functions_set(klass, NULL, NULL);
}
static const Efl_Class_Description class_desc2 = {
static Eina_Bool
_class_initializer3(Efl_Class *klass)
{
- return efl_class_functions_set(klass, NULL, NULL, NULL);
+ return efl_class_functions_set(klass, NULL, NULL);
}
static const Efl_Class_Description class_desc3 = {
EFL_OBJECT_OP_FUNC(efl_provider_find, _interface_get)
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc_searchable = {
#define SIMPLE_CLASS simple_class_get()
const Efl_Class *simple_class_get(void);
-EAPI int simple2_class_beef_get(const Efl_Class *obj);
-
#define SIMPLE2_CLASS simple2_class_get()
const Efl_Class *simple2_class_get(void);
EFL_OBJECT_OP_FUNC(efl_constructor, _singleton_efl_constructor),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(domain_a_get, _a_get),
EFL_OBJECT_OP_FUNC(domain_recursive, _recursive)
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
simple_a_set(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS), 2 * a);
}
+EAPI int test_class_beef_get(const Efl_Object *obj);
+
+EFL_FUNC_BODY_CONST(test_class_beef_get, int, 0)
+
+static int
+_simple_obj_override_beef_get(Eo *obj, void *class_data EINA_UNUSED)
+{
+ test_class_beef_get(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS));
+
+ return 1337;
+}
+
EFL_START_TEST(efl_object_override_tests)
{
/* Try introducing a new function */
EFL_OPS_DEFINE(
overrides3,
- EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
+ EFL_OBJECT_OP_FUNC(test_class_beef_get, _simple_obj_override_beef_get));
fail_if(efl_object_override(obj, &overrides3));
fail_if(!efl_object_override(obj, NULL));
fail_if(efl_object_override(obj, &overrides3));
EFL_OBJECT_OP_FUNC(efl_destructor, _man_des),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(eo_man_free)
EFL_OBJECT_OP_FUNC(resolve_a_print, _a_print),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(efl_func_resolve)
EFL_OBJECT_OP_FUNC(efl_finalize, _efl_add_failures_finalize),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(efl_add_failures)
_cast_inherit_class_initializer_1(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_1), );
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static Eina_Bool
_cast_inherit_class_initializer_2(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_2), );
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
EFL_START_TEST(efl_cast_test)
/* XXX-1: Essential for the next test to assign the wrong op. */
obj = efl_add_ref(SIMPLE_CLASS, NULL);
simple_a_set(obj, 1);
+ /* XXX-1: Essential for the next test to cache the op. */
ck_assert_int_eq(1, simple_a_get(obj));
- /* XXX-1: Essential for the next test to cache the op. */
- ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS));
efl_unref(obj);
fail_if(efl_object_shutdown());
ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS));
/* XXX-1: Verify that the op was not cached. */
- ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS));
+ obj = efl_add_ref(SIMPLE_CLASS, NULL);
+ simple_a_set(obj, 1);
+ ck_assert_int_eq(1, simple_a_get(obj));
}
EFL_END_TEST
EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack),
);
- return efl_class_functions_set(klass, &ops, NULL, NULL);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
);
opsp = &ops;
- return efl_class_functions_set(klass, opsp, NULL, NULL);
+ return efl_class_functions_set(klass, opsp, NULL);
}
static const Efl_Class_Description _class_simple_class_desc = {
);
opsp = &ops;
- return efl_class_functions_set(klass, opsp, NULL, NULL);
+ return efl_class_functions_set(klass, opsp, NULL);
}
static const Efl_Class_Description _function_as_argument_class_desc = {
);
opsp = &ops;
- return efl_class_functions_set(klass, opsp, NULL, NULL);
+ return efl_class_functions_set(klass, opsp, NULL);
}
static const Efl_Class_Description _override_class_desc = {
);
opsp = &ops;
- return efl_class_functions_set(klass, opsp, NULL, NULL);
+ return efl_class_functions_set(klass, opsp, NULL);
}
static const Efl_Class_Description _owning_class_desc = {