aboutsummaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-04-09 11:16:17 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-04-09 11:18:10 -0300
commitdf3b28b0ab650beb5d0fede24b164d2cc9c40ba9 (patch)
tree152db8d873f0d764e6f7700637f8ca7770db286f /src/bindings
parentefl-mono: Fix --enable-mono-beta for tests (diff)
downloadefl-df3b28b0ab650beb5d0fede24b164d2cc9c40ba9.tar.gz
efl-mono: Make override of methods only for methods that are defined by the user
Summary: Instead of overriding every method and making the callback to C, we just override the methods that are found by reflection on the type. Reviewers: bu5hm4n, vitor.sousa, segfaultxavi, woohyun, Jaehyun_Cho, YOhoho, lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8579
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 1aab776f26..f3696606d2 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -302,6 +302,29 @@ public class Globals
return null;
}
+ public static System.Collections.Generic.List<System.Reflection.MethodInfo>
+ GetUserMethods(System.Type type)
+ {
+ var r = new System.Collections.Generic.List<System.Reflection.MethodInfo>();
+ r.AddRange(type.GetMethods());
+ var base_type = type.BaseType;
+
+ for (;base_type != null; base_type = base_type.BaseType)
+ {
+ var attrs = System.Attribute.GetCustomAttributes(type);
+ foreach (var attr in attrs)
+ {
+ if (attr is Efl.Eo.NativeClass)
+ {
+ return r;
+ }
+ }
+
+ r.AddRange(base_type.GetMethods());
+ }
+ return r;
+ }
+
public static byte class_initializer_call(IntPtr klass, System.Type type)
{
Eina.Log.Debug($"called with 0x{klass.ToInt64():x} {type}");