From 7f8479005bcb14bdbcefecdf234352cbcfcef2b2 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Thu, 20 Feb 2020 10:29:45 +0900 Subject: [PATCH] [ElmSharp] Fix GestureLayer native callback return type (#1422) --- src/ElmSharp/ElmSharp/GestureLayer.cs | 7 ++++--- src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ElmSharp/ElmSharp/GestureLayer.cs b/src/ElmSharp/ElmSharp/GestureLayer.cs index 3e586ac..b322f45 100644 --- a/src/ElmSharp/ElmSharp/GestureLayer.cs +++ b/src/ElmSharp/ElmSharp/GestureLayer.cs @@ -552,18 +552,18 @@ namespace ElmSharp SetGestureCallback(type, state, new Action((info) => action((T)info))); } - private void GestureCallbackHandler(IntPtr data, IntPtr event_info) + private int GestureCallbackHandler(IntPtr data, IntPtr event_info) { // so EFL called our callback, lets use data to find the right Action to call var handlerIndex = (int)data; // thanks to the fact that we never remove item from _handlers, we don't need a lock here if (handlerIndex < 0 || handlerIndex >= _handlers.Count) - return; + return 0; var currentHandler = _handlers[handlerIndex]; Action action = currentHandler.Action; if (action == null) - return; + return 0; // the interpretation of the event_info struct pointer depends on the GestureType switch (currentHandler.Type) @@ -592,6 +592,7 @@ namespace ElmSharp action(Marshal.PtrToStructure(event_info)); break; } + return 0; } #region Info structures diff --git a/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs b/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs index 369eba1..48c4236 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs +++ b/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs @@ -21,7 +21,7 @@ internal static partial class Interop { internal static partial class Elementary { - public delegate void GestureEventCallback(IntPtr data, IntPtr event_info); + public delegate int GestureEventCallback(IntPtr data, IntPtr event_info); [DllImport(Libraries.Elementary)] internal static extern IntPtr elm_gesture_layer_add(IntPtr parent); -- 2.7.4