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 ValueDeserializeFuncNative(IntPtr dest, IntPtr s);
13 internal class ValueDeserializeFuncInvoker {
15 ValueDeserializeFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~ValueDeserializeFuncInvoker ()
26 internal ValueDeserializeFuncInvoker (ValueDeserializeFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal ValueDeserializeFuncInvoker (ValueDeserializeFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal ValueDeserializeFuncInvoker (ValueDeserializeFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.ValueDeserializeFunc Handler {
39 return new Gst.ValueDeserializeFunc(InvokeNative);
43 bool InvokeNative (GLib.Value dest, string s)
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);
48 Marshal.FreeHGlobal (native_dest);
49 GLib.Marshaller.Free (native_s);
54 internal class ValueDeserializeFuncWrapper {
56 public bool NativeCallback (IntPtr dest, IntPtr s)
59 bool __ret = managed ((GLib.Value) Marshal.PtrToStructure (dest, typeof (GLib.Value)), GLib.Marshaller.Utf8PtrToString (s));
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 ValueDeserializeFuncNative NativeDelegate;
79 Gst.ValueDeserializeFunc managed;
81 public ValueDeserializeFuncWrapper (Gst.ValueDeserializeFunc managed)
83 this.managed = managed;
85 NativeDelegate = new ValueDeserializeFuncNative (NativeCallback);
88 public static Gst.ValueDeserializeFunc GetManagedDelegate (ValueDeserializeFuncNative native)
92 ValueDeserializeFuncWrapper wrapper = (ValueDeserializeFuncWrapper) native.Target;
95 return wrapper.managed;