summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/function_definition.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_definition.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_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 763bbc4..2d9e1b5 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -71,7 +71,11 @@ struct native_function_definition_generator
71 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) 71 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
72 return false; 72 return false;
73 73
74 std::string klass_inherit_name = name_helpers::klass_inherit_name(*klass); 74 std::string klass_cast_name;
75 if (klass->type != attributes::class_type::interface_)
76 klass_cast_name = name_helpers::klass_inherit_name(*klass);
77 else
78 klass_cast_name = name_helpers::klass_interface_name(*klass);
75 79
76 if(!as_generator 80 if(!as_generator
77 (scope_tab 81 (scope_tab
@@ -89,7 +93,7 @@ struct native_function_definition_generator
89 << scope_tab << scope_tab << "if(wrapper != null) {\n" 93 << scope_tab << scope_tab << "if(wrapper != null) {\n"
90 << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble() 94 << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble()
91 << scope_tab << scope_tab << scope_tab << "try {\n" 95 << scope_tab << scope_tab << scope_tab << "try {\n"
92 << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << klass_inherit_name << ")wrapper)." << string 96 << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << klass_cast_name << ")wrapper)." << string
93 << "(" << (native_argument_invocation % ", ") << ");\n" 97 << "(" << (native_argument_invocation % ", ") << ");\n"
94 << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n" 98 << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n"
95 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n" 99 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
@@ -98,7 +102,7 @@ struct native_function_definition_generator
98 << eolian_mono::native_function_definition_epilogue(*klass) 102 << eolian_mono::native_function_definition_epilogue(*klass)
99 << scope_tab << scope_tab << "} else {\n" 103 << scope_tab << scope_tab << "} else {\n"
100 << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "return " : "") << string 104 << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "return " : "") << string
101 << "(Efl.Eo.Globals.efl_super(obj, " << "EoKlass)" << *(", " << argument) << ");\n" 105 << "(Efl.Eo.Globals.efl_super(obj, " << "GetEflClass())" << *(", " << argument) << ");\n"
102 << scope_tab << scope_tab << "}\n" 106 << scope_tab << scope_tab << "}\n"
103 << scope_tab << "}\n" 107 << scope_tab << "}\n"
104 ) 108 )