/// <summary>Removes a signal-triggered callback from an object. /// This function removes a callback, previously attached to the emission of a signal, from the object obj. The parameters emission, source and func must match exactly those passed to a previous call to <see cref="Efl.Layout.Signal.AddSignalCallback"/>. /// /// See <see cref="Efl.Layout.Signal.AddSignalCallback"/>. /// 1.21</summary> /// <param name="emission">The signal's "emission" string /// 1.21</param> /// <param name="source">The signal's "source" string /// 1.21</param> /// <param name="func">The callback function to be executed when the signal is emitted. /// 1.21</param> /// <returns><c>true</c> in case of success, <c>false</c> in case of error. /// 1.21</returns> public bool DelSignalCallback(System.String emission, System.String source, EflLayoutSignalCb func) { GCHandle func_handle = GCHandle.Alloc(func); var _ret_var = Efl.Layout.SignalNativeInherit.efl_layout_signal_callback_del_ptr.Value.Delegate(this.NativeHandle, emission, source, GCHandle.ToIntPtr(func_handle), EflLayoutSignalCbWrapper.Cb, Efl.Eo.Globals.free_gchandle); Eina.Error.RaiseIfUnhandledException(); return(_ret_var); }
internal static void Cb(IntPtr cb_data, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Efl.Eo.MarshalTest <Efl.Layout.SignalConcrete, Efl.Eo.NonOwnTag>))] Efl.Layout.Signal kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String emission, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String source) { GCHandle handle = GCHandle.FromIntPtr(cb_data); EflLayoutSignalCb cb = (EflLayoutSignalCb)handle.Target; try { cb(kw_object, emission, source); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } }