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 void TagForeachFuncNative(IntPtr list, IntPtr tag, IntPtr user_data);
13 internal class TagForeachFuncInvoker {
15 TagForeachFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~TagForeachFuncInvoker ()
26 internal TagForeachFuncInvoker (TagForeachFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal TagForeachFuncInvoker (TagForeachFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal TagForeachFuncInvoker (TagForeachFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.TagForeachFunc Handler {
39 return new Gst.TagForeachFunc(InvokeNative);
43 void InvokeNative (Gst.TagList list, string tag)
45 IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
46 native_cb (list == null ? IntPtr.Zero : list.Handle, native_tag, __data);
47 GLib.Marshaller.Free (native_tag);
51 internal class TagForeachFuncWrapper {
53 public void NativeCallback (IntPtr list, IntPtr tag, IntPtr user_data)
56 managed (list == IntPtr.Zero ? null : (Gst.TagList) GLib.Opaque.GetOpaque (list, typeof (Gst.TagList), false), GLib.Marshaller.Utf8PtrToString (tag));
59 } catch (Exception e) {
60 GLib.ExceptionManager.RaiseUnhandledException (e, false);
64 bool release_on_call = false;
67 public void PersistUntilCalled ()
69 release_on_call = true;
70 gch = GCHandle.Alloc (this);
73 internal TagForeachFuncNative NativeDelegate;
74 Gst.TagForeachFunc managed;
76 public TagForeachFuncWrapper (Gst.TagForeachFunc managed)
78 this.managed = managed;
80 NativeDelegate = new TagForeachFuncNative (NativeCallback);
83 public static Gst.TagForeachFunc GetManagedDelegate (TagForeachFuncNative native)
87 TagForeachFuncWrapper wrapper = (TagForeachFuncWrapper) native.Target;
90 return wrapper.managed;