summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/events.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/events.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index 20225b4..2a2aa4c 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -301,12 +301,15 @@ struct event_definition_generator
301 bool generate_event_add_remove(OutputIterator sink, attributes::event_def const &evt, const std::string& event_name, Context context) const 301 bool generate_event_add_remove(OutputIterator sink, attributes::event_def const &evt, const std::string& event_name, Context context) const
302 { 302 {
303 std::string upper_c_name = utils::to_uppercase(evt.c_name); 303 std::string upper_c_name = utils::to_uppercase(evt.c_name);
304 auto unit = (const Eolian_Unit*) context_find_tag<eolian_state_context>(context).state;
305 attributes::klass_def klass(get_klass(evt.klass, unit), unit);
306 auto library_name = context_find_tag<library_context>(context).actual_library_name(klass.filename);
304 return as_generator( 307 return as_generator(
305 scope_tab << "{\n" 308 scope_tab << "{\n"
306 << scope_tab << scope_tab << "add {\n" 309 << scope_tab << scope_tab << "add {\n"
307 << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n" 310 << scope_tab << scope_tab << scope_tab << "lock (eventLock) {\n"
308 << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n" 311 << scope_tab << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
309 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << event_name << "_delegate)) {\n" 312 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(" << library_name << ", key, this.evt_" << event_name << "_delegate)) {\n"
310 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eventHandlers.AddHandler(" << event_name << "Key , value);\n" 313 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eventHandlers.AddHandler(" << event_name << "Key , value);\n"
311 << scope_tab << scope_tab << scope_tab << scope_tab << "} else\n" 314 << scope_tab << scope_tab << scope_tab << scope_tab << "} else\n"
312 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Error adding proxy for event {key}\");\n" 315 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Error adding proxy for event {key}\");\n"