File: Gtk_CellRendererText.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 (659 lines) | stat: -rw-r--r-- 15,525 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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
// 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 CellRendererText : Gtk.CellRenderer {

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

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

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

		[GLib.Property ("text")]
		public string Text {
			get {
				GLib.Value val = GetProperty ("text");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("text", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("markup")]
		public string Markup {
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("markup", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("attributes")]
		public Pango.AttrList Attributes {
			get {
				GLib.Value val = GetProperty ("attributes");
				Pango.AttrList ret = (Pango.AttrList) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value, "PangoAttrList");
				SetProperty("attributes", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("single-paragraph-mode")]
		public bool SingleParagraphMode {
			get {
				GLib.Value val = GetProperty ("single-paragraph-mode");
				bool ret = (bool) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("single-paragraph-mode", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("background")]
		public string Background {
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("background", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("background-gdk")]
		public Gdk.Color BackgroundGdk {
			get {
				GLib.Value val = GetProperty ("background-gdk");
				Gdk.Color ret = (Gdk.Color) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = (GLib.Value) value;
				SetProperty("background-gdk", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("background-rgba")]
		public Gdk.RGBA BackgroundRgba {
			get {
				GLib.Value val = GetProperty ("background-rgba");
				Gdk.RGBA ret = (Gdk.RGBA) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("background-rgba", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("foreground")]
		public string Foreground {
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("foreground", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("foreground-gdk")]
		public Gdk.Color ForegroundGdk {
			get {
				GLib.Value val = GetProperty ("foreground-gdk");
				Gdk.Color ret = (Gdk.Color) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = (GLib.Value) value;
				SetProperty("foreground-gdk", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("foreground-rgba")]
		public Gdk.RGBA ForegroundRgba {
			get {
				GLib.Value val = GetProperty ("foreground-rgba");
				Gdk.RGBA ret = (Gdk.RGBA) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("foreground-rgba", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("editable")]
		public bool Editable {
			get {
				GLib.Value val = GetProperty ("editable");
				bool ret = (bool) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("editable", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("font")]
		public string Font {
			get {
				GLib.Value val = GetProperty ("font");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("font", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("font-desc")]
		public Pango.FontDescription FontDesc {
			get {
				GLib.Value val = GetProperty ("font-desc");
				Pango.FontDescription ret = (Pango.FontDescription) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value, "PangoFontDescription");
				SetProperty("font-desc", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("family")]
		public string Family {
			get {
				GLib.Value val = GetProperty ("family");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("family", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("style")]
		public Pango.Style Style {
			get {
				GLib.Value val = GetProperty ("style");
				Pango.Style ret = (Pango.Style) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("style", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("variant")]
		public Pango.Variant Variant {
			get {
				GLib.Value val = GetProperty ("variant");
				Pango.Variant ret = (Pango.Variant) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("variant", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("weight")]
		public int Weight {
			get {
				GLib.Value val = GetProperty ("weight");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("weight", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("stretch")]
		public Pango.Stretch Stretch {
			get {
				GLib.Value val = GetProperty ("stretch");
				Pango.Stretch ret = (Pango.Stretch) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("stretch", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("size")]
		public int Size {
			get {
				GLib.Value val = GetProperty ("size");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("size", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("size-points")]
		public double SizePoints {
			get {
				GLib.Value val = GetProperty ("size-points");
				double ret = (double) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("size-points", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("scale")]
		public double Scale {
			get {
				GLib.Value val = GetProperty ("scale");
				double ret = (double) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("scale", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("rise")]
		public int Rise {
			get {
				GLib.Value val = GetProperty ("rise");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("rise", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("strikethrough")]
		public bool Strikethrough {
			get {
				GLib.Value val = GetProperty ("strikethrough");
				bool ret = (bool) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("strikethrough", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("underline")]
		public Pango.Underline Underline {
			get {
				GLib.Value val = GetProperty ("underline");
				Pango.Underline ret = (Pango.Underline) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("underline", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("language")]
		public string Language {
			get {
				GLib.Value val = GetProperty ("language");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("language", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("ellipsize")]
		public Pango.EllipsizeMode Ellipsize {
			get {
				GLib.Value val = GetProperty ("ellipsize");
				Pango.EllipsizeMode ret = (Pango.EllipsizeMode) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("ellipsize", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("width-chars")]
		public int WidthChars {
			get {
				GLib.Value val = GetProperty ("width-chars");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("width-chars", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("max-width-chars")]
		public int MaxWidthChars {
			get {
				GLib.Value val = GetProperty ("max-width-chars");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("max-width-chars", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("wrap-mode")]
		public Pango.WrapMode WrapMode {
			get {
				GLib.Value val = GetProperty ("wrap-mode");
				Pango.WrapMode ret = (Pango.WrapMode) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("wrap-mode", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("wrap-width")]
		public int WrapWidth {
			get {
				GLib.Value val = GetProperty ("wrap-width");
				int ret = (int) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("wrap-width", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("alignment")]
		public Pango.Alignment Alignment {
			get {
				GLib.Value val = GetProperty ("alignment");
				Pango.Alignment ret = (Pango.Alignment) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("alignment", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("placeholder-text")]
		public string PlaceholderText {
			get {
				GLib.Value val = GetProperty ("placeholder-text");
				string ret = (string) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("placeholder-text", val);
				val.Dispose ();
			}
		}

		[GLib.Signal("edited")]
		public event Gtk.EditedHandler Edited {
			add {
				this.AddSignalHandler ("edited", value, typeof (Gtk.EditedArgs));
			}
			remove {
				this.RemoveSignalHandler ("edited", value);
			}
		}

		static EditedNativeDelegate Edited_cb_delegate;
		static EditedNativeDelegate EditedVMCallback {
			get {
				if (Edited_cb_delegate == null)
					Edited_cb_delegate = new EditedNativeDelegate (Edited_cb);
				return Edited_cb_delegate;
			}
		}

		static void OverrideEdited (GLib.GType gtype)
		{
			OverrideEdited (gtype, EditedVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void EditedNativeDelegate (IntPtr inst, IntPtr path, IntPtr new_text);

		static void Edited_cb (IntPtr inst, IntPtr path, IntPtr new_text)
		{
			try {
				CellRendererText __obj = GLib.Object.GetObject (inst, false) as CellRendererText;
				__obj.OnEdited (GLib.Marshaller.Utf8PtrToString (path), GLib.Marshaller.Utf8PtrToString (new_text));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.CellRendererText), ConnectionMethod="OverrideEdited")]
		protected virtual void OnEdited (string path, string new_text)
		{
			InternalEdited (path, new_text);
		}

		private void InternalEdited (string path, string new_text)
		{
			EditedNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("edited"));
				unmanaged = (EditedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(EditedNativeDelegate));
			}
			if (unmanaged == null) return;

			IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup (path);
			IntPtr native_new_text = GLib.Marshaller.StringToPtrGStrdup (new_text);
			unmanaged (this.Handle, native_path, native_new_text);
			GLib.Marshaller.Free (native_path);
			GLib.Marshaller.Free (native_new_text);
		}


		// 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("edited"
							, Gtk.CellRenderer.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // edited
							, null
							, "_gtk_reserved1"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // _gtk_reserved1
							, "edited"
							, "_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"
							, 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 IntPtr gtk_cell_renderer_text_get_type();

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

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

		public int FixedHeightFromFont { 
			set {
				gtk_cell_renderer_text_set_fixed_height_from_font(Handle, value);
			}
		}


		// 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"
							, Gtk.CellRenderer.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
	}
}