gstreamer/subprojects/gstreamer-sharp/ges/generated/GES/GESSharp.CreateElementForGapFuncNative.cs

97 lines
2.5 KiB
C#
Raw Normal View History

2018-01-29 18:56:49 +00:00
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.
namespace GESSharp {
using System;
using System.Runtime.InteropServices;
#region Autogenerated code
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate IntPtr CreateElementForGapFuncNative(IntPtr track);
internal class CreateElementForGapFuncInvoker {
CreateElementForGapFuncNative native_cb;
IntPtr __data;
GLib.DestroyNotify __notify;
~CreateElementForGapFuncInvoker ()
{
if (__notify == null)
return;
__notify (__data);
}
internal CreateElementForGapFuncInvoker (CreateElementForGapFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
internal CreateElementForGapFuncInvoker (CreateElementForGapFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
internal CreateElementForGapFuncInvoker (CreateElementForGapFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
{
this.native_cb = native_cb;
__data = data;
__notify = notify;
}
internal GES.CreateElementForGapFunc Handler {
get {
return new GES.CreateElementForGapFunc(InvokeNative);
}
}
Gst.Element InvokeNative (GES.Track track)
{
Gst.Element __result = GLib.Object.GetObject(native_cb (track == null ? IntPtr.Zero : track.Handle)) as Gst.Element;
return __result;
}
}
internal class CreateElementForGapFuncWrapper {
public IntPtr NativeCallback (IntPtr track)
{
try {
Gst.Element __ret = managed (GLib.Object.GetObject(track) as GES.Track);
if (release_on_call)
gch.Free ();
return __ret == null ? IntPtr.Zero : __ret.Handle;
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, true);
// NOTREACHED: Above call does not return.
throw e;
}
}
bool release_on_call = false;
GCHandle gch;
public void PersistUntilCalled ()
{
release_on_call = true;
gch = GCHandle.Alloc (this);
}
internal CreateElementForGapFuncNative NativeDelegate;
GES.CreateElementForGapFunc managed;
public CreateElementForGapFuncWrapper (GES.CreateElementForGapFunc managed)
{
this.managed = managed;
if (managed != null)
NativeDelegate = new CreateElementForGapFuncNative (NativeCallback);
}
public static GES.CreateElementForGapFunc GetManagedDelegate (CreateElementForGapFuncNative native)
{
if (native == null)
return null;
CreateElementForGapFuncWrapper wrapper = (CreateElementForGapFuncWrapper) native.Target;
if (wrapper == null)
return null;
return wrapper.managed;
}
}
#endregion
}