From: Tom Hacohen Date: Mon, 5 Sep 2016 11:31:55 +0000 (+0100) Subject: Adjust the EFL to the Eo class_initilizer changes. X-Git-Tag: upstream/1.20.0~4508^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8ccb191c6cc9d1191306449b20aba1c8eee965a;p=platform%2Fupstream%2Fefl.git Adjust the EFL to the Eo class_initilizer changes. --- diff --git a/src/bin/elementary/test_ui_grid.c b/src/bin/elementary/test_ui_grid.c index cf92f42..ba198c1 100644 --- a/src/bin/elementary/test_ui_grid.c +++ b/src/bin/elementary/test_ui_grid.c @@ -19,13 +19,19 @@ typedef enum { static void _custom_engine_layout_do(Eo *obj, void *pd, Efl_Pack *pack, const void *data); /* Common Efl Class boilerplate. */ -static const Efl_Op_Description custom_engine_op_desc[] = { - EFL_OBJECT_OP_CLASS_FUNC_OVERRIDE(efl_pack_layout_do, _custom_engine_layout_do), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description custom_engine_class_desc = { EO_VERSION, "Custom Layout Engine", EFL_CLASS_TYPE_INTERFACE, - EFL_CLASS_DESCRIPTION_OPS(custom_engine_op_desc), 0, NULL, NULL + 0, _custom_engine_class_initializer, NULL, NULL }; EFL_DEFINE_CLASS(_test_ui_grid_custom_engine_class_get, &custom_engine_class_desc, EFL_PACK_LAYOUT_INTERFACE, NULL) diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index 32d3fb7..cb72cdf 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -177,8 +177,7 @@ _custom_table_initializer(Efl_Class *klass) static const Efl_Class_Description custom_table_class_desc = { EO_VERSION, "Efl.Ui.Grid.Internal", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(custom_table_op_desc), - sizeof(Custom_Table_Data), NULL, NULL + sizeof(Custom_Table_Data), _custom_table_initializer, NULL, NULL }; EFL_DEFINE_CLASS(_efl_ui_grid_custom_table_class_get, &custom_table_class_desc, diff --git a/src/tests/eo/access/access_inherit.c b/src/tests/eo/access/access_inherit.c index 2e903db..7192901 100644 --- a/src/tests/eo/access/access_inherit.c +++ b/src/tests/eo/access/access_inherit.c @@ -32,8 +32,8 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Inherit", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/access/access_simple.c b/src/tests/eo/access/access_simple.c index 27550ce..f296834 100644 --- a/src/tests/eo/access/access_simple.c +++ b/src/tests/eo/access/access_simple.c @@ -46,8 +46,8 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Private_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/children/children_simple.c b/src/tests/eo/children/children_simple.c index 4f4dae9..c5cd9fa 100644 --- a/src/tests/eo/children/children_simple.c +++ b/src/tests/eo/children/children_simple.c @@ -11,9 +11,9 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c index d182835..ee6686d 100644 --- a/src/tests/eo/composite_objects/composite_objects_comp.c +++ b/src/tests/eo/composite_objects/composite_objects_comp.c @@ -36,17 +36,23 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) return obj; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), - EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _a_get), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Comp", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/composite_objects/composite_objects_simple.c b/src/tests/eo/composite_objects/composite_objects_simple.c index ea627dd..a377af3 100644 --- a/src/tests/eo/composite_objects/composite_objects_simple.c +++ b/src/tests/eo/composite_objects/composite_objects_simple.c @@ -95,85 +95,92 @@ EAPI EFL_VOID_FUNC_BODYV(simple_a_get30, EFL_FUNC_CALL(a), int a); EAPI EFL_VOID_FUNC_BODYV(simple_a_get31, EFL_FUNC_CALL(a), int a); EAPI EFL_VOID_FUNC_BODYV(simple_a_get32, EFL_FUNC_CALL(a), int a); -/* XXX: This is fragile, and emulates many IDs in order to go to the next - * op id chain (assuming chain size is as it is at the moment, 32). - * This is needed in order to properly test some edge cases (see commit message - * for more info). */ -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(simple_a_set1, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set2, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set3, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set4, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set5, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set6, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set7, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set8, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set9, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set10, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set11, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set12, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set13, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set14, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set15, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set16, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set17, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set18, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set19, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set20, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set21, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set22, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set23, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set24, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set25, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set26, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set27, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set28, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set29, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set30, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set31, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_set32, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_get1, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get2, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get3, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get4, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get5, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get6, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get7, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get8, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get9, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get10, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get11, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get12, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get13, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get14, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get15, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get16, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get17, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get18, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get19, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get20, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get21, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get22, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get23, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get24, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get25, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get26, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get27, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get28, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get29, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get30, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get31, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_get32, _a_get), - EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), -}; + +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + /* XXX: This is fragile, and emulates many IDs in order to go to the next + * op id chain (assuming chain size is as it is at the moment, 32). + * This is needed in order to properly test some edge cases (see commit message + * for more info). */ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(simple_a_set1, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set2, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set3, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set4, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set5, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set6, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set7, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set8, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set9, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set10, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set11, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set12, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set13, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set14, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set15, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set16, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set17, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set18, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set19, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set20, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set21, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set22, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set23, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set24, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set25, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set26, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set27, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set28, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set29, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set30, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set31, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_set32, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_get1, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get2, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get3, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get4, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get5, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get6, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get7, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get8, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get9, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get10, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get11, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get12, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get13, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get14, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get15, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get16, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get17, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get18, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get19, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get20, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get21, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get22, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get23, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get24, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get25, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get26, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get27, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get28, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get29, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get30, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get31, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_get32, _a_get), + EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Simple_Public_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_mixin.c b/src/tests/eo/constructors/constructors_mixin.c index e193d9e..a68c10b 100644 --- a/src/tests/eo/constructors/constructors_mixin.c +++ b/src/tests/eo/constructors/constructors_mixin.c @@ -37,18 +37,24 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED) EAPI EFL_VOID_FUNC_BODYV(mixin_add_and_print, EFL_FUNC_CALL(x), int x); -static Efl_Op_Description op_descs[] = { - 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), -}; +static Eina_Bool +_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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Mixin", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple.c b/src/tests/eo/constructors/constructors_simple.c index a6c992a..62d47d2 100644 --- a/src/tests/eo/constructors/constructors_simple.c +++ b/src/tests/eo/constructors/constructors_simple.c @@ -85,22 +85,28 @@ _class_destructor(Efl_Class *klass EINA_UNUSED) EFL_VOID_FUNC_BODYV(simple_constructor, EFL_FUNC_CALL(a), int a); -static Efl_Op_Description op_descs[] = { - 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(simple_a_set, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_get, _a_get), - EFL_OBJECT_OP_FUNC(simple_b_set, _b_set), +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(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), -}; + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Private_Data), + _class_initializer, _class_constructor, _class_destructor }; diff --git a/src/tests/eo/constructors/constructors_simple2.c b/src/tests/eo/constructors/constructors_simple2.c index 9dc6859..e97b95f 100644 --- a/src/tests/eo/constructors/constructors_simple2.c +++ b/src/tests/eo/constructors/constructors_simple2.c @@ -16,16 +16,22 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) return NULL; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple3.c b/src/tests/eo/constructors/constructors_simple3.c index 528efb2..8e7bdc5 100644 --- a/src/tests/eo/constructors/constructors_simple3.c +++ b/src/tests/eo/constructors/constructors_simple3.c @@ -14,16 +14,22 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) return obj; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple3", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple4.c b/src/tests/eo/constructors/constructors_simple4.c index 83e27ce..177c199 100644 --- a/src/tests/eo/constructors/constructors_simple4.c +++ b/src/tests/eo/constructors/constructors_simple4.c @@ -13,9 +13,9 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Simple4", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple5.c b/src/tests/eo/constructors/constructors_simple5.c index 280b335..86d9167 100644 --- a/src/tests/eo/constructors/constructors_simple5.c +++ b/src/tests/eo/constructors/constructors_simple5.c @@ -14,16 +14,22 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) (void) obj; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple5", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple6.c b/src/tests/eo/constructors/constructors_simple6.c index 92825d3..ffe9909 100644 --- a/src/tests/eo/constructors/constructors_simple6.c +++ b/src/tests/eo/constructors/constructors_simple6.c @@ -14,16 +14,22 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED) efl_destructor(efl_super(obj, MY_CLASS)); } -static Efl_Op_Description op_descs [] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple6", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/constructors/constructors_simple7.c b/src/tests/eo/constructors/constructors_simple7.c index c4bfaf6..815b974 100644 --- a/src/tests/eo/constructors/constructors_simple7.c +++ b/src/tests/eo/constructors/constructors_simple7.c @@ -18,16 +18,22 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) return efl_constructor(efl_super(obj, MY_CLASS)); } -static Efl_Op_Description op_descs [] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple7", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/function_overrides/function_overrides_inherit.c b/src/tests/eo/function_overrides/function_overrides_inherit.c index de17dfb..d93e383 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit.c @@ -12,9 +12,9 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Inherit", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/function_overrides/function_overrides_inherit2.c b/src/tests/eo/function_overrides/function_overrides_inherit2.c index c962d8a..0211a8c 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit2.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit2.c @@ -59,19 +59,25 @@ _class_print(Efl_Class *klass, void *data EINA_UNUSED) EAPI EFL_FUNC_BODY(inherit2_print, Eina_Bool, EINA_FALSE); EAPI EFL_FUNC_BODY(inherit2_print2, Eina_Bool, EINA_FALSE); -static Efl_Op_Description op_descs[] = { - 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), -}; +static Eina_Bool +_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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Inherit2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/function_overrides/function_overrides_inherit3.c b/src/tests/eo/function_overrides/function_overrides_inherit3.c index 38dd470..1043a2a 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit3.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit3.c @@ -16,16 +16,22 @@ _a_set(Eo *obj, void *class_data EINA_UNUSED, int a) simple_a_set(efl_super(obj, MY_CLASS), a + 1); } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _a_set), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _a_set), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Inherit3", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/function_overrides/function_overrides_simple.c b/src/tests/eo/function_overrides/function_overrides_simple.c index 7b3ef7a..9477e7d 100644 --- a/src/tests/eo/function_overrides/function_overrides_simple.c +++ b/src/tests/eo/function_overrides/function_overrides_simple.c @@ -56,19 +56,25 @@ EAPI EFL_FUNC_BODY(simple_a_print, Eina_Bool, EINA_FALSE); EAPI EFL_FUNC_BODY_CONST(simple_class_print, Eina_Bool, EINA_FALSE); EAPI EFL_FUNC_BODY_CONST(simple_class_print2, Eina_Bool, EINA_FALSE); -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), - EFL_OBJECT_OP_FUNC(simple_a_print, _a_print), - EFL_OBJECT_OP_FUNC(simple_class_print, _class_print), - EFL_OBJECT_OP_FUNC(simple_class_print2, _class_print2), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(simple_a_set, _a_set), + EFL_OBJECT_OP_FUNC(simple_a_print, _a_print), + EFL_OBJECT_OP_FUNC(simple_class_print, _class_print), + EFL_OBJECT_OP_FUNC(simple_class_print2, _class_print2), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Simple_Public_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/interface/interface_interface.c b/src/tests/eo/interface/interface_interface.c index 8358bcc..deac3af 100644 --- a/src/tests/eo/interface/interface_interface.c +++ b/src/tests/eo/interface/interface_interface.c @@ -10,16 +10,22 @@ EFL_FUNC_BODY(interface_ab_sum_get, int, 0); -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(interface_ab_sum_get, NULL), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(interface_ab_sum_get, NULL), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Interface", EFL_CLASS_TYPE_INTERFACE, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/interface/interface_interface2.c b/src/tests/eo/interface/interface_interface2.c index b4c2f9d..6cbc0b8 100644 --- a/src/tests/eo/interface/interface_interface2.c +++ b/src/tests/eo/interface/interface_interface2.c @@ -11,16 +11,22 @@ EFL_FUNC_BODY(interface2_ab_sum_get2, int, 0); -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, NULL), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, NULL), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Interface2", EFL_CLASS_TYPE_INTERFACE, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/interface/interface_simple.c b/src/tests/eo/interface/interface_simple.c index a1e03d8..433de5c 100644 --- a/src/tests/eo/interface/interface_simple.c +++ b/src/tests/eo/interface/interface_simple.c @@ -56,21 +56,27 @@ _ab_sum_get2(Eo *obj, void *class_data EINA_UNUSED) return a + b + 1; } -static Efl_Op_Description op_descs[] = { - 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_OVERRIDE(interface_ab_sum_get, _ab_sum_get), - EFL_OBJECT_OP_FUNC_OVERRIDE(interface2_ab_sum_get2, _ab_sum_get2), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + 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_OVERRIDE(interface_ab_sum_get, _ab_sum_get), + EFL_OBJECT_OP_FUNC_OVERRIDE(interface2_ab_sum_get2, _ab_sum_get2), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Private_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_inherit.c b/src/tests/eo/mixin/mixin_inherit.c index afabf6f..5c4503f 100644 --- a/src/tests/eo/mixin/mixin_inherit.c +++ b/src/tests/eo/mixin/mixin_inherit.c @@ -19,16 +19,22 @@ _a_get(Eo *obj, void *class_data EINA_UNUSED) return ret; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _a_get), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_get, _a_get), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Inherit", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_mixin.c b/src/tests/eo/mixin/mixin_mixin.c index 4373c5c..e5ac3af 100644 --- a/src/tests/eo/mixin/mixin_mixin.c +++ b/src/tests/eo/mixin/mixin_mixin.c @@ -32,18 +32,24 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED) EAPI EFL_FUNC_BODY(mixin_ab_sum_get, int, 0); -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor), - EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get), -}; +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(mixin_ab_sum_get, _ab_sum_get), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Mixin", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_mixin2.c b/src/tests/eo/mixin/mixin_mixin2.c index 71f6b0b..38547da 100644 --- a/src/tests/eo/mixin/mixin_mixin2.c +++ b/src/tests/eo/mixin/mixin_mixin2.c @@ -46,18 +46,24 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) efl_destructor(efl_super(obj, MY_CLASS)); } -static Efl_Op_Description op_descs[] = { - 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), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Mixin2", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Mixin2_Public_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_mixin3.c b/src/tests/eo/mixin/mixin_mixin3.c index d013372..21da5d0 100644 --- a/src/tests/eo/mixin/mixin_mixin3.c +++ b/src/tests/eo/mixin/mixin_mixin3.c @@ -45,18 +45,24 @@ _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) efl_destructor(efl_super(obj, MY_CLASS)); } -static Efl_Op_Description op_descs[] = { - 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), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Mixin3", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Mixin3_Public_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_mixin4.c b/src/tests/eo/mixin/mixin_mixin4.c index ff2757d..da0f98c 100644 --- a/src/tests/eo/mixin/mixin_mixin4.c +++ b/src/tests/eo/mixin/mixin_mixin4.c @@ -15,9 +15,9 @@ static const Efl_Class_Description class_desc = { EO_VERSION, "Mixin4", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/mixin/mixin_simple.c b/src/tests/eo/mixin/mixin_simple.c index d2f2d41..8322d31 100644 --- a/src/tests/eo/mixin/mixin_simple.c +++ b/src/tests/eo/mixin/mixin_simple.c @@ -37,19 +37,25 @@ EFL_FUNC_BODY(simple_##name##_get, int, 0); _GET_SET_FUNC(a) _GET_SET_FUNC(b) -static Efl_Op_Description op_descs[] = { - 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), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + 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), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Private_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/signals/signals_simple.c b/src/tests/eo/signals/signals_simple.c index 74b569b..3cd4d94 100644 --- a/src/tests/eo/signals/signals_simple.c +++ b/src/tests/eo/signals/signals_simple.c @@ -71,17 +71,23 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) EAPI EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a); -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _constructor), - 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_OVERRIDE(efl_constructor, _constructor), + 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, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Private_Data), + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_class_behaviour_errors.c b/src/tests/eo/suite/eo_test_class_behaviour_errors.c index 678cce6..fc443fb 100644 --- a/src/tests/eo/suite/eo_test_class_behaviour_errors.c +++ b/src/tests/eo/suite/eo_test_class_behaviour_errors.c @@ -22,21 +22,27 @@ static void _destructor_unref(Eo *obj, void *class_data EINA_UNUSED) efl_unref(obj); } +static Eina_Bool +_destructor_unref_class_initializer(Efl_Class *klass2) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor_unref), + ); + + return efl_class_functions_set(klass2, &ops); +} + START_TEST(efl_destructor_unref) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); - static Efl_Op_Description op_descs [] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _destructor_unref), - }; - static Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _destructor_unref_class_initializer, NULL, NULL }; @@ -65,9 +71,9 @@ START_TEST(efl_destructor_double_del) EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_class_errors.c b/src/tests/eo/suite/eo_test_class_errors.c index a63d9f5..89ad49b 100644 --- a/src/tests/eo/suite/eo_test_class_errors.c +++ b/src/tests/eo/suite/eo_test_class_errors.c @@ -25,9 +25,9 @@ START_TEST(eo_inherit_errors) EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -35,9 +35,9 @@ START_TEST(eo_inherit_errors) EO_VERSION, "Mixin", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -45,9 +45,9 @@ START_TEST(eo_inherit_errors) EO_VERSION, "General", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -90,9 +90,9 @@ START_TEST(eo_inconsistent_mro) EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -100,9 +100,9 @@ START_TEST(eo_inconsistent_mro) EO_VERSION, "Mixin", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -110,9 +110,9 @@ START_TEST(eo_inconsistent_mro) EO_VERSION, "Mixin2", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -120,9 +120,9 @@ START_TEST(eo_inconsistent_mro) EO_VERSION, "Mixin3", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -165,9 +165,9 @@ START_TEST(eo_bad_interface) EO_VERSION, "Interface", EFL_CLASS_TYPE_INTERFACE, - EFL_CLASS_DESCRIPTION_NOOPS(), 10, NULL, + NULL, NULL }; @@ -202,6 +202,16 @@ END_TEST static void _null_fct(Eo *eo_obj EINA_UNUSED, void *d EINA_UNUSED) { } void null_fct (void) {} +static Eina_Bool +_null_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(NULL, _null_fct), + ); + + return efl_class_functions_set(klass, &ops); +} + START_TEST(eo_null_api) { efl_object_init(); @@ -209,15 +219,12 @@ START_TEST(eo_null_api) const Efl_Class *klass; - static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(NULL, _null_fct), - }; static Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _null_class_initializer, NULL, NULL }; @@ -233,21 +240,28 @@ 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_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(null_fct, _null_fct), - }; static Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _wrong_override_class_initializer, NULL, NULL }; @@ -259,6 +273,17 @@ START_TEST(eo_wrong_override) } END_TEST +static Eina_Bool +_redefined_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(null_fct, _null_fct), + EFL_OBJECT_OP_FUNC(null_fct, NULL), + ); + + return efl_class_functions_set(klass, &ops); +} + START_TEST(eo_api_redefined) { efl_object_init(); @@ -266,16 +291,12 @@ START_TEST(eo_api_redefined) const Efl_Class *klass; - static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(null_fct, _null_fct), - EFL_OBJECT_OP_FUNC(null_fct, NULL), - }; static Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _redefined_class_initializer, NULL, NULL }; @@ -291,6 +312,17 @@ START_TEST(eo_api_redefined) } END_TEST +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), + ); + + return efl_class_functions_set(klass, &ops); +} + START_TEST(eo_dich_func_override) { efl_object_init(); @@ -298,16 +330,12 @@ START_TEST(eo_dich_func_override) const Efl_Class *klass; - static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, _null_fct), - EFL_OBJECT_OP_FUNC_OVERRIDE(simple_a_set, NULL), - }; static Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _dich_func_class_initializer, NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c index 6bbeda5..56d424c 100644 --- a/src/tests/eo/suite/eo_test_class_simple.c +++ b/src/tests/eo/suite/eo_test_class_simple.c @@ -88,23 +88,29 @@ 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); -static Efl_Op_Description op_descs[] = { - 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_OVERRIDE(efl_dbg_info_get, _dbg_info_get), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + 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_OVERRIDE(efl_dbg_info_get, _dbg_info_get), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Simple_Public_Data), + _class_initializer, NULL, NULL }; @@ -120,16 +126,22 @@ _beef_get(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) EFL_FUNC_BODY_CONST(simple2_class_beef_get, int, 0); -static Efl_Op_Description op_descs2[] = { - EFL_OBJECT_OP_CLASS_FUNC(simple2_class_beef_get, _beef_get), -}; +static Eina_Bool +_class_initializer2(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_CLASS_FUNC(simple2_class_beef_get, _beef_get), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc2 = { EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs2), 0, + _class_initializer2, NULL, NULL }; @@ -144,16 +156,22 @@ _interface_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const Efl_Object *klas return efl_provider_find(efl_super(obj, SEARCHABLE_CLASS), klass); } -static Efl_Op_Description op_descs_searchable[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_provider_find, _interface_get) -}; +static Eina_Bool +_searchable_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_provider_find, _interface_get) + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc_searchable = { EO_VERSION, "Searchable", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs_searchable), 0, + _searchable_class_initializer, NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_class_singleton.c b/src/tests/eo/suite/eo_test_class_singleton.c index b0a2304..2702d68 100644 --- a/src/tests/eo/suite/eo_test_class_singleton.c +++ b/src/tests/eo/suite/eo_test_class_singleton.c @@ -25,16 +25,22 @@ _singleton_efl_constructor(Eo *eo_obj EINA_UNUSED, void *_pd EINA_UNUSED) return singleton_obj; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _singleton_efl_constructor), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _singleton_efl_constructor), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Singleton", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 0, + _class_initializer, NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index e40ad89..9d072dc 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -268,9 +268,9 @@ START_TEST(efl_data_fetch) EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 10, NULL, + NULL, NULL }; @@ -310,9 +310,9 @@ START_TEST(efl_isa_tests) EO_VERSION, "Iface", EFL_CLASS_TYPE_INTERFACE, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -326,9 +326,9 @@ START_TEST(efl_isa_tests) EO_VERSION, "Mixin", EFL_CLASS_TYPE_MIXIN, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -342,9 +342,9 @@ START_TEST(efl_isa_tests) EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 10, NULL, + NULL, NULL }; @@ -427,10 +427,16 @@ _man_des(Eo *obj, void *data EINA_UNUSED, va_list *list EINA_UNUSED) efl_manual_free_set(obj, EINA_FALSE); } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_constructor, _man_con), - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_destructor, _man_des), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} START_TEST(eo_man_free) { @@ -441,8 +447,8 @@ START_TEST(eo_man_free) EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), 10, + _class_initializer, NULL, NULL }; @@ -975,10 +981,16 @@ _class_hi_print(Efl_Class *klass EINA_UNUSED, void *class_data EINA_UNUSED) EFL_FUNC_BODY(multi_a_print, Eina_Bool, EINA_FALSE); EFL_FUNC_BODY_CONST(multi_class_hi_print, Eina_Bool, EINA_FALSE); -static Efl_Op_Description _multi_do_op_descs[] = { - EFL_OBJECT_OP_FUNC(multi_a_print, _a_print), - EFL_OBJECT_OP_FUNC(multi_class_hi_print, _class_hi_print), -}; +static Eina_Bool +_multi_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(multi_a_print, _a_print), + EFL_OBJECT_OP_FUNC(multi_class_hi_print, _class_hi_print), + ); + + return efl_class_functions_set(klass, &ops); +} START_TEST(eo_multiple_do) { @@ -989,8 +1001,8 @@ START_TEST(eo_multiple_do) EO_VERSION, "Inherit", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(_multi_do_op_descs), 0, + _multi_class_initializer, NULL, NULL }; @@ -1064,9 +1076,9 @@ START_TEST(eo_pointers_indirection) EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; @@ -1149,9 +1161,15 @@ _efl_add_failures_finalize(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED) return NULL; } -static Efl_Op_Description _efl_add_failures_op_descs[] = { - EFL_OBJECT_OP_FUNC_OVERRIDE(efl_finalize, _efl_add_failures_finalize), -}; +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), + ); + + return efl_class_functions_set(klass, &ops); +} START_TEST(efl_add_failures) { @@ -1161,8 +1179,8 @@ START_TEST(efl_add_failures) EO_VERSION, "Simple2", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(_efl_add_failures_op_descs), 0, + _add_failures_class_initializer, NULL, NULL }; @@ -1198,9 +1216,9 @@ START_TEST(efl_del_intercept) EO_VERSION, "Simple", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_NOOPS(), 0, NULL, + NULL, NULL }; diff --git a/src/tests/eo/suite/eo_test_threaded_calls.c b/src/tests/eo/suite/eo_test_threaded_calls.c index 935a316..31b3102 100644 --- a/src/tests/eo/suite/eo_test_threaded_calls.c +++ b/src/tests/eo/suite/eo_test_threaded_calls.c @@ -60,18 +60,24 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED, int v) return obj; } -static Efl_Op_Description op_descs[] = { - EFL_OBJECT_OP_FUNC(thread_test_constructor, _constructor), - EFL_OBJECT_OP_FUNC(thread_test_v_get, _v_get), - EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack), -}; +static Eina_Bool +_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(thread_test_constructor, _constructor), + EFL_OBJECT_OP_FUNC(thread_test_v_get, _v_get), + EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack), + ); + + return efl_class_functions_set(klass, &ops); +} static const Efl_Class_Description class_desc = { EO_VERSION, "Thread Test", EFL_CLASS_TYPE_REGULAR, - EFL_CLASS_DESCRIPTION_OPS(op_descs), sizeof(Thread_Test_Public_Data), + _class_initializer, NULL, NULL };