summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/function_registration.hh
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-17 21:33:09 +0900
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-17 21:36:27 +0900
commitadc2e674af528c01ca5bb11d56edc475bce5cc4d (patch)
tree670312a6280387fbba6c25eeea23ea10beb22dfe /src/bin/eolian_mono/eolian/mono/function_registration.hh
parent7b342e8fddaff50dd62354f357a3d249afc77498 (diff)
eolian-mono: Add interface registration to inherited classes
Summary: Depends on D7635, D7634 Reviewers: woohyun, bu5hm4n, segfaultxavi, lauromoura Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7636
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/function_registration.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_registration.hh30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh
index 0b8da4a05a..78f2d718c7 100644
--- a/src/bin/eolian_mono/eolian/mono/function_registration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh
@@ -20,10 +20,10 @@
20 20
21namespace eolian_mono { 21namespace eolian_mono {
22 22
23template <typename I> 23// template <typename I>
24struct function_registration_generator 24struct function_registration_generator
25{ 25{
26 I index_generator; 26 // I index_generator;
27 attributes::klass_def const* klass; 27 attributes::klass_def const* klass;
28 28
29 template <typename OutputIterator, typename Context> 29 template <typename OutputIterator, typename Context>
@@ -34,7 +34,7 @@ struct function_registration_generator
34 return true; 34 return true;
35 else 35 else
36 { 36 {
37 auto index = index_generator(); 37 // auto index = index_generator();
38 38
39 if(!as_generator( 39 if(!as_generator(
40 scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" << 40 scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" <<
@@ -43,12 +43,13 @@ struct function_registration_generator
43 return false; 43 return false;
44 44
45 if(!as_generator 45 if(!as_generator
46 (scope_tab << scope_tab << "descs.Add(new Efl_Op_Description() {"
46#ifdef _WIN32 47#ifdef _WIN32
47 (scope_tab << scope_tab << "descs[" << index << "].api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\");\n" 48 << "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")"
48#else 49#else
49 (scope_tab << scope_tab << "descs[" << index << "].api_func = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, \"" << string << "\");\n" 50 << "api_func = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, \"" << string << "\")"
50#endif 51#endif
51 << scope_tab << scope_tab << "descs[" << index << "].func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate);\n" 52 ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n"
52 ) 53 )
53 .generate(sink, std::make_tuple(f.c_name, f.c_name), context)) 54 .generate(sink, std::make_tuple(f.c_name, f.c_name), context))
54 return false; 55 return false;
@@ -59,10 +60,9 @@ struct function_registration_generator
59 60
60struct function_registration_parameterized 61struct function_registration_parameterized
61{ 62{
62 template <typename I> 63 function_registration_generator operator()(attributes::klass_def const& klass) const
63 function_registration_generator<I> operator()(I i, attributes::klass_def const& klass) const
64 { 64 {
65 return {i, &klass}; 65 return {&klass};
66 } 66 }
67} const function_registration; 67} const function_registration;
68 68
@@ -70,15 +70,15 @@ struct function_registration_parameterized
70 70
71namespace efl { namespace eolian { namespace grammar { 71namespace efl { namespace eolian { namespace grammar {
72 72
73template <typename I> 73template <>
74struct is_eager_generator< ::eolian_mono::function_registration_generator<I>> : std::true_type {}; 74struct is_eager_generator< ::eolian_mono::function_registration_generator> : std::true_type {};
75template <typename I> 75template <>
76struct is_generator< ::eolian_mono::function_registration_generator<I>> : std::true_type {}; 76struct is_generator< ::eolian_mono::function_registration_generator> : std::true_type {};
77 77
78namespace type_traits { 78namespace type_traits {
79 79
80template <typename I> 80template <>
81struct attributes_needed< ::eolian_mono::function_registration_generator<I>> : std::integral_constant<int, 1> {}; 81struct attributes_needed< ::eolian_mono::function_registration_generator> : std::integral_constant<int, 1> {};
82} 82}
83 83
84} } } 84} } }