aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-14 20:39:09 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-12-14 20:47:46 -0200
commit9603cc07eb6e04bec8aef6b4facf9865d9b9a479 (patch)
treee230baf664529d2d312b36f59795e027f3def6e7 /src/tests/efl_mono/libefl_mono_native_test.c
parenteolian-cxx: Add parent/extensions information to klass_def (diff)
downloadefl-9603cc07eb6e04bec8aef6b4facf9865d9b9a479.tar.gz
efl-mono: Fix call of virtual methods after new API
Summary: After the new API, the virtual wrapper classes (*NativeInherit) just declared the wrappers for the current class. But as they didn't have any inheritance information, reimplementing methods from a parent Eo class wouldn't work. (e.g. Efl.Ui.Button reimplementing Efl.Object FinalizeAdd). This commit changes these NativeInherit classes to mimic the inheritance chain of their regular/abstract counterparts, reusing the virtual wrapper implementations. In order to access the correct Eo class created, the methods on it were changed from static to instance methods. The instance will be held as a class member of the regular/abstract API class to keep the delegates alive and allow getting C Function pointers from them. The class_initializer method was also split in two. The method collecting the wrapper delegates was extracted in order to call the parent ones. Also avoid exception in cached strings queries as TryGetValue requires non-null keys. Test Plan: Run test suite. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7460
Diffstat (limited to 'src/tests/efl_mono/libefl_mono_native_test.c')
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 52876e6859..841c6a92c6 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -36,6 +36,7 @@
#include "dummy_numberwrapper.eo.h"
#include "dummy_test_object.eo.h"
+#include "dummy_child.eo.h"
#include "dummy_test_iface.eo.h"
#include "dummy_another_iface.eo.h"
@@ -66,6 +67,10 @@ typedef struct Dummy_Numberwrapper_Data
int number;
} Dummy_Numberwrapper_Data;
+typedef struct Dummy_Child_Data
+{
+} Dummy_Child_Data;
+
static
void *_new_int(int v)
@@ -3898,8 +3903,29 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj
return pd->iface_prop;
}
+/// Dummy.Child
+static Efl_Object *
+_dummy_child_efl_object_constructor(Eo *obj, EINA_UNUSED Dummy_Child_Data *pd)
+{
+ efl_constructor(efl_super(obj, DUMMY_CHILD_CLASS));
+ return obj;
+}
+
+EOLIAN static void
+_dummy_child_class_constructor(Efl_Class *klass)
+{
+ (void)klass;
+}
+
+EOLIAN static void
+_dummy_child_class_destructor(Efl_Class *klass)
+{
+ (void)klass;
+}
+
#include "dummy_test_object.eo.c"
#include "dummy_numberwrapper.eo.c"
+#include "dummy_child.eo.c"
#include "dummy_test_iface.eo.c"
#include "dummy_another_iface.eo.c"