From 481853e1edbba2536f0189335f564e6133644f84 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Wed, 20 Dec 2017 19:45:07 -0200 Subject: [PATCH] efl-mono: Fix using right description pointer in event registration --- src/bin/eolian_mono/eolian/mono/klass.hh | 6 +++--- src/bindings/mono/eo_mono/iwrapper.cs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index d8bea22024..119cd73d12 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -562,7 +562,7 @@ struct klass << scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n" << scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n" << scope_tab << scope_tab << "if (event_count == 0) {\n" - << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n" + << scope_tab << scope_tab << scope_tab << "IntPtr desc = efl.eo.Globals.dlsym(efl.eo.Globals.RTLD_DEFAULT, key);\n" << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);\n" << scope_tab << scope_tab << scope_tab << "if (!result) {\n" << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to add event proxy for event {key}\");\n" @@ -639,7 +639,7 @@ struct klass << scope_tab << "}\n" << scope_tab << "private void on_" << event_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)\n" << scope_tab << "{\n" - << scope_tab << event_args + << scope_tab << scope_tab << event_args << scope_tab << scope_tab << "try {\n" << scope_tab << scope_tab << scope_tab << "On_" << event_name << "(args);\n" << scope_tab << scope_tab << "} catch (Exception e) {\n" @@ -730,7 +730,7 @@ struct klass << scope_tab << "efl.Event_Cb evt_" << wrapper_evt_name << "_delegate;\n" << scope_tab << "private void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)" << scope_tab << "{\n" - << scope_tab << event_args + << scope_tab << scope_tab << event_args << scope_tab << scope_tab << "try {\n" << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n" << scope_tab << scope_tab << "} catch (Exception e) {\n" diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 98e8f953ba..7812e06367 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -52,8 +52,9 @@ public class Globals { [DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_priority_add( System.IntPtr obj, // FIXME commented to allow passing null stuff during test - /* ref efl.kw_event.Description desc, */ - efl.kw_event.Description desc, + //ref efl.kw_event.Description desc, + //efl.kw_event.Description desc, + IntPtr desc, short priority, efl.Event_Cb cb, System.IntPtr data); @@ -62,7 +63,8 @@ public class Globals { efl.kw_event.Description desc, efl.Event_Cb cb, System.IntPtr data); - + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_object_legacy_only_event_description_get([MarshalAs(UnmanagedType.LPStr)] String name); public const int RTLD_NOW = 2;