summaryrefslogtreecommitdiff
path: root/src/lib/efl_mono
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-06-28 10:29:01 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-06-28 10:38:57 -0300
commitb7fa7d48ac9eff4b360e83de4d974a92c84c0291 (patch)
tree91c1ed776686af99a4fb19d816a4f4e5548f84ea /src/lib/efl_mono
parent549c417853f8f934a8fe63cd0c0cb2d4e8e9ff01 (diff)
csharp: make inherited C# classes constructible from native C
Summary: With this commit it is now possible for a class that inherits from a C# binding class to be instantiated from native C code. It only has to provide a constructor that receives an `Efl.Eo.EoWrapper.ConstructingHandle` struct, and which calls the base binding constructor passing it. For example: `private Type(ConstructingHandle ch) : base(ch) {}`. Add some test files to validate the proper behavior of this feature. Add some small fixes in generation contexts in order to properly generate base constructors. Depends on D9070 Test Plan: `meson test` and `make check` Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun, YOhoho Reviewed By: YOhoho Subscribers: YOhoho, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9071
Diffstat (limited to 'src/lib/efl_mono')
-rw-r--r--src/lib/efl_mono/efl_custom_exports_mono.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/efl_mono/efl_custom_exports_mono.c b/src/lib/efl_mono/efl_custom_exports_mono.c
index ad74babe52..8d57ad730f 100644
--- a/src/lib/efl_mono/efl_custom_exports_mono.c
+++ b/src/lib/efl_mono/efl_custom_exports_mono.c
@@ -166,6 +166,16 @@ EAPI Eina_Free_Cb efl_mono_native_efl_unref_addr_get()
166 return (Eina_Free_Cb)efl_mono_thread_safe_efl_unref; 166 return (Eina_Free_Cb)efl_mono_thread_safe_efl_unref;
167} 167}
168 168
169static Eo *_efl_mono_avoid_top_level_constructor_cb(void *data EINA_UNUSED, Eo *obj)
170{
171 return efl_constructor(efl_super(obj, efl_class_get(obj)));
172}
173
174EAPI Efl_Substitute_Ctor_Cb efl_mono_avoid_top_level_constructor_callback_addr_get()
175{
176 return &_efl_mono_avoid_top_level_constructor_cb;
177}
178
169// Iterator Wrapper // 179// Iterator Wrapper //
170 180
171typedef struct _Eina_Iterator_Wrapper_Mono 181typedef struct _Eina_Iterator_Wrapper_Mono