summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh14
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 51da954d44..a0f28df305 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -85,6 +85,11 @@ struct native_function_definition_generator
85 if (blacklist::is_non_public_interface_member(f, *klass)) 85 if (blacklist::is_non_public_interface_member(f, *klass))
86 return true; 86 return true;
87 87
88 // Do not generate static method in interface
89 if (((klass->type == attributes::class_type::interface_) ||
90 (klass->type == attributes::class_type::mixin)) && f.is_static)
91 return true;
92
88 // Actual method implementation to be called from C. 93 // Actual method implementation to be called from C.
89 std::string return_type; 94 std::string return_type;
90 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) 95 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
@@ -171,9 +176,15 @@ struct function_definition_generator
171 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const 176 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
172 { 177 {
173 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_definition_generator: " << f.c_name << std::endl; 178 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_definition_generator: " << f.c_name << std::endl;
179
180 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
174 if(blacklist::is_function_blacklisted(f, context)) 181 if(blacklist::is_function_blacklisted(f, context))
175 return true; 182 return true;
176 183
184 // Do not generate static function for concrete class
185 if (is_concrete && f.is_static)
186 return true;
187
177 std::string return_type; 188 std::string return_type;
178 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) 189 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
179 return false; 190 return false;
@@ -310,9 +321,10 @@ struct property_wrapper_definition_generator
310 bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface; 321 bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
311 bool is_static = (property.getter.is_engaged() && property.getter->is_static) 322 bool is_static = (property.getter.is_engaged() && property.getter->is_static)
312 || (property.setter.is_engaged() && property.setter->is_static); 323 || (property.setter.is_engaged() && property.setter->is_static);
324 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
313 325
314 326
315 if (is_interface && is_static) 327 if ((is_concrete || is_interface) && is_static)
316 return true; 328 return true;
317 329
318 auto get_params = property.getter.is_engaged() ? property.getter->parameters.size() : 0; 330 auto get_params = property.getter.is_engaged() ? property.getter->parameters.size() : 0;
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index 291e5234ff..5c1db6df24 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -258,6 +258,9 @@ std::vector<attributes::function_def> get_all_registerable_methods(attributes::k
258 if (cls == func.klass) 258 if (cls == func.klass)
259 return true; 259 return true;
260 260
261 if (is_managed_interface(func.klass) && func.is_static)
262 return true;
263
261 if (!is_managed_interface(func.klass) || func.scope != attributes::member_scope::scope_public) 264 if (!is_managed_interface(func.klass) || func.scope != attributes::member_scope::scope_public)
262 return true; 265 return true;
263 return false; 266 return false;