vitorsousa pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bafa91be2026d03efc379a7944ead14594c90e78

commit bafa91be2026d03efc379a7944ead14594c90e78
Author: Lauro Moura <lauromo...@expertisesolutions.com.br>
Date:   Wed May 16 17:35:21 2018 -0300

    efl_mono: Fix generation of event arguments
    
    Summary:
    Event argument was getting its type name from another path, different
    from the type_generator.
    
    In later commits the other functions from name_helpers should use the
    type_generator too.
    
    Reviewers: felipealmeida
    
    Reviewed By: felipealmeida
    
    Subscribers: cedric, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6170
---
 src/bin/eolian_mono/eolian/mono/events.hh       |  9 +++++++--
 src/bin/eolian_mono/eolian/mono/name_helpers.hh | 19 -------------------
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/src/bin/eolian_mono/eolian/mono/events.hh 
b/src/bin/eolian_mono/eolian/mono/events.hh
index 1d56db7dd2..2da287b8e7 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -81,7 +81,12 @@ struct event_argument_wrapper_generator
         return true;
 
       std::string evt_name = name_helpers::managed_event_name(evt.name);
-      std::string arg_type = 
(*etype).original_type.visit(name_helpers::get_csharp_type_visitor{});
+      std::string arg_type;
+      if (!as_generator(type).generate(std::back_inserter(arg_type), *etype, 
efl::eolian::grammar::context_null()))
+        {
+           EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Failed to get 
argument type for event " << evt.name;
+           return false;
+        }
 
       return as_generator("///<summary>Event argument wrapper for event " << 
evt_name << ".</summary>\n"
                           << "public class " << 
name_helpers::managed_event_args_short_name(evt) << " : EventArgs {\n"
@@ -177,7 +182,7 @@ struct event_definition_generator
         {
            wrapper_args_type = name_helpers::managed_event_args_name(evt);
            wrapper_args_template = "<" + wrapper_args_type + ">";
-           std::string arg_initializer = wrapper_args_type + " args = new " + 
wrapper_args_type + "();\n"; // = 
(*etype).original_type.visit(get_csharp_type_visitor{});
+           std::string arg_initializer = wrapper_args_type + " args = new " + 
wrapper_args_type + "();\n";
 
            arg_initializer += "      args.arg = ";
 
diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh 
b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
index 6dd0cc567c..912909b4a8 100644
--- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
@@ -291,25 +291,6 @@ inline std::string translate_inherited_event_name(const 
attributes::event_def &e
    return join_namespaces(klass.namespaces, '_') + klass.cxx_name + "_" + 
managed_event_name(evt.name);
 }
 
-// Type visistor
-struct get_csharp_type_visitor
-{
-    typedef get_csharp_type_visitor visitor_type;
-    typedef std::string result_type;
-    std::string operator()(attributes::regular_type_def const& type) const
-    {
-        return type_full_managed_name(type);
-    }
-    std::string operator()(attributes::klass_name const& name) const
-    {
-        return klass_full_interface_name(name);
-    }
-    std::string operator()(attributes::complex_type_def const&) const
-    {
-        return "UNSUPPORTED";
-    }
-};
-
 // Open/close namespaces
 template<typename OutputIterator, typename Context>
 bool open_namespaces(OutputIterator sink, std::vector<std::string> namespaces, 
Context context)

-- 


Reply via email to