pango.vala 31 KB
Newer Older
1
[CCode (cprefix = "Pango", lower_case_cprefix = "pango_")]
2
namespace Pango {
3
	[CCode (cprefix = "PANGO_ALIGN_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
4
5
6
7
8
	public enum Alignment {
		LEFT,
		CENTER,
		RIGHT,
	}
9
	[CCode (cprefix = "PANGO_ATTR_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
	public enum AttrType {
		INVALID,
		LANGUAGE,
		FAMILY,
		STYLE,
		WEIGHT,
		VARIANT,
		STRETCH,
		SIZE,
		FONT_DESC,
		FOREGROUND,
		BACKGROUND,
		UNDERLINE,
		STRIKETHROUGH,
		RISE,
		SHAPE,
		SCALE,
		FALLBACK,
		LETTER_SPACING,
		UNDERLINE_COLOR,
		STRIKETHROUGH_COLOR,
		ABSOLUTE_SIZE,
Jürg Billeter's avatar
Jürg Billeter committed
32
33
		GRAVITY,
		GRAVITY_HINT,
Jürg Billeter's avatar
Jürg Billeter committed
34
	}
35
	[CCode (cprefix = "PANGO_COVERAGE_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
36
37
38
39
40
41
	public enum CoverageLevel {
		NONE,
		FALLBACK,
		APPROXIMATE,
		EXACT,
	}
42
	[CCode (cprefix = "PANGO_DIRECTION_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
43
44
45
46
47
48
49
50
51
	public enum Direction {
		LTR,
		RTL,
		TTB_LTR,
		TTB_RTL,
		WEAK_LTR,
		WEAK_RTL,
		NEUTRAL,
	}
52
	[CCode (cprefix = "PANGO_ELLIPSIZE_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
53
54
55
56
57
58
	public enum EllipsizeMode {
		NONE,
		START,
		MIDDLE,
		END,
	}
59
	[CCode (cprefix = "PANGO_FONT_MASK_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
60
61
62
63
64
65
66
	public enum FontMask {
		FAMILY,
		STYLE,
		VARIANT,
		WEIGHT,
		STRETCH,
		SIZE,
Jürg Billeter's avatar
Jürg Billeter committed
67
68
		GRAVITY,
	}
69
	[CCode (cprefix = "PANGO_GRAVITY_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
70
71
72
73
74
75
76
	public enum Gravity {
		SOUTH,
		EAST,
		NORTH,
		WEST,
		AUTO,
	}
77
	[CCode (cprefix = "PANGO_GRAVITY_HINT_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
78
79
80
81
	public enum GravityHint {
		NATURAL,
		STRONG,
		LINE,
Jürg Billeter's avatar
Jürg Billeter committed
82
	}
83
	[CCode (cprefix = "PANGO_RENDER_PART_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
84
85
86
87
88
89
	public enum RenderPart {
		FOREGROUND,
		BACKGROUND,
		UNDERLINE,
		STRIKETHROUGH,
	}
90
	[CCode (cprefix = "PANGO_SCRIPT_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
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
	public enum Script {
		INVALID_CODE,
		COMMON,
		INHERITED,
		ARABIC,
		ARMENIAN,
		BENGALI,
		BOPOMOFO,
		CHEROKEE,
		COPTIC,
		CYRILLIC,
		DESERET,
		DEVANAGARI,
		ETHIOPIC,
		GEORGIAN,
		GOTHIC,
		GREEK,
		GUJARATI,
		GURMUKHI,
		HAN,
		HANGUL,
		HEBREW,
		HIRAGANA,
		KANNADA,
		KATAKANA,
		KHMER,
		LAO,
		LATIN,
		MALAYALAM,
		MONGOLIAN,
		MYANMAR,
		OGHAM,
		OLD_ITALIC,
		ORIYA,
		RUNIC,
		SINHALA,
		SYRIAC,
		TAMIL,
		TELUGU,
		THAANA,
		THAI,
		TIBETAN,
		CANADIAN_ABORIGINAL,
		YI,
		TAGALOG,
		HANUNOO,
		BUHID,
		TAGBANWA,
		BRAILLE,
		CYPRIOT,
		LIMBU,
		OSMANYA,
		SHAVIAN,
		LINEAR_B,
		TAI_LE,
		UGARITIC,
		NEW_TAI_LUE,
		BUGINESE,
		GLAGOLITIC,
		TIFINAGH,
		SYLOTI_NAGRI,
		OLD_PERSIAN,
		KHAROSHTHI,
		UNKNOWN,
		BALINESE,
		CUNEIFORM,
		PHOENICIAN,
		PHAGS_PA,
		NKO,
	}
161
	[CCode (cprefix = "PANGO_STRETCH_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
162
163
164
165
166
167
168
169
170
171
172
	public enum Stretch {
		ULTRA_CONDENSED,
		EXTRA_CONDENSED,
		CONDENSED,
		SEMI_CONDENSED,
		NORMAL,
		SEMI_EXPANDED,
		EXPANDED,
		EXTRA_EXPANDED,
		ULTRA_EXPANDED,
	}
173
	[CCode (cprefix = "PANGO_STYLE_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
174
175
176
177
178
	public enum Style {
		NORMAL,
		OBLIQUE,
		ITALIC,
	}
179
	[CCode (cprefix = "PANGO_TAB_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
180
181
182
	public enum TabAlign {
		LEFT,
	}
183
	[CCode (cprefix = "PANGO_UNDERLINE_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
184
185
186
187
188
189
190
	public enum Underline {
		NONE,
		SINGLE,
		DOUBLE,
		LOW,
		ERROR,
	}
191
	[CCode (cprefix = "PANGO_VARIANT_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
192
193
194
195
	public enum Variant {
		NORMAL,
		SMALL_CAPS,
	}
196
	[CCode (cprefix = "PANGO_WEIGHT_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
197
198
199
200
201
202
203
204
205
	public enum Weight {
		ULTRALIGHT,
		LIGHT,
		NORMAL,
		SEMIBOLD,
		BOLD,
		ULTRABOLD,
		HEAVY,
	}
206
	[CCode (cprefix = "PANGO_WRAP_", cheader_filename = "pango/pango.h")]
Jürg Billeter's avatar
Jürg Billeter committed
207
208
209
210
211
	public enum WrapMode {
		WORD,
		CHAR,
		WORD_CHAR,
	}
Jürg Billeter's avatar
Jürg Billeter committed
212
	[CCode (cheader_filename = "pango/pango.h")]
213
214
215
	public class CairoFontMap : GLib.Object {
		public weak Pango.Context create_context ();
		public static weak Pango.FontMap get_default ();
216
		public Cairo.FontType get_font_type ();
217
218
219
		public double get_resolution ();
		public static GLib.Type get_type ();
		public CairoFontMap ();
220
		public CairoFontMap.for_font_type (Cairo.FontType fonttype);
221
222
223
		public void set_resolution (double dpi);
	}
	[CCode (cheader_filename = "pango/pango.h")]
224
225
	public class Context : GLib.Object {
		public Pango.Direction get_base_dir ();
Jürg Billeter's avatar
Jürg Billeter committed
226
		public Pango.Gravity get_base_gravity ();
227
		public weak Pango.FontDescription get_font_description ();
228
		public weak Pango.FontMap get_font_map ();
Jürg Billeter's avatar
Jürg Billeter committed
229
230
		public Pango.Gravity get_gravity ();
		public Pango.GravityHint get_gravity_hint ();
231
		public weak Pango.Language get_language ();
232
		public Pango.Matrix get_matrix ();
233
		public weak Pango.FontMetrics get_metrics (Pango.FontDescription desc, Pango.Language language);
234
		public static GLib.Type get_type ();
235
236
		[NoArrayLength]
		public void list_families (Pango.FontFamily[] families, int n_families);
237
238
		public weak Pango.Font load_font (Pango.FontDescription desc);
		public weak Pango.Fontset load_fontset (Pango.FontDescription desc, Pango.Language language);
239
		public void set_base_dir (Pango.Direction direction);
Jürg Billeter's avatar
Jürg Billeter committed
240
		public void set_base_gravity (Pango.Gravity gravity);
241
		public void set_font_description (Pango.FontDescription desc);
Jürg Billeter's avatar
Jürg Billeter committed
242
		public void set_gravity_hint (Pango.GravityHint hint);
243
		public void set_language (Pango.Language language);
244
		public void set_matrix (out Pango.Matrix matrix);
245
	}
Jürg Billeter's avatar
Jürg Billeter committed
246
	[CCode (cheader_filename = "pango/pango.h")]
247
	public class Font : GLib.Object {
248
249
250
251
		public weak Pango.FontDescription describe ();
		public weak Pango.FontDescription describe_with_absolute_size ();
		[NoArrayLength]
		public static void descriptions_free (Pango.FontDescription[] descs, int n_descs);
252
253
254
		public weak Pango.EngineShape find_shaper (Pango.Language language, uint ch);
		public weak Pango.Coverage get_coverage (Pango.Language language);
		public weak Pango.FontMap get_font_map ();
255
		public void get_glyph_extents (uint glyph, out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
256
		public weak Pango.FontMetrics get_metrics (Pango.Language language);
257
		public static GLib.Type get_type ();
258
	}
Jürg Billeter's avatar
Jürg Billeter committed
259
	[CCode (cheader_filename = "pango/pango.h")]
260
261
	public class Fontset : GLib.Object {
		public void @foreach (Pango.FontsetForeachFunc func, pointer data);
262
		public weak Pango.Font get_font (uint wc);
263
		public weak Pango.FontMetrics get_metrics ();
264
		public static GLib.Type get_type ();
265
	}
Jürg Billeter's avatar
Jürg Billeter committed
266
	[CCode (cheader_filename = "pango/pango.h")]
267
	public class FontFace : GLib.Object {
268
		public weak Pango.FontDescription describe ();
269
		public weak string get_face_name ();
270
		public static GLib.Type get_type ();
271
		public bool is_synthesized ();
272
273
		[NoArrayLength]
		public void list_sizes (int[] sizes, int n_sizes);
274
	}
Jürg Billeter's avatar
Jürg Billeter committed
275
	[CCode (cheader_filename = "pango/pango.h")]
276
	public class FontFamily : GLib.Object {
277
		public weak string get_name ();
278
		public static GLib.Type get_type ();
279
		public bool is_monospace ();
280
281
		[NoArrayLength]
		public void list_faces (Pango.FontFace[] faces, int n_faces);
282
	}
Jürg Billeter's avatar
Jürg Billeter committed
283
	[CCode (cheader_filename = "pango/pango.h")]
284
	public class FontMap : GLib.Object {
285
		public static GLib.Type get_type ();
286
287
		[NoArrayLength]
		public void list_families (Pango.FontFamily[] families, int n_families);
288
289
		public weak Pango.Font load_font (Pango.Context context, Pango.FontDescription desc);
		public weak Pango.Fontset load_fontset (Pango.Context context, Pango.FontDescription desc, Pango.Language language);
290
	}
Jürg Billeter's avatar
Jürg Billeter committed
291
	[CCode (cheader_filename = "pango/pango.h")]
292
293
	public class Layout : GLib.Object {
		public void context_changed ();
294
		public weak Pango.Layout copy ();
295
		public Pango.Alignment get_alignment ();
296
		public weak Pango.AttrList get_attributes ();
297
		public bool get_auto_dir ();
298
		public weak Pango.Context get_context ();
299
		public void get_cursor_pos (int index_, out Pango.Rectangle strong_pos, out Pango.Rectangle weak_pos);
300
		public Pango.EllipsizeMode get_ellipsize ();
301
		public void get_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
302
		public weak Pango.FontDescription get_font_description ();
303
		public int get_indent ();
304
		public weak Pango.LayoutIter get_iter ();
305
		public bool get_justify ();
306
		public weak Pango.LayoutLine get_line (int line);
307
		public int get_line_count ();
308
		public weak Pango.LayoutLine get_line_readonly (int line);
309
310
		public weak GLib.SList get_lines ();
		public weak GLib.SList get_lines_readonly ();
311
312
		[NoArrayLength]
		public void get_log_attrs (Pango.LogAttr[] attrs, int n_attrs);
313
		public void get_pixel_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
314
315
316
317
		public void get_pixel_size (int width, int height);
		public bool get_single_paragraph_mode ();
		public void get_size (int width, int height);
		public int get_spacing ();
318
		public weak Pango.TabArray get_tabs ();
319
		public weak string get_text ();
320
		public static GLib.Type get_type ();
Jürg Billeter's avatar
Jürg Billeter committed
321
		public int get_unknown_glyphs_count ();
322
323
324
		public int get_width ();
		public Pango.WrapMode get_wrap ();
		public void index_to_line_x (int index_, bool trailing, int line, int x_pos);
325
		public void index_to_pos (int index_, out Pango.Rectangle pos);
Jürg Billeter's avatar
Jürg Billeter committed
326
327
		public bool is_ellipsized ();
		public bool is_wrapped ();
328
		public void move_cursor_visually (bool strong, int old_index, int old_trailing, int direction, int new_index, int new_trailing);
329
		public Layout (Pango.Context context);
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
		public void set_alignment (Pango.Alignment alignment);
		public void set_attributes (Pango.AttrList attrs);
		public void set_auto_dir (bool auto_dir);
		public void set_ellipsize (Pango.EllipsizeMode ellipsize);
		public void set_font_description (Pango.FontDescription desc);
		public void set_indent (int indent);
		public void set_justify (bool justify);
		public void set_markup (string markup, int length);
		public void set_markup_with_accel (string markup, int length, unichar accel_marker, unichar accel_char);
		public void set_single_paragraph_mode (bool setting);
		public void set_spacing (int spacing);
		public void set_tabs (Pango.TabArray tabs);
		public void set_text (string text, int length);
		public void set_width (int width);
		public void set_wrap (Pango.WrapMode wrap);
		public bool xy_to_index (int x, int y, int index_, int trailing);
	}
Jürg Billeter's avatar
Jürg Billeter committed
347
	[CCode (cheader_filename = "pango/pango.h")]
348
	public class Renderer : GLib.Object {
349
		public Pango.Matrix matrix;
350
351
		public void activate ();
		public void deactivate ();
352
353
354
		public virtual void draw_error_underline (int x, int y, int width, int height);
		public virtual void draw_glyph (Pango.Font font, uint glyph, double x, double y);
		public virtual void draw_glyphs (Pango.Font font, Pango.GlyphString glyphs, int x, int y);
355
356
		public void draw_layout (Pango.Layout layout, int x, int y);
		public void draw_layout_line (Pango.LayoutLine line, int x, int y);
357
358
		public virtual void draw_rectangle (Pango.RenderPart part, int x, int y, int width, int height);
		public virtual void draw_trapezoid (Pango.RenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22);
359
360
		public Pango.Color get_color (Pango.RenderPart part);
		public Pango.Matrix get_matrix ();
361
		public static GLib.Type get_type ();
362
		public virtual void part_changed (Pango.RenderPart part);
363
364
		public void set_color (Pango.RenderPart part, out Pango.Color color);
		public void set_matrix (out Pango.Matrix matrix);
365
	}
366
	[ReferenceType]
367
	[CCode (cheader_filename = "pango/pango.h")]
368
369
370
371
	public struct Analysis {
		public weak Pango.EngineShape shape_engine;
		public weak Pango.EngineLang lang_engine;
		public weak Pango.Font font;
372
		public uchar level;
Jürg Billeter's avatar
Jürg Billeter committed
373
		public uchar gravity;
374
		public uchar flags;
375
		public uchar script;
376
		public weak Pango.Language language;
377
378
		public weak GLib.SList extra_attrs;
	}
379
	[ReferenceType]
380
	[CCode (cheader_filename = "pango/pango.h")]
381
	public struct AttrClass {
382
		public Pango.AttrType type;
383
	}
384
	[ReferenceType]
385
	[CCode (cheader_filename = "pango/pango.h")]
386
387
	public struct AttrColor {
		public weak Pango.Attribute attr;
388
		public Pango.Color color;
389
	}
390
	[ReferenceType]
391
	[CCode (cheader_filename = "pango/pango.h")]
392
393
	public struct AttrFloat {
		public weak Pango.Attribute attr;
394
		public double value;
395
	}
396
	[ReferenceType]
397
	[CCode (cheader_filename = "pango/pango.h")]
398
399
	public struct AttrFontDesc {
		public weak Pango.Attribute attr;
400
		public weak Pango.FontDescription desc;
401
		public AttrFontDesc (Pango.FontDescription desc);
402
	}
403
	[ReferenceType]
404
	[CCode (cheader_filename = "pango/pango.h")]
405
406
	public struct AttrInt {
		public weak Pango.Attribute attr;
407
		public int value;
408
	}
409
	[ReferenceType]
410
	[CCode (cheader_filename = "pango/pango.h")]
411
	public struct AttrIterator {
412
		public weak Pango.AttrIterator copy ();
413
		public void destroy ();
414
		public weak Pango.Attribute get (Pango.AttrType type);
415
		public weak GLib.SList get_attrs ();
416
417
418
419
		public void get_font (Pango.FontDescription desc, Pango.Language language, GLib.SList extra_attrs);
		public bool next ();
		public void range (int start, int end);
	}
420
	[ReferenceType]
421
	[CCode (cheader_filename = "pango/pango.h")]
422
423
	public struct AttrLanguage {
		public weak Pango.Attribute attr;
424
		public weak Pango.Language value;
425
		public AttrLanguage (Pango.Language language);
426
	}
427
	[ReferenceType]
428
	[CCode (cheader_filename = "pango/pango.h")]
429
430
	public struct AttrList {
		public void change (Pango.Attribute attr);
431
432
		public weak Pango.AttrList copy ();
		public weak Pango.AttrList filter (Pango.AttrFilterFunc func, pointer data);
433
		public weak Pango.AttrIterator get_iterator ();
434
		public static GLib.Type get_type ();
435
436
		public void insert (Pango.Attribute attr);
		public void insert_before (Pango.Attribute attr);
437
		public AttrList ();
438
		public weak Pango.AttrList @ref ();
439
440
441
		public void splice (Pango.AttrList other, int pos, int len);
		public void unref ();
	}
442
	[ReferenceType]
443
	[CCode (cheader_filename = "pango/pango.h")]
444
445
	public struct AttrShape {
		public weak Pango.Attribute attr;
446
447
		public Pango.Rectangle ink_rect;
		public Pango.Rectangle logical_rect;
448
449
450
		public pointer data;
		public Pango.AttrDataCopyFunc copy_func;
		public GLib.DestroyNotify destroy_func;
451
452
		public AttrShape (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
		public AttrShape.with_data (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect, pointer data, Pango.AttrDataCopyFunc copy_func, GLib.DestroyNotify destroy_func);
453
	}
454
	[ReferenceType]
455
	[CCode (cheader_filename = "pango/pango.h")]
456
457
	public struct AttrSize {
		public weak Pango.Attribute attr;
458
459
		public int size;
		public uint absolute;
460
		public AttrSize (int size);
461
	}
462
	[ReferenceType]
463
	[CCode (cheader_filename = "pango/pango.h")]
464
465
466
467
	public struct AttrString {
		public weak Pango.Attribute attr;
		public weak string value;
	}
468
	[ReferenceType]
469
	[CCode (cheader_filename = "pango/pango.h")]
470
	public struct Attribute {
471
472
473
		public pointer klass;
		public uint start_index;
		public uint end_index;
474
		public weak Pango.Attribute copy ();
475
476
477
		public void destroy ();
		public bool equal (Pango.Attribute attr2);
	}
478
	[CCode (cheader_filename = "pango/pango.h")]
479
	public struct Color {
480
481
482
		public ushort red;
		public ushort green;
		public ushort blue;
483
		[InstanceByReference]
484
		public Pango.Color copy ();
485
		[InstanceByReference]
486
		public void free ();
487
		public static GLib.Type get_type ();
488
		[InstanceByReference]
489
		public bool parse (string spec);
490
		[InstanceByReference]
491
		public weak string to_string ();
492
	}
493
	[ReferenceType]
494
	[CCode (cheader_filename = "pango/pango.h")]
495
	public struct Coverage {
496
		public weak Pango.Coverage copy ();
497
		[NoArrayLength]
498
		public static weak Pango.Coverage from_bytes (uchar[] bytes, int n_bytes);
499
		public Pango.CoverageLevel get (int index_);
500
		public void max (Pango.Coverage other);
501
		public Coverage ();
502
		public weak Pango.Coverage @ref ();
503
		public void set (int index_, Pango.CoverageLevel level);
504
		[NoArrayLength]
Jürg Billeter's avatar
Jürg Billeter committed
505
		public void to_bytes (uchar[] bytes, int n_bytes);
506
507
		public void unref ();
	}
508
	[ReferenceType]
509
	[CCode (cheader_filename = "pango/pango.h")]
510
511
	public struct EngineLang {
	}
512
	[ReferenceType]
513
	[CCode (cheader_filename = "pango/pango.h")]
514
515
	public struct EngineShape {
	}
516
	[ReferenceType]
517
	[CCode (cheader_filename = "pango/pango.h")]
518
519
	public struct FontDescription {
		public bool better_match (Pango.FontDescription old_match, Pango.FontDescription new_match);
520
521
		public weak Pango.FontDescription copy ();
		public weak Pango.FontDescription copy_static ();
522
523
		public bool equal (Pango.FontDescription desc2);
		public void free ();
524
		public static weak Pango.FontDescription from_string (string str);
525
		public weak string get_family ();
Jürg Billeter's avatar
Jürg Billeter committed
526
		public Pango.Gravity get_gravity ();
527
528
529
530
531
		public Pango.FontMask get_set_fields ();
		public int get_size ();
		public bool get_size_is_absolute ();
		public Pango.Stretch get_stretch ();
		public Pango.Style get_style ();
532
		public static GLib.Type get_type ();
533
534
535
536
537
		public Pango.Variant get_variant ();
		public Pango.Weight get_weight ();
		public uint hash ();
		public void merge (Pango.FontDescription desc_to_merge, bool replace_existing);
		public void merge_static (Pango.FontDescription desc_to_merge, bool replace_existing);
538
		public FontDescription ();
539
540
541
		public void set_absolute_size (double size);
		public void set_family (string family);
		public void set_family_static (string family);
Jürg Billeter's avatar
Jürg Billeter committed
542
		public void set_gravity (Pango.Gravity gravity);
543
544
545
546
547
		public void set_size (int size);
		public void set_stretch (Pango.Stretch stretch);
		public void set_style (Pango.Style style);
		public void set_variant (Pango.Variant variant);
		public void set_weight (Pango.Weight weight);
548
549
		public weak string to_filename ();
		public weak string to_string ();
550
551
		public void unset_fields (Pango.FontMask to_unset);
	}
552
	[ReferenceType]
553
	[CCode (cheader_filename = "pango/pango.h")]
554
555
556
557
558
559
560
	public struct FontMetrics {
		public int get_approximate_char_width ();
		public int get_approximate_digit_width ();
		public int get_ascent ();
		public int get_descent ();
		public int get_strikethrough_position ();
		public int get_strikethrough_thickness ();
561
		public static GLib.Type get_type ();
562
563
		public int get_underline_position ();
		public int get_underline_thickness ();
564
		public weak Pango.FontMetrics @ref ();
565
566
		public void unref ();
	}
567
	[ReferenceType]
568
	[CCode (cheader_filename = "pango/pango.h")]
569
	public struct GlyphGeometry {
570
571
572
		public int width;
		public int x_offset;
		public int y_offset;
573
	}
574
	[ReferenceType]
575
	[CCode (cheader_filename = "pango/pango.h")]
576
	public struct GlyphInfo {
577
		public uint glyph;
578
579
580
		public weak Pango.GlyphGeometry geometry;
		public weak Pango.GlyphVisAttr attr;
	}
581
	[ReferenceType]
582
	[CCode (cheader_filename = "pango/pango.h")]
583
	public struct GlyphItem {
584
585
		public weak Pango.Item item;
		public weak Pango.GlyphString glyphs;
586
		public weak GLib.SList apply_attrs (string text, Pango.AttrList list);
587
588
		public void free ();
		public void letter_space (string text, Pango.LogAttr log_attrs, int letter_spacing);
589
		public weak Pango.GlyphItem split (string text, int split_index);
590
	}
591
	[ReferenceType]
592
	[CCode (cheader_filename = "pango/pango.h")]
593
	public struct GlyphString {
594
		public int num_glyphs;
Jürg Billeter's avatar
Jürg Billeter committed
595
		public weak Pango.GlyphInfo glyphs;
596
		public int log_clusters;
597
		public weak Pango.GlyphString copy ();
598
599
		public void extents (Pango.Font font, out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
		public void extents_range (int start, int end, Pango.Font font, out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
600
601
		public void free ();
		public void get_logical_widths (string text, int length, int embedding_level, int logical_widths);
602
		public static GLib.Type get_type ();
603
604
		public int get_width ();
		public void index_to_x (string text, int length, Pango.Analysis analysis, int index_, bool trailing, int x_pos);
605
		public GlyphString ();
606
607
608
		public void set_size (int new_len);
		public void x_to_index (string text, int length, Pango.Analysis analysis, int x_pos, int index_, int trailing);
	}
609
	[ReferenceType]
610
	[CCode (cheader_filename = "pango/pango.h")]
611
	public struct GlyphVisAttr {
612
		public uint is_cluster_start;
613
	}
614
	[ReferenceType]
615
	[CCode (cheader_filename = "pango/pango.h")]
616
	public struct Item {
617
618
619
		public int offset;
		public int length;
		public int num_chars;
Jürg Billeter's avatar
Jürg Billeter committed
620
		public weak Pango.Analysis analysis;
621
		public weak Pango.Item copy ();
622
		public void free ();
623
		public static GLib.Type get_type ();
624
		public Item ();
625
		public weak Pango.Item split (int split_index, int split_offset);
626
	}
627
	[ReferenceType]
628
	[CCode (cheader_filename = "pango/pango.h")]
629
	public struct Language {
630
631
		public static weak Pango.Language from_string (string language);
		public static weak Pango.Language get_default ();
632
		public weak string get_sample_string ();
633
		public static GLib.Type get_type ();
634
635
636
		public bool includes_script (Pango.Script script);
		public bool matches (string range_list);
	}
637
	[ReferenceType]
638
	[CCode (cheader_filename = "pango/pango.h")]
639
640
641
642
	public struct LayoutIter {
		public bool at_last_line ();
		public void free ();
		public int get_baseline ();
643
644
		public void get_char_extents (out Pango.Rectangle logical_rect);
		public void get_cluster_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
645
		public int get_index ();
646
		public void get_layout_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
647
		public weak Pango.LayoutLine get_line ();
648
		public void get_line_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
649
		public weak Pango.LayoutLine get_line_readonly ();
650
		public void get_line_yrange (int y0_, int y1_);
651
		public weak Pango.LayoutRun get_run ();
652
		public void get_run_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
653
		public weak Pango.LayoutRun get_run_readonly ();
654
		public static GLib.Type get_type ();
655
656
657
658
659
		public bool next_char ();
		public bool next_cluster ();
		public bool next_line ();
		public bool next_run ();
	}
660
	[ReferenceType]
661
	[CCode (cheader_filename = "pango/pango.h")]
662
	public struct LayoutLine {
Jürg Billeter's avatar
Jürg Billeter committed
663
		public weak Pango.Layout layout;
664
665
		public int start_index;
		public int length;
Jürg Billeter's avatar
Jürg Billeter committed
666
		public weak GLib.SList runs;
667
668
		public uint is_paragraph_start;
		public uint resolved_dir;
669
670
		public void get_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
		public void get_pixel_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
671
		public static GLib.Type get_type ();
672
673
		[NoArrayLength]
		public void get_x_ranges (int start_index, int end_index, int[] ranges, int n_ranges);
674
		public void index_to_x (int index_, bool trailing, int x_pos);
675
		public weak Pango.LayoutLine @ref ();
676
677
678
		public void unref ();
		public bool x_to_index (int x_pos, int index_, int trailing);
	}
679
	[ReferenceType]
680
	[CCode (cheader_filename = "pango/pango.h")]
681
	public struct LayoutRun {
682
683
		public weak Pango.Item item;
		public weak Pango.GlyphString glyphs;
684
	}
685
	[ReferenceType]
686
	[CCode (cheader_filename = "pango/pango.h")]
687
	public struct LogAttr {
688
689
690
691
692
693
694
695
696
697
698
		public uint is_line_break;
		public uint is_mandatory_break;
		public uint is_char_break;
		public uint is_white;
		public uint is_cursor_position;
		public uint is_word_start;
		public uint is_word_end;
		public uint is_sentence_boundary;
		public uint is_sentence_start;
		public uint is_sentence_end;
		public uint backspace_deletes_character;
699
		public uint is_expandable_space;
700
	}
701
	[CCode (cheader_filename = "pango/pango.h")]
702
	public struct Matrix {
703
704
705
706
707
708
		public double xx;
		public double xy;
		public double yx;
		public double yy;
		public double x0;
		public double y0;
709
		[InstanceByReference]
710
		public void concat (out Pango.Matrix new_matrix);
711
		[InstanceByReference]
712
		public Pango.Matrix copy ();
713
		[InstanceByReference]
714
		public void free ();
715
		[InstanceByReference]
716
		public double get_font_scale_factor ();
717
		public static GLib.Type get_type ();
718
		[InstanceByReference]
719
		public void rotate (double degrees);
720
		[InstanceByReference]
721
		public void scale (double scale_x, double scale_y);
722
		[InstanceByReference]
Jürg Billeter's avatar
Jürg Billeter committed
723
		public void transform_distance (double dx, double dy);
724
		[InstanceByReference]
725
		public void transform_pixel_rectangle (out Pango.Rectangle rect);
726
		[InstanceByReference]
Jürg Billeter's avatar
Jürg Billeter committed
727
		public void transform_point (double x, double y);
728
		[InstanceByReference]
729
		public void transform_rectangle (out Pango.Rectangle rect);
730
		[InstanceByReference]
731
732
		public void translate (double tx, double ty);
	}
733
	[CCode (cheader_filename = "pango/pango.h")]
734
	public struct Rectangle {
735
736
737
738
		public int x;
		public int y;
		public int width;
		public int height;
739
	}
740
	[ReferenceType]
741
	[CCode (cheader_filename = "pango/pango.h")]
742
743
744
	public struct ScriptIter {
		public void free ();
		public void get_range (string start, string end, Pango.Script script);
745
		public ScriptIter (string text, int length);
746
747
		public bool next ();
	}
748
	[ReferenceType]
749
	[CCode (cheader_filename = "pango/pango.h")]
750
	public struct TabArray {
751
		public weak Pango.TabArray copy ();
752
753
754
755
756
		public void free ();
		public bool get_positions_in_pixels ();
		public int get_size ();
		public void get_tab (int tab_index, Pango.TabAlign alignment, int location);
		public void get_tabs (Pango.TabAlign alignments, int locations);
757
		public static GLib.Type get_type ();
758
		public TabArray (int initial_size, bool positions_in_pixels);
759
		public TabArray.with_positions (int size, bool positions_in_pixels, Pango.TabAlign first_alignment, ...);
760
761
762
		public void resize (int new_size);
		public void set_tab (int tab_index, Pango.TabAlign alignment, int location);
	}
763
	[ReferenceType]
764
	[CCode (cheader_filename = "pango/pango.h")]
765
766
767
	public struct Win32FontCache {
		public void free ();
		public pointer load (pointer logfont);
768
		public pointer loadw (pointer logfont);
769
		public Win32FontCache ();
770
771
		public void unload (pointer hfont);
	}
772
	[ReferenceType]
773
	[CCode (cheader_filename = "pango/pango.h")]
774
	public struct Attr {
775
776
777
778
779
780
781
782
783
784
785
786
787
		public static weak Pango.Attribute background_new (ushort red, ushort green, ushort blue);
		public static weak Pango.Attribute fallback_new (bool enable_fallback);
		public static weak Pango.Attribute family_new (string family);
		public static weak Pango.Attribute foreground_new (ushort red, ushort green, ushort blue);
		public static weak Pango.Attribute gravity_hint_new (Pango.GravityHint hint);
		public static weak Pango.Attribute gravity_new (Pango.Gravity gravity);
		public static weak Pango.Attribute letter_spacing_new (int letter_spacing);
		public static weak Pango.Attribute rise_new (int rise);
		public static weak Pango.Attribute scale_new (double scale_factor);
		public static weak Pango.Attribute stretch_new (Pango.Stretch stretch);
		public static weak Pango.Attribute strikethrough_color_new (ushort red, ushort green, ushort blue);
		public static weak Pango.Attribute strikethrough_new (bool strikethrough);
		public static weak Pango.Attribute style_new (Pango.Style style);
788
		public static Pango.AttrType type_register (string name);
789
790
791
792
		public static weak Pango.Attribute underline_color_new (ushort red, ushort green, ushort blue);
		public static weak Pango.Attribute underline_new (Pango.Underline underline);
		public static weak Pango.Attribute variant_new (Pango.Variant variant);
		public static weak Pango.Attribute weight_new (Pango.Weight weight);
793
	}
794
	[ReferenceType]
795
	[CCode (cheader_filename = "pango/pango.h")]
796
	public struct Cairo {
797
		public static weak Cairo.FontOptions context_get_font_options (Pango.Context context);
798
		public static double context_get_resolution (Pango.Context context);
799
		public static Pango.CairoShapeRendererFunc context_get_shape_renderer (Pango.Context context, pointer data);
800
		public static void context_set_font_options (Pango.Context context, Cairo.FontOptions options);
801
		public static void context_set_resolution (Pango.Context context, double dpi);
802
		public static void context_set_shape_renderer (Pango.Context context, Pango.CairoShapeRendererFunc func, pointer data, GLib.DestroyNotify dnotify);
803
804
		public static weak Pango.Layout create_layout (Cairo.Context cr);
		public static void error_underline_path (Cairo.Context cr, double x, double y, double width, double height);
805
		public static weak Cairo.ScaledFont font_get_scaled_font (Pango.Font font);
806
807
808
809
810
811
812
813
814
815
816
		public static void glyph_string_path (Cairo.Context cr, Pango.Font font