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 ValueCompareFuncNative(IntPtr value1, IntPtr value2);
13 internal class ValueCompareFuncInvoker {
15 ValueCompareFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~ValueCompareFuncInvoker ()
26 internal ValueCompareFuncInvoker (ValueCompareFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal ValueCompareFuncInvoker (ValueCompareFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal ValueCompareFuncInvoker (ValueCompareFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.ValueCompareFunc Handler {
39 return new Gst.ValueCompareFunc(InvokeNative);
43 int InvokeNative (GLib.Value value1, GLib.Value value2)
45 IntPtr native_value1 = GLib.Marshaller.StructureToPtrAlloc (value1);
46 IntPtr native_value2 = GLib.Marshaller.StructureToPtrAlloc (value2);
47 int __result = native_cb (native_value1, native_value2);
48 Marshal.FreeHGlobal (native_value1);
49 Marshal.FreeHGlobal (native_value2);
54 internal class ValueCompareFuncWrapper {
56 public int NativeCallback (IntPtr value1, IntPtr value2)
59 int __ret = managed ((GLib.Value) Marshal.PtrToStructure (value1, typeof (GLib.Value)), (GLib.Value) Marshal.PtrToStructure (value2, typeof (GLib.Value)));
63 } catch (Exception e) {
64 GLib.ExceptionManager.RaiseUnhandledException (e, true);
65 // NOTREACHED: Above call does not return.
70 bool release_on_call = false;
73 public void PersistUntilCalled ()
75 release_on_call = true;
76 gch = GCHandle.Alloc (this);
79 internal ValueCompareFuncNative NativeDelegate;
80 Gst.ValueCompareFunc managed;
82 public ValueCompareFuncWrapper (Gst.ValueCompareFunc managed)
84 this.managed = managed;
86 NativeDelegate = new ValueCompareFuncNative (NativeCallback);
89 public static Gst.ValueCompareFunc GetManagedDelegate (ValueCompareFuncNative native)
93 ValueCompareFuncWrapper wrapper = (ValueCompareFuncWrapper) native.Target;
96 return wrapper.managed;