Efl object: rename EFL_OBJECT_OVERRIDE_OPS_DEFINE.

It is now called EFL_OPS_DEFINE as it's used for general purpose ops
definition.
This commit is contained in:
Tom Hacohen 2016-09-01 14:34:55 +01:00
parent 48f7eb02a8
commit c8c0bbcfcf
7 changed files with 33 additions and 15 deletions

View File

@ -177,7 +177,7 @@ _custom_layout_update(Eo *pack, const void *data EINA_UNUSED)
static void
custom_check_cb(void *data, const Efl_Event *event)
{
EFL_OBJECT_OVERRIDE_OPS_DEFINE(custom_layout_ops,
EFL_OPS_DEFINE(custom_layout_ops,
EFL_OBJECT_OP_FUNC_OVERRIDE(efl_pack_layout_update, _custom_layout_update));
Eina_Bool chk = elm_check_selected_get(event->object);

View File

@ -22,7 +22,7 @@ tmpl_eo_ops_desc[] = "\
static Eina_Bool\n\
_@#class_class_initializer(Efl_Class *klass)\n\
{\n\
EFL_OBJECT_OVERRIDE_OPS_DEFINE(ops,@#list_op\n\
EFL_OPS_DEFINE(ops,@#list_op\n\
);\n\
\n\
return efl_class_functions_set(klass, &ops);\n\

View File

@ -165,8 +165,14 @@ _table_size_hints_changed(void *data, Evas *e EINA_UNUSED,
/* Custom table class: overrides smart_calculate. */
static void _custom_table_calc(Eo *obj, Custom_Table_Data *pd);
static const Efl_Op_Description custom_table_op_desc[] = {
EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(efl_canvas_group_calculate, _custom_table_calc),
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)
);
return efl_class_functions_set(klass, &ops);
};
static const Efl_Class_Description custom_table_class_desc = {

View File

@ -466,13 +466,13 @@ EAPI Eina_Bool efl_object_override(Eo *obj, const Efl_Object_Ops *ops);
*
* This can be used as follows:
* @code
* EFL_OBJECT_OVERRIDE_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC_OVERRIDE(public_func, _my_func));
* EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC_OVERRIDE(public_func, _my_func));
* efl_object_override(obj, &ops);
* @endcode
*
* @see efl_object_override
*/
#define EFL_OBJECT_OVERRIDE_OPS_DEFINE(ops, ...) \
#define EFL_OPS_DEFINE(ops, ...) \
const Efl_Op_Description _##ops##_descs[] = { __VA_ARGS__ }; \
const Efl_Object_Ops ops = { _##ops##_descs, EINA_C_ARRAY_LENGTH(_##ops##_descs) }

View File

@ -18,9 +18,15 @@ _prot_print(Eo *obj, void *class_data EINA_UNUSED)
EAPI EFL_VOID_FUNC_BODY(inherit_prot_print);
static Efl_Op_Description op_descs[] = {
EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print),
};
static Eina_Bool
_class_initializer(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print),
);
return efl_class_functions_set(klass, &ops);
}
static const Efl_Class_Description class_desc = {
EO_VERSION,

View File

@ -32,9 +32,15 @@ _a_set(Eo *obj, void *class_data, int a)
EAPI EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a);
static Efl_Op_Description op_descs[] = {
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
};
static Eina_Bool
_class_initializer(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
);
return efl_class_functions_set(klass, &ops);
}
static const Efl_Class_Description class_desc = {
EO_VERSION,

View File

@ -73,7 +73,7 @@ START_TEST(efl_object_override_tests)
* make sure we don't cache. */
ck_assert_int_eq(simple_a_get(obj), 0);
EFL_OBJECT_OVERRIDE_OPS_DEFINE(
EFL_OPS_DEFINE(
overrides,
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _simple_obj_override_a_get));
fail_if(!efl_object_override(obj, &overrides));
@ -85,7 +85,7 @@ START_TEST(efl_object_override_tests)
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A + OVERRIDE_A_SIMPLE);
/* Override again. */
EFL_OBJECT_OVERRIDE_OPS_DEFINE(
EFL_OPS_DEFINE(
overrides2,
EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _simple_obj_override_a_double_set));
fail_if(!efl_object_override(obj, NULL));
@ -99,7 +99,7 @@ START_TEST(efl_object_override_tests)
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A_SIMPLE * 2);
/* Try introducing a new function */
EFL_OBJECT_OVERRIDE_OPS_DEFINE(
EFL_OPS_DEFINE(
overrides3,
EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
fail_if(!efl_object_override(obj, NULL));