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 int IteratorItemFunctionNative(IntPtr it, IntPtr item);
13 internal class IteratorItemFunctionInvoker {
15 IteratorItemFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~IteratorItemFunctionInvoker ()
26 internal IteratorItemFunctionInvoker (IteratorItemFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal IteratorItemFunctionInvoker (IteratorItemFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal IteratorItemFunctionInvoker (IteratorItemFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.IteratorItemFunction Handler {
39 return new Gst.IteratorItemFunction(InvokeNative);
43 Gst.IteratorItem InvokeNative (Gst.Iterator it, GLib.Value item)
45 IntPtr native_item = GLib.Marshaller.StructureToPtrAlloc (item);
46 Gst.IteratorItem __result = (Gst.IteratorItem) native_cb (it == null ? IntPtr.Zero : it.Handle, native_item);
47 Marshal.FreeHGlobal (native_item);
52 internal class IteratorItemFunctionWrapper {
54 public int NativeCallback (IntPtr it, IntPtr item)
57 Gst.IteratorItem __ret = managed (it == IntPtr.Zero ? null : (Gst.Iterator) GLib.Opaque.GetOpaque (it, typeof (Gst.Iterator), false), (GLib.Value) Marshal.PtrToStructure (item, typeof (GLib.Value)));
61 } catch (Exception e) {
62 GLib.ExceptionManager.RaiseUnhandledException (e, true);
63 // NOTREACHED: Above call does not return.
68 bool release_on_call = false;
71 public void PersistUntilCalled ()
73 release_on_call = true;
74 gch = GCHandle.Alloc (this);
77 internal IteratorItemFunctionNative NativeDelegate;
78 Gst.IteratorItemFunction managed;
80 public IteratorItemFunctionWrapper (Gst.IteratorItemFunction managed)
82 this.managed = managed;
84 NativeDelegate = new IteratorItemFunctionNative (NativeCallback);
87 public static Gst.IteratorItemFunction GetManagedDelegate (IteratorItemFunctionNative native)
91 IteratorItemFunctionWrapper wrapper = (IteratorItemFunctionWrapper) native.Target;
94 return wrapper.managed;