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 CapsForeachFuncNative(IntPtr features, IntPtr structure, IntPtr user_data);
13 internal class CapsForeachFuncInvoker {
15 CapsForeachFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~CapsForeachFuncInvoker ()
26 internal CapsForeachFuncInvoker (CapsForeachFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal CapsForeachFuncInvoker (CapsForeachFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal CapsForeachFuncInvoker (CapsForeachFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.CapsForeachFunc Handler {
39 return new Gst.CapsForeachFunc(InvokeNative);
43 bool InvokeNative (Gst.CapsFeatures features, Gst.Structure structure)
45 IntPtr native_features = GLib.Marshaller.StructureToPtrAlloc (features);
46 bool __result = native_cb (native_features, structure == null ? IntPtr.Zero : structure.Handle, __data);
47 Marshal.FreeHGlobal (native_features);
52 internal class CapsForeachFuncWrapper {
54 public bool NativeCallback (IntPtr features, IntPtr structure, IntPtr user_data)
57 bool __ret = managed (Gst.CapsFeatures.New (features), structure == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (structure, typeof (Gst.Structure), false));
61 } catch (Exception e) {
62 GLib.ExceptionManager.RaiseUnhandledException (e, false);
67 bool release_on_call = false;
70 public void PersistUntilCalled ()
72 release_on_call = true;
73 gch = GCHandle.Alloc (this);
76 internal CapsForeachFuncNative NativeDelegate;
77 Gst.CapsForeachFunc managed;
79 public CapsForeachFuncWrapper (Gst.CapsForeachFunc managed)
81 this.managed = managed;
83 NativeDelegate = new CapsForeachFuncNative (NativeCallback);
86 public static Gst.CapsForeachFunc GetManagedDelegate (CapsForeachFuncNative native)
90 CapsForeachFuncWrapper wrapper = (CapsForeachFuncWrapper) native.Target;
93 return wrapper.managed;