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 StructureFilterMapFuncNative(uint field_id, IntPtr value, IntPtr user_data);
13 internal class StructureFilterMapFuncInvoker {
15 StructureFilterMapFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~StructureFilterMapFuncInvoker ()
26 internal StructureFilterMapFuncInvoker (StructureFilterMapFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal StructureFilterMapFuncInvoker (StructureFilterMapFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal StructureFilterMapFuncInvoker (StructureFilterMapFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.StructureFilterMapFunc Handler {
39 return new Gst.StructureFilterMapFunc(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 StructureFilterMapFuncWrapper {
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 StructureFilterMapFuncNative NativeDelegate;
77 Gst.StructureFilterMapFunc managed;
79 public StructureFilterMapFuncWrapper (Gst.StructureFilterMapFunc managed)
81 this.managed = managed;
83 NativeDelegate = new StructureFilterMapFuncNative (NativeCallback);
86 public static Gst.StructureFilterMapFunc GetManagedDelegate (StructureFilterMapFuncNative native)
90 StructureFilterMapFuncWrapper wrapper = (StructureFilterMapFuncWrapper) native.Target;
93 return wrapper.managed;