EFL_OBJECT_OP_FUNC(simple_other_call, _other_call),
);
- return efl_class_functions_set(klass, &ops);
+ 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);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static void
static Eina_Bool
_custom_engine_class_initializer(Efl_Class *klass)
{
- EFL_OPS_DEFINE(ops,
- EFL_OBJECT_OP_CLASS_FUNC(efl_pack_layout_do, _custom_engine_layout_do),
+ EFL_OPS_DEFINE(class_ops,
+ EFL_OBJECT_OP_FUNC(efl_pack_layout_do, _custom_engine_layout_do),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, NULL, &class_ops);
}
static const Efl_Class_Description custom_engine_class_desc = {
static Eina_Bool
_custom_table_initializer(Efl_Class *klass)
{
- EFL_OPS_DEFINE(ops,
- EFL_OBJECT_OP_CLASS_FUNC(efl_canvas_group_calculate, _custom_table_calc)
+ EFL_OPS_DEFINE(class_ops,
+ EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc)
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, NULL, &class_ops);
};
static const Efl_Class_Description custom_table_class_desc = {
EAPI extern unsigned int _efl_object_init_generation;
/**
- * @internal
- * An enum representing the possible types of an Op.
- */
-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++. */
-};
-
-/**
- * @internal
- * @typedef Efl_Object_Op_Type
- * A convenience typedef for #_Efl_Object_Op_Type.
- */
-typedef enum _Efl_Object_Op_Type Efl_Object_Op_Type;
-
-/**
* @typedef Efl_Del_Intercept
*
* A function to be called on object deletion/destruction instead of normal
{
void *api_func; /**< The EAPI function offering this op. (The name of the func on windows) */
void *func; /**< The static function to call for the op. */
- Efl_Object_Op_Type op_type; /**< The type of the Op. */
} Efl_Op_Description;
/**
/**
* @brief Set the functions of a class
* @param klass_id the class whose functions we are setting.
- * @param ops The function structure we are setting.
+ * @param object_ops The function structure we are setting for object functions
+ * @param class_ops The function structure we are setting for class functions
* @return True on success, False otherwise.
*
* This should only be called from within the initializer function.
*
* @see #EFL_DEFINE_CLASS
*/
-EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *ops);
+EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops);
/**
* @brief Override Eo functions of this object.
# define _EFL_OBJECT_OP_API_ENTRY(a) #a
#endif
-#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(_api, _private) { _EFL_OBJECT_OP_API_ENTRY(_api), (void*)_private }
// returns the OP id corresponding to the given api_func
EAPI Efl_Object_Op _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 EINA_UNUSED)
+_eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Class *hierarchy_klass, const _Efl_Class *klass, Efl_Object_Op id_offset, Eina_Bool override_only)
{
unsigned int i;
- int op_id;
+ Efl_Object_Op op_id;
const void *last_api_func;
const Efl_Op_Description *op_desc;
const Efl_Op_Description *op_descs;
- op_id = hierarchy_klass->base_id;
+ op_id = hierarchy_klass->base_id + id_offset;
op_descs = ops->descs;
DBG("Set functions for class '%s':%p", klass->desc->name, klass);
return EINA_FALSE;
}
- if ((op_desc->op_type == EFL_OBJECT_OP_TYPE_REGULAR) || (op_desc->op_type == EFL_OBJECT_OP_TYPE_CLASS))
+ /* Get the opid for the function. */
{
if (_eo_api_func_equal(op_desc->api_func, last_api_func))
{
}
}
- if (op == EFL_NOOP)
- {
- ERR("Class '%s': Invalid op 'EFL_NOOP' (%p->%p '%s').",
- klass->desc->name, op_desc->api_func, op_desc->func, _eo_op_desc_name_get(op_desc));
- return EINA_FALSE;
- }
-
DBG("%p->%p '%s'", op_desc->api_func, op_desc->func, _eo_op_desc_name_get(op_desc));
if (!_vtable_func_set(vtable, klass, op, op_desc->func))
}
EAPI Eina_Bool
-efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *ops)
+efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops)
{
EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EINA_FALSE);
Efl_Object_Ops empty_ops = { 0 };
+
if (klass->functions_set)
{
ERR("Class %s already had its functions set..", klass->desc->name);
}
klass->functions_set = EINA_TRUE;
- if (!ops)
+ if (!object_ops)
+ {
+ object_ops = &empty_ops;
+ }
+
+ if (!class_ops)
{
- ops = &empty_ops;
+ class_ops = &empty_ops;
}
- klass->ops_count = ops->count;
+ klass->ops_count = object_ops->count + class_ops->count;
klass->base_id = _eo_ops_last_id;
_eo_ops_last_id += klass->ops_count + 1;
}
}
- return _eo_class_funcs_set(&klass->vtable, ops, klass, klass, EINA_FALSE);
+ 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);
}
EAPI Eo *
/* 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);
+ efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL);
}
/* Mark which classes we implement */
return EINA_FALSE;
}
- if (!_eo_class_funcs_set(obj->vtable, ops, obj->klass, klass, EINA_TRUE))
+ if (!_eo_class_funcs_set(obj->vtable, ops, obj->klass, klass, 0, EINA_TRUE))
{
ERR("Failed to override functions for %p", eo_id);
return EINA_FALSE;
EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print),
);
- return efl_class_functions_set(klass, &ops);
+ 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);
+ 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);
+ 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);
+ 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);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
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),
- EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
+ EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
);
- return efl_class_functions_set(klass, &ops);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(inherit2_print, _print),
EFL_OBJECT_OP_FUNC(inherit2_print2, _print2),
- EFL_OBJECT_OP_CLASS_FUNC(simple_class_print, _class_print),
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);
+ return efl_class_functions_set(klass, &ops, &cops);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
- return efl_class_functions_set(klass, &ops);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor_unref),
);
- return efl_class_functions_set(klass2, &ops);
+ return efl_class_functions_set(klass2, &ops, NULL);
}
START_TEST(efl_destructor_unref)
EFL_OBJECT_OP_FUNC(NULL, _null_fct),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(eo_null_api)
EFL_OBJECT_OP_FUNC(null_fct, NULL),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(eo_api_redefined)
EFL_OBJECT_OP_FUNC(simple_a_set, NULL),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(eo_dich_func_override)
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
EFL_OBJECT_OP_FUNC(simple_a_print, _a_print),
- EFL_OBJECT_OP_CLASS_FUNC(simple_class_hi_print, _class_hi_print),
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(efl_dbg_info_get, _dbg_info_get),
);
+ EFL_OPS_DEFINE(cops,
+ EFL_OBJECT_OP_FUNC(simple_class_hi_print, _class_hi_print),
+ );
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, &cops);
}
static const Efl_Class_Description class_desc = {
static Eina_Bool
_class_initializer2(Efl_Class *klass)
{
- EFL_OPS_DEFINE(ops,
- EFL_OBJECT_OP_CLASS_FUNC(simple2_class_beef_get, _beef_get),
+ EFL_OPS_DEFINE(cops,
+ EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _beef_get),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, NULL, &cops);
}
static const Efl_Class_Description class_desc2 = {
EFL_OBJECT_OP_FUNC(efl_provider_find, _interface_get)
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc_searchable = {
EFL_OBJECT_OP_FUNC(efl_constructor, _singleton_efl_constructor),
);
- return efl_class_functions_set(klass, &ops);
+ 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);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_destructor, _man_des),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(eo_man_free)
EFL_OBJECT_OP_FUNC(multi_class_hi_print, _class_hi_print),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(eo_multiple_do)
EFL_OBJECT_OP_FUNC(efl_finalize, _efl_add_failures_finalize),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
START_TEST(efl_add_failures)
EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack),
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description class_desc = {
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo)
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description _class_simple_class_desc = {
NULL
};
-EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL);
\ No newline at end of file
+EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL);
EFL_OBJECT_OP_FUNC(override_foo, NULL)
);
- return efl_class_functions_set(klass, &ops);
+ return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description _override_class_desc = {
NULL
};
-EFL_DEFINE_CLASS(override_class_get, &_override_class_desc, BASE_CLASS, NULL);
\ No newline at end of file
+EFL_DEFINE_CLASS(override_class_get, &_override_class_desc, BASE_CLASS, NULL);