efl/src/bindings
Yeongjong Lee 06c2bbf798 eolian_mono: reduce duplicated code in OnXXXEvent
Summary:
`CallNativeEventCallback` is used to reduce duplicated code.

E.g.

Before
```
protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e)
{
    var key = "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED";
    IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
    if (desc == IntPtr.Zero)
    {
        Eina.Log.Error($"Failed to get native event {key}");
        return;
    }

    IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
    try
    {
        Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
    }
    finally
    {
        Marshal.FreeHGlobal(info);
    }
}
```

After
```
protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e)
{
    IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
    CallNativeEventCallback("elementary", "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED", info, (p) => Marshal.FreeHGlobal(p));
}
```

Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10661
2019-12-09 13:56:19 -03:00
..
cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
js all: Simplify definition of EAPI 2018-01-18 18:04:03 +09:00
luajit elua: fix error api in lua eolian bindings 2019-10-09 13:20:15 +02:00
mono eolian_mono: reduce duplicated code in OnXXXEvent 2019-12-09 13:56:19 -03:00
meson.build charp: Require mono bindings when using dotnet 2019-12-04 17:09:06 +01:00