summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-10 16:57:00 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-13 16:59:59 +0100
commit46885653bc0467f88042bb110fdc973b2258f69c (patch)
treec716b93474cbc0847c1e082298ae7314a0f16b26 /src/lib/eo
parent37d2d378ec2e2d1f9a3941372ef4d818996291c7 (diff)
eo: remove class functions from eo
As in the previous commit explained, we want to get rid of class functions in eo, and make them just c functions right away. This commit removes the class parameter from the eo_class_function_set call, and adjusts the tests to not depend on class functions anymore. Class functions are now not tested anymore, tests that used them as a way to test *things* are adjusted to test them now with object functions, tests that just tested the working of class functions are dropped. This fixes T7675. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7902
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/Eo.h2
-rw-r--r--src/lib/eo/eo.c11
2 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 2fd2c1b7e8..df5dc338e0 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -897,7 +897,7 @@ EAPI const Efl_Class *efl_class_new(const Efl_Class_Description *desc, const Efl
897 * efl_property_reflection_set() or efl_property_reflection_get() is called. 897 * efl_property_reflection_set() or efl_property_reflection_get() is called.
898 * @see #EFL_DEFINE_CLASS 898 * @see #EFL_DEFINE_CLASS
899 */ 899 */
900EAPI 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); 900EAPI 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);
901 901
902/** 902/**
903 * @brief Override Eo functions of this object. 903 * @brief Override Eo functions of this object.
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 95823f7a08..0611643546 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -819,7 +819,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
819} 819}
820 820
821EAPI Eina_Bool 821EAPI Eina_Bool
822efl_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) 822efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table)
823{ 823{
824 EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass); 824 EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass);
825 Efl_Object_Ops empty_ops = { 0 }; 825 Efl_Object_Ops empty_ops = { 0 };
@@ -830,11 +830,9 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_
830 830
831 if (!object_ops) object_ops = &empty_ops; 831 if (!object_ops) object_ops = &empty_ops;
832 832
833 if (!class_ops) class_ops = &empty_ops;
834
835 klass->reflection = reflection_table; 833 klass->reflection = reflection_table;
836 834
837 klass->ops_count = object_ops->count + class_ops->count; 835 klass->ops_count = object_ops->count;
838 836
839 klass->base_id = _eo_ops_last_id; 837 klass->base_id = _eo_ops_last_id;
840 _eo_ops_last_id += klass->ops_count + 1; 838 _eo_ops_last_id += klass->ops_count + 1;
@@ -851,8 +849,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_
851 _vtable_copy_all(&klass->vtable, &(*mro_itr)->vtable); 849 _vtable_copy_all(&klass->vtable, &(*mro_itr)->vtable);
852 } 850 }
853 851
854 return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE) && 852 return _eo_class_funcs_set(&klass->vtable, object_ops, klass, klass, 0, EINA_FALSE);
855 _eo_class_funcs_set(&klass->vtable, class_ops, klass, klass, object_ops->count, EINA_FALSE);
856 853
857err_funcs: 854err_funcs:
858 ERR("Class %s already had its functions set..", klass->desc->name); 855 ERR("Class %s already had its functions set..", klass->desc->name);
@@ -1693,7 +1690,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
1693 /* If functions haven't been set, invoke it with an empty ops structure. */ 1690 /* If functions haven't been set, invoke it with an empty ops structure. */
1694 if (!klass->functions_set) 1691 if (!klass->functions_set)
1695 { 1692 {
1696 efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL, NULL); 1693 efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL);
1697 } 1694 }
1698 1695
1699 /* Mark which classes we implement */ 1696 /* Mark which classes we implement */