@girs/gsk-4.0 4.0.0-3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/gsk-4.0.cjs +9 -0
- package/gsk-4.0.d.cts +3514 -0
- package/gsk-4.0.d.ts +3519 -0
- package/gsk-4.0.js +8 -0
- package/package.json +63 -0
- package/tsconfig.doc.json +19 -0
package/gsk-4.0.d.cts
ADDED
|
@@ -0,0 +1,3514 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Gsk-4.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type Graphene from '@girs/graphene-1.0';
|
|
13
|
+
import type GObject from '@girs/gobject-2.0';
|
|
14
|
+
import type GLib from '@girs/glib-2.0';
|
|
15
|
+
import type Gdk from '@girs/gdk-4.0';
|
|
16
|
+
import type cairo from '@girs/cairo-1.0';
|
|
17
|
+
import type PangoCairo from '@girs/pangocairo-1.0';
|
|
18
|
+
import type Pango from '@girs/pango-1.0';
|
|
19
|
+
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
20
|
+
import type freetype2 from '@girs/freetype2-2.0';
|
|
21
|
+
import type Gio from '@girs/gio-2.0';
|
|
22
|
+
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
23
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The blend modes available for render nodes.
|
|
27
|
+
*
|
|
28
|
+
* The implementation of each blend mode is deferred to the
|
|
29
|
+
* rendering pipeline.
|
|
30
|
+
*
|
|
31
|
+
* See <https://www.w3.org/TR/compositing-1/#blending> for more information
|
|
32
|
+
* on blending and blend modes.
|
|
33
|
+
*/
|
|
34
|
+
export enum BlendMode {
|
|
35
|
+
/**
|
|
36
|
+
* The default blend mode, which specifies no blending
|
|
37
|
+
*/
|
|
38
|
+
DEFAULT,
|
|
39
|
+
/**
|
|
40
|
+
* The source color is multiplied by the destination
|
|
41
|
+
* and replaces the destination
|
|
42
|
+
*/
|
|
43
|
+
MULTIPLY,
|
|
44
|
+
/**
|
|
45
|
+
* Multiplies the complements of the destination and source
|
|
46
|
+
* color values, then complements the result.
|
|
47
|
+
*/
|
|
48
|
+
SCREEN,
|
|
49
|
+
/**
|
|
50
|
+
* Multiplies or screens the colors, depending on the
|
|
51
|
+
* destination color value. This is the inverse of hard-list
|
|
52
|
+
*/
|
|
53
|
+
OVERLAY,
|
|
54
|
+
/**
|
|
55
|
+
* Selects the darker of the destination and source colors
|
|
56
|
+
*/
|
|
57
|
+
DARKEN,
|
|
58
|
+
/**
|
|
59
|
+
* Selects the lighter of the destination and source colors
|
|
60
|
+
*/
|
|
61
|
+
LIGHTEN,
|
|
62
|
+
/**
|
|
63
|
+
* Brightens the destination color to reflect the source color
|
|
64
|
+
*/
|
|
65
|
+
COLOR_DODGE,
|
|
66
|
+
/**
|
|
67
|
+
* Darkens the destination color to reflect the source color
|
|
68
|
+
*/
|
|
69
|
+
COLOR_BURN,
|
|
70
|
+
/**
|
|
71
|
+
* Multiplies or screens the colors, depending on the source color value
|
|
72
|
+
*/
|
|
73
|
+
HARD_LIGHT,
|
|
74
|
+
/**
|
|
75
|
+
* Darkens or lightens the colors, depending on the source color value
|
|
76
|
+
*/
|
|
77
|
+
SOFT_LIGHT,
|
|
78
|
+
/**
|
|
79
|
+
* Subtracts the darker of the two constituent colors from the lighter color
|
|
80
|
+
*/
|
|
81
|
+
DIFFERENCE,
|
|
82
|
+
/**
|
|
83
|
+
* Produces an effect similar to that of the difference mode but lower in contrast
|
|
84
|
+
*/
|
|
85
|
+
EXCLUSION,
|
|
86
|
+
/**
|
|
87
|
+
* Creates a color with the hue and saturation of the source color and the luminosity of the destination color
|
|
88
|
+
*/
|
|
89
|
+
COLOR,
|
|
90
|
+
/**
|
|
91
|
+
* Creates a color with the hue of the source color and the saturation and luminosity of the destination color
|
|
92
|
+
*/
|
|
93
|
+
HUE,
|
|
94
|
+
/**
|
|
95
|
+
* Creates a color with the saturation of the source color and the hue and luminosity of the destination color
|
|
96
|
+
*/
|
|
97
|
+
SATURATION,
|
|
98
|
+
/**
|
|
99
|
+
* Creates a color with the luminosity of the source color and the hue and saturation of the destination color
|
|
100
|
+
*/
|
|
101
|
+
LUMINOSITY,
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The corner indices used by `GskRoundedRect`.
|
|
105
|
+
*/
|
|
106
|
+
export enum Corner {
|
|
107
|
+
/**
|
|
108
|
+
* The top left corner
|
|
109
|
+
*/
|
|
110
|
+
TOP_LEFT,
|
|
111
|
+
/**
|
|
112
|
+
* The top right corner
|
|
113
|
+
*/
|
|
114
|
+
TOP_RIGHT,
|
|
115
|
+
/**
|
|
116
|
+
* The bottom right corner
|
|
117
|
+
*/
|
|
118
|
+
BOTTOM_RIGHT,
|
|
119
|
+
/**
|
|
120
|
+
* The bottom left corner
|
|
121
|
+
*/
|
|
122
|
+
BOTTOM_LEFT,
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* This defines the types of the uniforms that `GskGLShaders`
|
|
126
|
+
* declare.
|
|
127
|
+
*
|
|
128
|
+
* It defines both what the type is called in the GLSL shader
|
|
129
|
+
* code, and what the corresponding C type is on the Gtk side.
|
|
130
|
+
*/
|
|
131
|
+
export enum GLUniformType {
|
|
132
|
+
/**
|
|
133
|
+
* No type, used for uninitialized or unspecified values.
|
|
134
|
+
*/
|
|
135
|
+
NONE,
|
|
136
|
+
/**
|
|
137
|
+
* A float uniform
|
|
138
|
+
*/
|
|
139
|
+
FLOAT,
|
|
140
|
+
/**
|
|
141
|
+
* A GLSL int / gint32 uniform
|
|
142
|
+
*/
|
|
143
|
+
INT,
|
|
144
|
+
/**
|
|
145
|
+
* A GLSL uint / guint32 uniform
|
|
146
|
+
*/
|
|
147
|
+
UINT,
|
|
148
|
+
/**
|
|
149
|
+
* A GLSL bool / gboolean uniform
|
|
150
|
+
*/
|
|
151
|
+
BOOL,
|
|
152
|
+
/**
|
|
153
|
+
* A GLSL vec2 / graphene_vec2_t uniform
|
|
154
|
+
*/
|
|
155
|
+
VEC2,
|
|
156
|
+
/**
|
|
157
|
+
* A GLSL vec3 / graphene_vec3_t uniform
|
|
158
|
+
*/
|
|
159
|
+
VEC3,
|
|
160
|
+
/**
|
|
161
|
+
* A GLSL vec4 / graphene_vec4_t uniform
|
|
162
|
+
*/
|
|
163
|
+
VEC4,
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The mask modes available for mask nodes.
|
|
167
|
+
*/
|
|
168
|
+
export enum MaskMode {
|
|
169
|
+
/**
|
|
170
|
+
* Use the alpha channel of the mask
|
|
171
|
+
*/
|
|
172
|
+
ALPHA,
|
|
173
|
+
/**
|
|
174
|
+
* Use the inverted alpha channel of the mask
|
|
175
|
+
*/
|
|
176
|
+
INVERTED_ALPHA,
|
|
177
|
+
/**
|
|
178
|
+
* Use the luminance of the mask,
|
|
179
|
+
* multiplied by mask alpha
|
|
180
|
+
*/
|
|
181
|
+
LUMINANCE,
|
|
182
|
+
/**
|
|
183
|
+
* Use the inverted luminance of the mask,
|
|
184
|
+
* multiplied by mask alpha
|
|
185
|
+
*/
|
|
186
|
+
INVERTED_LUMINANCE,
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The type of a node determines what the node is rendering.
|
|
190
|
+
*/
|
|
191
|
+
export enum RenderNodeType {
|
|
192
|
+
/**
|
|
193
|
+
* Error type. No node will ever have this type.
|
|
194
|
+
*/
|
|
195
|
+
NOT_A_RENDER_NODE,
|
|
196
|
+
/**
|
|
197
|
+
* A node containing a stack of children
|
|
198
|
+
*/
|
|
199
|
+
CONTAINER_NODE,
|
|
200
|
+
/**
|
|
201
|
+
* A node drawing a `cairo_surface_t`
|
|
202
|
+
*/
|
|
203
|
+
CAIRO_NODE,
|
|
204
|
+
/**
|
|
205
|
+
* A node drawing a single color rectangle
|
|
206
|
+
*/
|
|
207
|
+
COLOR_NODE,
|
|
208
|
+
/**
|
|
209
|
+
* A node drawing a linear gradient
|
|
210
|
+
*/
|
|
211
|
+
LINEAR_GRADIENT_NODE,
|
|
212
|
+
/**
|
|
213
|
+
* A node drawing a repeating linear gradient
|
|
214
|
+
*/
|
|
215
|
+
REPEATING_LINEAR_GRADIENT_NODE,
|
|
216
|
+
/**
|
|
217
|
+
* A node drawing a radial gradient
|
|
218
|
+
*/
|
|
219
|
+
RADIAL_GRADIENT_NODE,
|
|
220
|
+
/**
|
|
221
|
+
* A node drawing a repeating radial gradient
|
|
222
|
+
*/
|
|
223
|
+
REPEATING_RADIAL_GRADIENT_NODE,
|
|
224
|
+
/**
|
|
225
|
+
* A node drawing a conic gradient
|
|
226
|
+
*/
|
|
227
|
+
CONIC_GRADIENT_NODE,
|
|
228
|
+
/**
|
|
229
|
+
* A node stroking a border around an area
|
|
230
|
+
*/
|
|
231
|
+
BORDER_NODE,
|
|
232
|
+
/**
|
|
233
|
+
* A node drawing a `GdkTexture`
|
|
234
|
+
*/
|
|
235
|
+
TEXTURE_NODE,
|
|
236
|
+
/**
|
|
237
|
+
* A node drawing an inset shadow
|
|
238
|
+
*/
|
|
239
|
+
INSET_SHADOW_NODE,
|
|
240
|
+
/**
|
|
241
|
+
* A node drawing an outset shadow
|
|
242
|
+
*/
|
|
243
|
+
OUTSET_SHADOW_NODE,
|
|
244
|
+
/**
|
|
245
|
+
* A node that renders its child after applying a matrix transform
|
|
246
|
+
*/
|
|
247
|
+
TRANSFORM_NODE,
|
|
248
|
+
/**
|
|
249
|
+
* A node that changes the opacity of its child
|
|
250
|
+
*/
|
|
251
|
+
OPACITY_NODE,
|
|
252
|
+
/**
|
|
253
|
+
* A node that applies a color matrix to every pixel
|
|
254
|
+
*/
|
|
255
|
+
COLOR_MATRIX_NODE,
|
|
256
|
+
/**
|
|
257
|
+
* A node that repeats the child's contents
|
|
258
|
+
*/
|
|
259
|
+
REPEAT_NODE,
|
|
260
|
+
/**
|
|
261
|
+
* A node that clips its child to a rectangular area
|
|
262
|
+
*/
|
|
263
|
+
CLIP_NODE,
|
|
264
|
+
/**
|
|
265
|
+
* A node that clips its child to a rounded rectangle
|
|
266
|
+
*/
|
|
267
|
+
ROUNDED_CLIP_NODE,
|
|
268
|
+
/**
|
|
269
|
+
* A node that draws a shadow below its child
|
|
270
|
+
*/
|
|
271
|
+
SHADOW_NODE,
|
|
272
|
+
/**
|
|
273
|
+
* A node that blends two children together
|
|
274
|
+
*/
|
|
275
|
+
BLEND_NODE,
|
|
276
|
+
/**
|
|
277
|
+
* A node that cross-fades between two children
|
|
278
|
+
*/
|
|
279
|
+
CROSS_FADE_NODE,
|
|
280
|
+
/**
|
|
281
|
+
* A node containing a glyph string
|
|
282
|
+
*/
|
|
283
|
+
TEXT_NODE,
|
|
284
|
+
/**
|
|
285
|
+
* A node that applies a blur
|
|
286
|
+
*/
|
|
287
|
+
BLUR_NODE,
|
|
288
|
+
/**
|
|
289
|
+
* Debug information that does not affect the rendering
|
|
290
|
+
*/
|
|
291
|
+
DEBUG_NODE,
|
|
292
|
+
/**
|
|
293
|
+
* A node that uses OpenGL fragment shaders to render
|
|
294
|
+
*/
|
|
295
|
+
GL_SHADER_NODE,
|
|
296
|
+
/**
|
|
297
|
+
* A node drawing a `GdkTexture` scaled and filtered (Since: 4.10)
|
|
298
|
+
*/
|
|
299
|
+
TEXTURE_SCALE_NODE,
|
|
300
|
+
/**
|
|
301
|
+
* A node that masks one child with another (Since: 4.10)
|
|
302
|
+
*/
|
|
303
|
+
MASK_NODE,
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The filters used when scaling texture data.
|
|
307
|
+
*
|
|
308
|
+
* The actual implementation of each filter is deferred to the
|
|
309
|
+
* rendering pipeline.
|
|
310
|
+
*/
|
|
311
|
+
export enum ScalingFilter {
|
|
312
|
+
/**
|
|
313
|
+
* linear interpolation filter
|
|
314
|
+
*/
|
|
315
|
+
LINEAR,
|
|
316
|
+
/**
|
|
317
|
+
* nearest neighbor interpolation filter
|
|
318
|
+
*/
|
|
319
|
+
NEAREST,
|
|
320
|
+
/**
|
|
321
|
+
* linear interpolation along each axis,
|
|
322
|
+
* plus mipmap generation, with linear interpolation along the mipmap
|
|
323
|
+
* levels
|
|
324
|
+
*/
|
|
325
|
+
TRILINEAR,
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Errors that can happen during (de)serialization.
|
|
329
|
+
*/
|
|
330
|
+
export enum SerializationError {
|
|
331
|
+
/**
|
|
332
|
+
* The format can not be identified
|
|
333
|
+
*/
|
|
334
|
+
UNSUPPORTED_FORMAT,
|
|
335
|
+
/**
|
|
336
|
+
* The version of the data is not
|
|
337
|
+
* understood
|
|
338
|
+
*/
|
|
339
|
+
UNSUPPORTED_VERSION,
|
|
340
|
+
/**
|
|
341
|
+
* The given data may not exist in
|
|
342
|
+
* a proper serialization
|
|
343
|
+
*/
|
|
344
|
+
INVALID_DATA,
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The categories of matrices relevant for GSK and GTK.
|
|
348
|
+
*
|
|
349
|
+
* Note that any category includes matrices of all later categories.
|
|
350
|
+
* So if you want to for example check if a matrix is a 2D matrix,
|
|
351
|
+
* `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
|
|
352
|
+
*
|
|
353
|
+
* Also keep in mind that rounding errors may cause matrices to not
|
|
354
|
+
* conform to their categories. Otherwise, matrix operations done via
|
|
355
|
+
* multiplication will not worsen categories. So for the matrix
|
|
356
|
+
* multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
|
|
357
|
+
*/
|
|
358
|
+
export enum TransformCategory {
|
|
359
|
+
/**
|
|
360
|
+
* The category of the matrix has not been
|
|
361
|
+
* determined.
|
|
362
|
+
*/
|
|
363
|
+
UNKNOWN,
|
|
364
|
+
/**
|
|
365
|
+
* Analyzing the matrix concluded that it does
|
|
366
|
+
* not fit in any other category.
|
|
367
|
+
*/
|
|
368
|
+
ANY,
|
|
369
|
+
/**
|
|
370
|
+
* The matrix is a 3D matrix. This means that
|
|
371
|
+
* the w column (the last column) has the values (0, 0, 0, 1).
|
|
372
|
+
*/
|
|
373
|
+
TODO_3D,
|
|
374
|
+
/**
|
|
375
|
+
* The matrix is a 2D matrix. This is equivalent
|
|
376
|
+
* to graphene_matrix_is_2d() returning %TRUE. In particular, this
|
|
377
|
+
* means that Cairo can deal with the matrix.
|
|
378
|
+
*/
|
|
379
|
+
TODO_2D,
|
|
380
|
+
/**
|
|
381
|
+
* The matrix is a combination of 2D scale
|
|
382
|
+
* and 2D translation operations. In particular, this means that any
|
|
383
|
+
* rectangle can be transformed exactly using this matrix.
|
|
384
|
+
*/
|
|
385
|
+
TODO_2D_AFFINE,
|
|
386
|
+
/**
|
|
387
|
+
* The matrix is a 2D translation.
|
|
388
|
+
*/
|
|
389
|
+
TODO_2D_TRANSLATE,
|
|
390
|
+
/**
|
|
391
|
+
* The matrix is the identity matrix.
|
|
392
|
+
*/
|
|
393
|
+
IDENTITY,
|
|
394
|
+
}
|
|
395
|
+
export function serialization_error_quark(): GLib.Quark
|
|
396
|
+
/**
|
|
397
|
+
* Parses the given `string` into a transform and puts it in
|
|
398
|
+
* `out_transform`.
|
|
399
|
+
*
|
|
400
|
+
* Strings printed via [method`Gsk`.Transform.to_string]
|
|
401
|
+
* can be read in again successfully using this function.
|
|
402
|
+
*
|
|
403
|
+
* If `string` does not describe a valid transform, %FALSE is
|
|
404
|
+
* returned and %NULL is put in `out_transform`.
|
|
405
|
+
* @param string the string to parse
|
|
406
|
+
* @returns %TRUE if @string described a valid transform.
|
|
407
|
+
*/
|
|
408
|
+
export function transform_parse(string: string | null): [ /* returnType */ boolean, /* out_transform */ Transform ]
|
|
409
|
+
/**
|
|
410
|
+
* Retrieves the `GskRenderNode` stored inside the given `value`, and acquires
|
|
411
|
+
* a reference to it.
|
|
412
|
+
* @param value a [struct`GObject`.Value] initialized with type `GSK_TYPE_RENDER_NODE`
|
|
413
|
+
* @returns a `GskRenderNode`
|
|
414
|
+
*/
|
|
415
|
+
export function value_dup_render_node(value: any): RenderNode | null
|
|
416
|
+
/**
|
|
417
|
+
* Retrieves the `GskRenderNode` stored inside the given `value`.
|
|
418
|
+
* @param value a `GValue` initialized with type `GSK_TYPE_RENDER_NODE`
|
|
419
|
+
* @returns a `GskRenderNode`
|
|
420
|
+
*/
|
|
421
|
+
export function value_get_render_node(value: any): RenderNode | null
|
|
422
|
+
/**
|
|
423
|
+
* Stores the given `GskRenderNode` inside `value`.
|
|
424
|
+
*
|
|
425
|
+
* The [struct`GObject`.Value] will acquire a reference to the `node`.
|
|
426
|
+
* @param value a [struct`GObject`.Value] initialized with type `GSK_TYPE_RENDER_NODE`
|
|
427
|
+
* @param node a `GskRenderNode`
|
|
428
|
+
*/
|
|
429
|
+
export function value_set_render_node(value: any, node: RenderNode): void
|
|
430
|
+
/**
|
|
431
|
+
* Stores the given `GskRenderNode` inside `value`.
|
|
432
|
+
*
|
|
433
|
+
* This function transfers the ownership of the `node` to the `GValue`.
|
|
434
|
+
* @param value a [struct`GObject`.Value] initialized with type `GSK_TYPE_RENDER_NODE`
|
|
435
|
+
* @param node a `GskRenderNode`
|
|
436
|
+
*/
|
|
437
|
+
export function value_take_render_node(value: any, node: RenderNode | null): void
|
|
438
|
+
/**
|
|
439
|
+
* Type of callback that is called when an error occurs
|
|
440
|
+
* during node deserialization.
|
|
441
|
+
* @callback
|
|
442
|
+
* @param start start of the error location
|
|
443
|
+
* @param end end of the error location
|
|
444
|
+
* @param error the error
|
|
445
|
+
*/
|
|
446
|
+
export interface ParseErrorFunc {
|
|
447
|
+
(start: ParseLocation, end: ParseLocation, error: GLib.Error): void
|
|
448
|
+
}
|
|
449
|
+
export interface BlendNode {
|
|
450
|
+
|
|
451
|
+
// Owm methods of Gsk-4.0.Gsk.BlendNode
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Retrieves the blend mode used by `node`.
|
|
455
|
+
* @returns the blend mode
|
|
456
|
+
*/
|
|
457
|
+
get_blend_mode(): BlendMode
|
|
458
|
+
/**
|
|
459
|
+
* Retrieves the bottom `GskRenderNode` child of the `node`.
|
|
460
|
+
* @returns the bottom child node
|
|
461
|
+
*/
|
|
462
|
+
get_bottom_child(): RenderNode
|
|
463
|
+
/**
|
|
464
|
+
* Retrieves the top `GskRenderNode` child of the `node`.
|
|
465
|
+
* @returns the top child node
|
|
466
|
+
*/
|
|
467
|
+
get_top_child(): RenderNode
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* A render node applying a blending function between its two child nodes.
|
|
472
|
+
* @class
|
|
473
|
+
*/
|
|
474
|
+
export class BlendNode extends RenderNode {
|
|
475
|
+
|
|
476
|
+
// Own properties of Gsk-4.0.Gsk.BlendNode
|
|
477
|
+
|
|
478
|
+
static name: string
|
|
479
|
+
|
|
480
|
+
// Constructors of Gsk-4.0.Gsk.BlendNode
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Creates a `GskRenderNode` that will use `blend_mode` to blend the `top`
|
|
484
|
+
* node onto the `bottom` node.
|
|
485
|
+
* @constructor
|
|
486
|
+
* @param bottom The bottom node to be drawn
|
|
487
|
+
* @param top The node to be blended onto the `bottom` node
|
|
488
|
+
* @param blend_mode The blend mode to use
|
|
489
|
+
* @returns A new `GskRenderNode`
|
|
490
|
+
*/
|
|
491
|
+
constructor(bottom: RenderNode, top: RenderNode, blend_mode: BlendMode)
|
|
492
|
+
/**
|
|
493
|
+
* Creates a `GskRenderNode` that will use `blend_mode` to blend the `top`
|
|
494
|
+
* node onto the `bottom` node.
|
|
495
|
+
* @constructor
|
|
496
|
+
* @param bottom The bottom node to be drawn
|
|
497
|
+
* @param top The node to be blended onto the `bottom` node
|
|
498
|
+
* @param blend_mode The blend mode to use
|
|
499
|
+
* @returns A new `GskRenderNode`
|
|
500
|
+
*/
|
|
501
|
+
static new(bottom: RenderNode, top: RenderNode, blend_mode: BlendMode): BlendNode
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export interface BlurNode {
|
|
505
|
+
|
|
506
|
+
// Owm methods of Gsk-4.0.Gsk.BlurNode
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Retrieves the child `GskRenderNode` of the blur `node`.
|
|
510
|
+
* @returns the blurred child node
|
|
511
|
+
*/
|
|
512
|
+
get_child(): RenderNode
|
|
513
|
+
/**
|
|
514
|
+
* Retrieves the blur radius of the `node`.
|
|
515
|
+
* @returns the blur radius
|
|
516
|
+
*/
|
|
517
|
+
get_radius(): number
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* A render node applying a blur effect to its single child.
|
|
522
|
+
* @class
|
|
523
|
+
*/
|
|
524
|
+
export class BlurNode extends RenderNode {
|
|
525
|
+
|
|
526
|
+
// Own properties of Gsk-4.0.Gsk.BlurNode
|
|
527
|
+
|
|
528
|
+
static name: string
|
|
529
|
+
|
|
530
|
+
// Constructors of Gsk-4.0.Gsk.BlurNode
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Creates a render node that blurs the child.
|
|
534
|
+
* @constructor
|
|
535
|
+
* @param child the child node to blur
|
|
536
|
+
* @param radius the blur radius. Must be positive
|
|
537
|
+
* @returns a new `GskRenderNode`
|
|
538
|
+
*/
|
|
539
|
+
constructor(child: RenderNode, radius: number)
|
|
540
|
+
/**
|
|
541
|
+
* Creates a render node that blurs the child.
|
|
542
|
+
* @constructor
|
|
543
|
+
* @param child the child node to blur
|
|
544
|
+
* @param radius the blur radius. Must be positive
|
|
545
|
+
* @returns a new `GskRenderNode`
|
|
546
|
+
*/
|
|
547
|
+
static new(child: RenderNode, radius: number): BlurNode
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export interface BorderNode {
|
|
551
|
+
|
|
552
|
+
// Owm methods of Gsk-4.0.Gsk.BorderNode
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Retrieves the colors of the border.
|
|
556
|
+
* @returns an array of 4 `GdkRGBA` structs for the top, right, bottom and left color of the border
|
|
557
|
+
*/
|
|
558
|
+
get_colors(): Gdk.RGBA
|
|
559
|
+
/**
|
|
560
|
+
* Retrieves the outline of the border.
|
|
561
|
+
* @returns the outline of the border
|
|
562
|
+
*/
|
|
563
|
+
get_outline(): RoundedRect
|
|
564
|
+
/**
|
|
565
|
+
* Retrieves the stroke widths of the border.
|
|
566
|
+
* @returns an array of 4 floats for the top, right, bottom and left stroke width of the border, respectively
|
|
567
|
+
*/
|
|
568
|
+
get_widths(): number[]
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* A render node for a border.
|
|
573
|
+
* @class
|
|
574
|
+
*/
|
|
575
|
+
export class BorderNode extends RenderNode {
|
|
576
|
+
|
|
577
|
+
// Own properties of Gsk-4.0.Gsk.BorderNode
|
|
578
|
+
|
|
579
|
+
static name: string
|
|
580
|
+
|
|
581
|
+
// Constructors of Gsk-4.0.Gsk.BorderNode
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Creates a `GskRenderNode` that will stroke a border rectangle inside the
|
|
585
|
+
* given `outline`.
|
|
586
|
+
*
|
|
587
|
+
* The 4 sides of the border can have different widths and colors.
|
|
588
|
+
* @constructor
|
|
589
|
+
* @param outline a `GskRoundedRect` describing the outline of the border
|
|
590
|
+
* @param border_width the stroke width of the border on the top, right, bottom and left side respectively.
|
|
591
|
+
* @param border_color the color used on the top, right, bottom and left side.
|
|
592
|
+
* @returns A new `GskRenderNode`
|
|
593
|
+
*/
|
|
594
|
+
constructor(outline: RoundedRect, border_width: number[], border_color: Gdk.RGBA[])
|
|
595
|
+
/**
|
|
596
|
+
* Creates a `GskRenderNode` that will stroke a border rectangle inside the
|
|
597
|
+
* given `outline`.
|
|
598
|
+
*
|
|
599
|
+
* The 4 sides of the border can have different widths and colors.
|
|
600
|
+
* @constructor
|
|
601
|
+
* @param outline a `GskRoundedRect` describing the outline of the border
|
|
602
|
+
* @param border_width the stroke width of the border on the top, right, bottom and left side respectively.
|
|
603
|
+
* @param border_color the color used on the top, right, bottom and left side.
|
|
604
|
+
* @returns A new `GskRenderNode`
|
|
605
|
+
*/
|
|
606
|
+
static new(outline: RoundedRect, border_width: number[], border_color: Gdk.RGBA[]): BorderNode
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export module BroadwayRenderer {
|
|
610
|
+
|
|
611
|
+
// Constructor properties interface
|
|
612
|
+
|
|
613
|
+
export interface ConstructorProperties extends Renderer.ConstructorProperties {
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface BroadwayRenderer {
|
|
619
|
+
|
|
620
|
+
// Class property signals of Gsk-4.0.Gsk.BroadwayRenderer
|
|
621
|
+
|
|
622
|
+
connect(sigName: "notify::realized", callback: (($obj: BroadwayRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
623
|
+
connect_after(sigName: "notify::realized", callback: (($obj: BroadwayRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
624
|
+
emit(sigName: "notify::realized", ...args: any[]): void
|
|
625
|
+
connect(sigName: "notify::surface", callback: (($obj: BroadwayRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
626
|
+
connect_after(sigName: "notify::surface", callback: (($obj: BroadwayRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
627
|
+
emit(sigName: "notify::surface", ...args: any[]): void
|
|
628
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
629
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
630
|
+
emit(sigName: string, ...args: any[]): void
|
|
631
|
+
disconnect(id: number): void
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
export class BroadwayRenderer extends Renderer {
|
|
635
|
+
|
|
636
|
+
// Own properties of Gsk-4.0.Gsk.BroadwayRenderer
|
|
637
|
+
|
|
638
|
+
static name: string
|
|
639
|
+
static $gtype: GObject.GType<BroadwayRenderer>
|
|
640
|
+
|
|
641
|
+
// Constructors of Gsk-4.0.Gsk.BroadwayRenderer
|
|
642
|
+
|
|
643
|
+
constructor(config?: BroadwayRenderer.ConstructorProperties)
|
|
644
|
+
/**
|
|
645
|
+
* Creates a new Broadway renderer.
|
|
646
|
+
*
|
|
647
|
+
* The Broadway renderer is the default renderer for the broadway backend.
|
|
648
|
+
* It will only work with broadway surfaces, otherwise it will fail the
|
|
649
|
+
* call to gsk_renderer_realize().
|
|
650
|
+
*
|
|
651
|
+
* This function is only available when GTK was compiled with Broadway
|
|
652
|
+
* support.
|
|
653
|
+
* @constructor
|
|
654
|
+
* @returns a new Broadway renderer.
|
|
655
|
+
*/
|
|
656
|
+
constructor()
|
|
657
|
+
/**
|
|
658
|
+
* Creates a new Broadway renderer.
|
|
659
|
+
*
|
|
660
|
+
* The Broadway renderer is the default renderer for the broadway backend.
|
|
661
|
+
* It will only work with broadway surfaces, otherwise it will fail the
|
|
662
|
+
* call to gsk_renderer_realize().
|
|
663
|
+
*
|
|
664
|
+
* This function is only available when GTK was compiled with Broadway
|
|
665
|
+
* support.
|
|
666
|
+
* @constructor
|
|
667
|
+
* @returns a new Broadway renderer.
|
|
668
|
+
*/
|
|
669
|
+
static new(): BroadwayRenderer
|
|
670
|
+
_init(config?: BroadwayRenderer.ConstructorProperties): void
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
export interface CairoNode {
|
|
674
|
+
|
|
675
|
+
// Owm methods of Gsk-4.0.Gsk.CairoNode
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Creates a Cairo context for drawing using the surface associated
|
|
679
|
+
* to the render node.
|
|
680
|
+
*
|
|
681
|
+
* If no surface exists yet, a surface will be created optimized for
|
|
682
|
+
* rendering to `renderer`.
|
|
683
|
+
* @returns a Cairo context used for drawing; use cairo_destroy() when done drawing
|
|
684
|
+
*/
|
|
685
|
+
get_draw_context(): cairo.Context
|
|
686
|
+
/**
|
|
687
|
+
* Retrieves the Cairo surface used by the render node.
|
|
688
|
+
* @returns a Cairo surface
|
|
689
|
+
*/
|
|
690
|
+
get_surface(): cairo.Surface
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* A render node for a Cairo surface.
|
|
695
|
+
* @class
|
|
696
|
+
*/
|
|
697
|
+
export class CairoNode extends RenderNode {
|
|
698
|
+
|
|
699
|
+
// Own properties of Gsk-4.0.Gsk.CairoNode
|
|
700
|
+
|
|
701
|
+
static name: string
|
|
702
|
+
|
|
703
|
+
// Constructors of Gsk-4.0.Gsk.CairoNode
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Creates a `GskRenderNode` that will render a cairo surface
|
|
707
|
+
* into the area given by `bounds`.
|
|
708
|
+
*
|
|
709
|
+
* You can draw to the cairo surface using [method`Gsk`.CairoNode.get_draw_context].
|
|
710
|
+
* @constructor
|
|
711
|
+
* @param bounds the rectangle to render to
|
|
712
|
+
* @returns A new `GskRenderNode`
|
|
713
|
+
*/
|
|
714
|
+
constructor(bounds: Graphene.Rect)
|
|
715
|
+
/**
|
|
716
|
+
* Creates a `GskRenderNode` that will render a cairo surface
|
|
717
|
+
* into the area given by `bounds`.
|
|
718
|
+
*
|
|
719
|
+
* You can draw to the cairo surface using [method`Gsk`.CairoNode.get_draw_context].
|
|
720
|
+
* @constructor
|
|
721
|
+
* @param bounds the rectangle to render to
|
|
722
|
+
* @returns A new `GskRenderNode`
|
|
723
|
+
*/
|
|
724
|
+
static new(bounds: Graphene.Rect): CairoNode
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export module CairoRenderer {
|
|
728
|
+
|
|
729
|
+
// Constructor properties interface
|
|
730
|
+
|
|
731
|
+
export interface ConstructorProperties extends Renderer.ConstructorProperties {
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export interface CairoRenderer {
|
|
737
|
+
|
|
738
|
+
// Class property signals of Gsk-4.0.Gsk.CairoRenderer
|
|
739
|
+
|
|
740
|
+
connect(sigName: "notify::realized", callback: (($obj: CairoRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
741
|
+
connect_after(sigName: "notify::realized", callback: (($obj: CairoRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
742
|
+
emit(sigName: "notify::realized", ...args: any[]): void
|
|
743
|
+
connect(sigName: "notify::surface", callback: (($obj: CairoRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
744
|
+
connect_after(sigName: "notify::surface", callback: (($obj: CairoRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
745
|
+
emit(sigName: "notify::surface", ...args: any[]): void
|
|
746
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
747
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
748
|
+
emit(sigName: string, ...args: any[]): void
|
|
749
|
+
disconnect(id: number): void
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* A GSK renderer that is using cairo.
|
|
754
|
+
*
|
|
755
|
+
* Since it is using cairo, this renderer cannot support
|
|
756
|
+
* 3D transformations.
|
|
757
|
+
* @class
|
|
758
|
+
*/
|
|
759
|
+
export class CairoRenderer extends Renderer {
|
|
760
|
+
|
|
761
|
+
// Own properties of Gsk-4.0.Gsk.CairoRenderer
|
|
762
|
+
|
|
763
|
+
static name: string
|
|
764
|
+
static $gtype: GObject.GType<CairoRenderer>
|
|
765
|
+
|
|
766
|
+
// Constructors of Gsk-4.0.Gsk.CairoRenderer
|
|
767
|
+
|
|
768
|
+
constructor(config?: CairoRenderer.ConstructorProperties)
|
|
769
|
+
/**
|
|
770
|
+
* Creates a new Cairo renderer.
|
|
771
|
+
*
|
|
772
|
+
* The Cairo renderer is the fallback renderer drawing in ways similar
|
|
773
|
+
* to how GTK 3 drew its content. Its primary use is as comparison tool.
|
|
774
|
+
*
|
|
775
|
+
* The Cairo renderer is incomplete. It cannot render 3D transformed
|
|
776
|
+
* content and will instead render an error marker. Its usage should be
|
|
777
|
+
* avoided.
|
|
778
|
+
* @constructor
|
|
779
|
+
* @returns a new Cairo renderer.
|
|
780
|
+
*/
|
|
781
|
+
constructor()
|
|
782
|
+
/**
|
|
783
|
+
* Creates a new Cairo renderer.
|
|
784
|
+
*
|
|
785
|
+
* The Cairo renderer is the fallback renderer drawing in ways similar
|
|
786
|
+
* to how GTK 3 drew its content. Its primary use is as comparison tool.
|
|
787
|
+
*
|
|
788
|
+
* The Cairo renderer is incomplete. It cannot render 3D transformed
|
|
789
|
+
* content and will instead render an error marker. Its usage should be
|
|
790
|
+
* avoided.
|
|
791
|
+
* @constructor
|
|
792
|
+
* @returns a new Cairo renderer.
|
|
793
|
+
*/
|
|
794
|
+
static new(): CairoRenderer
|
|
795
|
+
_init(config?: CairoRenderer.ConstructorProperties): void
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export interface ClipNode {
|
|
799
|
+
|
|
800
|
+
// Owm methods of Gsk-4.0.Gsk.ClipNode
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Gets the child node that is getting clipped by the given `node`.
|
|
804
|
+
* @returns The child that is getting clipped
|
|
805
|
+
*/
|
|
806
|
+
get_child(): RenderNode
|
|
807
|
+
/**
|
|
808
|
+
* Retrieves the clip rectangle for `node`.
|
|
809
|
+
* @returns a clip rectangle
|
|
810
|
+
*/
|
|
811
|
+
get_clip(): Graphene.Rect
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* A render node applying a rectangular clip to its single child node.
|
|
816
|
+
* @class
|
|
817
|
+
*/
|
|
818
|
+
export class ClipNode extends RenderNode {
|
|
819
|
+
|
|
820
|
+
// Own properties of Gsk-4.0.Gsk.ClipNode
|
|
821
|
+
|
|
822
|
+
static name: string
|
|
823
|
+
|
|
824
|
+
// Constructors of Gsk-4.0.Gsk.ClipNode
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Creates a `GskRenderNode` that will clip the `child` to the area
|
|
828
|
+
* given by `clip`.
|
|
829
|
+
* @constructor
|
|
830
|
+
* @param child The node to draw
|
|
831
|
+
* @param clip The clip to apply
|
|
832
|
+
* @returns A new `GskRenderNode`
|
|
833
|
+
*/
|
|
834
|
+
constructor(child: RenderNode, clip: Graphene.Rect)
|
|
835
|
+
/**
|
|
836
|
+
* Creates a `GskRenderNode` that will clip the `child` to the area
|
|
837
|
+
* given by `clip`.
|
|
838
|
+
* @constructor
|
|
839
|
+
* @param child The node to draw
|
|
840
|
+
* @param clip The clip to apply
|
|
841
|
+
* @returns A new `GskRenderNode`
|
|
842
|
+
*/
|
|
843
|
+
static new(child: RenderNode, clip: Graphene.Rect): ClipNode
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export interface ColorMatrixNode {
|
|
847
|
+
|
|
848
|
+
// Owm methods of Gsk-4.0.Gsk.ColorMatrixNode
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Gets the child node that is getting its colors modified by the given `node`.
|
|
852
|
+
* @returns The child that is getting its colors modified
|
|
853
|
+
*/
|
|
854
|
+
get_child(): RenderNode
|
|
855
|
+
/**
|
|
856
|
+
* Retrieves the color matrix used by the `node`.
|
|
857
|
+
* @returns a 4x4 color matrix
|
|
858
|
+
*/
|
|
859
|
+
get_color_matrix(): Graphene.Matrix
|
|
860
|
+
/**
|
|
861
|
+
* Retrieves the color offset used by the `node`.
|
|
862
|
+
* @returns a color vector
|
|
863
|
+
*/
|
|
864
|
+
get_color_offset(): Graphene.Vec4
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* A render node controlling the color matrix of its single child node.
|
|
869
|
+
* @class
|
|
870
|
+
*/
|
|
871
|
+
export class ColorMatrixNode extends RenderNode {
|
|
872
|
+
|
|
873
|
+
// Own properties of Gsk-4.0.Gsk.ColorMatrixNode
|
|
874
|
+
|
|
875
|
+
static name: string
|
|
876
|
+
|
|
877
|
+
// Constructors of Gsk-4.0.Gsk.ColorMatrixNode
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Creates a `GskRenderNode` that will drawn the `child` with
|
|
881
|
+
* `color_matrix`.
|
|
882
|
+
*
|
|
883
|
+
* In particular, the node will transform the operation
|
|
884
|
+
*
|
|
885
|
+
* pixel = color_matrix * pixel + color_offset
|
|
886
|
+
*
|
|
887
|
+
* for every pixel.
|
|
888
|
+
* @constructor
|
|
889
|
+
* @param child The node to draw
|
|
890
|
+
* @param color_matrix The matrix to apply
|
|
891
|
+
* @param color_offset Values to add to the color
|
|
892
|
+
* @returns A new `GskRenderNode`
|
|
893
|
+
*/
|
|
894
|
+
constructor(child: RenderNode, color_matrix: Graphene.Matrix, color_offset: Graphene.Vec4)
|
|
895
|
+
/**
|
|
896
|
+
* Creates a `GskRenderNode` that will drawn the `child` with
|
|
897
|
+
* `color_matrix`.
|
|
898
|
+
*
|
|
899
|
+
* In particular, the node will transform the operation
|
|
900
|
+
*
|
|
901
|
+
* pixel = color_matrix * pixel + color_offset
|
|
902
|
+
*
|
|
903
|
+
* for every pixel.
|
|
904
|
+
* @constructor
|
|
905
|
+
* @param child The node to draw
|
|
906
|
+
* @param color_matrix The matrix to apply
|
|
907
|
+
* @param color_offset Values to add to the color
|
|
908
|
+
* @returns A new `GskRenderNode`
|
|
909
|
+
*/
|
|
910
|
+
static new(child: RenderNode, color_matrix: Graphene.Matrix, color_offset: Graphene.Vec4): ColorMatrixNode
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export interface ColorNode {
|
|
914
|
+
|
|
915
|
+
// Owm methods of Gsk-4.0.Gsk.ColorNode
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Retrieves the color of the given `node`.
|
|
919
|
+
* @returns the color of the node
|
|
920
|
+
*/
|
|
921
|
+
get_color(): Gdk.RGBA
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* A render node for a solid color.
|
|
926
|
+
* @class
|
|
927
|
+
*/
|
|
928
|
+
export class ColorNode extends RenderNode {
|
|
929
|
+
|
|
930
|
+
// Own properties of Gsk-4.0.Gsk.ColorNode
|
|
931
|
+
|
|
932
|
+
static name: string
|
|
933
|
+
|
|
934
|
+
// Constructors of Gsk-4.0.Gsk.ColorNode
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Creates a `GskRenderNode` that will render the color specified by `rgba` into
|
|
938
|
+
* the area given by `bounds`.
|
|
939
|
+
* @constructor
|
|
940
|
+
* @param rgba a `GdkRGBA` specifying a color
|
|
941
|
+
* @param bounds the rectangle to render the color into
|
|
942
|
+
* @returns A new `GskRenderNode`
|
|
943
|
+
*/
|
|
944
|
+
constructor(rgba: Gdk.RGBA, bounds: Graphene.Rect)
|
|
945
|
+
/**
|
|
946
|
+
* Creates a `GskRenderNode` that will render the color specified by `rgba` into
|
|
947
|
+
* the area given by `bounds`.
|
|
948
|
+
* @constructor
|
|
949
|
+
* @param rgba a `GdkRGBA` specifying a color
|
|
950
|
+
* @param bounds the rectangle to render the color into
|
|
951
|
+
* @returns A new `GskRenderNode`
|
|
952
|
+
*/
|
|
953
|
+
static new(rgba: Gdk.RGBA, bounds: Graphene.Rect): ColorNode
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export interface ConicGradientNode {
|
|
957
|
+
|
|
958
|
+
// Owm methods of Gsk-4.0.Gsk.ConicGradientNode
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].
|
|
962
|
+
*
|
|
963
|
+
* The angle is starting at the top and going clockwise, as expressed
|
|
964
|
+
* in the css specification:
|
|
965
|
+
*
|
|
966
|
+
* angle = 90 - gsk_conic_gradient_node_get_rotation()
|
|
967
|
+
* @returns the angle for the gradient
|
|
968
|
+
*/
|
|
969
|
+
get_angle(): number
|
|
970
|
+
/**
|
|
971
|
+
* Retrieves the center pointer for the gradient.
|
|
972
|
+
* @returns the center point for the gradient
|
|
973
|
+
*/
|
|
974
|
+
get_center(): Graphene.Point
|
|
975
|
+
/**
|
|
976
|
+
* Retrieves the color stops in the gradient.
|
|
977
|
+
* @returns the color stops in the gradient
|
|
978
|
+
*/
|
|
979
|
+
get_color_stops(): ColorStop[]
|
|
980
|
+
/**
|
|
981
|
+
* Retrieves the number of color stops in the gradient.
|
|
982
|
+
* @returns the number of color stops
|
|
983
|
+
*/
|
|
984
|
+
get_n_color_stops(): number
|
|
985
|
+
/**
|
|
986
|
+
* Retrieves the rotation for the gradient in degrees.
|
|
987
|
+
* @returns the rotation for the gradient
|
|
988
|
+
*/
|
|
989
|
+
get_rotation(): number
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* A render node for a conic gradient.
|
|
994
|
+
* @class
|
|
995
|
+
*/
|
|
996
|
+
export class ConicGradientNode extends RenderNode {
|
|
997
|
+
|
|
998
|
+
// Own properties of Gsk-4.0.Gsk.ConicGradientNode
|
|
999
|
+
|
|
1000
|
+
static name: string
|
|
1001
|
+
|
|
1002
|
+
// Constructors of Gsk-4.0.Gsk.ConicGradientNode
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Creates a `GskRenderNode` that draws a conic gradient.
|
|
1006
|
+
*
|
|
1007
|
+
* The conic gradient
|
|
1008
|
+
* starts around `center` in the direction of `rotation`. A rotation of 0 means
|
|
1009
|
+
* that the gradient points up. Color stops are then added clockwise.
|
|
1010
|
+
* @constructor
|
|
1011
|
+
* @param bounds the bounds of the node
|
|
1012
|
+
* @param center the center of the gradient
|
|
1013
|
+
* @param rotation the rotation of the gradient in degrees
|
|
1014
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
1015
|
+
* @returns A new `GskRenderNode`
|
|
1016
|
+
*/
|
|
1017
|
+
constructor(bounds: Graphene.Rect, center: Graphene.Point, rotation: number, color_stops: ColorStop[])
|
|
1018
|
+
/**
|
|
1019
|
+
* Creates a `GskRenderNode` that draws a conic gradient.
|
|
1020
|
+
*
|
|
1021
|
+
* The conic gradient
|
|
1022
|
+
* starts around `center` in the direction of `rotation`. A rotation of 0 means
|
|
1023
|
+
* that the gradient points up. Color stops are then added clockwise.
|
|
1024
|
+
* @constructor
|
|
1025
|
+
* @param bounds the bounds of the node
|
|
1026
|
+
* @param center the center of the gradient
|
|
1027
|
+
* @param rotation the rotation of the gradient in degrees
|
|
1028
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
1029
|
+
* @returns A new `GskRenderNode`
|
|
1030
|
+
*/
|
|
1031
|
+
static new(bounds: Graphene.Rect, center: Graphene.Point, rotation: number, color_stops: ColorStop[]): ConicGradientNode
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
export interface ContainerNode {
|
|
1035
|
+
|
|
1036
|
+
// Owm methods of Gsk-4.0.Gsk.ContainerNode
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Gets one of the children of `container`.
|
|
1040
|
+
* @param idx the position of the child to get
|
|
1041
|
+
* @returns the @idx'th child of @container
|
|
1042
|
+
*/
|
|
1043
|
+
get_child(idx: number): RenderNode
|
|
1044
|
+
/**
|
|
1045
|
+
* Retrieves the number of direct children of `node`.
|
|
1046
|
+
* @returns the number of children of the `GskRenderNode`
|
|
1047
|
+
*/
|
|
1048
|
+
get_n_children(): number
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* A render node that can contain other render nodes.
|
|
1053
|
+
* @class
|
|
1054
|
+
*/
|
|
1055
|
+
export class ContainerNode extends RenderNode {
|
|
1056
|
+
|
|
1057
|
+
// Own properties of Gsk-4.0.Gsk.ContainerNode
|
|
1058
|
+
|
|
1059
|
+
static name: string
|
|
1060
|
+
|
|
1061
|
+
// Constructors of Gsk-4.0.Gsk.ContainerNode
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Creates a new `GskRenderNode` instance for holding the given `children`.
|
|
1065
|
+
*
|
|
1066
|
+
* The new node will acquire a reference to each of the children.
|
|
1067
|
+
* @constructor
|
|
1068
|
+
* @param children The children of the node
|
|
1069
|
+
* @returns the new `GskRenderNode`
|
|
1070
|
+
*/
|
|
1071
|
+
constructor(children: RenderNode[])
|
|
1072
|
+
/**
|
|
1073
|
+
* Creates a new `GskRenderNode` instance for holding the given `children`.
|
|
1074
|
+
*
|
|
1075
|
+
* The new node will acquire a reference to each of the children.
|
|
1076
|
+
* @constructor
|
|
1077
|
+
* @param children The children of the node
|
|
1078
|
+
* @returns the new `GskRenderNode`
|
|
1079
|
+
*/
|
|
1080
|
+
static new(children: RenderNode[]): ContainerNode
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
export interface CrossFadeNode {
|
|
1084
|
+
|
|
1085
|
+
// Owm methods of Gsk-4.0.Gsk.CrossFadeNode
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* Retrieves the child `GskRenderNode` at the end of the cross-fade.
|
|
1089
|
+
* @returns a `GskRenderNode`
|
|
1090
|
+
*/
|
|
1091
|
+
get_end_child(): RenderNode
|
|
1092
|
+
/**
|
|
1093
|
+
* Retrieves the progress value of the cross fade.
|
|
1094
|
+
* @returns the progress value, between 0 and 1
|
|
1095
|
+
*/
|
|
1096
|
+
get_progress(): number
|
|
1097
|
+
/**
|
|
1098
|
+
* Retrieves the child `GskRenderNode` at the beginning of the cross-fade.
|
|
1099
|
+
* @returns a `GskRenderNode`
|
|
1100
|
+
*/
|
|
1101
|
+
get_start_child(): RenderNode
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* A render node cross fading between two child nodes.
|
|
1106
|
+
* @class
|
|
1107
|
+
*/
|
|
1108
|
+
export class CrossFadeNode extends RenderNode {
|
|
1109
|
+
|
|
1110
|
+
// Own properties of Gsk-4.0.Gsk.CrossFadeNode
|
|
1111
|
+
|
|
1112
|
+
static name: string
|
|
1113
|
+
|
|
1114
|
+
// Constructors of Gsk-4.0.Gsk.CrossFadeNode
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Creates a `GskRenderNode` that will do a cross-fade between `start` and `end`.
|
|
1118
|
+
* @constructor
|
|
1119
|
+
* @param start The start node to be drawn
|
|
1120
|
+
* @param end The node to be cross_fadeed onto the `start` node
|
|
1121
|
+
* @param progress How far the fade has progressed from start to end. The value will be clamped to the range [0 ... 1]
|
|
1122
|
+
* @returns A new `GskRenderNode`
|
|
1123
|
+
*/
|
|
1124
|
+
constructor(start: RenderNode, end: RenderNode, progress: number)
|
|
1125
|
+
/**
|
|
1126
|
+
* Creates a `GskRenderNode` that will do a cross-fade between `start` and `end`.
|
|
1127
|
+
* @constructor
|
|
1128
|
+
* @param start The start node to be drawn
|
|
1129
|
+
* @param end The node to be cross_fadeed onto the `start` node
|
|
1130
|
+
* @param progress How far the fade has progressed from start to end. The value will be clamped to the range [0 ... 1]
|
|
1131
|
+
* @returns A new `GskRenderNode`
|
|
1132
|
+
*/
|
|
1133
|
+
static new(start: RenderNode, end: RenderNode, progress: number): CrossFadeNode
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
export interface DebugNode {
|
|
1137
|
+
|
|
1138
|
+
// Owm methods of Gsk-4.0.Gsk.DebugNode
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Gets the child node that is getting drawn by the given `node`.
|
|
1142
|
+
* @returns the child `GskRenderNode`
|
|
1143
|
+
*/
|
|
1144
|
+
get_child(): RenderNode
|
|
1145
|
+
/**
|
|
1146
|
+
* Gets the debug message that was set on this node
|
|
1147
|
+
* @returns The debug message
|
|
1148
|
+
*/
|
|
1149
|
+
get_message(): string | null
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* A render node that emits a debugging message when drawing its
|
|
1154
|
+
* child node.
|
|
1155
|
+
* @class
|
|
1156
|
+
*/
|
|
1157
|
+
export class DebugNode extends RenderNode {
|
|
1158
|
+
|
|
1159
|
+
// Own properties of Gsk-4.0.Gsk.DebugNode
|
|
1160
|
+
|
|
1161
|
+
static name: string
|
|
1162
|
+
|
|
1163
|
+
// Constructors of Gsk-4.0.Gsk.DebugNode
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Creates a `GskRenderNode` that will add debug information about
|
|
1167
|
+
* the given `child`.
|
|
1168
|
+
*
|
|
1169
|
+
* Adding this node has no visual effect.
|
|
1170
|
+
* @constructor
|
|
1171
|
+
* @param child The child to add debug info for
|
|
1172
|
+
* @param message The debug message
|
|
1173
|
+
* @returns A new `GskRenderNode`
|
|
1174
|
+
*/
|
|
1175
|
+
constructor(child: RenderNode, message: string | null)
|
|
1176
|
+
/**
|
|
1177
|
+
* Creates a `GskRenderNode` that will add debug information about
|
|
1178
|
+
* the given `child`.
|
|
1179
|
+
*
|
|
1180
|
+
* Adding this node has no visual effect.
|
|
1181
|
+
* @constructor
|
|
1182
|
+
* @param child The child to add debug info for
|
|
1183
|
+
* @param message The debug message
|
|
1184
|
+
* @returns A new `GskRenderNode`
|
|
1185
|
+
*/
|
|
1186
|
+
static new(child: RenderNode, message: string | null): DebugNode
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
export module GLRenderer {
|
|
1190
|
+
|
|
1191
|
+
// Constructor properties interface
|
|
1192
|
+
|
|
1193
|
+
export interface ConstructorProperties extends Renderer.ConstructorProperties {
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export interface GLRenderer {
|
|
1199
|
+
|
|
1200
|
+
// Class property signals of Gsk-4.0.Gsk.GLRenderer
|
|
1201
|
+
|
|
1202
|
+
connect(sigName: "notify::realized", callback: (($obj: GLRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1203
|
+
connect_after(sigName: "notify::realized", callback: (($obj: GLRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1204
|
+
emit(sigName: "notify::realized", ...args: any[]): void
|
|
1205
|
+
connect(sigName: "notify::surface", callback: (($obj: GLRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1206
|
+
connect_after(sigName: "notify::surface", callback: (($obj: GLRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1207
|
+
emit(sigName: "notify::surface", ...args: any[]): void
|
|
1208
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1209
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1210
|
+
emit(sigName: string, ...args: any[]): void
|
|
1211
|
+
disconnect(id: number): void
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
export class GLRenderer extends Renderer {
|
|
1215
|
+
|
|
1216
|
+
// Own properties of Gsk-4.0.Gsk.GLRenderer
|
|
1217
|
+
|
|
1218
|
+
static name: string
|
|
1219
|
+
static $gtype: GObject.GType<GLRenderer>
|
|
1220
|
+
|
|
1221
|
+
// Constructors of Gsk-4.0.Gsk.GLRenderer
|
|
1222
|
+
|
|
1223
|
+
constructor(config?: GLRenderer.ConstructorProperties)
|
|
1224
|
+
/**
|
|
1225
|
+
* Creates a new `GskRenderer` using the new OpenGL renderer.
|
|
1226
|
+
* @constructor
|
|
1227
|
+
* @returns a new GL renderer
|
|
1228
|
+
*/
|
|
1229
|
+
constructor()
|
|
1230
|
+
/**
|
|
1231
|
+
* Creates a new `GskRenderer` using the new OpenGL renderer.
|
|
1232
|
+
* @constructor
|
|
1233
|
+
* @returns a new GL renderer
|
|
1234
|
+
*/
|
|
1235
|
+
static new(): GLRenderer
|
|
1236
|
+
_init(config?: GLRenderer.ConstructorProperties): void
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
export module GLShader {
|
|
1240
|
+
|
|
1241
|
+
// Constructor properties interface
|
|
1242
|
+
|
|
1243
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1244
|
+
|
|
1245
|
+
// Own constructor properties of Gsk-4.0.Gsk.GLShader
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Resource containing the source code for the shader.
|
|
1249
|
+
*
|
|
1250
|
+
* If the shader source is not coming from a resource, this
|
|
1251
|
+
* will be %NULL.
|
|
1252
|
+
*/
|
|
1253
|
+
resource?: string | null
|
|
1254
|
+
source?: GLib.Bytes | null
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
export interface GLShader {
|
|
1260
|
+
|
|
1261
|
+
// Own properties of Gsk-4.0.Gsk.GLShader
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Resource containing the source code for the shader.
|
|
1265
|
+
*
|
|
1266
|
+
* If the shader source is not coming from a resource, this
|
|
1267
|
+
* will be %NULL.
|
|
1268
|
+
*/
|
|
1269
|
+
readonly resource: string | null
|
|
1270
|
+
readonly source: GLib.Bytes
|
|
1271
|
+
|
|
1272
|
+
// Owm methods of Gsk-4.0.Gsk.GLShader
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* Tries to compile the `shader` for the given `renderer`.
|
|
1276
|
+
*
|
|
1277
|
+
* If there is a problem, this function returns %FALSE and reports
|
|
1278
|
+
* an error. You should use this function before relying on the shader
|
|
1279
|
+
* for rendering and use a fallback with a simpler shader or without
|
|
1280
|
+
* shaders if it fails.
|
|
1281
|
+
*
|
|
1282
|
+
* Note that this will modify the rendering state (for example
|
|
1283
|
+
* change the current GL context) and requires the renderer to be
|
|
1284
|
+
* set up. This means that the widget has to be realized. Commonly you
|
|
1285
|
+
* want to call this from the realize signal of a widget, or during
|
|
1286
|
+
* widget snapshot.
|
|
1287
|
+
* @param renderer a `GskRenderer`
|
|
1288
|
+
* @returns %TRUE on success, %FALSE if an error occurred
|
|
1289
|
+
*/
|
|
1290
|
+
compile(renderer: Renderer): boolean
|
|
1291
|
+
/**
|
|
1292
|
+
* Looks for a uniform by the name `name,` and returns the index
|
|
1293
|
+
* of the uniform, or -1 if it was not found.
|
|
1294
|
+
* @param name uniform name
|
|
1295
|
+
* @returns The index of the uniform, or -1
|
|
1296
|
+
*/
|
|
1297
|
+
find_uniform_by_name(name: string | null): number
|
|
1298
|
+
/**
|
|
1299
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1300
|
+
*
|
|
1301
|
+
* The uniform must be of bool type.
|
|
1302
|
+
* @param args uniform arguments
|
|
1303
|
+
* @param idx index of the uniform
|
|
1304
|
+
* @returns The value
|
|
1305
|
+
*/
|
|
1306
|
+
get_arg_bool(args: GLib.Bytes, idx: number): boolean
|
|
1307
|
+
/**
|
|
1308
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1309
|
+
*
|
|
1310
|
+
* The uniform must be of float type.
|
|
1311
|
+
* @param args uniform arguments
|
|
1312
|
+
* @param idx index of the uniform
|
|
1313
|
+
* @returns The value
|
|
1314
|
+
*/
|
|
1315
|
+
get_arg_float(args: GLib.Bytes, idx: number): number
|
|
1316
|
+
/**
|
|
1317
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1318
|
+
*
|
|
1319
|
+
* The uniform must be of int type.
|
|
1320
|
+
* @param args uniform arguments
|
|
1321
|
+
* @param idx index of the uniform
|
|
1322
|
+
* @returns The value
|
|
1323
|
+
*/
|
|
1324
|
+
get_arg_int(args: GLib.Bytes, idx: number): number
|
|
1325
|
+
/**
|
|
1326
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1327
|
+
*
|
|
1328
|
+
* The uniform must be of uint type.
|
|
1329
|
+
* @param args uniform arguments
|
|
1330
|
+
* @param idx index of the uniform
|
|
1331
|
+
* @returns The value
|
|
1332
|
+
*/
|
|
1333
|
+
get_arg_uint(args: GLib.Bytes, idx: number): number
|
|
1334
|
+
/**
|
|
1335
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1336
|
+
*
|
|
1337
|
+
* The uniform must be of vec2 type.
|
|
1338
|
+
* @param args uniform arguments
|
|
1339
|
+
* @param idx index of the uniform
|
|
1340
|
+
* @param out_value location to store the uniform value in
|
|
1341
|
+
*/
|
|
1342
|
+
get_arg_vec2(args: GLib.Bytes, idx: number, out_value: Graphene.Vec2): void
|
|
1343
|
+
/**
|
|
1344
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1345
|
+
*
|
|
1346
|
+
* The uniform must be of vec3 type.
|
|
1347
|
+
* @param args uniform arguments
|
|
1348
|
+
* @param idx index of the uniform
|
|
1349
|
+
* @param out_value location to store the uniform value in
|
|
1350
|
+
*/
|
|
1351
|
+
get_arg_vec3(args: GLib.Bytes, idx: number, out_value: Graphene.Vec3): void
|
|
1352
|
+
/**
|
|
1353
|
+
* Gets the value of the uniform `idx` in the `args` block.
|
|
1354
|
+
*
|
|
1355
|
+
* The uniform must be of vec4 type.
|
|
1356
|
+
* @param args uniform arguments
|
|
1357
|
+
* @param idx index of the uniform
|
|
1358
|
+
* @param out_value location to store set the uniform value in
|
|
1359
|
+
*/
|
|
1360
|
+
get_arg_vec4(args: GLib.Bytes, idx: number, out_value: Graphene.Vec4): void
|
|
1361
|
+
/**
|
|
1362
|
+
* Get the size of the data block used to specify arguments for this shader.
|
|
1363
|
+
* @returns The size of the data block
|
|
1364
|
+
*/
|
|
1365
|
+
get_args_size(): number
|
|
1366
|
+
/**
|
|
1367
|
+
* Returns the number of textures that the shader requires.
|
|
1368
|
+
*
|
|
1369
|
+
* This can be used to check that the a passed shader works
|
|
1370
|
+
* in your usecase. It is determined by looking at the highest
|
|
1371
|
+
* u_textureN value that the shader defines.
|
|
1372
|
+
* @returns The number of texture inputs required by @shader
|
|
1373
|
+
*/
|
|
1374
|
+
get_n_textures(): number
|
|
1375
|
+
/**
|
|
1376
|
+
* Get the number of declared uniforms for this shader.
|
|
1377
|
+
* @returns The number of declared uniforms
|
|
1378
|
+
*/
|
|
1379
|
+
get_n_uniforms(): number
|
|
1380
|
+
/**
|
|
1381
|
+
* Gets the resource path for the GLSL sourcecode being used
|
|
1382
|
+
* to render this shader.
|
|
1383
|
+
* @returns The resource path for the shader
|
|
1384
|
+
*/
|
|
1385
|
+
get_resource(): string | null
|
|
1386
|
+
/**
|
|
1387
|
+
* Gets the GLSL sourcecode being used to render this shader.
|
|
1388
|
+
* @returns The source code for the shader
|
|
1389
|
+
*/
|
|
1390
|
+
get_source(): GLib.Bytes
|
|
1391
|
+
/**
|
|
1392
|
+
* Get the name of the declared uniform for this shader at index `idx`.
|
|
1393
|
+
* @param idx index of the uniform
|
|
1394
|
+
* @returns The name of the declared uniform
|
|
1395
|
+
*/
|
|
1396
|
+
get_uniform_name(idx: number): string | null
|
|
1397
|
+
/**
|
|
1398
|
+
* Get the offset into the data block where data for this uniforms is stored.
|
|
1399
|
+
* @param idx index of the uniform
|
|
1400
|
+
* @returns The data offset
|
|
1401
|
+
*/
|
|
1402
|
+
get_uniform_offset(idx: number): number
|
|
1403
|
+
/**
|
|
1404
|
+
* Get the type of the declared uniform for this shader at index `idx`.
|
|
1405
|
+
* @param idx index of the uniform
|
|
1406
|
+
* @returns The type of the declared uniform
|
|
1407
|
+
*/
|
|
1408
|
+
get_uniform_type(idx: number): GLUniformType
|
|
1409
|
+
|
|
1410
|
+
// Class property signals of Gsk-4.0.Gsk.GLShader
|
|
1411
|
+
|
|
1412
|
+
connect(sigName: "notify::resource", callback: (($obj: GLShader, pspec: GObject.ParamSpec) => void)): number
|
|
1413
|
+
connect_after(sigName: "notify::resource", callback: (($obj: GLShader, pspec: GObject.ParamSpec) => void)): number
|
|
1414
|
+
emit(sigName: "notify::resource", ...args: any[]): void
|
|
1415
|
+
connect(sigName: "notify::source", callback: (($obj: GLShader, pspec: GObject.ParamSpec) => void)): number
|
|
1416
|
+
connect_after(sigName: "notify::source", callback: (($obj: GLShader, pspec: GObject.ParamSpec) => void)): number
|
|
1417
|
+
emit(sigName: "notify::source", ...args: any[]): void
|
|
1418
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1419
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1420
|
+
emit(sigName: string, ...args: any[]): void
|
|
1421
|
+
disconnect(id: number): void
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* A `GskGLShader` is a snippet of GLSL that is meant to run in the
|
|
1426
|
+
* fragment shader of the rendering pipeline.
|
|
1427
|
+
*
|
|
1428
|
+
* A fragment shader gets the coordinates being rendered as input and
|
|
1429
|
+
* produces the pixel values for that particular pixel. Additionally,
|
|
1430
|
+
* the shader can declare a set of other input arguments, called
|
|
1431
|
+
* uniforms (as they are uniform over all the calls to your shader in
|
|
1432
|
+
* each instance of use). A shader can also receive up to 4
|
|
1433
|
+
* textures that it can use as input when producing the pixel data.
|
|
1434
|
+
*
|
|
1435
|
+
* `GskGLShader` is usually used with gtk_snapshot_push_gl_shader()
|
|
1436
|
+
* to produce a [class`Gsk`.GLShaderNode] in the rendering hierarchy,
|
|
1437
|
+
* and then its input textures are constructed by rendering the child
|
|
1438
|
+
* nodes to textures before rendering the shader node itself. (You can
|
|
1439
|
+
* pass texture nodes as children if you want to directly use a texture
|
|
1440
|
+
* as input).
|
|
1441
|
+
*
|
|
1442
|
+
* The actual shader code is GLSL code that gets combined with
|
|
1443
|
+
* some other code into the fragment shader. Since the exact
|
|
1444
|
+
* capabilities of the GPU driver differs between different OpenGL
|
|
1445
|
+
* drivers and hardware, GTK adds some defines that you can use
|
|
1446
|
+
* to ensure your GLSL code runs on as many drivers as it can.
|
|
1447
|
+
*
|
|
1448
|
+
* If the OpenGL driver is GLES, then the shader language version
|
|
1449
|
+
* is set to 100, and GSK_GLES will be defined in the shader.
|
|
1450
|
+
*
|
|
1451
|
+
* Otherwise, if the OpenGL driver does not support the 3.2 core profile,
|
|
1452
|
+
* then the shader will run with language version 110 for GL2 and 130 for GL3,
|
|
1453
|
+
* and GSK_LEGACY will be defined in the shader.
|
|
1454
|
+
*
|
|
1455
|
+
* If the OpenGL driver supports the 3.2 code profile, it will be used,
|
|
1456
|
+
* the shader language version is set to 150, and GSK_GL3 will be defined
|
|
1457
|
+
* in the shader.
|
|
1458
|
+
*
|
|
1459
|
+
* The main function the shader must implement is:
|
|
1460
|
+
*
|
|
1461
|
+
* ```glsl
|
|
1462
|
+
* void mainImage(out vec4 fragColor,
|
|
1463
|
+
* in vec2 fragCoord,
|
|
1464
|
+
* in vec2 resolution,
|
|
1465
|
+
* in vec2 uv)
|
|
1466
|
+
* ```
|
|
1467
|
+
*
|
|
1468
|
+
* Where the input `fragCoord` is the coordinate of the pixel we're
|
|
1469
|
+
* currently rendering, relative to the boundary rectangle that was
|
|
1470
|
+
* specified in the `GskGLShaderNode`, and `resolution` is the width and
|
|
1471
|
+
* height of that rectangle. This is in the typical GTK coordinate
|
|
1472
|
+
* system with the origin in the top left. `uv` contains the u and v
|
|
1473
|
+
* coordinates that can be used to index a texture at the
|
|
1474
|
+
* corresponding point. These coordinates are in the [0..1]x[0..1]
|
|
1475
|
+
* region, with 0, 0 being in the lower left corder (which is typical
|
|
1476
|
+
* for OpenGL).
|
|
1477
|
+
*
|
|
1478
|
+
* The output `fragColor` should be a RGBA color (with
|
|
1479
|
+
* premultiplied alpha) that will be used as the output for the
|
|
1480
|
+
* specified pixel location. Note that this output will be
|
|
1481
|
+
* automatically clipped to the clip region of the glshader node.
|
|
1482
|
+
*
|
|
1483
|
+
* In addition to the function arguments the shader can define
|
|
1484
|
+
* up to 4 uniforms for textures which must be called u_textureN
|
|
1485
|
+
* (i.e. u_texture1 to u_texture4) as well as any custom uniforms
|
|
1486
|
+
* you want of types int, uint, bool, float, vec2, vec3 or vec4.
|
|
1487
|
+
*
|
|
1488
|
+
* All textures sources contain premultiplied alpha colors, but if some
|
|
1489
|
+
* there are outer sources of colors there is a gsk_premultiply() helper
|
|
1490
|
+
* to compute premultiplication when needed.
|
|
1491
|
+
*
|
|
1492
|
+
* Note that GTK parses the uniform declarations, so each uniform has to
|
|
1493
|
+
* be on a line by itself with no other code, like so:
|
|
1494
|
+
*
|
|
1495
|
+
* ```glsl
|
|
1496
|
+
* uniform float u_time;
|
|
1497
|
+
* uniform vec3 u_color;
|
|
1498
|
+
* uniform sampler2D u_texture1;
|
|
1499
|
+
* uniform sampler2D u_texture2;
|
|
1500
|
+
* ```
|
|
1501
|
+
*
|
|
1502
|
+
* GTK uses the "gsk" namespace in the symbols it uses in the
|
|
1503
|
+
* shader, so your code should not use any symbols with the prefix gsk
|
|
1504
|
+
* or GSK. There are some helper functions declared that you can use:
|
|
1505
|
+
*
|
|
1506
|
+
* ```glsl
|
|
1507
|
+
* vec4 GskTexture(sampler2D sampler, vec2 texCoords);
|
|
1508
|
+
* ```
|
|
1509
|
+
*
|
|
1510
|
+
* This samples a texture (e.g. u_texture1) at the specified
|
|
1511
|
+
* coordinates, and contains some helper ifdefs to ensure that
|
|
1512
|
+
* it works on all OpenGL versions.
|
|
1513
|
+
*
|
|
1514
|
+
* You can compile the shader yourself using [method`Gsk`.GLShader.compile],
|
|
1515
|
+
* otherwise the GSK renderer will do it when it handling the glshader
|
|
1516
|
+
* node. If errors occurs, the returned `error` will include the glsl
|
|
1517
|
+
* sources, so you can see what GSK was passing to the compiler. You
|
|
1518
|
+
* can also set GSK_DEBUG=shaders in the environment to see the sources
|
|
1519
|
+
* and other relevant information about all shaders that GSK is handling.
|
|
1520
|
+
*
|
|
1521
|
+
* # An example shader
|
|
1522
|
+
*
|
|
1523
|
+
* ```glsl
|
|
1524
|
+
* uniform float position;
|
|
1525
|
+
* uniform sampler2D u_texture1;
|
|
1526
|
+
* uniform sampler2D u_texture2;
|
|
1527
|
+
*
|
|
1528
|
+
* void mainImage(out vec4 fragColor,
|
|
1529
|
+
* in vec2 fragCoord,
|
|
1530
|
+
* in vec2 resolution,
|
|
1531
|
+
* in vec2 uv) {
|
|
1532
|
+
* vec4 source1 = GskTexture(u_texture1, uv);
|
|
1533
|
+
* vec4 source2 = GskTexture(u_texture2, uv);
|
|
1534
|
+
*
|
|
1535
|
+
* fragColor = position * source1 + (1.0 - position) * source2;
|
|
1536
|
+
* }
|
|
1537
|
+
* ```
|
|
1538
|
+
* @class
|
|
1539
|
+
*/
|
|
1540
|
+
export class GLShader extends GObject.Object {
|
|
1541
|
+
|
|
1542
|
+
// Own properties of Gsk-4.0.Gsk.GLShader
|
|
1543
|
+
|
|
1544
|
+
static name: string
|
|
1545
|
+
static $gtype: GObject.GType<GLShader>
|
|
1546
|
+
|
|
1547
|
+
// Constructors of Gsk-4.0.Gsk.GLShader
|
|
1548
|
+
|
|
1549
|
+
constructor(config?: GLShader.ConstructorProperties)
|
|
1550
|
+
/**
|
|
1551
|
+
* Creates a `GskGLShader` that will render pixels using the specified code.
|
|
1552
|
+
* @constructor
|
|
1553
|
+
* @param sourcecode GLSL sourcecode for the shader, as a `GBytes`
|
|
1554
|
+
* @returns A new `GskGLShader`
|
|
1555
|
+
*/
|
|
1556
|
+
static new_from_bytes(sourcecode: GLib.Bytes): GLShader
|
|
1557
|
+
/**
|
|
1558
|
+
* Creates a `GskGLShader` that will render pixels using the specified code.
|
|
1559
|
+
* @constructor
|
|
1560
|
+
* @param resource_path path to a resource that contains the GLSL sourcecode for the shader
|
|
1561
|
+
* @returns A new `GskGLShader`
|
|
1562
|
+
*/
|
|
1563
|
+
static new_from_resource(resource_path: string | null): GLShader
|
|
1564
|
+
_init(config?: GLShader.ConstructorProperties): void
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
export interface GLShaderNode {
|
|
1568
|
+
|
|
1569
|
+
// Owm methods of Gsk-4.0.Gsk.GLShaderNode
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Gets args for the node.
|
|
1573
|
+
* @returns A `GBytes` with the uniform arguments
|
|
1574
|
+
*/
|
|
1575
|
+
get_args(): GLib.Bytes
|
|
1576
|
+
/**
|
|
1577
|
+
* Gets one of the children.
|
|
1578
|
+
* @param idx the position of the child to get
|
|
1579
|
+
* @returns the @idx'th child of @node
|
|
1580
|
+
*/
|
|
1581
|
+
get_child(idx: number): RenderNode
|
|
1582
|
+
/**
|
|
1583
|
+
* Returns the number of children
|
|
1584
|
+
* @returns The number of children
|
|
1585
|
+
*/
|
|
1586
|
+
get_n_children(): number
|
|
1587
|
+
/**
|
|
1588
|
+
* Gets shader code for the node.
|
|
1589
|
+
* @returns the `GskGLShader` shader
|
|
1590
|
+
*/
|
|
1591
|
+
get_shader(): GLShader
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* A render node using a GL shader when drawing its children nodes.
|
|
1596
|
+
* @class
|
|
1597
|
+
*/
|
|
1598
|
+
export class GLShaderNode extends RenderNode {
|
|
1599
|
+
|
|
1600
|
+
// Own properties of Gsk-4.0.Gsk.GLShaderNode
|
|
1601
|
+
|
|
1602
|
+
static name: string
|
|
1603
|
+
|
|
1604
|
+
// Constructors of Gsk-4.0.Gsk.GLShaderNode
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Creates a `GskRenderNode` that will render the given `shader` into the
|
|
1608
|
+
* area given by `bounds`.
|
|
1609
|
+
*
|
|
1610
|
+
* The `args` is a block of data to use for uniform input, as per types and
|
|
1611
|
+
* offsets defined by the `shader`. Normally this is generated by
|
|
1612
|
+
* [method`Gsk`.GLShader.format_args] or [struct`Gsk`.ShaderArgsBuilder].
|
|
1613
|
+
*
|
|
1614
|
+
* See [class`Gsk`.GLShader] for details about how the shader should be written.
|
|
1615
|
+
*
|
|
1616
|
+
* All the children will be rendered into textures (if they aren't already
|
|
1617
|
+
* `GskTextureNodes`, which will be used directly). These textures will be
|
|
1618
|
+
* sent as input to the shader.
|
|
1619
|
+
*
|
|
1620
|
+
* If the renderer doesn't support GL shaders, or if there is any problem
|
|
1621
|
+
* when compiling the shader, then the node will draw pink. You should use
|
|
1622
|
+
* [method`Gsk`.GLShader.compile] to ensure the `shader` will work for the
|
|
1623
|
+
* renderer before using it.
|
|
1624
|
+
* @constructor
|
|
1625
|
+
* @param shader the `GskGLShader`
|
|
1626
|
+
* @param bounds the rectangle to render the shader into
|
|
1627
|
+
* @param args Arguments for the uniforms
|
|
1628
|
+
* @param children array of child nodes, these will be rendered to textures and used as input.
|
|
1629
|
+
* @returns A new `GskRenderNode`
|
|
1630
|
+
*/
|
|
1631
|
+
constructor(shader: GLShader, bounds: Graphene.Rect, args: GLib.Bytes, children: RenderNode[] | null)
|
|
1632
|
+
/**
|
|
1633
|
+
* Creates a `GskRenderNode` that will render the given `shader` into the
|
|
1634
|
+
* area given by `bounds`.
|
|
1635
|
+
*
|
|
1636
|
+
* The `args` is a block of data to use for uniform input, as per types and
|
|
1637
|
+
* offsets defined by the `shader`. Normally this is generated by
|
|
1638
|
+
* [method`Gsk`.GLShader.format_args] or [struct`Gsk`.ShaderArgsBuilder].
|
|
1639
|
+
*
|
|
1640
|
+
* See [class`Gsk`.GLShader] for details about how the shader should be written.
|
|
1641
|
+
*
|
|
1642
|
+
* All the children will be rendered into textures (if they aren't already
|
|
1643
|
+
* `GskTextureNodes`, which will be used directly). These textures will be
|
|
1644
|
+
* sent as input to the shader.
|
|
1645
|
+
*
|
|
1646
|
+
* If the renderer doesn't support GL shaders, or if there is any problem
|
|
1647
|
+
* when compiling the shader, then the node will draw pink. You should use
|
|
1648
|
+
* [method`Gsk`.GLShader.compile] to ensure the `shader` will work for the
|
|
1649
|
+
* renderer before using it.
|
|
1650
|
+
* @constructor
|
|
1651
|
+
* @param shader the `GskGLShader`
|
|
1652
|
+
* @param bounds the rectangle to render the shader into
|
|
1653
|
+
* @param args Arguments for the uniforms
|
|
1654
|
+
* @param children array of child nodes, these will be rendered to textures and used as input.
|
|
1655
|
+
* @returns A new `GskRenderNode`
|
|
1656
|
+
*/
|
|
1657
|
+
static new(shader: GLShader, bounds: Graphene.Rect, args: GLib.Bytes, children: RenderNode[] | null): GLShaderNode
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
export interface InsetShadowNode {
|
|
1661
|
+
|
|
1662
|
+
// Owm methods of Gsk-4.0.Gsk.InsetShadowNode
|
|
1663
|
+
|
|
1664
|
+
/**
|
|
1665
|
+
* Retrieves the blur radius to apply to the shadow.
|
|
1666
|
+
* @returns the blur radius, in pixels
|
|
1667
|
+
*/
|
|
1668
|
+
get_blur_radius(): number
|
|
1669
|
+
/**
|
|
1670
|
+
* Retrieves the color of the inset shadow.
|
|
1671
|
+
* @returns the color of the shadow
|
|
1672
|
+
*/
|
|
1673
|
+
get_color(): Gdk.RGBA
|
|
1674
|
+
/**
|
|
1675
|
+
* Retrieves the horizontal offset of the inset shadow.
|
|
1676
|
+
* @returns an offset, in pixels
|
|
1677
|
+
*/
|
|
1678
|
+
get_dx(): number
|
|
1679
|
+
/**
|
|
1680
|
+
* Retrieves the vertical offset of the inset shadow.
|
|
1681
|
+
* @returns an offset, in pixels
|
|
1682
|
+
*/
|
|
1683
|
+
get_dy(): number
|
|
1684
|
+
/**
|
|
1685
|
+
* Retrieves the outline rectangle of the inset shadow.
|
|
1686
|
+
* @returns a rounded rectangle
|
|
1687
|
+
*/
|
|
1688
|
+
get_outline(): RoundedRect
|
|
1689
|
+
/**
|
|
1690
|
+
* Retrieves how much the shadow spreads inwards.
|
|
1691
|
+
* @returns the size of the shadow, in pixels
|
|
1692
|
+
*/
|
|
1693
|
+
get_spread(): number
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* A render node for an inset shadow.
|
|
1698
|
+
* @class
|
|
1699
|
+
*/
|
|
1700
|
+
export class InsetShadowNode extends RenderNode {
|
|
1701
|
+
|
|
1702
|
+
// Own properties of Gsk-4.0.Gsk.InsetShadowNode
|
|
1703
|
+
|
|
1704
|
+
static name: string
|
|
1705
|
+
|
|
1706
|
+
// Constructors of Gsk-4.0.Gsk.InsetShadowNode
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Creates a `GskRenderNode` that will render an inset shadow
|
|
1710
|
+
* into the box given by `outline`.
|
|
1711
|
+
* @constructor
|
|
1712
|
+
* @param outline outline of the region containing the shadow
|
|
1713
|
+
* @param color color of the shadow
|
|
1714
|
+
* @param dx horizontal offset of shadow
|
|
1715
|
+
* @param dy vertical offset of shadow
|
|
1716
|
+
* @param spread how far the shadow spreads towards the inside
|
|
1717
|
+
* @param blur_radius how much blur to apply to the shadow
|
|
1718
|
+
* @returns A new `GskRenderNode`
|
|
1719
|
+
*/
|
|
1720
|
+
constructor(outline: RoundedRect, color: Gdk.RGBA, dx: number, dy: number, spread: number, blur_radius: number)
|
|
1721
|
+
/**
|
|
1722
|
+
* Creates a `GskRenderNode` that will render an inset shadow
|
|
1723
|
+
* into the box given by `outline`.
|
|
1724
|
+
* @constructor
|
|
1725
|
+
* @param outline outline of the region containing the shadow
|
|
1726
|
+
* @param color color of the shadow
|
|
1727
|
+
* @param dx horizontal offset of shadow
|
|
1728
|
+
* @param dy vertical offset of shadow
|
|
1729
|
+
* @param spread how far the shadow spreads towards the inside
|
|
1730
|
+
* @param blur_radius how much blur to apply to the shadow
|
|
1731
|
+
* @returns A new `GskRenderNode`
|
|
1732
|
+
*/
|
|
1733
|
+
static new(outline: RoundedRect, color: Gdk.RGBA, dx: number, dy: number, spread: number, blur_radius: number): InsetShadowNode
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
export interface LinearGradientNode {
|
|
1737
|
+
|
|
1738
|
+
// Owm methods of Gsk-4.0.Gsk.LinearGradientNode
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* Retrieves the color stops in the gradient.
|
|
1742
|
+
* @returns the color stops in the gradient
|
|
1743
|
+
*/
|
|
1744
|
+
get_color_stops(): ColorStop[]
|
|
1745
|
+
/**
|
|
1746
|
+
* Retrieves the final point of the linear gradient.
|
|
1747
|
+
* @returns the final point
|
|
1748
|
+
*/
|
|
1749
|
+
get_end(): Graphene.Point
|
|
1750
|
+
/**
|
|
1751
|
+
* Retrieves the number of color stops in the gradient.
|
|
1752
|
+
* @returns the number of color stops
|
|
1753
|
+
*/
|
|
1754
|
+
get_n_color_stops(): number
|
|
1755
|
+
/**
|
|
1756
|
+
* Retrieves the initial point of the linear gradient.
|
|
1757
|
+
* @returns the initial point
|
|
1758
|
+
*/
|
|
1759
|
+
get_start(): Graphene.Point
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* A render node for a linear gradient.
|
|
1764
|
+
* @class
|
|
1765
|
+
*/
|
|
1766
|
+
export class LinearGradientNode extends RenderNode {
|
|
1767
|
+
|
|
1768
|
+
// Own properties of Gsk-4.0.Gsk.LinearGradientNode
|
|
1769
|
+
|
|
1770
|
+
static name: string
|
|
1771
|
+
|
|
1772
|
+
// Constructors of Gsk-4.0.Gsk.LinearGradientNode
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* Creates a `GskRenderNode` that will create a linear gradient from the given
|
|
1776
|
+
* points and color stops, and render that into the area given by `bounds`.
|
|
1777
|
+
* @constructor
|
|
1778
|
+
* @param bounds the rectangle to render the linear gradient into
|
|
1779
|
+
* @param start the point at which the linear gradient will begin
|
|
1780
|
+
* @param end the point at which the linear gradient will finish
|
|
1781
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
1782
|
+
* @returns A new `GskRenderNode`
|
|
1783
|
+
*/
|
|
1784
|
+
constructor(bounds: Graphene.Rect, start: Graphene.Point, end: Graphene.Point, color_stops: ColorStop[])
|
|
1785
|
+
/**
|
|
1786
|
+
* Creates a `GskRenderNode` that will create a linear gradient from the given
|
|
1787
|
+
* points and color stops, and render that into the area given by `bounds`.
|
|
1788
|
+
* @constructor
|
|
1789
|
+
* @param bounds the rectangle to render the linear gradient into
|
|
1790
|
+
* @param start the point at which the linear gradient will begin
|
|
1791
|
+
* @param end the point at which the linear gradient will finish
|
|
1792
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
1793
|
+
* @returns A new `GskRenderNode`
|
|
1794
|
+
*/
|
|
1795
|
+
static new(bounds: Graphene.Rect, start: Graphene.Point, end: Graphene.Point, color_stops: ColorStop[]): LinearGradientNode
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
export interface MaskNode {
|
|
1799
|
+
|
|
1800
|
+
// Owm methods of Gsk-4.0.Gsk.MaskNode
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* Retrieves the mask `GskRenderNode` child of the `node`.
|
|
1804
|
+
* @returns the mask child node
|
|
1805
|
+
*/
|
|
1806
|
+
get_mask(): RenderNode
|
|
1807
|
+
/**
|
|
1808
|
+
* Retrieves the mask mode used by `node`.
|
|
1809
|
+
* @returns the mask mode
|
|
1810
|
+
*/
|
|
1811
|
+
get_mask_mode(): MaskMode
|
|
1812
|
+
/**
|
|
1813
|
+
* Retrieves the source `GskRenderNode` child of the `node`.
|
|
1814
|
+
* @returns the source child node
|
|
1815
|
+
*/
|
|
1816
|
+
get_source(): RenderNode
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* A render node masking one child node with another.
|
|
1821
|
+
* @class
|
|
1822
|
+
*/
|
|
1823
|
+
export class MaskNode extends RenderNode {
|
|
1824
|
+
|
|
1825
|
+
// Own properties of Gsk-4.0.Gsk.MaskNode
|
|
1826
|
+
|
|
1827
|
+
static name: string
|
|
1828
|
+
|
|
1829
|
+
// Constructors of Gsk-4.0.Gsk.MaskNode
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* Creates a `GskRenderNode` that will mask a given node by another.
|
|
1833
|
+
*
|
|
1834
|
+
* The `mask_mode` determines how the 'mask values' are derived from
|
|
1835
|
+
* the colors of the `mask`. Applying the mask consists of multiplying
|
|
1836
|
+
* the 'mask value' with the alpha of the source.
|
|
1837
|
+
* @constructor
|
|
1838
|
+
* @param source The source node to be drawn
|
|
1839
|
+
* @param mask The node to be used as mask
|
|
1840
|
+
* @param mask_mode The mask mode to use
|
|
1841
|
+
* @returns A new `GskRenderNode`
|
|
1842
|
+
*/
|
|
1843
|
+
constructor(source: RenderNode, mask: RenderNode, mask_mode: MaskMode)
|
|
1844
|
+
/**
|
|
1845
|
+
* Creates a `GskRenderNode` that will mask a given node by another.
|
|
1846
|
+
*
|
|
1847
|
+
* The `mask_mode` determines how the 'mask values' are derived from
|
|
1848
|
+
* the colors of the `mask`. Applying the mask consists of multiplying
|
|
1849
|
+
* the 'mask value' with the alpha of the source.
|
|
1850
|
+
* @constructor
|
|
1851
|
+
* @param source The source node to be drawn
|
|
1852
|
+
* @param mask The node to be used as mask
|
|
1853
|
+
* @param mask_mode The mask mode to use
|
|
1854
|
+
* @returns A new `GskRenderNode`
|
|
1855
|
+
*/
|
|
1856
|
+
static new(source: RenderNode, mask: RenderNode, mask_mode: MaskMode): MaskNode
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
export module NglRenderer {
|
|
1860
|
+
|
|
1861
|
+
// Constructor properties interface
|
|
1862
|
+
|
|
1863
|
+
export interface ConstructorProperties extends Renderer.ConstructorProperties {
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
export interface NglRenderer {
|
|
1869
|
+
|
|
1870
|
+
// Class property signals of Gsk-4.0.Gsk.NglRenderer
|
|
1871
|
+
|
|
1872
|
+
connect(sigName: "notify::realized", callback: (($obj: NglRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1873
|
+
connect_after(sigName: "notify::realized", callback: (($obj: NglRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1874
|
+
emit(sigName: "notify::realized", ...args: any[]): void
|
|
1875
|
+
connect(sigName: "notify::surface", callback: (($obj: NglRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1876
|
+
connect_after(sigName: "notify::surface", callback: (($obj: NglRenderer, pspec: GObject.ParamSpec) => void)): number
|
|
1877
|
+
emit(sigName: "notify::surface", ...args: any[]): void
|
|
1878
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1879
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1880
|
+
emit(sigName: string, ...args: any[]): void
|
|
1881
|
+
disconnect(id: number): void
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
export class NglRenderer extends Renderer {
|
|
1885
|
+
|
|
1886
|
+
// Own properties of Gsk-4.0.Gsk.NglRenderer
|
|
1887
|
+
|
|
1888
|
+
static name: string
|
|
1889
|
+
static $gtype: GObject.GType<NglRenderer>
|
|
1890
|
+
|
|
1891
|
+
// Constructors of Gsk-4.0.Gsk.NglRenderer
|
|
1892
|
+
|
|
1893
|
+
constructor(config?: NglRenderer.ConstructorProperties)
|
|
1894
|
+
/**
|
|
1895
|
+
* Same as gsk_gl_renderer_new().
|
|
1896
|
+
* @constructor
|
|
1897
|
+
* @returns a new GL renderer
|
|
1898
|
+
*/
|
|
1899
|
+
constructor()
|
|
1900
|
+
/**
|
|
1901
|
+
* Same as gsk_gl_renderer_new().
|
|
1902
|
+
* @constructor
|
|
1903
|
+
* @returns a new GL renderer
|
|
1904
|
+
*/
|
|
1905
|
+
static new(): NglRenderer
|
|
1906
|
+
_init(config?: NglRenderer.ConstructorProperties): void
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
export interface OpacityNode {
|
|
1910
|
+
|
|
1911
|
+
// Owm methods of Gsk-4.0.Gsk.OpacityNode
|
|
1912
|
+
|
|
1913
|
+
/**
|
|
1914
|
+
* Gets the child node that is getting opacityed by the given `node`.
|
|
1915
|
+
* @returns The child that is getting opacityed
|
|
1916
|
+
*/
|
|
1917
|
+
get_child(): RenderNode
|
|
1918
|
+
/**
|
|
1919
|
+
* Gets the transparency factor for an opacity node.
|
|
1920
|
+
* @returns the opacity factor
|
|
1921
|
+
*/
|
|
1922
|
+
get_opacity(): number
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
/**
|
|
1926
|
+
* A render node controlling the opacity of its single child node.
|
|
1927
|
+
* @class
|
|
1928
|
+
*/
|
|
1929
|
+
export class OpacityNode extends RenderNode {
|
|
1930
|
+
|
|
1931
|
+
// Own properties of Gsk-4.0.Gsk.OpacityNode
|
|
1932
|
+
|
|
1933
|
+
static name: string
|
|
1934
|
+
|
|
1935
|
+
// Constructors of Gsk-4.0.Gsk.OpacityNode
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* Creates a `GskRenderNode` that will drawn the `child` with reduced
|
|
1939
|
+
* `opacity`.
|
|
1940
|
+
* @constructor
|
|
1941
|
+
* @param child The node to draw
|
|
1942
|
+
* @param opacity The opacity to apply
|
|
1943
|
+
* @returns A new `GskRenderNode`
|
|
1944
|
+
*/
|
|
1945
|
+
constructor(child: RenderNode, opacity: number)
|
|
1946
|
+
/**
|
|
1947
|
+
* Creates a `GskRenderNode` that will drawn the `child` with reduced
|
|
1948
|
+
* `opacity`.
|
|
1949
|
+
* @constructor
|
|
1950
|
+
* @param child The node to draw
|
|
1951
|
+
* @param opacity The opacity to apply
|
|
1952
|
+
* @returns A new `GskRenderNode`
|
|
1953
|
+
*/
|
|
1954
|
+
static new(child: RenderNode, opacity: number): OpacityNode
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
export interface OutsetShadowNode {
|
|
1958
|
+
|
|
1959
|
+
// Owm methods of Gsk-4.0.Gsk.OutsetShadowNode
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* Retrieves the blur radius of the shadow.
|
|
1963
|
+
* @returns the blur radius, in pixels
|
|
1964
|
+
*/
|
|
1965
|
+
get_blur_radius(): number
|
|
1966
|
+
/**
|
|
1967
|
+
* Retrieves the color of the outset shadow.
|
|
1968
|
+
* @returns a color
|
|
1969
|
+
*/
|
|
1970
|
+
get_color(): Gdk.RGBA
|
|
1971
|
+
/**
|
|
1972
|
+
* Retrieves the horizontal offset of the outset shadow.
|
|
1973
|
+
* @returns an offset, in pixels
|
|
1974
|
+
*/
|
|
1975
|
+
get_dx(): number
|
|
1976
|
+
/**
|
|
1977
|
+
* Retrieves the vertical offset of the outset shadow.
|
|
1978
|
+
* @returns an offset, in pixels
|
|
1979
|
+
*/
|
|
1980
|
+
get_dy(): number
|
|
1981
|
+
/**
|
|
1982
|
+
* Retrieves the outline rectangle of the outset shadow.
|
|
1983
|
+
* @returns a rounded rectangle
|
|
1984
|
+
*/
|
|
1985
|
+
get_outline(): RoundedRect
|
|
1986
|
+
/**
|
|
1987
|
+
* Retrieves how much the shadow spreads outwards.
|
|
1988
|
+
* @returns the size of the shadow, in pixels
|
|
1989
|
+
*/
|
|
1990
|
+
get_spread(): number
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
/**
|
|
1994
|
+
* A render node for an outset shadow.
|
|
1995
|
+
* @class
|
|
1996
|
+
*/
|
|
1997
|
+
export class OutsetShadowNode extends RenderNode {
|
|
1998
|
+
|
|
1999
|
+
// Own properties of Gsk-4.0.Gsk.OutsetShadowNode
|
|
2000
|
+
|
|
2001
|
+
static name: string
|
|
2002
|
+
|
|
2003
|
+
// Constructors of Gsk-4.0.Gsk.OutsetShadowNode
|
|
2004
|
+
|
|
2005
|
+
/**
|
|
2006
|
+
* Creates a `GskRenderNode` that will render an outset shadow
|
|
2007
|
+
* around the box given by `outline`.
|
|
2008
|
+
* @constructor
|
|
2009
|
+
* @param outline outline of the region surrounded by shadow
|
|
2010
|
+
* @param color color of the shadow
|
|
2011
|
+
* @param dx horizontal offset of shadow
|
|
2012
|
+
* @param dy vertical offset of shadow
|
|
2013
|
+
* @param spread how far the shadow spreads towards the inside
|
|
2014
|
+
* @param blur_radius how much blur to apply to the shadow
|
|
2015
|
+
* @returns A new `GskRenderNode`
|
|
2016
|
+
*/
|
|
2017
|
+
constructor(outline: RoundedRect, color: Gdk.RGBA, dx: number, dy: number, spread: number, blur_radius: number)
|
|
2018
|
+
/**
|
|
2019
|
+
* Creates a `GskRenderNode` that will render an outset shadow
|
|
2020
|
+
* around the box given by `outline`.
|
|
2021
|
+
* @constructor
|
|
2022
|
+
* @param outline outline of the region surrounded by shadow
|
|
2023
|
+
* @param color color of the shadow
|
|
2024
|
+
* @param dx horizontal offset of shadow
|
|
2025
|
+
* @param dy vertical offset of shadow
|
|
2026
|
+
* @param spread how far the shadow spreads towards the inside
|
|
2027
|
+
* @param blur_radius how much blur to apply to the shadow
|
|
2028
|
+
* @returns A new `GskRenderNode`
|
|
2029
|
+
*/
|
|
2030
|
+
static new(outline: RoundedRect, color: Gdk.RGBA, dx: number, dy: number, spread: number, blur_radius: number): OutsetShadowNode
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
export interface RadialGradientNode {
|
|
2034
|
+
|
|
2035
|
+
// Owm methods of Gsk-4.0.Gsk.RadialGradientNode
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* Retrieves the center pointer for the gradient.
|
|
2039
|
+
* @returns the center point for the gradient
|
|
2040
|
+
*/
|
|
2041
|
+
get_center(): Graphene.Point
|
|
2042
|
+
/**
|
|
2043
|
+
* Retrieves the color stops in the gradient.
|
|
2044
|
+
* @returns the color stops in the gradient
|
|
2045
|
+
*/
|
|
2046
|
+
get_color_stops(): ColorStop[]
|
|
2047
|
+
/**
|
|
2048
|
+
* Retrieves the end value for the gradient.
|
|
2049
|
+
* @returns the end value for the gradient
|
|
2050
|
+
*/
|
|
2051
|
+
get_end(): number
|
|
2052
|
+
/**
|
|
2053
|
+
* Retrieves the horizontal radius for the gradient.
|
|
2054
|
+
* @returns the horizontal radius for the gradient
|
|
2055
|
+
*/
|
|
2056
|
+
get_hradius(): number
|
|
2057
|
+
/**
|
|
2058
|
+
* Retrieves the number of color stops in the gradient.
|
|
2059
|
+
* @returns the number of color stops
|
|
2060
|
+
*/
|
|
2061
|
+
get_n_color_stops(): number
|
|
2062
|
+
/**
|
|
2063
|
+
* Retrieves the start value for the gradient.
|
|
2064
|
+
* @returns the start value for the gradient
|
|
2065
|
+
*/
|
|
2066
|
+
get_start(): number
|
|
2067
|
+
/**
|
|
2068
|
+
* Retrieves the vertical radius for the gradient.
|
|
2069
|
+
* @returns the vertical radius for the gradient
|
|
2070
|
+
*/
|
|
2071
|
+
get_vradius(): number
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* A render node for a radial gradient.
|
|
2076
|
+
* @class
|
|
2077
|
+
*/
|
|
2078
|
+
export class RadialGradientNode extends RenderNode {
|
|
2079
|
+
|
|
2080
|
+
// Own properties of Gsk-4.0.Gsk.RadialGradientNode
|
|
2081
|
+
|
|
2082
|
+
static name: string
|
|
2083
|
+
|
|
2084
|
+
// Constructors of Gsk-4.0.Gsk.RadialGradientNode
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* Creates a `GskRenderNode` that draws a radial gradient.
|
|
2088
|
+
*
|
|
2089
|
+
* The radial gradient
|
|
2090
|
+
* starts around `center`. The size of the gradient is dictated by `hradius`
|
|
2091
|
+
* in horizontal orientation and by `vradius` in vertical orientation.
|
|
2092
|
+
* @constructor
|
|
2093
|
+
* @param bounds the bounds of the node
|
|
2094
|
+
* @param center the center of the gradient
|
|
2095
|
+
* @param hradius the horizontal radius
|
|
2096
|
+
* @param vradius the vertical radius
|
|
2097
|
+
* @param start a percentage >= 0 that defines the start of the gradient around `center`
|
|
2098
|
+
* @param end a percentage >= 0 that defines the end of the gradient around `center`
|
|
2099
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2100
|
+
* @returns A new `GskRenderNode`
|
|
2101
|
+
*/
|
|
2102
|
+
constructor(bounds: Graphene.Rect, center: Graphene.Point, hradius: number, vradius: number, start: number, end: number, color_stops: ColorStop[])
|
|
2103
|
+
/**
|
|
2104
|
+
* Creates a `GskRenderNode` that draws a radial gradient.
|
|
2105
|
+
*
|
|
2106
|
+
* The radial gradient
|
|
2107
|
+
* starts around `center`. The size of the gradient is dictated by `hradius`
|
|
2108
|
+
* in horizontal orientation and by `vradius` in vertical orientation.
|
|
2109
|
+
* @constructor
|
|
2110
|
+
* @param bounds the bounds of the node
|
|
2111
|
+
* @param center the center of the gradient
|
|
2112
|
+
* @param hradius the horizontal radius
|
|
2113
|
+
* @param vradius the vertical radius
|
|
2114
|
+
* @param start a percentage >= 0 that defines the start of the gradient around `center`
|
|
2115
|
+
* @param end a percentage >= 0 that defines the end of the gradient around `center`
|
|
2116
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2117
|
+
* @returns A new `GskRenderNode`
|
|
2118
|
+
*/
|
|
2119
|
+
static new(bounds: Graphene.Rect, center: Graphene.Point, hradius: number, vradius: number, start: number, end: number, color_stops: ColorStop[]): RadialGradientNode
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
export interface RenderNode {
|
|
2123
|
+
|
|
2124
|
+
// Owm methods of Gsk-4.0.Gsk.RenderNode
|
|
2125
|
+
|
|
2126
|
+
/**
|
|
2127
|
+
* Draw the contents of `node` to the given cairo context.
|
|
2128
|
+
*
|
|
2129
|
+
* Typically, you'll use this function to implement fallback rendering
|
|
2130
|
+
* of `GskRenderNode`s on an intermediate Cairo context, instead of using
|
|
2131
|
+
* the drawing context associated to a [class`Gdk`.Surface]'s rendering buffer.
|
|
2132
|
+
*
|
|
2133
|
+
* For advanced nodes that cannot be supported using Cairo, in particular
|
|
2134
|
+
* for nodes doing 3D operations, this function may fail.
|
|
2135
|
+
* @param cr cairo context to draw to
|
|
2136
|
+
*/
|
|
2137
|
+
draw(cr: cairo.Context): void
|
|
2138
|
+
/**
|
|
2139
|
+
* Retrieves the boundaries of the `node`.
|
|
2140
|
+
*
|
|
2141
|
+
* The node will not draw outside of its boundaries.
|
|
2142
|
+
*/
|
|
2143
|
+
get_bounds(): /* bounds */ Graphene.Rect
|
|
2144
|
+
/**
|
|
2145
|
+
* Returns the type of the `node`.
|
|
2146
|
+
* @returns the type of the `GskRenderNode`
|
|
2147
|
+
*/
|
|
2148
|
+
get_node_type(): RenderNodeType
|
|
2149
|
+
/**
|
|
2150
|
+
* Acquires a reference on the given `GskRenderNode`.
|
|
2151
|
+
* @returns the `GskRenderNode` with an additional reference
|
|
2152
|
+
*/
|
|
2153
|
+
ref(): RenderNode
|
|
2154
|
+
/**
|
|
2155
|
+
* Serializes the `node` for later deserialization via
|
|
2156
|
+
* gsk_render_node_deserialize(). No guarantees are made about the format
|
|
2157
|
+
* used other than that the same version of GTK will be able to deserialize
|
|
2158
|
+
* the result of a call to gsk_render_node_serialize() and
|
|
2159
|
+
* gsk_render_node_deserialize() will correctly reject files it cannot open
|
|
2160
|
+
* that were created with previous versions of GTK.
|
|
2161
|
+
*
|
|
2162
|
+
* The intended use of this functions is testing, benchmarking and debugging.
|
|
2163
|
+
* The format is not meant as a permanent storage format.
|
|
2164
|
+
* @returns a `GBytes` representing the node.
|
|
2165
|
+
*/
|
|
2166
|
+
serialize(): GLib.Bytes
|
|
2167
|
+
/**
|
|
2168
|
+
* Releases a reference on the given `GskRenderNode`.
|
|
2169
|
+
*
|
|
2170
|
+
* If the reference was the last, the resources associated to the `node` are
|
|
2171
|
+
* freed.
|
|
2172
|
+
*/
|
|
2173
|
+
unref(): void
|
|
2174
|
+
/**
|
|
2175
|
+
* This function is equivalent to calling [method`Gsk`.RenderNode.serialize]
|
|
2176
|
+
* followed by [func`GLib`.file_set_contents].
|
|
2177
|
+
*
|
|
2178
|
+
* See those two functions for details on the arguments.
|
|
2179
|
+
*
|
|
2180
|
+
* It is mostly intended for use inside a debugger to quickly dump a render
|
|
2181
|
+
* node to a file for later inspection.
|
|
2182
|
+
* @param filename the file to save it to.
|
|
2183
|
+
* @returns %TRUE if saving was successful
|
|
2184
|
+
*/
|
|
2185
|
+
write_to_file(filename: string): boolean
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* `GskRenderNode` is the basic block in a scene graph to be
|
|
2190
|
+
* rendered using [class`Gsk`.Renderer].
|
|
2191
|
+
*
|
|
2192
|
+
* Each node has a parent, except the top-level node; each node may have
|
|
2193
|
+
* children nodes.
|
|
2194
|
+
*
|
|
2195
|
+
* Each node has an associated drawing surface, which has the size of
|
|
2196
|
+
* the rectangle set when creating it.
|
|
2197
|
+
*
|
|
2198
|
+
* Render nodes are meant to be transient; once they have been associated
|
|
2199
|
+
* to a [class`Gsk`.Renderer] it's safe to release any reference you have on
|
|
2200
|
+
* them. All [class`Gsk`.RenderNode]s are immutable, you can only specify their
|
|
2201
|
+
* properties during construction.
|
|
2202
|
+
* @class
|
|
2203
|
+
*/
|
|
2204
|
+
export class RenderNode {
|
|
2205
|
+
|
|
2206
|
+
// Own properties of Gsk-4.0.Gsk.RenderNode
|
|
2207
|
+
|
|
2208
|
+
static name: string
|
|
2209
|
+
|
|
2210
|
+
// Constructors of Gsk-4.0.Gsk.RenderNode
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Loads data previously created via [method`Gsk`.RenderNode.serialize].
|
|
2214
|
+
*
|
|
2215
|
+
* For a discussion of the supported format, see that function.
|
|
2216
|
+
* @param bytes the bytes containing the data
|
|
2217
|
+
* @returns a new `GskRenderNode`
|
|
2218
|
+
*/
|
|
2219
|
+
static deserialize(bytes: GLib.Bytes): RenderNode | null
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
export module Renderer {
|
|
2223
|
+
|
|
2224
|
+
// Constructor properties interface
|
|
2225
|
+
|
|
2226
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
export interface Renderer {
|
|
2232
|
+
|
|
2233
|
+
// Own properties of Gsk-4.0.Gsk.Renderer
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* Whether the renderer has been associated with a surface or draw context.
|
|
2237
|
+
*/
|
|
2238
|
+
readonly realized: boolean
|
|
2239
|
+
/**
|
|
2240
|
+
* The surface associated with renderer.
|
|
2241
|
+
*/
|
|
2242
|
+
readonly surface: Gdk.Surface
|
|
2243
|
+
|
|
2244
|
+
// Owm methods of Gsk-4.0.Gsk.Renderer
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* Retrieves the `GdkSurface` set using gsk_enderer_realize().
|
|
2248
|
+
*
|
|
2249
|
+
* If the renderer has not been realized yet, %NULL will be returned.
|
|
2250
|
+
* @returns a `GdkSurface`
|
|
2251
|
+
*/
|
|
2252
|
+
get_surface(): Gdk.Surface | null
|
|
2253
|
+
/**
|
|
2254
|
+
* Checks whether the `renderer` is realized or not.
|
|
2255
|
+
* @returns %TRUE if the `GskRenderer` was realized, and %FALSE otherwise
|
|
2256
|
+
*/
|
|
2257
|
+
is_realized(): boolean
|
|
2258
|
+
/**
|
|
2259
|
+
* Creates the resources needed by the `renderer` to render the scene
|
|
2260
|
+
* graph.
|
|
2261
|
+
*
|
|
2262
|
+
* Since GTK 4.6, the surface may be `NULL`, which allows using
|
|
2263
|
+
* renderers without having to create a surface.
|
|
2264
|
+
*
|
|
2265
|
+
* Note that it is mandatory to call [method`Gsk`.Renderer.unrealize] before
|
|
2266
|
+
* destroying the renderer.
|
|
2267
|
+
* @param surface the `GdkSurface` renderer will be used on
|
|
2268
|
+
* @returns Whether the renderer was successfully realized
|
|
2269
|
+
*/
|
|
2270
|
+
realize(surface: Gdk.Surface | null): boolean
|
|
2271
|
+
/**
|
|
2272
|
+
* Renders the scene graph, described by a tree of `GskRenderNode` instances
|
|
2273
|
+
* to the renderer's surface, ensuring that the given `region` gets redrawn.
|
|
2274
|
+
*
|
|
2275
|
+
* If the renderer has no associated surface, this function does nothing.
|
|
2276
|
+
*
|
|
2277
|
+
* Renderers must ensure that changes of the contents given by the `root`
|
|
2278
|
+
* node as well as the area given by `region` are redrawn. They are however
|
|
2279
|
+
* free to not redraw any pixel outside of `region` if they can guarantee that
|
|
2280
|
+
* it didn't change.
|
|
2281
|
+
*
|
|
2282
|
+
* The `renderer` will acquire a reference on the `GskRenderNode` tree while
|
|
2283
|
+
* the rendering is in progress.
|
|
2284
|
+
* @param root a `GskRenderNode`
|
|
2285
|
+
* @param region the `cairo_region_t` that must be redrawn or %NULL for the whole window
|
|
2286
|
+
*/
|
|
2287
|
+
render(root: RenderNode, region: cairo.Region | null): void
|
|
2288
|
+
/**
|
|
2289
|
+
* Renders the scene graph, described by a tree of `GskRenderNode` instances,
|
|
2290
|
+
* to a `GdkTexture`.
|
|
2291
|
+
*
|
|
2292
|
+
* The `renderer` will acquire a reference on the `GskRenderNode` tree while
|
|
2293
|
+
* the rendering is in progress.
|
|
2294
|
+
*
|
|
2295
|
+
* If you want to apply any transformations to `root,` you should put it into a
|
|
2296
|
+
* transform node and pass that node instead.
|
|
2297
|
+
* @param root a `GskRenderNode`
|
|
2298
|
+
* @param viewport the section to draw or %NULL to use `root'`s bounds
|
|
2299
|
+
* @returns a `GdkTexture` with the rendered contents of @root.
|
|
2300
|
+
*/
|
|
2301
|
+
render_texture(root: RenderNode, viewport: Graphene.Rect | null): Gdk.Texture
|
|
2302
|
+
/**
|
|
2303
|
+
* Releases all the resources created by gsk_renderer_realize().
|
|
2304
|
+
*/
|
|
2305
|
+
unrealize(): void
|
|
2306
|
+
|
|
2307
|
+
// Class property signals of Gsk-4.0.Gsk.Renderer
|
|
2308
|
+
|
|
2309
|
+
connect(sigName: "notify::realized", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
|
|
2310
|
+
connect_after(sigName: "notify::realized", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
|
|
2311
|
+
emit(sigName: "notify::realized", ...args: any[]): void
|
|
2312
|
+
connect(sigName: "notify::surface", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
|
|
2313
|
+
connect_after(sigName: "notify::surface", callback: (($obj: Renderer, pspec: GObject.ParamSpec) => void)): number
|
|
2314
|
+
emit(sigName: "notify::surface", ...args: any[]): void
|
|
2315
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2316
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2317
|
+
emit(sigName: string, ...args: any[]): void
|
|
2318
|
+
disconnect(id: number): void
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* `GskRenderer` is a class that renders a scene graph defined via a
|
|
2323
|
+
* tree of [class`Gsk`.RenderNode] instances.
|
|
2324
|
+
*
|
|
2325
|
+
* Typically you will use a `GskRenderer` instance to repeatedly call
|
|
2326
|
+
* [method`Gsk`.Renderer.render] to update the contents of its associated
|
|
2327
|
+
* [class`Gdk`.Surface].
|
|
2328
|
+
*
|
|
2329
|
+
* It is necessary to realize a `GskRenderer` instance using
|
|
2330
|
+
* [method`Gsk`.Renderer.realize] before calling [method`Gsk`.Renderer.render],
|
|
2331
|
+
* in order to create the appropriate windowing system resources needed
|
|
2332
|
+
* to render the scene.
|
|
2333
|
+
* @class
|
|
2334
|
+
*/
|
|
2335
|
+
export class Renderer extends GObject.Object {
|
|
2336
|
+
|
|
2337
|
+
// Own properties of Gsk-4.0.Gsk.Renderer
|
|
2338
|
+
|
|
2339
|
+
static name: string
|
|
2340
|
+
static $gtype: GObject.GType<Renderer>
|
|
2341
|
+
|
|
2342
|
+
// Constructors of Gsk-4.0.Gsk.Renderer
|
|
2343
|
+
|
|
2344
|
+
constructor(config?: Renderer.ConstructorProperties)
|
|
2345
|
+
/**
|
|
2346
|
+
* Creates an appropriate `GskRenderer` instance for the given `surface`.
|
|
2347
|
+
*
|
|
2348
|
+
* If the `GSK_RENDERER` environment variable is set, GSK will
|
|
2349
|
+
* try that renderer first, before trying the backend-specific
|
|
2350
|
+
* default. The ultimate fallback is the cairo renderer.
|
|
2351
|
+
*
|
|
2352
|
+
* The renderer will be realized before it is returned.
|
|
2353
|
+
* @constructor
|
|
2354
|
+
* @param surface a `GdkSurface`
|
|
2355
|
+
* @returns a `GskRenderer`
|
|
2356
|
+
*/
|
|
2357
|
+
static new_for_surface(surface: Gdk.Surface): Renderer
|
|
2358
|
+
_init(config?: Renderer.ConstructorProperties): void
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
export interface RepeatNode {
|
|
2362
|
+
|
|
2363
|
+
// Owm methods of Gsk-4.0.Gsk.RepeatNode
|
|
2364
|
+
|
|
2365
|
+
/**
|
|
2366
|
+
* Retrieves the child of `node`.
|
|
2367
|
+
* @returns a `GskRenderNode`
|
|
2368
|
+
*/
|
|
2369
|
+
get_child(): RenderNode
|
|
2370
|
+
/**
|
|
2371
|
+
* Retrieves the bounding rectangle of the child of `node`.
|
|
2372
|
+
* @returns a bounding rectangle
|
|
2373
|
+
*/
|
|
2374
|
+
get_child_bounds(): Graphene.Rect
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* A render node repeating its single child node.
|
|
2379
|
+
* @class
|
|
2380
|
+
*/
|
|
2381
|
+
export class RepeatNode extends RenderNode {
|
|
2382
|
+
|
|
2383
|
+
// Own properties of Gsk-4.0.Gsk.RepeatNode
|
|
2384
|
+
|
|
2385
|
+
static name: string
|
|
2386
|
+
|
|
2387
|
+
// Constructors of Gsk-4.0.Gsk.RepeatNode
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* Creates a `GskRenderNode` that will repeat the drawing of `child` across
|
|
2391
|
+
* the given `bounds`.
|
|
2392
|
+
* @constructor
|
|
2393
|
+
* @param bounds The bounds of the area to be painted
|
|
2394
|
+
* @param child The child to repeat
|
|
2395
|
+
* @param child_bounds The area of the child to repeat or %NULL to use the child's bounds
|
|
2396
|
+
* @returns A new `GskRenderNode`
|
|
2397
|
+
*/
|
|
2398
|
+
constructor(bounds: Graphene.Rect, child: RenderNode, child_bounds: Graphene.Rect | null)
|
|
2399
|
+
/**
|
|
2400
|
+
* Creates a `GskRenderNode` that will repeat the drawing of `child` across
|
|
2401
|
+
* the given `bounds`.
|
|
2402
|
+
* @constructor
|
|
2403
|
+
* @param bounds The bounds of the area to be painted
|
|
2404
|
+
* @param child The child to repeat
|
|
2405
|
+
* @param child_bounds The area of the child to repeat or %NULL to use the child's bounds
|
|
2406
|
+
* @returns A new `GskRenderNode`
|
|
2407
|
+
*/
|
|
2408
|
+
static new(bounds: Graphene.Rect, child: RenderNode, child_bounds: Graphene.Rect | null): RepeatNode
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
export interface RepeatingLinearGradientNode {
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
/**
|
|
2415
|
+
* A render node for a repeating linear gradient.
|
|
2416
|
+
* @class
|
|
2417
|
+
*/
|
|
2418
|
+
export class RepeatingLinearGradientNode extends RenderNode {
|
|
2419
|
+
|
|
2420
|
+
// Own properties of Gsk-4.0.Gsk.RepeatingLinearGradientNode
|
|
2421
|
+
|
|
2422
|
+
static name: string
|
|
2423
|
+
|
|
2424
|
+
// Constructors of Gsk-4.0.Gsk.RepeatingLinearGradientNode
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Creates a `GskRenderNode` that will create a repeating linear gradient
|
|
2428
|
+
* from the given points and color stops, and render that into the area
|
|
2429
|
+
* given by `bounds`.
|
|
2430
|
+
* @constructor
|
|
2431
|
+
* @param bounds the rectangle to render the linear gradient into
|
|
2432
|
+
* @param start the point at which the linear gradient will begin
|
|
2433
|
+
* @param end the point at which the linear gradient will finish
|
|
2434
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2435
|
+
* @returns A new `GskRenderNode`
|
|
2436
|
+
*/
|
|
2437
|
+
constructor(bounds: Graphene.Rect, start: Graphene.Point, end: Graphene.Point, color_stops: ColorStop[])
|
|
2438
|
+
/**
|
|
2439
|
+
* Creates a `GskRenderNode` that will create a repeating linear gradient
|
|
2440
|
+
* from the given points and color stops, and render that into the area
|
|
2441
|
+
* given by `bounds`.
|
|
2442
|
+
* @constructor
|
|
2443
|
+
* @param bounds the rectangle to render the linear gradient into
|
|
2444
|
+
* @param start the point at which the linear gradient will begin
|
|
2445
|
+
* @param end the point at which the linear gradient will finish
|
|
2446
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2447
|
+
* @returns A new `GskRenderNode`
|
|
2448
|
+
*/
|
|
2449
|
+
static new(bounds: Graphene.Rect, start: Graphene.Point, end: Graphene.Point, color_stops: ColorStop[]): RepeatingLinearGradientNode
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
export interface RepeatingRadialGradientNode {
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* A render node for a repeating radial gradient.
|
|
2457
|
+
* @class
|
|
2458
|
+
*/
|
|
2459
|
+
export class RepeatingRadialGradientNode extends RenderNode {
|
|
2460
|
+
|
|
2461
|
+
// Own properties of Gsk-4.0.Gsk.RepeatingRadialGradientNode
|
|
2462
|
+
|
|
2463
|
+
static name: string
|
|
2464
|
+
|
|
2465
|
+
// Constructors of Gsk-4.0.Gsk.RepeatingRadialGradientNode
|
|
2466
|
+
|
|
2467
|
+
/**
|
|
2468
|
+
* Creates a `GskRenderNode` that draws a repeating radial gradient.
|
|
2469
|
+
*
|
|
2470
|
+
* The radial gradient starts around `center`. The size of the gradient
|
|
2471
|
+
* is dictated by `hradius` in horizontal orientation and by `vradius`
|
|
2472
|
+
* in vertical orientation.
|
|
2473
|
+
* @constructor
|
|
2474
|
+
* @param bounds the bounds of the node
|
|
2475
|
+
* @param center the center of the gradient
|
|
2476
|
+
* @param hradius the horizontal radius
|
|
2477
|
+
* @param vradius the vertical radius
|
|
2478
|
+
* @param start a percentage >= 0 that defines the start of the gradient around `center`
|
|
2479
|
+
* @param end a percentage >= 0 that defines the end of the gradient around `center`
|
|
2480
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2481
|
+
* @returns A new `GskRenderNode`
|
|
2482
|
+
*/
|
|
2483
|
+
constructor(bounds: Graphene.Rect, center: Graphene.Point, hradius: number, vradius: number, start: number, end: number, color_stops: ColorStop[])
|
|
2484
|
+
/**
|
|
2485
|
+
* Creates a `GskRenderNode` that draws a repeating radial gradient.
|
|
2486
|
+
*
|
|
2487
|
+
* The radial gradient starts around `center`. The size of the gradient
|
|
2488
|
+
* is dictated by `hradius` in horizontal orientation and by `vradius`
|
|
2489
|
+
* in vertical orientation.
|
|
2490
|
+
* @constructor
|
|
2491
|
+
* @param bounds the bounds of the node
|
|
2492
|
+
* @param center the center of the gradient
|
|
2493
|
+
* @param hradius the horizontal radius
|
|
2494
|
+
* @param vradius the vertical radius
|
|
2495
|
+
* @param start a percentage >= 0 that defines the start of the gradient around `center`
|
|
2496
|
+
* @param end a percentage >= 0 that defines the end of the gradient around `center`
|
|
2497
|
+
* @param color_stops a pointer to an array of `GskColorStop` defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
|
|
2498
|
+
* @returns A new `GskRenderNode`
|
|
2499
|
+
*/
|
|
2500
|
+
static new(bounds: Graphene.Rect, center: Graphene.Point, hradius: number, vradius: number, start: number, end: number, color_stops: ColorStop[]): RepeatingRadialGradientNode
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
export interface RoundedClipNode {
|
|
2504
|
+
|
|
2505
|
+
// Owm methods of Gsk-4.0.Gsk.RoundedClipNode
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Gets the child node that is getting clipped by the given `node`.
|
|
2509
|
+
* @returns The child that is getting clipped
|
|
2510
|
+
*/
|
|
2511
|
+
get_child(): RenderNode
|
|
2512
|
+
/**
|
|
2513
|
+
* Retrieves the rounded rectangle used to clip the contents of the `node`.
|
|
2514
|
+
* @returns a rounded rectangle
|
|
2515
|
+
*/
|
|
2516
|
+
get_clip(): RoundedRect
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* A render node applying a rounded rectangle clip to its single child.
|
|
2521
|
+
* @class
|
|
2522
|
+
*/
|
|
2523
|
+
export class RoundedClipNode extends RenderNode {
|
|
2524
|
+
|
|
2525
|
+
// Own properties of Gsk-4.0.Gsk.RoundedClipNode
|
|
2526
|
+
|
|
2527
|
+
static name: string
|
|
2528
|
+
|
|
2529
|
+
// Constructors of Gsk-4.0.Gsk.RoundedClipNode
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* Creates a `GskRenderNode` that will clip the `child` to the area
|
|
2533
|
+
* given by `clip`.
|
|
2534
|
+
* @constructor
|
|
2535
|
+
* @param child The node to draw
|
|
2536
|
+
* @param clip The clip to apply
|
|
2537
|
+
* @returns A new `GskRenderNode`
|
|
2538
|
+
*/
|
|
2539
|
+
constructor(child: RenderNode, clip: RoundedRect)
|
|
2540
|
+
/**
|
|
2541
|
+
* Creates a `GskRenderNode` that will clip the `child` to the area
|
|
2542
|
+
* given by `clip`.
|
|
2543
|
+
* @constructor
|
|
2544
|
+
* @param child The node to draw
|
|
2545
|
+
* @param clip The clip to apply
|
|
2546
|
+
* @returns A new `GskRenderNode`
|
|
2547
|
+
*/
|
|
2548
|
+
static new(child: RenderNode, clip: RoundedRect): RoundedClipNode
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
export interface ShadowNode {
|
|
2552
|
+
|
|
2553
|
+
// Owm methods of Gsk-4.0.Gsk.ShadowNode
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* Retrieves the child `GskRenderNode` of the shadow `node`.
|
|
2557
|
+
* @returns the child render node
|
|
2558
|
+
*/
|
|
2559
|
+
get_child(): RenderNode
|
|
2560
|
+
/**
|
|
2561
|
+
* Retrieves the number of shadows in the `node`.
|
|
2562
|
+
* @returns the number of shadows.
|
|
2563
|
+
*/
|
|
2564
|
+
get_n_shadows(): number
|
|
2565
|
+
/**
|
|
2566
|
+
* Retrieves the shadow data at the given index `i`.
|
|
2567
|
+
* @param i the given index
|
|
2568
|
+
* @returns the shadow data
|
|
2569
|
+
*/
|
|
2570
|
+
get_shadow(i: number): Shadow
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
/**
|
|
2574
|
+
* A render node drawing one or more shadows behind its single child node.
|
|
2575
|
+
* @class
|
|
2576
|
+
*/
|
|
2577
|
+
export class ShadowNode extends RenderNode {
|
|
2578
|
+
|
|
2579
|
+
// Own properties of Gsk-4.0.Gsk.ShadowNode
|
|
2580
|
+
|
|
2581
|
+
static name: string
|
|
2582
|
+
|
|
2583
|
+
// Constructors of Gsk-4.0.Gsk.ShadowNode
|
|
2584
|
+
|
|
2585
|
+
/**
|
|
2586
|
+
* Creates a `GskRenderNode` that will draw a `child` with the given
|
|
2587
|
+
* `shadows` below it.
|
|
2588
|
+
* @constructor
|
|
2589
|
+
* @param child The node to draw
|
|
2590
|
+
* @param shadows The shadows to apply
|
|
2591
|
+
* @returns A new `GskRenderNode`
|
|
2592
|
+
*/
|
|
2593
|
+
constructor(child: RenderNode, shadows: Shadow[])
|
|
2594
|
+
/**
|
|
2595
|
+
* Creates a `GskRenderNode` that will draw a `child` with the given
|
|
2596
|
+
* `shadows` below it.
|
|
2597
|
+
* @constructor
|
|
2598
|
+
* @param child The node to draw
|
|
2599
|
+
* @param shadows The shadows to apply
|
|
2600
|
+
* @returns A new `GskRenderNode`
|
|
2601
|
+
*/
|
|
2602
|
+
static new(child: RenderNode, shadows: Shadow[]): ShadowNode
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
export interface TextNode {
|
|
2606
|
+
|
|
2607
|
+
// Owm methods of Gsk-4.0.Gsk.TextNode
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* Retrieves the color used by the text `node`.
|
|
2611
|
+
* @returns the text color
|
|
2612
|
+
*/
|
|
2613
|
+
get_color(): Gdk.RGBA
|
|
2614
|
+
/**
|
|
2615
|
+
* Returns the font used by the text `node`.
|
|
2616
|
+
* @returns the font
|
|
2617
|
+
*/
|
|
2618
|
+
get_font(): Pango.Font
|
|
2619
|
+
/**
|
|
2620
|
+
* Retrieves the glyph information in the `node`.
|
|
2621
|
+
* @returns the glyph information
|
|
2622
|
+
*/
|
|
2623
|
+
get_glyphs(): Pango.GlyphInfo[]
|
|
2624
|
+
/**
|
|
2625
|
+
* Retrieves the number of glyphs in the text node.
|
|
2626
|
+
* @returns the number of glyphs
|
|
2627
|
+
*/
|
|
2628
|
+
get_num_glyphs(): number
|
|
2629
|
+
/**
|
|
2630
|
+
* Retrieves the offset applied to the text.
|
|
2631
|
+
* @returns a point with the horizontal and vertical offsets
|
|
2632
|
+
*/
|
|
2633
|
+
get_offset(): Graphene.Point
|
|
2634
|
+
/**
|
|
2635
|
+
* Checks whether the text `node` has color glyphs.
|
|
2636
|
+
* @returns %TRUE if the text node has color glyphs
|
|
2637
|
+
*/
|
|
2638
|
+
has_color_glyphs(): boolean
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* A render node drawing a set of glyphs.
|
|
2643
|
+
* @class
|
|
2644
|
+
*/
|
|
2645
|
+
export class TextNode extends RenderNode {
|
|
2646
|
+
|
|
2647
|
+
// Own properties of Gsk-4.0.Gsk.TextNode
|
|
2648
|
+
|
|
2649
|
+
static name: string
|
|
2650
|
+
|
|
2651
|
+
// Constructors of Gsk-4.0.Gsk.TextNode
|
|
2652
|
+
|
|
2653
|
+
/**
|
|
2654
|
+
* Creates a render node that renders the given glyphs.
|
|
2655
|
+
*
|
|
2656
|
+
* Note that `color` may not be used if the font contains
|
|
2657
|
+
* color glyphs.
|
|
2658
|
+
* @constructor
|
|
2659
|
+
* @param font the `PangoFont` containing the glyphs
|
|
2660
|
+
* @param glyphs the `PangoGlyphString` to render
|
|
2661
|
+
* @param color the foreground color to render with
|
|
2662
|
+
* @param offset offset of the baseline
|
|
2663
|
+
* @returns a new `GskRenderNode`
|
|
2664
|
+
*/
|
|
2665
|
+
constructor(font: Pango.Font, glyphs: Pango.GlyphString, color: Gdk.RGBA, offset: Graphene.Point)
|
|
2666
|
+
/**
|
|
2667
|
+
* Creates a render node that renders the given glyphs.
|
|
2668
|
+
*
|
|
2669
|
+
* Note that `color` may not be used if the font contains
|
|
2670
|
+
* color glyphs.
|
|
2671
|
+
* @constructor
|
|
2672
|
+
* @param font the `PangoFont` containing the glyphs
|
|
2673
|
+
* @param glyphs the `PangoGlyphString` to render
|
|
2674
|
+
* @param color the foreground color to render with
|
|
2675
|
+
* @param offset offset of the baseline
|
|
2676
|
+
* @returns a new `GskRenderNode`
|
|
2677
|
+
*/
|
|
2678
|
+
static new(font: Pango.Font, glyphs: Pango.GlyphString, color: Gdk.RGBA, offset: Graphene.Point): TextNode
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
export interface TextureNode {
|
|
2682
|
+
|
|
2683
|
+
// Owm methods of Gsk-4.0.Gsk.TextureNode
|
|
2684
|
+
|
|
2685
|
+
/**
|
|
2686
|
+
* Retrieves the `GdkTexture` used when creating this `GskRenderNode`.
|
|
2687
|
+
* @returns the `GdkTexture`
|
|
2688
|
+
*/
|
|
2689
|
+
get_texture(): Gdk.Texture
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
/**
|
|
2693
|
+
* A render node for a `GdkTexture`.
|
|
2694
|
+
* @class
|
|
2695
|
+
*/
|
|
2696
|
+
export class TextureNode extends RenderNode {
|
|
2697
|
+
|
|
2698
|
+
// Own properties of Gsk-4.0.Gsk.TextureNode
|
|
2699
|
+
|
|
2700
|
+
static name: string
|
|
2701
|
+
|
|
2702
|
+
// Constructors of Gsk-4.0.Gsk.TextureNode
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* Creates a `GskRenderNode` that will render the given
|
|
2706
|
+
* `texture` into the area given by `bounds`.
|
|
2707
|
+
* @constructor
|
|
2708
|
+
* @param texture the `GdkTexture`
|
|
2709
|
+
* @param bounds the rectangle to render the texture into
|
|
2710
|
+
* @returns A new `GskRenderNode`
|
|
2711
|
+
*/
|
|
2712
|
+
constructor(texture: Gdk.Texture, bounds: Graphene.Rect)
|
|
2713
|
+
/**
|
|
2714
|
+
* Creates a `GskRenderNode` that will render the given
|
|
2715
|
+
* `texture` into the area given by `bounds`.
|
|
2716
|
+
* @constructor
|
|
2717
|
+
* @param texture the `GdkTexture`
|
|
2718
|
+
* @param bounds the rectangle to render the texture into
|
|
2719
|
+
* @returns A new `GskRenderNode`
|
|
2720
|
+
*/
|
|
2721
|
+
static new(texture: Gdk.Texture, bounds: Graphene.Rect): TextureNode
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
export interface TextureScaleNode {
|
|
2725
|
+
|
|
2726
|
+
// Owm methods of Gsk-4.0.Gsk.TextureScaleNode
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* Retrieves the `GskScalingFilter` used when creating this `GskRenderNode`.
|
|
2730
|
+
* @returns the `GskScalingFilter`
|
|
2731
|
+
*/
|
|
2732
|
+
get_filter(): ScalingFilter
|
|
2733
|
+
/**
|
|
2734
|
+
* Retrieves the `GdkTexture` used when creating this `GskRenderNode`.
|
|
2735
|
+
* @returns the `GdkTexture`
|
|
2736
|
+
*/
|
|
2737
|
+
get_texture(): Gdk.Texture
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* A render node for a `GdkTexture`.
|
|
2742
|
+
* @class
|
|
2743
|
+
*/
|
|
2744
|
+
export class TextureScaleNode extends RenderNode {
|
|
2745
|
+
|
|
2746
|
+
// Own properties of Gsk-4.0.Gsk.TextureScaleNode
|
|
2747
|
+
|
|
2748
|
+
static name: string
|
|
2749
|
+
|
|
2750
|
+
// Constructors of Gsk-4.0.Gsk.TextureScaleNode
|
|
2751
|
+
|
|
2752
|
+
/**
|
|
2753
|
+
* Creates a node that scales the texture to the size given by the
|
|
2754
|
+
* bounds and the filter and then places it at the bounds' position.
|
|
2755
|
+
*
|
|
2756
|
+
* This node is intended for tight control over scaling applied
|
|
2757
|
+
* to a texture, such as in image editors and requires the
|
|
2758
|
+
* application to be aware of the whole render tree as further
|
|
2759
|
+
* transforms may be applied that conflict with the desired effect
|
|
2760
|
+
* of this node.
|
|
2761
|
+
* @constructor
|
|
2762
|
+
* @param texture the texture to scale
|
|
2763
|
+
* @param bounds the size of the texture to scale to
|
|
2764
|
+
* @param filter how to scale the texture
|
|
2765
|
+
* @returns A new `GskRenderNode`
|
|
2766
|
+
*/
|
|
2767
|
+
constructor(texture: Gdk.Texture, bounds: Graphene.Rect, filter: ScalingFilter)
|
|
2768
|
+
/**
|
|
2769
|
+
* Creates a node that scales the texture to the size given by the
|
|
2770
|
+
* bounds and the filter and then places it at the bounds' position.
|
|
2771
|
+
*
|
|
2772
|
+
* This node is intended for tight control over scaling applied
|
|
2773
|
+
* to a texture, such as in image editors and requires the
|
|
2774
|
+
* application to be aware of the whole render tree as further
|
|
2775
|
+
* transforms may be applied that conflict with the desired effect
|
|
2776
|
+
* of this node.
|
|
2777
|
+
* @constructor
|
|
2778
|
+
* @param texture the texture to scale
|
|
2779
|
+
* @param bounds the size of the texture to scale to
|
|
2780
|
+
* @param filter how to scale the texture
|
|
2781
|
+
* @returns A new `GskRenderNode`
|
|
2782
|
+
*/
|
|
2783
|
+
static new(texture: Gdk.Texture, bounds: Graphene.Rect, filter: ScalingFilter): TextureScaleNode
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
export interface TransformNode {
|
|
2787
|
+
|
|
2788
|
+
// Owm methods of Gsk-4.0.Gsk.TransformNode
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* Gets the child node that is getting transformed by the given `node`.
|
|
2792
|
+
* @returns The child that is getting transformed
|
|
2793
|
+
*/
|
|
2794
|
+
get_child(): RenderNode
|
|
2795
|
+
/**
|
|
2796
|
+
* Retrieves the `GskTransform` used by the `node`.
|
|
2797
|
+
* @returns a `GskTransform`
|
|
2798
|
+
*/
|
|
2799
|
+
get_transform(): Transform
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
/**
|
|
2803
|
+
* A render node applying a `GskTransform` to its single child node.
|
|
2804
|
+
* @class
|
|
2805
|
+
*/
|
|
2806
|
+
export class TransformNode extends RenderNode {
|
|
2807
|
+
|
|
2808
|
+
// Own properties of Gsk-4.0.Gsk.TransformNode
|
|
2809
|
+
|
|
2810
|
+
static name: string
|
|
2811
|
+
|
|
2812
|
+
// Constructors of Gsk-4.0.Gsk.TransformNode
|
|
2813
|
+
|
|
2814
|
+
/**
|
|
2815
|
+
* Creates a `GskRenderNode` that will transform the given `child`
|
|
2816
|
+
* with the given `transform`.
|
|
2817
|
+
* @constructor
|
|
2818
|
+
* @param child The node to transform
|
|
2819
|
+
* @param transform The transform to apply
|
|
2820
|
+
* @returns A new `GskRenderNode`
|
|
2821
|
+
*/
|
|
2822
|
+
constructor(child: RenderNode, transform: Transform)
|
|
2823
|
+
/**
|
|
2824
|
+
* Creates a `GskRenderNode` that will transform the given `child`
|
|
2825
|
+
* with the given `transform`.
|
|
2826
|
+
* @constructor
|
|
2827
|
+
* @param child The node to transform
|
|
2828
|
+
* @param transform The transform to apply
|
|
2829
|
+
* @returns A new `GskRenderNode`
|
|
2830
|
+
*/
|
|
2831
|
+
static new(child: RenderNode, transform: Transform): TransformNode
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
export interface BroadwayRendererClass {
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
export abstract class BroadwayRendererClass {
|
|
2838
|
+
|
|
2839
|
+
// Own properties of Gsk-4.0.Gsk.BroadwayRendererClass
|
|
2840
|
+
|
|
2841
|
+
static name: string
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
export interface CairoRendererClass {
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
export abstract class CairoRendererClass {
|
|
2848
|
+
|
|
2849
|
+
// Own properties of Gsk-4.0.Gsk.CairoRendererClass
|
|
2850
|
+
|
|
2851
|
+
static name: string
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
export interface ColorStop {
|
|
2855
|
+
|
|
2856
|
+
// Own fields of Gsk-4.0.Gsk.ColorStop
|
|
2857
|
+
|
|
2858
|
+
/**
|
|
2859
|
+
* the offset of the color stop
|
|
2860
|
+
* @field
|
|
2861
|
+
*/
|
|
2862
|
+
offset: number
|
|
2863
|
+
/**
|
|
2864
|
+
* the color at the given offset
|
|
2865
|
+
* @field
|
|
2866
|
+
*/
|
|
2867
|
+
color: Gdk.RGBA
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
/**
|
|
2871
|
+
* A color stop in a gradient node.
|
|
2872
|
+
* @record
|
|
2873
|
+
*/
|
|
2874
|
+
export class ColorStop {
|
|
2875
|
+
|
|
2876
|
+
// Own properties of Gsk-4.0.Gsk.ColorStop
|
|
2877
|
+
|
|
2878
|
+
static name: string
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
export interface GLRendererClass {
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
export abstract class GLRendererClass {
|
|
2885
|
+
|
|
2886
|
+
// Own properties of Gsk-4.0.Gsk.GLRendererClass
|
|
2887
|
+
|
|
2888
|
+
static name: string
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
export interface GLShaderClass {
|
|
2892
|
+
|
|
2893
|
+
// Own fields of Gsk-4.0.Gsk.GLShaderClass
|
|
2894
|
+
|
|
2895
|
+
parent_class: GObject.ObjectClass
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
export abstract class GLShaderClass {
|
|
2899
|
+
|
|
2900
|
+
// Own properties of Gsk-4.0.Gsk.GLShaderClass
|
|
2901
|
+
|
|
2902
|
+
static name: string
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
export interface ParseLocation {
|
|
2906
|
+
|
|
2907
|
+
// Own fields of Gsk-4.0.Gsk.ParseLocation
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* the offset of the location in the parse buffer, as bytes
|
|
2911
|
+
* @field
|
|
2912
|
+
*/
|
|
2913
|
+
bytes: number
|
|
2914
|
+
/**
|
|
2915
|
+
* the offset of the location in the parse buffer, as characters
|
|
2916
|
+
* @field
|
|
2917
|
+
*/
|
|
2918
|
+
chars: number
|
|
2919
|
+
/**
|
|
2920
|
+
* the line of the location in the parse buffer
|
|
2921
|
+
* @field
|
|
2922
|
+
*/
|
|
2923
|
+
lines: number
|
|
2924
|
+
/**
|
|
2925
|
+
* the position in the line, as bytes
|
|
2926
|
+
* @field
|
|
2927
|
+
*/
|
|
2928
|
+
line_bytes: number
|
|
2929
|
+
/**
|
|
2930
|
+
* the position in the line, as characters
|
|
2931
|
+
* @field
|
|
2932
|
+
*/
|
|
2933
|
+
line_chars: number
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
/**
|
|
2937
|
+
* A location in a parse buffer.
|
|
2938
|
+
* @record
|
|
2939
|
+
*/
|
|
2940
|
+
export class ParseLocation {
|
|
2941
|
+
|
|
2942
|
+
// Own properties of Gsk-4.0.Gsk.ParseLocation
|
|
2943
|
+
|
|
2944
|
+
static name: string
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
export interface RendererClass {
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
export abstract class RendererClass {
|
|
2951
|
+
|
|
2952
|
+
// Own properties of Gsk-4.0.Gsk.RendererClass
|
|
2953
|
+
|
|
2954
|
+
static name: string
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
export interface RoundedRect {
|
|
2958
|
+
|
|
2959
|
+
// Own fields of Gsk-4.0.Gsk.RoundedRect
|
|
2960
|
+
|
|
2961
|
+
/**
|
|
2962
|
+
* the bounds of the rectangle
|
|
2963
|
+
* @field
|
|
2964
|
+
*/
|
|
2965
|
+
bounds: Graphene.Rect
|
|
2966
|
+
/**
|
|
2967
|
+
* the size of the 4 rounded corners
|
|
2968
|
+
* @field
|
|
2969
|
+
*/
|
|
2970
|
+
corner: Graphene.Size[]
|
|
2971
|
+
|
|
2972
|
+
// Owm methods of Gsk-4.0.Gsk.RoundedRect
|
|
2973
|
+
|
|
2974
|
+
/**
|
|
2975
|
+
* Checks if the given `point` is inside the rounded rectangle.
|
|
2976
|
+
* @param point the point to check
|
|
2977
|
+
* @returns %TRUE if the @point is inside the rounded rectangle
|
|
2978
|
+
*/
|
|
2979
|
+
contains_point(point: Graphene.Point): boolean
|
|
2980
|
+
/**
|
|
2981
|
+
* Checks if the given `rect` is contained inside the rounded rectangle.
|
|
2982
|
+
* @param rect the rectangle to check
|
|
2983
|
+
* @returns %TRUE if the @rect is fully contained inside the rounded rectangle
|
|
2984
|
+
*/
|
|
2985
|
+
contains_rect(rect: Graphene.Rect): boolean
|
|
2986
|
+
/**
|
|
2987
|
+
* Initializes the given `GskRoundedRect` with the given values.
|
|
2988
|
+
*
|
|
2989
|
+
* This function will implicitly normalize the `GskRoundedRect`
|
|
2990
|
+
* before returning.
|
|
2991
|
+
* @param bounds a `graphene_rect_t` describing the bounds
|
|
2992
|
+
* @param top_left the rounding radius of the top left corner
|
|
2993
|
+
* @param top_right the rounding radius of the top right corner
|
|
2994
|
+
* @param bottom_right the rounding radius of the bottom right corner
|
|
2995
|
+
* @param bottom_left the rounding radius of the bottom left corner
|
|
2996
|
+
* @returns the initialized rectangle
|
|
2997
|
+
*/
|
|
2998
|
+
init(bounds: Graphene.Rect, top_left: Graphene.Size, top_right: Graphene.Size, bottom_right: Graphene.Size, bottom_left: Graphene.Size): RoundedRect
|
|
2999
|
+
/**
|
|
3000
|
+
* Initializes `self` using the given `src` rectangle.
|
|
3001
|
+
*
|
|
3002
|
+
* This function will not normalize the `GskRoundedRect`,
|
|
3003
|
+
* so make sure the source is normalized.
|
|
3004
|
+
* @param src a `GskRoundedRect`
|
|
3005
|
+
* @returns the initialized rectangle
|
|
3006
|
+
*/
|
|
3007
|
+
init_copy(src: RoundedRect): RoundedRect
|
|
3008
|
+
/**
|
|
3009
|
+
* Initializes `self` to the given `bounds` and sets the radius
|
|
3010
|
+
* of all four corners to `radius`.
|
|
3011
|
+
* @param bounds a `graphene_rect_t`
|
|
3012
|
+
* @param radius the border radius
|
|
3013
|
+
* @returns the initialized rectangle
|
|
3014
|
+
*/
|
|
3015
|
+
init_from_rect(bounds: Graphene.Rect, radius: number): RoundedRect
|
|
3016
|
+
/**
|
|
3017
|
+
* Checks if part of the given `rect` is contained inside the rounded rectangle.
|
|
3018
|
+
* @param rect the rectangle to check
|
|
3019
|
+
* @returns %TRUE if the @rect intersects with the rounded rectangle
|
|
3020
|
+
*/
|
|
3021
|
+
intersects_rect(rect: Graphene.Rect): boolean
|
|
3022
|
+
/**
|
|
3023
|
+
* Checks if all corners of `self` are right angles and the
|
|
3024
|
+
* rectangle covers all of its bounds.
|
|
3025
|
+
*
|
|
3026
|
+
* This information can be used to decide if [ctor`Gsk`.ClipNode.new]
|
|
3027
|
+
* or [ctor`Gsk`.RoundedClipNode.new] should be called.
|
|
3028
|
+
* @returns %TRUE if the rectangle is rectilinear
|
|
3029
|
+
*/
|
|
3030
|
+
is_rectilinear(): boolean
|
|
3031
|
+
/**
|
|
3032
|
+
* Normalizes the passed rectangle.
|
|
3033
|
+
*
|
|
3034
|
+
* This function will ensure that the bounds of the rectangle
|
|
3035
|
+
* are normalized and ensure that the corner values are positive
|
|
3036
|
+
* and the corners do not overlap.
|
|
3037
|
+
* @returns the normalized rectangle
|
|
3038
|
+
*/
|
|
3039
|
+
normalize(): RoundedRect
|
|
3040
|
+
/**
|
|
3041
|
+
* Offsets the bound's origin by `dx` and `dy`.
|
|
3042
|
+
*
|
|
3043
|
+
* The size and corners of the rectangle are unchanged.
|
|
3044
|
+
* @param dx the horizontal offset
|
|
3045
|
+
* @param dy the vertical offset
|
|
3046
|
+
* @returns the offset rectangle
|
|
3047
|
+
*/
|
|
3048
|
+
offset(dx: number, dy: number): RoundedRect
|
|
3049
|
+
/**
|
|
3050
|
+
* Shrinks (or grows) the given rectangle by moving the 4 sides
|
|
3051
|
+
* according to the offsets given.
|
|
3052
|
+
*
|
|
3053
|
+
* The corner radii will be changed in a way that tries to keep
|
|
3054
|
+
* the center of the corner circle intact. This emulates CSS behavior.
|
|
3055
|
+
*
|
|
3056
|
+
* This function also works for growing rectangles if you pass
|
|
3057
|
+
* negative values for the `top,` `right,` `bottom` or `left`.
|
|
3058
|
+
* @param top How far to move the top side downwards
|
|
3059
|
+
* @param right How far to move the right side to the left
|
|
3060
|
+
* @param bottom How far to move the bottom side upwards
|
|
3061
|
+
* @param left How far to move the left side to the right
|
|
3062
|
+
* @returns the resized `GskRoundedRect`
|
|
3063
|
+
*/
|
|
3064
|
+
shrink(top: number, right: number, bottom: number, left: number): RoundedRect
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* A rectangular region with rounded corners.
|
|
3069
|
+
*
|
|
3070
|
+
* Application code should normalize rectangles using
|
|
3071
|
+
* [method`Gsk`.RoundedRect.normalize]; this function will ensure that
|
|
3072
|
+
* the bounds of the rectangle are normalized and ensure that the corner
|
|
3073
|
+
* values are positive and the corners do not overlap.
|
|
3074
|
+
*
|
|
3075
|
+
* All functions taking a `GskRoundedRect` as an argument will internally
|
|
3076
|
+
* operate on a normalized copy; all functions returning a `GskRoundedRect`
|
|
3077
|
+
* will always return a normalized one.
|
|
3078
|
+
*
|
|
3079
|
+
* The algorithm used for normalizing corner sizes is described in
|
|
3080
|
+
* [the CSS specification](https://drafts.csswg.org/css-backgrounds-3/#border-radius).
|
|
3081
|
+
* @record
|
|
3082
|
+
*/
|
|
3083
|
+
export class RoundedRect {
|
|
3084
|
+
|
|
3085
|
+
// Own properties of Gsk-4.0.Gsk.RoundedRect
|
|
3086
|
+
|
|
3087
|
+
static name: string
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
export interface ShaderArgsBuilder {
|
|
3091
|
+
|
|
3092
|
+
// Owm methods of Gsk-4.0.Gsk.ShaderArgsBuilder
|
|
3093
|
+
|
|
3094
|
+
/**
|
|
3095
|
+
* Increases the reference count of a `GskShaderArgsBuilder` by one.
|
|
3096
|
+
* @returns the passed in `GskShaderArgsBuilder`
|
|
3097
|
+
*/
|
|
3098
|
+
ref(): ShaderArgsBuilder
|
|
3099
|
+
/**
|
|
3100
|
+
* Sets the value of the uniform `idx`.
|
|
3101
|
+
*
|
|
3102
|
+
* The uniform must be of bool type.
|
|
3103
|
+
* @param idx index of the uniform
|
|
3104
|
+
* @param value value to set the uniform to
|
|
3105
|
+
*/
|
|
3106
|
+
set_bool(idx: number, value: boolean): void
|
|
3107
|
+
/**
|
|
3108
|
+
* Sets the value of the uniform `idx`.
|
|
3109
|
+
*
|
|
3110
|
+
* The uniform must be of float type.
|
|
3111
|
+
* @param idx index of the uniform
|
|
3112
|
+
* @param value value to set the uniform to
|
|
3113
|
+
*/
|
|
3114
|
+
set_float(idx: number, value: number): void
|
|
3115
|
+
/**
|
|
3116
|
+
* Sets the value of the uniform `idx`.
|
|
3117
|
+
*
|
|
3118
|
+
* The uniform must be of int type.
|
|
3119
|
+
* @param idx index of the uniform
|
|
3120
|
+
* @param value value to set the uniform to
|
|
3121
|
+
*/
|
|
3122
|
+
set_int(idx: number, value: number): void
|
|
3123
|
+
/**
|
|
3124
|
+
* Sets the value of the uniform `idx`.
|
|
3125
|
+
*
|
|
3126
|
+
* The uniform must be of uint type.
|
|
3127
|
+
* @param idx index of the uniform
|
|
3128
|
+
* @param value value to set the uniform to
|
|
3129
|
+
*/
|
|
3130
|
+
set_uint(idx: number, value: number): void
|
|
3131
|
+
/**
|
|
3132
|
+
* Sets the value of the uniform `idx`.
|
|
3133
|
+
*
|
|
3134
|
+
* The uniform must be of vec2 type.
|
|
3135
|
+
* @param idx index of the uniform
|
|
3136
|
+
* @param value value to set the uniform too
|
|
3137
|
+
*/
|
|
3138
|
+
set_vec2(idx: number, value: Graphene.Vec2): void
|
|
3139
|
+
/**
|
|
3140
|
+
* Sets the value of the uniform `idx`.
|
|
3141
|
+
*
|
|
3142
|
+
* The uniform must be of vec3 type.
|
|
3143
|
+
* @param idx index of the uniform
|
|
3144
|
+
* @param value value to set the uniform too
|
|
3145
|
+
*/
|
|
3146
|
+
set_vec3(idx: number, value: Graphene.Vec3): void
|
|
3147
|
+
/**
|
|
3148
|
+
* Sets the value of the uniform `idx`.
|
|
3149
|
+
*
|
|
3150
|
+
* The uniform must be of vec4 type.
|
|
3151
|
+
* @param idx index of the uniform
|
|
3152
|
+
* @param value value to set the uniform too
|
|
3153
|
+
*/
|
|
3154
|
+
set_vec4(idx: number, value: Graphene.Vec4): void
|
|
3155
|
+
/**
|
|
3156
|
+
* Creates a new `GBytes` args from the current state of the
|
|
3157
|
+
* given `builder`.
|
|
3158
|
+
*
|
|
3159
|
+
* Any uniforms of the shader that have not been explicitly set on
|
|
3160
|
+
* the `builder` are zero-initialized.
|
|
3161
|
+
*
|
|
3162
|
+
* The given `GskShaderArgsBuilder` is reset once this function returns;
|
|
3163
|
+
* you cannot call this function multiple times on the same `builder` instance.
|
|
3164
|
+
*
|
|
3165
|
+
* This function is intended primarily for bindings. C code should use
|
|
3166
|
+
* [method`Gsk`.ShaderArgsBuilder.free_to_args].
|
|
3167
|
+
* @returns the newly allocated buffer with all the args added to @builder
|
|
3168
|
+
*/
|
|
3169
|
+
to_args(): GLib.Bytes
|
|
3170
|
+
/**
|
|
3171
|
+
* Decreases the reference count of a `GskShaderArgBuilder` by one.
|
|
3172
|
+
*
|
|
3173
|
+
* If the resulting reference count is zero, frees the builder.
|
|
3174
|
+
*/
|
|
3175
|
+
unref(): void
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* An object to build the uniforms data for a `GskGLShader`.
|
|
3180
|
+
* @record
|
|
3181
|
+
*/
|
|
3182
|
+
export class ShaderArgsBuilder {
|
|
3183
|
+
|
|
3184
|
+
// Own properties of Gsk-4.0.Gsk.ShaderArgsBuilder
|
|
3185
|
+
|
|
3186
|
+
static name: string
|
|
3187
|
+
|
|
3188
|
+
// Constructors of Gsk-4.0.Gsk.ShaderArgsBuilder
|
|
3189
|
+
|
|
3190
|
+
/**
|
|
3191
|
+
* Allocates a builder that can be used to construct a new uniform data
|
|
3192
|
+
* chunk.
|
|
3193
|
+
* @constructor
|
|
3194
|
+
* @param shader a `GskGLShader`
|
|
3195
|
+
* @param initial_values optional `GBytes` with initial values
|
|
3196
|
+
* @returns The newly allocated builder, free with [method@Gsk.ShaderArgsBuilder.unref]
|
|
3197
|
+
*/
|
|
3198
|
+
constructor(shader: GLShader, initial_values: GLib.Bytes | null)
|
|
3199
|
+
/**
|
|
3200
|
+
* Allocates a builder that can be used to construct a new uniform data
|
|
3201
|
+
* chunk.
|
|
3202
|
+
* @constructor
|
|
3203
|
+
* @param shader a `GskGLShader`
|
|
3204
|
+
* @param initial_values optional `GBytes` with initial values
|
|
3205
|
+
* @returns The newly allocated builder, free with [method@Gsk.ShaderArgsBuilder.unref]
|
|
3206
|
+
*/
|
|
3207
|
+
static new(shader: GLShader, initial_values: GLib.Bytes | null): ShaderArgsBuilder
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
export interface Shadow {
|
|
3211
|
+
|
|
3212
|
+
// Own fields of Gsk-4.0.Gsk.Shadow
|
|
3213
|
+
|
|
3214
|
+
/**
|
|
3215
|
+
* the color of the shadow
|
|
3216
|
+
* @field
|
|
3217
|
+
*/
|
|
3218
|
+
color: Gdk.RGBA
|
|
3219
|
+
/**
|
|
3220
|
+
* the horizontal offset of the shadow
|
|
3221
|
+
* @field
|
|
3222
|
+
*/
|
|
3223
|
+
dx: number
|
|
3224
|
+
/**
|
|
3225
|
+
* the vertical offset of the shadow
|
|
3226
|
+
* @field
|
|
3227
|
+
*/
|
|
3228
|
+
dy: number
|
|
3229
|
+
/**
|
|
3230
|
+
* the radius of the shadow
|
|
3231
|
+
* @field
|
|
3232
|
+
*/
|
|
3233
|
+
radius: number
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* The shadow parameters in a shadow node.
|
|
3238
|
+
* @record
|
|
3239
|
+
*/
|
|
3240
|
+
export class Shadow {
|
|
3241
|
+
|
|
3242
|
+
// Own properties of Gsk-4.0.Gsk.Shadow
|
|
3243
|
+
|
|
3244
|
+
static name: string
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
export interface Transform {
|
|
3248
|
+
|
|
3249
|
+
// Owm methods of Gsk-4.0.Gsk.Transform
|
|
3250
|
+
|
|
3251
|
+
/**
|
|
3252
|
+
* Checks two transforms for equality.
|
|
3253
|
+
* @param second the second transform
|
|
3254
|
+
* @returns %TRUE if the two transforms perform the same operation
|
|
3255
|
+
*/
|
|
3256
|
+
equal(second: Transform | null): boolean
|
|
3257
|
+
/**
|
|
3258
|
+
* Returns the category this transform belongs to.
|
|
3259
|
+
* @returns The category of the transform
|
|
3260
|
+
*/
|
|
3261
|
+
get_category(): TransformCategory
|
|
3262
|
+
/**
|
|
3263
|
+
* Inverts the given transform.
|
|
3264
|
+
*
|
|
3265
|
+
* If `self` is not invertible, %NULL is returned.
|
|
3266
|
+
* Note that inverting %NULL also returns %NULL, which is
|
|
3267
|
+
* the correct inverse of %NULL. If you need to differentiate
|
|
3268
|
+
* between those cases, you should check `self` is not %NULL
|
|
3269
|
+
* before calling this function.
|
|
3270
|
+
* @returns The inverted transform
|
|
3271
|
+
*/
|
|
3272
|
+
invert(): Transform | null
|
|
3273
|
+
/**
|
|
3274
|
+
* Multiplies `next` with the given `matrix`.
|
|
3275
|
+
* @param matrix the matrix to multiply `next` with
|
|
3276
|
+
* @returns The new transform
|
|
3277
|
+
*/
|
|
3278
|
+
matrix(matrix: Graphene.Matrix): Transform
|
|
3279
|
+
/**
|
|
3280
|
+
* Applies a perspective projection transform.
|
|
3281
|
+
*
|
|
3282
|
+
* This transform scales points in X and Y based on their Z value,
|
|
3283
|
+
* scaling points with positive Z values away from the origin, and
|
|
3284
|
+
* those with negative Z values towards the origin. Points
|
|
3285
|
+
* on the z=0 plane are unchanged.
|
|
3286
|
+
* @param depth distance of the z=0 plane. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect.
|
|
3287
|
+
* @returns The new transform
|
|
3288
|
+
*/
|
|
3289
|
+
perspective(depth: number): Transform
|
|
3290
|
+
/**
|
|
3291
|
+
* Converts `self` into a human-readable string representation suitable
|
|
3292
|
+
* for printing.
|
|
3293
|
+
*
|
|
3294
|
+
* The result of this function can later be parsed with
|
|
3295
|
+
* [func`Gsk`.Transform.parse].
|
|
3296
|
+
* @param string The string to print into
|
|
3297
|
+
*/
|
|
3298
|
+
print(string: GLib.String): void
|
|
3299
|
+
/**
|
|
3300
|
+
* Acquires a reference on the given `GskTransform`.
|
|
3301
|
+
* @returns the `GskTransform` with an additional reference
|
|
3302
|
+
*/
|
|
3303
|
+
ref(): Transform | null
|
|
3304
|
+
/**
|
|
3305
|
+
* Rotates `next` `angle` degrees in 2D - or in 3D-speak, around the z axis.
|
|
3306
|
+
* @param angle the rotation angle, in degrees (clockwise)
|
|
3307
|
+
* @returns The new transform
|
|
3308
|
+
*/
|
|
3309
|
+
rotate(angle: number): Transform | null
|
|
3310
|
+
/**
|
|
3311
|
+
* Rotates `next` `angle` degrees around `axis`.
|
|
3312
|
+
*
|
|
3313
|
+
* For a rotation in 2D space, use [method`Gsk`.Transform.rotate]
|
|
3314
|
+
* @param angle the rotation angle, in degrees (clockwise)
|
|
3315
|
+
* @param axis The rotation axis
|
|
3316
|
+
* @returns The new transform
|
|
3317
|
+
*/
|
|
3318
|
+
rotate_3d(angle: number, axis: Graphene.Vec3): Transform | null
|
|
3319
|
+
/**
|
|
3320
|
+
* Scales `next` in 2-dimensional space by the given factors.
|
|
3321
|
+
*
|
|
3322
|
+
* Use [method`Gsk`.Transform.scale_3d] to scale in all 3 dimensions.
|
|
3323
|
+
* @param factor_x scaling factor on the X axis
|
|
3324
|
+
* @param factor_y scaling factor on the Y axis
|
|
3325
|
+
* @returns The new transform
|
|
3326
|
+
*/
|
|
3327
|
+
scale(factor_x: number, factor_y: number): Transform | null
|
|
3328
|
+
/**
|
|
3329
|
+
* Scales `next` by the given factors.
|
|
3330
|
+
* @param factor_x scaling factor on the X axis
|
|
3331
|
+
* @param factor_y scaling factor on the Y axis
|
|
3332
|
+
* @param factor_z scaling factor on the Z axis
|
|
3333
|
+
* @returns The new transform
|
|
3334
|
+
*/
|
|
3335
|
+
scale_3d(factor_x: number, factor_y: number, factor_z: number): Transform | null
|
|
3336
|
+
/**
|
|
3337
|
+
* Applies a skew transform.
|
|
3338
|
+
* @param skew_x skew factor, in degrees, on the X axis
|
|
3339
|
+
* @param skew_y skew factor, in degrees, on the Y axis
|
|
3340
|
+
* @returns The new transform
|
|
3341
|
+
*/
|
|
3342
|
+
skew(skew_x: number, skew_y: number): Transform | null
|
|
3343
|
+
/**
|
|
3344
|
+
* Converts a `GskTransform` to a 2D transformation matrix.
|
|
3345
|
+
*
|
|
3346
|
+
* `self` must be a 2D transformation. If you are not
|
|
3347
|
+
* sure, use gsk_transform_get_category() >=
|
|
3348
|
+
* %GSK_TRANSFORM_CATEGORY_2D to check.
|
|
3349
|
+
*
|
|
3350
|
+
* The returned values have the following layout:
|
|
3351
|
+
*
|
|
3352
|
+
* ```
|
|
3353
|
+
* | xx yx | | a b 0 |
|
|
3354
|
+
* | xy yy | = | c d 0 |
|
|
3355
|
+
* | dx dy | | tx ty 1 |
|
|
3356
|
+
* ```
|
|
3357
|
+
*
|
|
3358
|
+
* This function can be used to convert between a `GskTransform`
|
|
3359
|
+
* and a matrix type from other 2D drawing libraries, in particular
|
|
3360
|
+
* Cairo.
|
|
3361
|
+
*/
|
|
3362
|
+
to_2d(): [ /* out_xx */ number, /* out_yx */ number, /* out_xy */ number, /* out_yy */ number, /* out_dx */ number, /* out_dy */ number ]
|
|
3363
|
+
/**
|
|
3364
|
+
* Converts a `GskTransform` to 2D transformation factors.
|
|
3365
|
+
*
|
|
3366
|
+
* To recreate an equivalent transform from the factors returned
|
|
3367
|
+
* by this function, use
|
|
3368
|
+
*
|
|
3369
|
+
* gsk_transform_skew (
|
|
3370
|
+
* gsk_transform_scale (
|
|
3371
|
+
* gsk_transform_rotate (
|
|
3372
|
+
* gsk_transform_translate (NULL, &GRAPHENE_POINT_T (dx, dy)),
|
|
3373
|
+
* angle),
|
|
3374
|
+
* scale_x, scale_y),
|
|
3375
|
+
* skew_x, skew_y)
|
|
3376
|
+
*
|
|
3377
|
+
* `self` must be a 2D transformation. If you are not sure, use
|
|
3378
|
+
*
|
|
3379
|
+
* gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D
|
|
3380
|
+
*
|
|
3381
|
+
* to check.
|
|
3382
|
+
*/
|
|
3383
|
+
to_2d_components(): [ /* out_skew_x */ number, /* out_skew_y */ number, /* out_scale_x */ number, /* out_scale_y */ number, /* out_angle */ number, /* out_dx */ number, /* out_dy */ number ]
|
|
3384
|
+
/**
|
|
3385
|
+
* Converts a `GskTransform` to 2D affine transformation factors.
|
|
3386
|
+
*
|
|
3387
|
+
* To recreate an equivalent transform from the factors returned
|
|
3388
|
+
* by this function, use
|
|
3389
|
+
*
|
|
3390
|
+
* gsk_transform_scale (gsk_transform_translate (NULL,
|
|
3391
|
+
* &GRAPHENE_POINT_T (dx, dy)),
|
|
3392
|
+
* sx, sy)
|
|
3393
|
+
*
|
|
3394
|
+
* `self` must be a 2D affine transformation. If you are not
|
|
3395
|
+
* sure, use
|
|
3396
|
+
*
|
|
3397
|
+
* gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D_AFFINE
|
|
3398
|
+
*
|
|
3399
|
+
* to check.
|
|
3400
|
+
*/
|
|
3401
|
+
to_affine(): [ /* out_scale_x */ number, /* out_scale_y */ number, /* out_dx */ number, /* out_dy */ number ]
|
|
3402
|
+
/**
|
|
3403
|
+
* Computes the actual value of `self` and stores it in `out_matrix`.
|
|
3404
|
+
*
|
|
3405
|
+
* The previous value of `out_matrix` will be ignored.
|
|
3406
|
+
*/
|
|
3407
|
+
to_matrix(): /* out_matrix */ Graphene.Matrix
|
|
3408
|
+
/**
|
|
3409
|
+
* Converts a matrix into a string that is suitable for printing.
|
|
3410
|
+
*
|
|
3411
|
+
* The resulting string can be parsed with [func`Gsk`.Transform.parse].
|
|
3412
|
+
*
|
|
3413
|
+
* This is a wrapper around [method`Gsk`.Transform.print].
|
|
3414
|
+
* @returns A new string for @self
|
|
3415
|
+
*/
|
|
3416
|
+
to_string(): string | null
|
|
3417
|
+
/**
|
|
3418
|
+
* Converts a `GskTransform` to a translation operation.
|
|
3419
|
+
*
|
|
3420
|
+
* `self` must be a 2D transformation. If you are not
|
|
3421
|
+
* sure, use
|
|
3422
|
+
*
|
|
3423
|
+
* gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D_TRANSLATE
|
|
3424
|
+
*
|
|
3425
|
+
* to check.
|
|
3426
|
+
*/
|
|
3427
|
+
to_translate(): [ /* out_dx */ number, /* out_dy */ number ]
|
|
3428
|
+
/**
|
|
3429
|
+
* Applies all the operations from `other` to `next`.
|
|
3430
|
+
* @param other Transform to apply
|
|
3431
|
+
* @returns The new transform
|
|
3432
|
+
*/
|
|
3433
|
+
transform(other: Transform | null): Transform | null
|
|
3434
|
+
/**
|
|
3435
|
+
* Transforms a `graphene_rect_t` using the given transform `self`.
|
|
3436
|
+
*
|
|
3437
|
+
* The result is the bounding box containing the coplanar quad.
|
|
3438
|
+
* @param rect a `graphene_rect_t`
|
|
3439
|
+
*/
|
|
3440
|
+
transform_bounds(rect: Graphene.Rect): /* out_rect */ Graphene.Rect
|
|
3441
|
+
/**
|
|
3442
|
+
* Transforms a `graphene_point_t` using the given transform `self`.
|
|
3443
|
+
* @param point a `graphene_point_t`
|
|
3444
|
+
*/
|
|
3445
|
+
transform_point(point: Graphene.Point): /* out_point */ Graphene.Point
|
|
3446
|
+
/**
|
|
3447
|
+
* Translates `next` in 2-dimensional space by `point`.
|
|
3448
|
+
* @param point the point to translate the transform by
|
|
3449
|
+
* @returns The new transform
|
|
3450
|
+
*/
|
|
3451
|
+
translate(point: Graphene.Point): Transform | null
|
|
3452
|
+
/**
|
|
3453
|
+
* Translates `next` by `point`.
|
|
3454
|
+
* @param point the point to translate the transform by
|
|
3455
|
+
* @returns The new transform
|
|
3456
|
+
*/
|
|
3457
|
+
translate_3d(point: Graphene.Point3D): Transform | null
|
|
3458
|
+
/**
|
|
3459
|
+
* Releases a reference on the given `GskTransform`.
|
|
3460
|
+
*
|
|
3461
|
+
* If the reference was the last, the resources associated to the `self` are
|
|
3462
|
+
* freed.
|
|
3463
|
+
*/
|
|
3464
|
+
unref(): void
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
/**
|
|
3468
|
+
* `GskTransform` is an object to describe transform matrices.
|
|
3469
|
+
*
|
|
3470
|
+
* Unlike `graphene_matrix_t`, `GskTransform` retains the steps in how
|
|
3471
|
+
* a transform was constructed, and allows inspecting them. It is modeled
|
|
3472
|
+
* after the way CSS describes transforms.
|
|
3473
|
+
*
|
|
3474
|
+
* `GskTransform` objects are immutable and cannot be changed after creation.
|
|
3475
|
+
* This means code can safely expose them as properties of objects without
|
|
3476
|
+
* having to worry about others changing them.
|
|
3477
|
+
* @record
|
|
3478
|
+
*/
|
|
3479
|
+
export class Transform {
|
|
3480
|
+
|
|
3481
|
+
// Own properties of Gsk-4.0.Gsk.Transform
|
|
3482
|
+
|
|
3483
|
+
static name: string
|
|
3484
|
+
|
|
3485
|
+
// Constructors of Gsk-4.0.Gsk.Transform
|
|
3486
|
+
|
|
3487
|
+
constructor()
|
|
3488
|
+
static new(): Transform
|
|
3489
|
+
/**
|
|
3490
|
+
* Parses the given `string` into a transform and puts it in
|
|
3491
|
+
* `out_transform`.
|
|
3492
|
+
*
|
|
3493
|
+
* Strings printed via [method`Gsk`.Transform.to_string]
|
|
3494
|
+
* can be read in again successfully using this function.
|
|
3495
|
+
*
|
|
3496
|
+
* If `string` does not describe a valid transform, %FALSE is
|
|
3497
|
+
* returned and %NULL is put in `out_transform`.
|
|
3498
|
+
* @param string the string to parse
|
|
3499
|
+
* @returns %TRUE if @string described a valid transform.
|
|
3500
|
+
*/
|
|
3501
|
+
static parse(string: string | null): [ /* returnType */ boolean, /* out_transform */ Transform ]
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
/**
|
|
3505
|
+
* Name of the imported GIR library
|
|
3506
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
3507
|
+
*/
|
|
3508
|
+
export const __name__: string
|
|
3509
|
+
/**
|
|
3510
|
+
* Version of the imported GIR library
|
|
3511
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
3512
|
+
*/
|
|
3513
|
+
export const __version__: string
|
|
3514
|
+
// END
|