tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c8c0bbcfcfd33907e6f8edc253f094d89bd320c5

commit c8c0bbcfcfd33907e6f8edc253f094d89bd320c5
Author: Tom Hacohen <t...@stosb.com>
Date:   Thu Sep 1 14:34:55 2016 +0100

    Efl object: rename EFL_OBJECT_OVERRIDE_OPS_DEFINE.
    
    It is now called EFL_OPS_DEFINE as it's used for general purpose ops
    definition.
---
 src/bin/elementary/test_ui_box.c     |  2 +-
 src/bin/eolian/eo_generator.c        |  2 +-
 src/lib/elementary/efl_ui_grid.c     | 10 ++++++++--
 src/lib/eo/Eo.h                      |  4 ++--
 src/tests/eo/access/access_inherit.c | 12 +++++++++---
 src/tests/eo/access/access_simple.c  | 12 +++++++++---
 src/tests/eo/suite/eo_test_general.c |  6 +++---
 7 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c
index e12438a..44fedfa 100644
--- a/src/bin/elementary/test_ui_box.c
+++ b/src/bin/elementary/test_ui_box.c
@@ -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);
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 3a9c68b..35b0593 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -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\
diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c
index 5c8db37..32d3fb7 100644
--- a/src/lib/elementary/efl_ui_grid.c
+++ b/src/lib/elementary/efl_ui_grid.c
@@ -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 = {
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index f241ca8..58644fe 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -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) }
 
diff --git a/src/tests/eo/access/access_inherit.c 
b/src/tests/eo/access/access_inherit.c
index 2967f3d..2e903db 100644
--- a/src/tests/eo/access/access_inherit.c
+++ b/src/tests/eo/access/access_inherit.c
@@ -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,
diff --git a/src/tests/eo/access/access_simple.c 
b/src/tests/eo/access/access_simple.c
index 52bafcf..27550ce 100644
--- a/src/tests/eo/access/access_simple.c
+++ b/src/tests/eo/access/access_simple.c
@@ -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,
diff --git a/src/tests/eo/suite/eo_test_general.c 
b/src/tests/eo/suite/eo_test_general.c
index 4e2b2b3..e40ad89 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -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));

-- 


Reply via email to