path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-05 19:53:37 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-04-05 19:56:42 -0300
commit1e22db1150049e313bcba7906fc5ffc9a745eaf0 (patch)
tree3dd72d0486e2e03d90e10e5f96554176326aa783 /src/tests/efl_mono/libefl_mono_native_test.c
parentmeson: correctly use the correct dependency (diff)
csharp: Make classes abstract and rework casting
Summary: Abstract Eo classes are now proper C# abstract classes. As a side effect, returning Eo instances from native code was reworked to return instances of their actual Eo classes instead of previous behavior of returning a generic Efl.Object and using static_cast. Instead of `var window = Efl.Ui.Win.static_cast(widget.GetParent());` Use `var window = widget.GetParent() as Efl.Ui.Win;` Another side effect was that `efl_constructor` was removed from the list of supported `Efl.Object` overrides. It is invoked inside `efl_add_internal_start`, before the bindings makes the association of the newly created EoId with the C# instance that created it, making the managed delegate meaningless. C# users then can use regular C# constructors to initialize fields. Also changed to set the private data of C#-inherited classes before the call to constructing methods (aka constructor parameters) so C# classes can override them correctly. Fixes https://phab.enlightenment.org/T7778 Fixes https://phab.enlightenment.org/T7757 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7778, https://phab.enlightenment.org/T7757, https://phab.enlightenment.org/T7702 Differential Revision: https://phab.enlightenment.org/D8550
Diffstat (limited to 'src/tests/efl_mono/libefl_mono_native_test.c')
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 7b4dd1a77f..8575ebac9c 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -45,11 +45,11 @@
# endif
+#include "dummy_test_iface.eo.h"
+#include "dummy_inherit_iface.eo.h"
#include "dummy_numberwrapper.eo.h"
#include "dummy_test_object.eo.h"
#include "dummy_child.eo.h"
-#include "dummy_test_iface.eo.h"
-#include "dummy_inherit_iface.eo.h"
#include "dummy_inherit_helper.eo.h"
#include "dummy_part_holder.eo.h"
@@ -172,6 +172,11 @@ Efl_Object *_dummy_test_object_return_null_object(Eo *obj EINA_UNUSED, EINA_UNUS
return NULL;
+Dummy_Test_Iface *_dummy_test_object_return_iface(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
+ return obj;
void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y)
*y = -x;