Release 1.20.0
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.PbUtils / Gst.PbUtilsSharp.InstallPluginsResultFuncNative.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.PbUtilsSharp {
5
6         using System;
7         using System.Runtime.InteropServices;
8
9 #region Autogenerated code
10         [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
11         internal delegate void InstallPluginsResultFuncNative(int _result, IntPtr user_data);
12
13         internal class InstallPluginsResultFuncInvoker {
14
15                 InstallPluginsResultFuncNative native_cb;
16                 IntPtr __data;
17                 GLib.DestroyNotify __notify;
18
19                 ~InstallPluginsResultFuncInvoker ()
20                 {
21                         if (__notify == null)
22                                 return;
23                         __notify (__data);
24                 }
25
26                 internal InstallPluginsResultFuncInvoker (InstallPluginsResultFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
27
28                 internal InstallPluginsResultFuncInvoker (InstallPluginsResultFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
29
30                 internal InstallPluginsResultFuncInvoker (InstallPluginsResultFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
31                 {
32                         this.native_cb = native_cb;
33                         __data = data;
34                         __notify = notify;
35                 }
36
37                 internal Gst.PbUtils.InstallPluginsResultFunc Handler {
38                         get {
39                                 return new Gst.PbUtils.InstallPluginsResultFunc(InvokeNative);
40                         }
41                 }
42
43                 void InvokeNative (Gst.PbUtils.InstallPluginsReturn _result)
44                 {
45                         native_cb ((int) _result, __data);
46                 }
47         }
48
49         internal class InstallPluginsResultFuncWrapper {
50
51                 public void NativeCallback (int _result, IntPtr user_data)
52                 {
53                         try {
54                                 managed ((Gst.PbUtils.InstallPluginsReturn) _result);
55                                 if (release_on_call)
56                                         gch.Free ();
57                         } catch (Exception e) {
58                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
59                         }
60                 }
61
62                 bool release_on_call = false;
63                 GCHandle gch;
64
65                 public void PersistUntilCalled ()
66                 {
67                         release_on_call = true;
68                         gch = GCHandle.Alloc (this);
69                 }
70
71                 internal InstallPluginsResultFuncNative NativeDelegate;
72                 Gst.PbUtils.InstallPluginsResultFunc managed;
73
74                 public InstallPluginsResultFuncWrapper (Gst.PbUtils.InstallPluginsResultFunc managed)
75                 {
76                         this.managed = managed;
77                         if (managed != null)
78                                 NativeDelegate = new InstallPluginsResultFuncNative (NativeCallback);
79                 }
80
81                 public static Gst.PbUtils.InstallPluginsResultFunc GetManagedDelegate (InstallPluginsResultFuncNative native)
82                 {
83                         if (native == null)
84                                 return null;
85                         InstallPluginsResultFuncWrapper wrapper = (InstallPluginsResultFuncWrapper) native.Target;
86                         if (wrapper == null)
87                                 return null;
88                         return wrapper.managed;
89                 }
90         }
91 #endregion
92 }