summaryrefslogtreecommitdiff
path: root/src/bin
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/bin
parentb1f0031b55b356f9722ee643844fd055653c9678 (diff)
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/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_registration.hh7
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh
index 5898af9c27..fc044e6b72 100644
--- a/src/bin/eolian_mono/eolian/mono/function_registration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh
@@ -44,7 +44,10 @@ struct function_registration_generator
44 return false; 44 return false;
45 45
46 if(!as_generator 46 if(!as_generator
47 (scope_tab << scope_tab << "descs.Add(new Efl_Op_Description() {" 47 (scope_tab << scope_tab
48 << "if (methods.FirstOrDefault(m => m.Name == \"" << string << "\") != null)\n"
49 << scope_tab << scope_tab << scope_tab
50 << "descs.Add(new Efl_Op_Description() {"
48#ifdef _WIN32 51#ifdef _WIN32
49 << "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")" 52 << "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")"
50#else 53#else
@@ -52,7 +55,7 @@ struct function_registration_generator
52#endif 55#endif
53 << ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n" 56 << ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n"
54 ) 57 )
55 .generate(sink, std::make_tuple(f.c_name, f.c_name), context)) 58 .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.c_name, f.c_name), context))
56 return false; 59 return false;
57 return true; 60 return true;
58 } 61 }
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index e34a126321..87ad1bd5a7 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -369,6 +369,7 @@ struct klass
369 << scope_tab << "public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)\n" 369 << scope_tab << "public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)\n"
370 << scope_tab << "{\n" 370 << scope_tab << "{\n"
371 << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List<Efl_Op_Description>();\n" 371 << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List<Efl_Op_Description>();\n"
372 << scope_tab << scope_tab << "var methods = Efl.Eo.Globals.GetUserMethods(type);\n"
372 ) 373 )
373 .generate(sink, attributes::unused, inative_cxt)) 374 .generate(sink, attributes::unused, inative_cxt))
374 return false; 375 return false;