Back to development
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst / Context.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst {
5
6         using System;
7         using System.Collections;
8         using System.Collections.Generic;
9         using System.Runtime.InteropServices;
10
11 #region Autogenerated code
12         [StructLayout(LayoutKind.Sequential)]
13         public partial struct Context : IEquatable<Context> {
14
15
16                 public static Gst.Context Zero = new Gst.Context ();
17
18                 public static Gst.Context New(IntPtr raw) {
19                         if (raw == IntPtr.Zero)
20                                 return Gst.Context.Zero;
21                         return (Gst.Context) Marshal.PtrToStructure (raw, typeof (Gst.Context));
22                 }
23
24                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
25                 static extern IntPtr gst_context_new(IntPtr context_type, bool persistent);
26
27                 public static Context New(string context_type, bool persistent)
28                 {
29                         IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
30                         Context result = Context.New (gst_context_new(native_context_type, persistent));
31                         GLib.Marshaller.Free (native_context_type);
32                         return result;
33                 }
34
35                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
36                 static extern IntPtr gst_context_get_type();
37
38                 public static GLib.GType GType { 
39                         get {
40                                 IntPtr raw_ret = gst_context_get_type();
41                                 GLib.GType ret = new GLib.GType(raw_ret);
42                                 return ret;
43                         }
44                 }
45
46                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
47                 static extern IntPtr gst_context_get_context_type(IntPtr raw);
48
49                 public string ContextType { 
50                         get {
51                                 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
52                                 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
53                                 IntPtr raw_ret = gst_context_get_context_type(this_as_native);
54                                 string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
55                                 ReadNative (this_as_native, ref this);
56                                 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
57                                 return ret;
58                         }
59                 }
60
61                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
62                 static extern IntPtr gst_context_get_structure(IntPtr raw);
63
64                 public Gst.Structure Structure { 
65                         get {
66                                 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
67                                 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
68                                 IntPtr raw_ret = gst_context_get_structure(this_as_native);
69                                 Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), false);
70                                 ReadNative (this_as_native, ref this);
71                                 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
72                                 return ret;
73                         }
74                 }
75
76                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
77                 static extern bool gst_context_has_context_type(IntPtr raw, IntPtr context_type);
78
79                 public bool HasContextType(string context_type) {
80                         IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
81                         System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
82                         IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
83                         bool raw_ret = gst_context_has_context_type(this_as_native, native_context_type);
84                         bool ret = raw_ret;
85                         ReadNative (this_as_native, ref this);
86                         System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
87                         GLib.Marshaller.Free (native_context_type);
88                         return ret;
89                 }
90
91                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
92                 static extern bool gst_context_is_persistent(IntPtr raw);
93
94                 public bool IsPersistent { 
95                         get {
96                                 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
97                                 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
98                                 bool raw_ret = gst_context_is_persistent(this_as_native);
99                                 bool ret = raw_ret;
100                                 ReadNative (this_as_native, ref this);
101                                 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
102                                 return ret;
103                         }
104                 }
105
106                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
107                 static extern IntPtr gst_context_writable_structure(IntPtr raw);
108
109                 public Gst.Structure WritableStructure() {
110                         IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
111                         System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
112                         IntPtr raw_ret = gst_context_writable_structure(this_as_native);
113                         Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
114                         ReadNative (this_as_native, ref this);
115                         System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
116                         return ret;
117                 }
118
119                 static void ReadNative (IntPtr native, ref Gst.Context target)
120                 {
121                         target = New (native);
122                 }
123
124                 public bool Equals (Context other)
125                 {
126                         return true;
127                 }
128
129                 public override bool Equals (object other)
130                 {
131                         return other is Context && Equals ((Context) other);
132                 }
133
134                 public override int GetHashCode ()
135                 {
136                         return this.GetType ().FullName.GetHashCode ();
137                 }
138
139                 public static explicit operator GLib.Value (Gst.Context boxed)
140                 {
141                         GLib.Value val = GLib.Value.Empty;
142                         val.Init (Gst.Context.GType);
143                         val.Val = boxed;
144                         return val;
145                 }
146
147                 public static explicit operator Gst.Context (GLib.Value val)
148                 {
149                         return (Gst.Context) val.Val;
150                 }
151 #endregion
152         }
153 }