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 IntPtr MiniObjectCopyFunctionNative(IntPtr obj);
13 internal class MiniObjectCopyFunctionInvoker {
15 MiniObjectCopyFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MiniObjectCopyFunctionInvoker ()
26 internal MiniObjectCopyFunctionInvoker (MiniObjectCopyFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MiniObjectCopyFunctionInvoker (MiniObjectCopyFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MiniObjectCopyFunctionInvoker (MiniObjectCopyFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MiniObjectCopyFunction Handler {
39 return new Gst.MiniObjectCopyFunction(InvokeNative);
43 Gst.MiniObject InvokeNative (Gst.MiniObject obj)
45 Gst.MiniObject __result = native_cb (obj == null ? IntPtr.Zero : obj.Handle) == IntPtr.Zero ? null : (Gst.MiniObject) GLib.Opaque.GetOpaque (native_cb (obj == null ? IntPtr.Zero : obj.Handle), typeof (Gst.MiniObject), false);
50 internal class MiniObjectCopyFunctionWrapper {
52 public IntPtr NativeCallback (IntPtr obj)
55 Gst.MiniObject __ret = managed (obj == IntPtr.Zero ? null : (Gst.MiniObject) GLib.Opaque.GetOpaque (obj, typeof (Gst.MiniObject), false));
58 return __ret == null ? IntPtr.Zero : __ret.Handle;
59 } catch (Exception e) {
60 GLib.ExceptionManager.RaiseUnhandledException (e, true);
61 // NOTREACHED: Above call does not return.
66 bool release_on_call = false;
69 public void PersistUntilCalled ()
71 release_on_call = true;
72 gch = GCHandle.Alloc (this);
75 internal MiniObjectCopyFunctionNative NativeDelegate;
76 Gst.MiniObjectCopyFunction managed;
78 public MiniObjectCopyFunctionWrapper (Gst.MiniObjectCopyFunction managed)
80 this.managed = managed;
82 NativeDelegate = new MiniObjectCopyFunctionNative (NativeCallback);
85 public static Gst.MiniObjectCopyFunction GetManagedDelegate (MiniObjectCopyFunctionNative native)
89 MiniObjectCopyFunctionWrapper wrapper = (MiniObjectCopyFunctionWrapper) native.Target;
92 return wrapper.managed;