summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-15 10:11:09 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-15 10:11:09 -0300
commit31bc3beb222b0c36b5a5ffb84beebd8e761dbdc2 (patch)
tree4b7e6bb6443ba9d5ae3af8922fa4bd13cd2cc8d0 /src/bindings/mono/eo_mono
parent64e22aaadad980d65e2bb2531374b399f0c876f8 (diff)
csharp: Avoid direct usage of some dllimport funcs
Summary: Instead of accessing them directly, generated code should access them only through proper managed wrappers. JIT should take care of inline them. This would allow D10338 without depending on the friendly assembly feature. Reviewers: YOhoho, felipealmeida, brunobelo, woohyun, segfaultxavi Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10366
Diffstat (limited to 'src/bindings/mono/eo_mono')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 8fe4b06..ae39b61 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -188,9 +188,37 @@ public class Globals
188 public delegate IntPtr efl_data_scope_get_delegate(IntPtr obj, IntPtr klass); 188 public delegate IntPtr efl_data_scope_get_delegate(IntPtr obj, IntPtr klass);
189 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_data_scope_get(IntPtr obj, IntPtr klass); 189 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_data_scope_get(IntPtr obj, IntPtr klass);
190 public delegate IntPtr efl_super_delegate(IntPtr obj, IntPtr klass); 190 public delegate IntPtr efl_super_delegate(IntPtr obj, IntPtr klass);
191
192 /// <summary>Gets a native pointer to <c>obj</c> that forwards the method call to its parent
193 /// implementation.
194 ///
195 /// <para>For generated code use only.</para>
196 /// <para>Since EFL 1.23.</para>
197 /// </summary>
198 /// <param name="obj">The native pointer to be prepared.</param>
199 /// <param name="klass">The current class.</param>
200 /// <returns>The native pointer to <c>obj</c> prepared to call the parent implementation of <c>klass</c>.</returns>
201 public static IntPtr Super(IntPtr obj, IntPtr klass)
202 {
203 return efl_super(obj, klass);
204 }
205
191 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_super(IntPtr obj, IntPtr klass); 206 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_super(IntPtr obj, IntPtr klass);
192 public delegate IntPtr efl_class_get_delegate(IntPtr obj); 207 public delegate IntPtr efl_class_get_delegate(IntPtr obj);
193 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_get(IntPtr obj); 208 [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_get(IntPtr obj);
209
210 /// <summary>Gets the native EO class pointer for the given object.
211 /// <para>For generated code use only.</para>
212 /// <para>Since EFL 1.23.</para>
213 /// </summary>
214 /// <param name="obj">The native pointer to the <see cref="Efl.Object" /> instance to get the native class
215 /// from.</param>
216 /// <returns>The native class pointer or <see cref="IntPtr.Zero" /> if no such class existis.</returns>
217 public static IntPtr GetClass(IntPtr obj)
218 {
219 return efl_class_get(obj);
220 }
221
194 [DllImport(efl.Libs.Eo)] public static extern EflClassType efl_class_type_get(IntPtr klass); 222 [DllImport(efl.Libs.Eo)] public static extern EflClassType efl_class_type_get(IntPtr klass);
195 public delegate IntPtr dlerror_delegate(); 223 public delegate IntPtr dlerror_delegate();
196 [DllImport(efl.Libs.Evil)] public static extern IntPtr dlerror(); 224 [DllImport(efl.Libs.Evil)] public static extern IntPtr dlerror();
@@ -208,6 +236,20 @@ public class Globals
208 [DllImport(efl.Libs.Eo)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool 236 [DllImport(efl.Libs.Eo)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool
209 efl_event_callback_call(IntPtr obj, IntPtr desc, IntPtr event_info); 237 efl_event_callback_call(IntPtr obj, IntPtr desc, IntPtr event_info);
210 238
239 /// <summary>Calls the callbacks associated to an event.
240 /// <para>For generated code use only.</para>
241 /// <para>Since EFL 1.23.</para>
242 /// </summary>
243 /// <param name="obj">The native pointer to the <see cref="Efl.Object" /> instance that will be the emitter
244 /// of the event.</param>
245 /// <param name="desc">The native event description.</param>
246 /// <param name="event_info">The native payload of the event.</param>
247 /// <returns><c>false</c> if one of the callbacks aborted the call. <c>true</c> otherwise.</returns>
248 public static bool CallEventCallback(IntPtr obj, IntPtr desc, IntPtr event_info)
249 {
250 return efl_event_callback_call(obj, desc, event_info);
251 }
252
211 public const int RTLD_NOW = 2; 253 public const int RTLD_NOW = 2;
212 254
213 public delegate byte class_initializer(IntPtr klass); 255 public delegate byte class_initializer(IntPtr klass);