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 StructureForeachFuncNative(uint field_id, IntPtr value, IntPtr user_data);
13 internal class StructureForeachFuncInvoker {
15 StructureForeachFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~StructureForeachFuncInvoker ()
26 internal StructureForeachFuncInvoker (StructureForeachFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal StructureForeachFuncInvoker (StructureForeachFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal StructureForeachFuncInvoker (StructureForeachFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.StructureForeachFunc Handler {
39 return new Gst.StructureForeachFunc(InvokeNative);
43 bool InvokeNative (uint field_id, GLib.Value value)
45 IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
46 bool __result = native_cb (field_id, native_value, __data);
47 Marshal.FreeHGlobal (native_value);
52 internal class StructureForeachFuncWrapper {
54 public bool NativeCallback (uint field_id, IntPtr value, IntPtr user_data)
57 bool __ret = managed (field_id, (GLib.Value) Marshal.PtrToStructure (value, typeof (GLib.Value)));
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 StructureForeachFuncNative NativeDelegate;
77 Gst.StructureForeachFunc managed;
79 public StructureForeachFuncWrapper (Gst.StructureForeachFunc managed)
81 this.managed = managed;
83 NativeDelegate = new StructureForeachFuncNative (NativeCallback);
86 public static Gst.StructureForeachFunc GetManagedDelegate (StructureForeachFuncNative native)
90 StructureForeachFuncWrapper wrapper = (StructureForeachFuncWrapper) native.Target;
93 return wrapper.managed;