From: Seungkeun Lee Date: Thu, 20 Feb 2020 01:29:45 +0000 (+0900) Subject: [ElmSharp] Fix GestureLayer native callback return type (#1422) X-Git-Tag: accepted/tizen/unified/20210219.040944~846 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=7f8479005bcb14bdbcefecdf234352cbcfcef2b2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [ElmSharp] Fix GestureLayer native callback return type (#1422) --- 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);