File: Gtk_Builder.cs

package info (click to toggle)
gnome-subtitles 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 103,144 kB
  • sloc: xml: 406,395; cs: 364,495; ansic: 3,104; perl: 1,477; sh: 769; python: 545; javascript: 500; makefile: 49
file content (383 lines) | stat: -rw-r--r-- 13,928 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class Builder : GLib.Object {

		public Builder (IntPtr raw) : base(raw) {}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_new();

		public Builder () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Builder)) {
				CreateNativeObject (new string [0], new GLib.Value[0]);
				return;
			}
			Raw = gtk_builder_new();
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_get_translation_domain(IntPtr raw);

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gtk_builder_set_translation_domain(IntPtr raw, IntPtr domain);

		[GLib.Property ("translation-domain")]
		public string TranslationDomain {
			get  {
				IntPtr raw_ret = gtk_builder_get_translation_domain(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
			set  {
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gtk_builder_set_translation_domain(Handle, native_value);
				GLib.Marshaller.Free (native_value);
			}
		}

		static GetTypeFromNameNativeDelegate GetTypeFromName_cb_delegate;
		static GetTypeFromNameNativeDelegate GetTypeFromNameVMCallback {
			get {
				if (GetTypeFromName_cb_delegate == null)
					GetTypeFromName_cb_delegate = new GetTypeFromNameNativeDelegate (GetTypeFromName_cb);
				return GetTypeFromName_cb_delegate;
			}
		}

		static void OverrideGetTypeFromName (GLib.GType gtype)
		{
			OverrideGetTypeFromName (gtype, GetTypeFromNameVMCallback);
		}

		static void OverrideGetTypeFromName (GLib.GType gtype, GetTypeFromNameNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_type_from_name"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr GetTypeFromNameNativeDelegate (IntPtr inst, IntPtr type_name);

		static IntPtr GetTypeFromName_cb (IntPtr inst, IntPtr type_name)
		{
			try {
				Builder __obj = GLib.Object.GetObject (inst, false) as Builder;
				GLib.GType __result;
				__result = __obj.OnGetTypeFromName (GLib.Marshaller.Utf8PtrToString (type_name));
				return __result.Val;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Builder), ConnectionMethod="OverrideGetTypeFromName")]
		protected virtual GLib.GType OnGetTypeFromName (string type_name)
		{
			return InternalGetTypeFromName (type_name);
		}

		private GLib.GType InternalGetTypeFromName (string type_name)
		{
			GetTypeFromNameNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("get_type_from_name"));
				unmanaged = (GetTypeFromNameNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetTypeFromNameNativeDelegate));
			}
			if (unmanaged == null) return GLib.GType.None;

			IntPtr native_type_name = GLib.Marshaller.StringToPtrGStrdup (type_name);
			IntPtr __result = unmanaged (this.Handle, native_type_name);
			GLib.Marshaller.Free (native_type_name);
			return new GLib.GType(__result);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("get_type_from_name"
							, GLib.Object.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // get_type_from_name
							, null
							, "_gtk_reserved1"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved1
							, "get_type_from_name"
							, "_gtk_reserved2"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved2"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved2
							, "_gtk_reserved1"
							, "_gtk_reserved3"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved3
							, "_gtk_reserved2"
							, "_gtk_reserved4"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved4"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved4
							, "_gtk_reserved3"
							, "_gtk_reserved5"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved5"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved5
							, "_gtk_reserved4"
							, "_gtk_reserved6"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved6"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved6
							, "_gtk_reserved5"
							, "_gtk_reserved7"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved7"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved7
							, "_gtk_reserved6"
							, "_gtk_reserved8"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved8"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved8
							, "_gtk_reserved7"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_from_file(IntPtr raw, IntPtr filename, out IntPtr error);

		public unsafe uint AddFromFile(string filename) {
			IntPtr native_filename = GLib.Marshaller.StringToFilenamePtr (filename);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_from_file(Handle, native_filename, out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_filename);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_from_resource(IntPtr raw, IntPtr resource_path, out IntPtr error);

		public unsafe uint AddFromResource(string resource_path) {
			IntPtr native_resource_path = GLib.Marshaller.StringToPtrGStrdup (resource_path);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_from_resource(Handle, native_resource_path, out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_resource_path);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_from_string(IntPtr raw, IntPtr buffer, UIntPtr length, out IntPtr error);

		public unsafe uint AddFromString(string buffer) {
			IntPtr native_buffer = GLib.Marshaller.StringToPtrGStrdup (buffer);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_from_string(Handle, native_buffer, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (buffer)), out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_buffer);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_objects_from_file(IntPtr raw, IntPtr filename, IntPtr object_ids, out IntPtr error);

		public unsafe uint AddObjectsFromFile(string filename, string object_ids) {
			IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_objects_from_file(Handle, native_filename, GLib.Marshaller.StringToPtrGStrdup(object_ids), out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_filename);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_objects_from_resource(IntPtr raw, IntPtr resource_path, IntPtr object_ids, out IntPtr error);

		public unsafe uint AddObjectsFromResource(string resource_path, string object_ids) {
			IntPtr native_resource_path = GLib.Marshaller.StringToPtrGStrdup (resource_path);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_objects_from_resource(Handle, native_resource_path, GLib.Marshaller.StringToPtrGStrdup(object_ids), out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_resource_path);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_add_objects_from_string(IntPtr raw, IntPtr buffer, UIntPtr length, IntPtr object_ids, out IntPtr error);

		public unsafe uint AddObjectsFromString(string buffer, string object_ids) {
			IntPtr native_buffer = GLib.Marshaller.StringToPtrGStrdup (buffer);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_add_objects_from_string(Handle, native_buffer, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (buffer)), GLib.Marshaller.StringToPtrGStrdup(object_ids), out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_buffer);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gtk_builder_error_quark();

		public static int ErrorQuark { 
			get {
				int raw_ret = gtk_builder_error_quark();
				int ret = raw_ret;
				return ret;
			}
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gtk_builder_expose_object(IntPtr raw, IntPtr name, IntPtr objekt);

		public void ExposeObject(string name, GLib.Object objekt) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			gtk_builder_expose_object(Handle, native_name, objekt == null ? IntPtr.Zero : objekt.Handle);
			GLib.Marshaller.Free (native_name);
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe uint gtk_builder_extend_with_template(IntPtr raw, IntPtr widget, IntPtr template_type, IntPtr buffer, UIntPtr length, out IntPtr error);

		public unsafe uint ExtendWithTemplate(Gtk.Widget widget, GLib.GType template_type, string buffer) {
			IntPtr native_buffer = GLib.Marshaller.StringToPtrGStrdup (buffer);
			IntPtr error = IntPtr.Zero;
			uint raw_ret = gtk_builder_extend_with_template(Handle, widget == null ? IntPtr.Zero : widget.Handle, template_type.Val, native_buffer, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (buffer)), out error);
			uint ret = raw_ret;
			GLib.Marshaller.Free (native_buffer);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_get_application(IntPtr raw);

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gtk_builder_set_application(IntPtr raw, IntPtr application);

		public Gtk.Application Application { 
			get {
				IntPtr raw_ret = gtk_builder_get_application(Handle);
				Gtk.Application ret = GLib.Object.GetObject(raw_ret) as Gtk.Application;
				return ret;
			}
			set {
				gtk_builder_set_application(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_get_object(IntPtr raw, IntPtr name);

		public GLib.Object GetObject(string name) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			IntPtr raw_ret = gtk_builder_get_object(Handle, native_name);
			GLib.Object ret = GLib.Object.GetObject (raw_ret);
			GLib.Marshaller.Free (native_name);
			return ret;
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_get_objects(IntPtr raw);

		public GLib.Object[] Objects { 
			get {
				IntPtr raw_ret = gtk_builder_get_objects(Handle);
				GLib.Object[] ret = (GLib.Object[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.SList), true, false, typeof(GLib.Object));
				return ret;
			}
		}

		[DllImport("gtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gtk_builder_get_type();

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_builder_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, GLib.Object.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, null
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}