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 ValueDeserializeWithPSpecFuncNative(IntPtr dest, IntPtr s, IntPtr pspec);
13 internal class ValueDeserializeWithPSpecFuncInvoker {
15 ValueDeserializeWithPSpecFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~ValueDeserializeWithPSpecFuncInvoker ()
26 internal ValueDeserializeWithPSpecFuncInvoker (ValueDeserializeWithPSpecFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal ValueDeserializeWithPSpecFuncInvoker (ValueDeserializeWithPSpecFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal ValueDeserializeWithPSpecFuncInvoker (ValueDeserializeWithPSpecFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.ValueDeserializeWithPSpecFunc Handler {
39 return new Gst.ValueDeserializeWithPSpecFunc(InvokeNative);
43 bool InvokeNative (GLib.Value dest, string s, IntPtr pspec)
45 IntPtr native_dest = GLib.Marshaller.StructureToPtrAlloc (dest);
46 IntPtr native_s = GLib.Marshaller.StringToPtrGStrdup (s);
47 bool __result = native_cb (native_dest, native_s, pspec);
48 Marshal.FreeHGlobal (native_dest);
49 GLib.Marshaller.Free (native_s);
54 internal class ValueDeserializeWithPSpecFuncWrapper {
56 public bool NativeCallback (IntPtr dest, IntPtr s, IntPtr pspec)
59 bool __ret = managed ((GLib.Value) Marshal.PtrToStructure (dest, typeof (GLib.Value)), GLib.Marshaller.Utf8PtrToString (s), pspec);
63 } catch (Exception e) {
64 GLib.ExceptionManager.RaiseUnhandledException (e, false);
69 bool release_on_call = false;
72 public void PersistUntilCalled ()
74 release_on_call = true;
75 gch = GCHandle.Alloc (this);
78 internal ValueDeserializeWithPSpecFuncNative NativeDelegate;
79 Gst.ValueDeserializeWithPSpecFunc managed;
81 public ValueDeserializeWithPSpecFuncWrapper (Gst.ValueDeserializeWithPSpecFunc managed)
83 this.managed = managed;
85 NativeDelegate = new ValueDeserializeWithPSpecFuncNative (NativeCallback);
88 public static Gst.ValueDeserializeWithPSpecFunc GetManagedDelegate (ValueDeserializeWithPSpecFuncNative native)
92 ValueDeserializeWithPSpecFuncWrapper wrapper = (ValueDeserializeWithPSpecFuncWrapper) native.Target;
95 return wrapper.managed;