1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Runtime.InteropServices;
9 #region Autogenerated code
10 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
11 internal delegate bool PadEventFunctionNative(IntPtr pad, IntPtr parent, IntPtr evnt);
13 internal class PadEventFunctionInvoker {
15 PadEventFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~PadEventFunctionInvoker ()
26 internal PadEventFunctionInvoker (PadEventFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal PadEventFunctionInvoker (PadEventFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal PadEventFunctionInvoker (PadEventFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.PadEventFunction Handler {
39 return new Gst.PadEventFunction(InvokeNative);
43 bool InvokeNative (Gst.Pad pad, Gst.Object parent, Gst.Event evnt)
46 bool __result = native_cb (pad == null ? IntPtr.Zero : pad.Handle, parent == null ? IntPtr.Zero : parent.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
51 internal class PadEventFunctionWrapper {
53 public bool NativeCallback (IntPtr pad, IntPtr parent, IntPtr evnt)
56 bool __ret = managed (GLib.Object.GetObject(pad) as Gst.Pad, GLib.Object.GetObject(parent) as Gst.Object, evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), true));
60 } catch (Exception e) {
61 GLib.ExceptionManager.RaiseUnhandledException (e, false);
66 bool release_on_call = false;
69 public void PersistUntilCalled ()
71 release_on_call = true;
72 gch = GCHandle.Alloc (this);
75 internal PadEventFunctionNative NativeDelegate;
76 Gst.PadEventFunction managed;
78 public PadEventFunctionWrapper (Gst.PadEventFunction managed)
80 this.managed = managed;
82 NativeDelegate = new PadEventFunctionNative (NativeCallback);
85 public static Gst.PadEventFunction GetManagedDelegate (PadEventFunctionNative native)
89 PadEventFunctionWrapper wrapper = (PadEventFunctionWrapper) native.Target;
92 return wrapper.managed;