/
CoglPango-2.0.d.ts
743 lines (740 loc) · 33.7 KB
/
CoglPango-2.0.d.ts
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
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
/*
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* CoglPango-2.0
*/
import type * as Gjs from './Gjs';
import type PangoCairo from './PangoCairo-1.0';
import type cairo from './cairo-1.0';
import type Pango from './Pango-1.0';
import type HarfBuzz from './HarfBuzz-0.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type Cogl from './Cogl-2.0';
import type GL from './GL-1.0';
export namespace CoglPango {
function ensure_glyph_cache_for_layout(layout: Pango.Layout): void
function font_map_clear_glyph_cache(font_map: FontMap): void
function font_map_create_context(font_map: FontMap): Pango.Context
function font_map_get_renderer(font_map: FontMap): Pango.Renderer
function font_map_get_use_mipmapping(font_map: FontMap): Cogl.Bool
function font_map_new(): Pango.FontMap
function font_map_set_resolution(font_map: FontMap, dpi: number): void
function font_map_set_use_mipmapping(font_map: FontMap, value: Cogl.Bool): void
function render_layout(layout: Pango.Layout, x: number, y: number, color: Cogl.Color, flags: number): void
function render_layout_line(line: Pango.LayoutLine, x: number, y: number, color: Cogl.Color): void
function render_layout_subpixel(layout: Pango.Layout, x: number, y: number, color: Cogl.Color, flags: number): void
function show_layout(framebuffer: Cogl.Framebuffer, layout: Pango.Layout, x: number, y: number, color: Cogl.Color): void
function show_layout_line(framebuffer: Cogl.Framebuffer, line: Pango.LayoutLine, x: number, y: number, color: Cogl.Color): void
interface Renderer_ConstructProps extends Pango.Renderer_ConstructProps {
/* Constructor properties of CoglPango-2.0.CoglPango.Renderer */
context?: object
}
class Renderer {
/* Properties of CoglPango-2.0.CoglPango.Renderer */
readonly context: object
/* Fields of Pango-1.0.Pango.Renderer */
/**
* the current transformation matrix for
* the Renderer; may be %NULL, which should be treated the
* same as the identity matrix.
*/
matrix: Pango.Matrix
/* Fields of GObject-2.0.GObject.Object */
g_type_instance: GObject.TypeInstance
/* Methods of Pango-1.0.Pango.Renderer */
/**
* Does initial setup before rendering operations on `renderer`.
*
* [method`Pango`.Renderer.deactivate] should be called when done drawing.
* Calls such as [method`Pango`.Renderer.draw_layout] automatically
* activate the layout before drawing on it.
*
* Calls to [method`Pango`.Renderer.activate] and
* [method`Pango`.Renderer.deactivate] can be nested and the
* renderer will only be initialized and deinitialized once.
*/
activate(): void
/**
* Cleans up after rendering operations on `renderer`.
*
* See docs for [method`Pango`.Renderer.activate].
*/
deactivate(): void
/**
* Draw a squiggly line that approximately covers the given rectangle
* in the style of an underline used to indicate a spelling error.
*
* The width of the underline is rounded to an integer number
* of up/down segments and the resulting rectangle is centered
* in the original rectangle.
*
* This should be called while `renderer` is already active.
* Use [method`Pango`.Renderer.activate] to activate a renderer.
* @param x X coordinate of underline, in Pango units in user coordinate system
* @param y Y coordinate of underline, in Pango units in user coordinate system
* @param width width of underline, in Pango units in user coordinate system
* @param height height of underline, in Pango units in user coordinate system
*/
draw_error_underline(x: number, y: number, width: number, height: number): void
/**
* Draws a single glyph with coordinates in device space.
* @param font a `PangoFont`
* @param glyph the glyph index of a single glyph
* @param x X coordinate of left edge of baseline of glyph
* @param y Y coordinate of left edge of baseline of glyph
*/
draw_glyph(font: Pango.Font, glyph: Pango.Glyph, x: number, y: number): void
/**
* Draws the glyphs in `glyph_item` with the specified `PangoRenderer`,
* embedding the text associated with the glyphs in the output if the
* output format supports it.
*
* This is useful for rendering text in PDF.
*
* Note that this method does not handle attributes in `glyph_item`.
* If you want colors, shapes and lines handled automatically according
* to those attributes, you need to use pango_renderer_draw_layout_line()
* or pango_renderer_draw_layout().
*
* Note that `text` is the start of the text for layout, which is then
* indexed by `glyph_item->item->offset`.
*
* If `text` is %NULL, this simply calls [method`Pango`.Renderer.draw_glyphs].
*
* The default implementation of this method simply falls back to
* [method`Pango`.Renderer.draw_glyphs].
* @param text the UTF-8 text that `glyph_item` refers to
* @param glyph_item a `PangoGlyphItem`
* @param x X position of left edge of baseline, in user space coordinates in Pango units
* @param y Y position of left edge of baseline, in user space coordinates in Pango units
*/
draw_glyph_item(text: string | null, glyph_item: Pango.GlyphItem, x: number, y: number): void
/**
* Draws the glyphs in `glyphs` with the specified `PangoRenderer`.
* @param font a `PangoFont`
* @param glyphs a `PangoGlyphString`
* @param x X position of left edge of baseline, in user space coordinates in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates in Pango units.
*/
draw_glyphs(font: Pango.Font, glyphs: Pango.GlyphString, x: number, y: number): void
/**
* Draws `layout` with the specified `PangoRenderer`.
*
* This is equivalent to drawing the lines of the layout, at their
* respective positions relative to `x,` `y`.
* @param layout a `PangoLayout`
* @param x X position of left edge of baseline, in user space coordinates in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates in Pango units.
*/
draw_layout(layout: Pango.Layout, x: number, y: number): void
/**
* Draws `line` with the specified `PangoRenderer`.
*
* This draws the glyph items that make up the line, as well as
* shapes, backgrounds and lines that are specified by the attributes
* of those items.
* @param line a `PangoLayoutLine`
* @param x X position of left edge of baseline, in user space coordinates in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates in Pango units.
*/
draw_layout_line(line: Pango.LayoutLine, x: number, y: number): void
/**
* Draws an axis-aligned rectangle in user space coordinates with the
* specified `PangoRenderer`.
*
* This should be called while `renderer` is already active.
* Use [method`Pango`.Renderer.activate] to activate a renderer.
* @param part type of object this rectangle is part of
* @param x X position at which to draw rectangle, in user space coordinates in Pango units
* @param y Y position at which to draw rectangle, in user space coordinates in Pango units
* @param width width of rectangle in Pango units
* @param height height of rectangle in Pango units
*/
draw_rectangle(part: Pango.RenderPart, x: number, y: number, width: number, height: number): void
/**
* Draws a trapezoid with the parallel sides aligned with the X axis
* using the given `PangoRenderer`; coordinates are in device space.
* @param part type of object this trapezoid is part of
* @param y1_ Y coordinate of top of trapezoid
* @param x11 X coordinate of left end of top of trapezoid
* @param x21 X coordinate of right end of top of trapezoid
* @param y2 Y coordinate of bottom of trapezoid
* @param x12 X coordinate of left end of bottom of trapezoid
* @param x22 X coordinate of right end of bottom of trapezoid
*/
draw_trapezoid(part: Pango.RenderPart, y1_: number, x11: number, x21: number, y2: number, x12: number, x22: number): void
/**
* Gets the current alpha for the specified part.
* @param part the part to get the alpha for
*/
get_alpha(part: Pango.RenderPart): number
/**
* Gets the current rendering color for the specified part.
* @param part the part to get the color for
*/
get_color(part: Pango.RenderPart): Pango.Color | null
/**
* Gets the layout currently being rendered using `renderer`.
*
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape vfunc, for example.
*
* The returned layout should not be modified while still being
* rendered.
*/
get_layout(): Pango.Layout | null
/**
* Gets the layout line currently being rendered using `renderer`.
*
* Calling this function only makes sense from inside a subclass's
* methods, like in its draw_shape vfunc, for example.
*
* The returned layout line should not be modified while still being
* rendered.
*/
get_layout_line(): Pango.LayoutLine | null
/**
* Gets the transformation matrix that will be applied when
* rendering.
*
* See [method`Pango`.Renderer.set_matrix].
*/
get_matrix(): Pango.Matrix | null
/**
* Informs Pango that the way that the rendering is done
* for `part` has changed.
*
* This should be called if the rendering changes in a way that would
* prevent multiple pieces being joined together into one drawing call.
* For instance, if a subclass of `PangoRenderer` was to add a stipple
* option for drawing underlines, it needs to call
*
* ```
* pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
* ```
*
* When the stipple changes or underlines with different stipples
* might be joined together. Pango automatically calls this for
* changes to colors. (See [method`Pango`.Renderer.set_color])
* @param part the part for which rendering has changed.
*/
part_changed(part: Pango.RenderPart): void
/**
* Sets the alpha for part of the rendering.
*
* Note that the alpha may only be used if a color is
* specified for `part` as well.
* @param part the part to set the alpha for
* @param alpha an alpha value between 1 and 65536, or 0 to unset the alpha
*/
set_alpha(part: Pango.RenderPart, alpha: number): void
/**
* Sets the color for part of the rendering.
*
* Also see [method`Pango`.Renderer.set_alpha].
* @param part the part to change the color of
* @param color the new color or %NULL to unset the current color
*/
set_color(part: Pango.RenderPart, color?: Pango.Color | null): void
/**
* Sets the transformation matrix that will be applied when rendering.
* @param matrix a `PangoMatrix`, or %NULL to unset any existing matrix (No matrix set is the same as setting the identity matrix.)
*/
set_matrix(matrix?: Pango.Matrix | null): void
/* Methods of GObject-2.0.GObject.Object */
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on `source` to bind
* @param target the target #GObject
* @param target_property the property on `target` to bind
* @param flags flags to pass to #GBinding
*/
bind_property(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags): GObject.Binding
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* This function is the language bindings friendly version of
* g_object_bind_property_full(), using #GClosures instead of
* function pointers.
* @param source_property the property on `source` to bind
* @param target the target #GObject
* @param target_property the property on `target` to bind
* @param flags flags to pass to #GBinding
* @param transform_to a #GClosure wrapping the transformation function from the `source` to the `target,` or %NULL to use the default
* @param transform_from a #GClosure wrapping the transformation function from the `target` to the `source,` or %NULL to use the default
*/
bind_property_full(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags, transform_to: Function, transform_from: Function): GObject.Binding
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
*/
get_data(key: string): object | null
/**
* Gets a property of an object.
*
* The `value` can be:
*
* - an empty #GValue initialized by %G_VALUE_INIT, which will be
* automatically initialized with the expected type of the property
* (since GLib 2.60)
* - a #GValue initialized with the expected type of the property
* - a #GValue initialized with a type to which the expected type
* of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is
* responsible for freeing the memory by calling g_value_unset().
*
* Note that g_object_get_property() is really intended for language
* bindings, g_object_get() is much more convenient for C programming.
* @param property_name the name of the property to get
* @param value return location for the property value
*/
get_property(property_name: string, value: any): void
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
*/
get_qdata(quark: GLib.Quark): object | null
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: any[]): void
/**
* Checks whether `object` has a [floating][floating-ref] reference.
*/
is_floating(): boolean
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of `object`.
*/
notify(property_name: string): void
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* enum
* {
* PROP_0,
* PROP_FOO,
* PROP_LAST
* };
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
* 0, 100,
* 50,
* G_PARAM_READWRITE);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of `object`.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
*/
ref(): GObject.Object
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
*/
ref_sink(): GObject.Object
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: object | null): void
/**
* Sets a property on an object.
* @param property_name the name of the property to set
* @param value the value
*/
set_property(property_name: string, value: any): void
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
*/
steal_data(key: string): object | null
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
*/
steal_qdata(quark: GLib.Quark): object | null
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: Function): void
/* Virtual methods of Pango-1.0.Pango.Renderer */
vfunc_begin(): void
/**
* Draw a squiggly line that approximately covers the given rectangle
* in the style of an underline used to indicate a spelling error.
*
* The width of the underline is rounded to an integer number
* of up/down segments and the resulting rectangle is centered
* in the original rectangle.
*
* This should be called while `renderer` is already active.
* Use [method`Pango`.Renderer.activate] to activate a renderer.
* @param x X coordinate of underline, in Pango units in user coordinate system
* @param y Y coordinate of underline, in Pango units in user coordinate system
* @param width width of underline, in Pango units in user coordinate system
* @param height height of underline, in Pango units in user coordinate system
*/
vfunc_draw_error_underline(x: number, y: number, width: number, height: number): void
/**
* Draws a single glyph with coordinates in device space.
* @param font a `PangoFont`
* @param glyph the glyph index of a single glyph
* @param x X coordinate of left edge of baseline of glyph
* @param y Y coordinate of left edge of baseline of glyph
*/
vfunc_draw_glyph(font: Pango.Font, glyph: Pango.Glyph, x: number, y: number): void
/**
* Draws the glyphs in `glyph_item` with the specified `PangoRenderer`,
* embedding the text associated with the glyphs in the output if the
* output format supports it.
*
* This is useful for rendering text in PDF.
*
* Note that this method does not handle attributes in `glyph_item`.
* If you want colors, shapes and lines handled automatically according
* to those attributes, you need to use pango_renderer_draw_layout_line()
* or pango_renderer_draw_layout().
*
* Note that `text` is the start of the text for layout, which is then
* indexed by `glyph_item->item->offset`.
*
* If `text` is %NULL, this simply calls [method`Pango`.Renderer.draw_glyphs].
*
* The default implementation of this method simply falls back to
* [method`Pango`.Renderer.draw_glyphs].
* @param text the UTF-8 text that `glyph_item` refers to
* @param glyph_item a `PangoGlyphItem`
* @param x X position of left edge of baseline, in user space coordinates in Pango units
* @param y Y position of left edge of baseline, in user space coordinates in Pango units
*/
vfunc_draw_glyph_item(text: string | null, glyph_item: Pango.GlyphItem, x: number, y: number): void
/**
* Draws the glyphs in `glyphs` with the specified `PangoRenderer`.
* @param font a `PangoFont`
* @param glyphs a `PangoGlyphString`
* @param x X position of left edge of baseline, in user space coordinates in Pango units.
* @param y Y position of left edge of baseline, in user space coordinates in Pango units.
*/
vfunc_draw_glyphs(font: Pango.Font, glyphs: Pango.GlyphString, x: number, y: number): void
/**
* Draws an axis-aligned rectangle in user space coordinates with the
* specified `PangoRenderer`.
*
* This should be called while `renderer` is already active.
* Use [method`Pango`.Renderer.activate] to activate a renderer.
* @param part type of object this rectangle is part of
* @param x X position at which to draw rectangle, in user space coordinates in Pango units
* @param y Y position at which to draw rectangle, in user space coordinates in Pango units
* @param width width of rectangle in Pango units
* @param height height of rectangle in Pango units
*/
vfunc_draw_rectangle(part: Pango.RenderPart, x: number, y: number, width: number, height: number): void
vfunc_draw_shape(attr: Pango.AttrShape, x: number, y: number): void
/**
* Draws a trapezoid with the parallel sides aligned with the X axis
* using the given `PangoRenderer`; coordinates are in device space.
* @param part type of object this trapezoid is part of
* @param y1_ Y coordinate of top of trapezoid
* @param x11 X coordinate of left end of top of trapezoid
* @param x21 X coordinate of right end of top of trapezoid
* @param y2 Y coordinate of bottom of trapezoid
* @param x12 X coordinate of left end of bottom of trapezoid
* @param x22 X coordinate of right end of bottom of trapezoid
*/
vfunc_draw_trapezoid(part: Pango.RenderPart, y1_: number, x11: number, x21: number, y2: number, x12: number, x22: number): void
vfunc_end(): void
/**
* Informs Pango that the way that the rendering is done
* for `part` has changed.
*
* This should be called if the rendering changes in a way that would
* prevent multiple pieces being joined together into one drawing call.
* For instance, if a subclass of `PangoRenderer` was to add a stipple
* option for drawing underlines, it needs to call
*
* ```
* pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
* ```
*
* When the stipple changes or underlines with different stipples
* might be joined together. Pango automatically calls this for
* changes to colors. (See [method`Pango`.Renderer.set_color])
* @param part the part for which rendering has changed.
*/
vfunc_part_changed(part: Pango.RenderPart): void
vfunc_prepare_run(run: Pango.LayoutRun): void
/* Virtual methods of GObject-2.0.GObject.Object */
vfunc_constructed(): void
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void
vfunc_dispose(): void
vfunc_finalize(): void
vfunc_get_property(property_id: number, value: any, pspec: GObject.ParamSpec): void
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void
vfunc_set_property(property_id: number, value: any, pspec: GObject.ParamSpec): void
/* Signals of GObject-2.0.GObject.Object */
/**
* The notify signal is emitted on an object when one of its properties has
* its value set through g_object_set_property(), g_object_set(), et al.
*
* Note that getting this signal doesn’t itself guarantee that the value of
* the property has actually changed. When it is emitted is determined by the
* derived GObject class. If the implementor did not create the property with
* %G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results
* in ::notify being emitted, even if the new value is the same as the old.
* If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only
* when they explicitly call g_object_notify() or g_object_notify_by_pspec(),
* and common practice is to do that only when the value has actually changed.
*
* This signal is typically used to obtain change notification for a
* single property, by specifying the property name as a detail in the
* g_signal_connect() call, like this:
*
*
* ```c
* g_signal_connect (text_view->buffer, "notify::paste-target-list",
* G_CALLBACK (gtk_text_view_target_list_notify),
* text_view)
* ```
*
*
* It is important to note that you must use
* [canonical parameter names][canonical-parameter-names] as
* detail strings for the notify signal.
* @param pspec the #GParamSpec of the property which changed.
*/
connect(sigName: "notify", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
connect_after(sigName: "notify", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
emit(sigName: "notify", pspec: GObject.ParamSpec): void
connect(sigName: "notify::context", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
connect_after(sigName: "notify::context", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
connect(sigName: string, callback: any): number
connect_after(sigName: string, callback: any): number
emit(sigName: string, ...args: any[]): void
disconnect(id: number): void
static name: string
constructor (config?: Renderer_ConstructProps)
_init (config?: Renderer_ConstructProps): void
static $gtype: GObject.Type
}
abstract class RendererClass {
static name: string
}
type FontMap = PangoCairo.FontMap
}
export default CoglPango;