@gtkx/cairo 1.2.2

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.
Files changed (86) hide show
  1. package/dist/context.d.ts +229 -0
  2. package/dist/context.d.ts.map +1 -0
  3. package/dist/context.js +646 -0
  4. package/dist/context.js.map +1 -0
  5. package/dist/device.d.ts +21 -0
  6. package/dist/device.d.ts.map +1 -0
  7. package/dist/device.js +39 -0
  8. package/dist/device.js.map +1 -0
  9. package/dist/enums.d.ts +526 -0
  10. package/dist/enums.d.ts.map +1 -0
  11. package/dist/enums.js +482 -0
  12. package/dist/enums.js.map +1 -0
  13. package/dist/font-face.d.ts +55 -0
  14. package/dist/font-face.d.ts.map +1 -0
  15. package/dist/font-face.js +103 -0
  16. package/dist/font-face.js.map +1 -0
  17. package/dist/font-options.d.ts +43 -0
  18. package/dist/font-options.d.ts.map +1 -0
  19. package/dist/font-options.js +95 -0
  20. package/dist/font-options.js.map +1 -0
  21. package/dist/index.d.ts +29 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +27 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/lib.d.ts +36 -0
  26. package/dist/lib.d.ts.map +1 -0
  27. package/dist/lib.js +120 -0
  28. package/dist/lib.js.map +1 -0
  29. package/dist/matrix.d.ts +40 -0
  30. package/dist/matrix.d.ts.map +1 -0
  31. package/dist/matrix.js +93 -0
  32. package/dist/matrix.js.map +1 -0
  33. package/dist/path.d.ts +14 -0
  34. package/dist/path.d.ts.map +1 -0
  35. package/dist/path.js +67 -0
  36. package/dist/path.js.map +1 -0
  37. package/dist/pattern.d.ts +95 -0
  38. package/dist/pattern.d.ts.map +1 -0
  39. package/dist/pattern.js +250 -0
  40. package/dist/pattern.js.map +1 -0
  41. package/dist/region.d.ts +59 -0
  42. package/dist/region.d.ts.map +1 -0
  43. package/dist/region.js +154 -0
  44. package/dist/region.js.map +1 -0
  45. package/dist/scaled-font.d.ts +43 -0
  46. package/dist/scaled-font.d.ts.map +1 -0
  47. package/dist/scaled-font.js +156 -0
  48. package/dist/scaled-font.js.map +1 -0
  49. package/dist/structs.d.ts +120 -0
  50. package/dist/structs.d.ts.map +1 -0
  51. package/dist/structs.js +185 -0
  52. package/dist/structs.js.map +1 -0
  53. package/dist/surface.d.ts +98 -0
  54. package/dist/surface.d.ts.map +1 -0
  55. package/dist/surface.js +274 -0
  56. package/dist/surface.js.map +1 -0
  57. package/dist/text.d.ts +10 -0
  58. package/dist/text.d.ts.map +1 -0
  59. package/dist/text.js +45 -0
  60. package/dist/text.js.map +1 -0
  61. package/dist/types.d.ts +245 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +2 -0
  64. package/dist/types.js.map +1 -0
  65. package/dist/version.d.ts +9 -0
  66. package/dist/version.d.ts.map +1 -0
  67. package/dist/version.js +13 -0
  68. package/dist/version.js.map +1 -0
  69. package/package.json +64 -0
  70. package/src/context.ts +899 -0
  71. package/src/device.ts +50 -0
  72. package/src/enums.ts +571 -0
  73. package/src/font-face.ts +157 -0
  74. package/src/font-options.ts +142 -0
  75. package/src/index.ts +28 -0
  76. package/src/lib.ts +186 -0
  77. package/src/matrix.ts +135 -0
  78. package/src/path.ts +87 -0
  79. package/src/pattern.ts +423 -0
  80. package/src/region.ts +216 -0
  81. package/src/scaled-font.ts +268 -0
  82. package/src/structs.ts +306 -0
  83. package/src/surface.ts +411 -0
  84. package/src/text.ts +56 -0
  85. package/src/types.ts +290 -0
  86. package/src/version.ts +16 -0
package/src/device.ts ADDED
@@ -0,0 +1,50 @@
1
+ import { getHandle, registerWrapperClass, t } from "@gtkx/runtime";
2
+ import type { DeviceType, Status } from "./enums.js";
3
+ import { bindCairo, cairoGType, DEVICE_T } from "./lib.js";
4
+
5
+ const DEVICE_TYPE = cairoGType("cairo_gobject_device_get_type");
6
+ const cairoDeviceStatus = bindCairo("cairo_device_status", [DEVICE_T], t.int32);
7
+ const cairoDeviceGetType = bindCairo("cairo_device_get_type", [DEVICE_T], t.int32);
8
+ const cairoDeviceFinish = bindCairo("cairo_device_finish", [DEVICE_T], t.void);
9
+ const cairoDeviceFlush = bindCairo("cairo_device_flush", [DEVICE_T], t.void);
10
+ const cairoDeviceGetReferenceCount = bindCairo("cairo_device_get_reference_count", [DEVICE_T], t.int32);
11
+
12
+ /**
13
+ * A cairo device (`cairo_device_t`): the backend-specific object behind a surface, such as a GL context or an
14
+ * output stream. Instances come from bindings that hand one back.
15
+ */
16
+ abstract class Device {
17
+ static {
18
+ registerWrapperClass(this, DEVICE_TYPE);
19
+ }
20
+
21
+ /** GType of `CairoDevice`, the boxed type this class is registered under. */
22
+ declare __type__: bigint;
23
+
24
+ /** Returns the error status of the device, `Status.SUCCESS` when it is usable. */
25
+ status(): Status {
26
+ return cairoDeviceStatus(getHandle(this)) as Status;
27
+ }
28
+
29
+ /** Returns the backend the device belongs to. */
30
+ getType(): DeviceType {
31
+ return cairoDeviceGetType(getHandle(this)) as DeviceType;
32
+ }
33
+
34
+ /** Finishes the device, dropping its resources; further drawing through it fails. */
35
+ finish(): void {
36
+ cairoDeviceFinish(getHandle(this));
37
+ }
38
+
39
+ /** Flushes any pending operations on the device. */
40
+ flush(): void {
41
+ cairoDeviceFlush(getHandle(this));
42
+ }
43
+
44
+ /** Returns the reference count of the device. */
45
+ getReferenceCount(): number {
46
+ return cairoDeviceGetReferenceCount(getHandle(this)) as number;
47
+ }
48
+ }
49
+
50
+ export { Device };
package/src/enums.ts ADDED
@@ -0,0 +1,571 @@
1
+ /** One of the `Status` codes a cairo object or operation reports. */
2
+ type Status = (typeof Status)[keyof typeof Status];
3
+ /** One of the `Content` kinds a surface holds. */
4
+ type Content = (typeof Content)[keyof typeof Content];
5
+ /** One of the `Operator` compositing modes. */
6
+ type Operator = (typeof Operator)[keyof typeof Operator];
7
+ /** One of the `Antialias` modes for rendering shapes and text. */
8
+ type Antialias = (typeof Antialias)[keyof typeof Antialias];
9
+ /** One of the `FillRule` modes deciding which areas a path fills. */
10
+ type FillRule = (typeof FillRule)[keyof typeof FillRule];
11
+ /** One of the `LineCap` styles for the ends of a stroked line. */
12
+ type LineCap = (typeof LineCap)[keyof typeof LineCap];
13
+ /** One of the `LineJoin` styles for the corners of a stroked path. */
14
+ type LineJoin = (typeof LineJoin)[keyof typeof LineJoin];
15
+ /** One of the `TextClusterFlags` values describing a cluster mapping. */
16
+ type TextClusterFlags = (typeof TextClusterFlags)[keyof typeof TextClusterFlags];
17
+ /** One of the `FontSlant` values for a toy font face. */
18
+ type FontSlant = (typeof FontSlant)[keyof typeof FontSlant];
19
+ /** One of the `FontWeight` values for a toy font face. */
20
+ type FontWeight = (typeof FontWeight)[keyof typeof FontWeight];
21
+ /** One of the `SubpixelOrder` values for subpixel antialiasing. */
22
+ type SubpixelOrder = (typeof SubpixelOrder)[keyof typeof SubpixelOrder];
23
+ /** One of the `HintStyle` values for font outline hinting. */
24
+ type HintStyle = (typeof HintStyle)[keyof typeof HintStyle];
25
+ /** One of the `HintMetrics` values for font metric quantization. */
26
+ type HintMetrics = (typeof HintMetrics)[keyof typeof HintMetrics];
27
+ /** One of the `FontType` backends a font face or scaled font uses. */
28
+ type FontType = (typeof FontType)[keyof typeof FontType];
29
+ /** One of the `PathDataType` segment kinds in a copied path. */
30
+ type PathDataType = (typeof PathDataType)[keyof typeof PathDataType];
31
+ /** One of the `DeviceType` backends a device belongs to. */
32
+ type DeviceType = (typeof DeviceType)[keyof typeof DeviceType];
33
+ /** One of the `SurfaceType` backends a surface belongs to. */
34
+ type SurfaceType = (typeof SurfaceType)[keyof typeof SurfaceType];
35
+ /** One of the `Format` pixel layouts of an image surface. */
36
+ type Format = (typeof Format)[keyof typeof Format];
37
+ /** One of the `PatternType` kinds a pattern can be. */
38
+ type PatternType = (typeof PatternType)[keyof typeof PatternType];
39
+ /** One of the `Extend` modes for drawing outside a pattern's natural area. */
40
+ type Extend = (typeof Extend)[keyof typeof Extend];
41
+ /** One of the `Filter` modes for resizing a pattern. */
42
+ type Filter = (typeof Filter)[keyof typeof Filter];
43
+ /** One of the `RegionOverlap` results of a region containment test. */
44
+ type RegionOverlap = (typeof RegionOverlap)[keyof typeof RegionOverlap];
45
+
46
+ /**
47
+ * The result a cairo object or operation reports; anything but `SUCCESS` marks the object as errored.
48
+ * @enum
49
+ */
50
+ const Status = {
51
+ /** No error has occurred. */
52
+ SUCCESS: 0,
53
+ /** Out of memory. */
54
+ NO_MEMORY: 1,
55
+ /** `restore` was called without a matching `save`. */
56
+ INVALID_RESTORE: 2,
57
+ /** `popGroup` was called without a matching `pushGroup`. */
58
+ INVALID_POP_GROUP: 3,
59
+ /** No current point is defined. */
60
+ NO_CURRENT_POINT: 4,
61
+ /** The matrix is invalid, such as one that is not invertible. */
62
+ INVALID_MATRIX: 5,
63
+ /** The status value is invalid. */
64
+ INVALID_STATUS: 6,
65
+ /** A null pointer was passed. */
66
+ NULL_POINTER: 7,
67
+ /** The string is invalid, such as malformed UTF-8. */
68
+ INVALID_STRING: 8,
69
+ /** The path data is not valid. */
70
+ INVALID_PATH_DATA: 9,
71
+ /** An error occurred while reading from an input stream. */
72
+ READ_ERROR: 10,
73
+ /** An error occurred while writing to an output stream. */
74
+ WRITE_ERROR: 11,
75
+ /** The target surface has been finished. */
76
+ SURFACE_FINISHED: 12,
77
+ /** The surface type is not appropriate for the operation. */
78
+ SURFACE_TYPE_MISMATCH: 13,
79
+ /** The pattern type is not appropriate for the operation. */
80
+ PATTERN_TYPE_MISMATCH: 14,
81
+ /** The content value is invalid. */
82
+ INVALID_CONTENT: 15,
83
+ /** The format value is invalid. */
84
+ INVALID_FORMAT: 16,
85
+ /** The visual value is invalid. */
86
+ INVALID_VISUAL: 17,
87
+ /** The file was not found. */
88
+ FILE_NOT_FOUND: 18,
89
+ /** The dash setting is invalid. */
90
+ INVALID_DASH: 19,
91
+ /** The DSC comment is invalid. */
92
+ INVALID_DSC_COMMENT: 20,
93
+ /** The index passed to a getter is out of range. */
94
+ INVALID_INDEX: 21,
95
+ /** The clip region is not representable in the desired format. */
96
+ CLIP_NOT_REPRESENTABLE: 22,
97
+ /** An error occurred while creating a temporary file. */
98
+ TEMP_FILE_ERROR: 23,
99
+ /** The stride value is invalid. */
100
+ INVALID_STRIDE: 24,
101
+ /** The font type is not appropriate for the operation. */
102
+ FONT_TYPE_MISMATCH: 25,
103
+ /** The user font is immutable. */
104
+ USER_FONT_IMMUTABLE: 26,
105
+ /** An error occurred in a user font callback. */
106
+ USER_FONT_ERROR: 27,
107
+ /** A negative number was used where it is not allowed. */
108
+ NEGATIVE_COUNT: 28,
109
+ /** The input clusters do not represent the accompanying text and glyph arrays. */
110
+ INVALID_CLUSTERS: 29,
111
+ /** The font slant value is invalid. */
112
+ INVALID_SLANT: 30,
113
+ /** The font weight value is invalid. */
114
+ INVALID_WEIGHT: 31,
115
+ /** The size value, such as a negative width, is invalid. */
116
+ INVALID_SIZE: 32,
117
+ /** The user font method is not implemented. */
118
+ USER_FONT_NOT_IMPLEMENTED: 33,
119
+ /** The device type is not appropriate for the operation. */
120
+ DEVICE_TYPE_MISMATCH: 34,
121
+ /** An operation on the device caused an unspecified error. */
122
+ DEVICE_ERROR: 35,
123
+ /** A mesh pattern construction operation was used outside a `beginPatch`/`endPatch` pair. */
124
+ INVALID_MESH_CONSTRUCTION: 36,
125
+ /** The target device has been finished. */
126
+ DEVICE_FINISHED: 37,
127
+ /** A JBIG2 global data stream was attached without its global identifier. */
128
+ JBIG2_GLOBAL_MISSING: 38,
129
+ } as const;
130
+
131
+ /**
132
+ * What a surface holds: color, alpha coverage, or both.
133
+ * @enum
134
+ */
135
+ const Content = {
136
+ /** The surface holds color content only. */
137
+ COLOR: 4096,
138
+ /** The surface holds alpha content only. */
139
+ ALPHA: 8192,
140
+ /** The surface holds color and alpha content. */
141
+ COLOR_ALPHA: 12_288,
142
+ } as const;
143
+
144
+ /**
145
+ * How a drawing operation composites its source onto the destination.
146
+ * @enum
147
+ */
148
+ const Operator = {
149
+ /** Clears the destination where the source is drawn. */
150
+ CLEAR: 0,
151
+ /** Replaces the destination with the source. */
152
+ SOURCE: 1,
153
+ /** Draws the source over the destination. */
154
+ OVER: 2,
155
+ /** Draws the source where there was destination content. */
156
+ IN: 3,
157
+ /** Draws the source where there was no destination content. */
158
+ OUT: 4,
159
+ /** Draws the source on top of the destination, limited to the destination's extents. */
160
+ ATOP: 5,
161
+ /** Ignores the source. */
162
+ DEST: 6,
163
+ /** Draws the destination on top of the source. */
164
+ DEST_OVER: 7,
165
+ /** Leaves the destination only where there was source content. */
166
+ DEST_IN: 8,
167
+ /** Leaves the destination only where there was no source content. */
168
+ DEST_OUT: 9,
169
+ /** Leaves the destination on top of the source, limited to the source's extents. */
170
+ DEST_ATOP: 10,
171
+ /** Shows the source and destination where there is only one of them. */
172
+ XOR: 11,
173
+ /** Accumulates the source and destination layers. */
174
+ ADD: 12,
175
+ /** Like `OVER`, but assumes the source and destination are disjoint geometries. */
176
+ SATURATE: 13,
177
+ /** Multiplies the source and destination colors, always darkening. */
178
+ MULTIPLY: 14,
179
+ /** Complements and multiplies the source and destination, always lightening. */
180
+ SCREEN: 15,
181
+ /** Multiplies or screens depending on the destination lightness. */
182
+ OVERLAY: 16,
183
+ /** Keeps the darker of the source and destination. */
184
+ DARKEN: 17,
185
+ /** Keeps the lighter of the source and destination. */
186
+ LIGHTEN: 18,
187
+ /** Brightens the destination to reflect the source. */
188
+ COLOR_DODGE: 19,
189
+ /** Darkens the destination to reflect the source. */
190
+ COLOR_BURN: 20,
191
+ /** Multiplies or screens depending on the source lightness. */
192
+ HARD_LIGHT: 21,
193
+ /** Darkens or lightens depending on the source lightness. */
194
+ SOFT_LIGHT: 22,
195
+ /** Takes the difference of the source and destination. */
196
+ DIFFERENCE: 23,
197
+ /** Like `DIFFERENCE` but with lower contrast. */
198
+ EXCLUSION: 24,
199
+ /** Takes the hue of the source and the saturation and luminosity of the destination. */
200
+ HSL_HUE: 25,
201
+ /** Takes the saturation of the source and the hue and luminosity of the destination. */
202
+ HSL_SATURATION: 26,
203
+ /** Takes the hue and saturation of the source and the luminosity of the destination. */
204
+ HSL_COLOR: 27,
205
+ /** Takes the luminosity of the source and the hue and saturation of the destination. */
206
+ HSL_LUMINOSITY: 28,
207
+ } as const;
208
+
209
+ /**
210
+ * How shapes and text are antialiased.
211
+ * @enum
212
+ */
213
+ const Antialias = {
214
+ /** Uses the default antialiasing of the subsystem and target device. */
215
+ DEFAULT: 0,
216
+ /** Uses a bilevel alpha mask. */
217
+ NONE: 1,
218
+ /** Uses a single color for antialiasing. */
219
+ GRAY: 2,
220
+ /** Uses the subpixels of an LCD panel. */
221
+ SUBPIXEL: 3,
222
+ /** Prefers speed over quality. */
223
+ FAST: 4,
224
+ /** Balances quality against performance. */
225
+ GOOD: 5,
226
+ /** Renders at the highest quality, sacrificing speed. */
227
+ BEST: 6,
228
+ } as const;
229
+
230
+ /**
231
+ * Which areas inside a path a fill covers.
232
+ * @enum
233
+ */
234
+ const FillRule = {
235
+ /** Fills where the winding number is non-zero. */
236
+ WINDING: 0,
237
+ /** Fills where a ray crosses the path an odd number of times. */
238
+ EVEN_ODD: 1,
239
+ } as const;
240
+
241
+ /**
242
+ * How the ends of a stroked line are rendered.
243
+ * @enum
244
+ */
245
+ const LineCap = {
246
+ /** Starts and stops the line exactly at the start and end points. */
247
+ BUTT: 0,
248
+ /** Uses a round ending centered on the end point. */
249
+ ROUND: 1,
250
+ /** Uses a squared ending extending past the end point. */
251
+ SQUARE: 2,
252
+ } as const;
253
+
254
+ /**
255
+ * How the corners of a stroked path are rendered.
256
+ * @enum
257
+ */
258
+ const LineJoin = {
259
+ /** Uses a sharp corner cut off at the miter limit. */
260
+ MITER: 0,
261
+ /** Uses a rounded join centered on the joint point. */
262
+ ROUND: 1,
263
+ /** Uses a cut-off join at half the line width from the joint point. */
264
+ BEVEL: 2,
265
+ } as const;
266
+
267
+ /**
268
+ * Properties of a text cluster mapping.
269
+ * @enum
270
+ */
271
+ const TextClusterFlags = {
272
+ /** The clusters map to glyphs from the end of the glyph array backwards. */
273
+ BACKWARD: 1,
274
+ } as const;
275
+
276
+ /**
277
+ * The slant of a toy font face.
278
+ * @enum
279
+ */
280
+ const FontSlant = {
281
+ /** Upright font style. */
282
+ NORMAL: 0,
283
+ /** Italic font style. */
284
+ ITALIC: 1,
285
+ /** Oblique font style. */
286
+ OBLIQUE: 2,
287
+ } as const;
288
+
289
+ /**
290
+ * The weight of a toy font face.
291
+ * @enum
292
+ */
293
+ const FontWeight = {
294
+ /** Normal font weight. */
295
+ NORMAL: 0,
296
+ /** Bold font weight. */
297
+ BOLD: 1,
298
+ } as const;
299
+
300
+ /**
301
+ * The order of color elements within each pixel on a display, for subpixel antialiasing.
302
+ * @enum
303
+ */
304
+ const SubpixelOrder = {
305
+ /** Uses the default subpixel order for the target device. */
306
+ DEFAULT: 0,
307
+ /** Subpixels are ordered red, green, blue horizontally. */
308
+ RGB: 1,
309
+ /** Subpixels are ordered blue, green, red horizontally. */
310
+ BGR: 2,
311
+ /** Subpixels are ordered red, green, blue vertically. */
312
+ VRGB: 3,
313
+ /** Subpixels are ordered blue, green, red vertically. */
314
+ VBGR: 4,
315
+ } as const;
316
+
317
+ /**
318
+ * How much font outlines are fitted to the pixel grid.
319
+ * @enum
320
+ */
321
+ const HintStyle = {
322
+ /** Uses the default hint style of the font backend and target device. */
323
+ DEFAULT: 0,
324
+ /** Does not hint outlines. */
325
+ NONE: 1,
326
+ /** Hints outlines slightly, keeping contrast while preserving shape. */
327
+ SLIGHT: 2,
328
+ /** Hints outlines with medium strength. */
329
+ MEDIUM: 3,
330
+ /** Hints outlines to maximize contrast. */
331
+ FULL: 4,
332
+ } as const;
333
+
334
+ /**
335
+ * Whether font metrics are quantized to integer device units.
336
+ * @enum
337
+ */
338
+ const HintMetrics = {
339
+ /** Uses the default metric hinting of the font backend and target device. */
340
+ DEFAULT: 0,
341
+ /** Does not hint metrics. */
342
+ OFF: 1,
343
+ /** Hints metrics to integer device units. */
344
+ ON: 2,
345
+ } as const;
346
+
347
+ /**
348
+ * The backend behind a font face or scaled font.
349
+ * @enum
350
+ */
351
+ const FontType = {
352
+ /** A font created with the toy font API (`selectFontFace`). */
353
+ TOY: 0,
354
+ /** A font of type FreeType. */
355
+ FT: 1,
356
+ /** A font of type Win32. */
357
+ WIN32: 2,
358
+ /** A font of type Quartz. */
359
+ QUARTZ: 3,
360
+ /** A font created with the user font API. */
361
+ USER: 4,
362
+ } as const;
363
+
364
+ /**
365
+ * The kind of a segment in a copied path.
366
+ * @enum
367
+ */
368
+ const PathDataType = {
369
+ /** Starts a new sub-path. */
370
+ MOVE_TO: 0,
371
+ /** Adds a straight line. */
372
+ LINE_TO: 1,
373
+ /** Adds a cubic Bézier curve. */
374
+ CURVE_TO: 2,
375
+ /** Closes the current sub-path. */
376
+ CLOSE_PATH: 3,
377
+ } as const;
378
+
379
+ /**
380
+ * The backend behind a device.
381
+ * @enum
382
+ */
383
+ const DeviceType = {
384
+ /** A Direct Render Manager device. */
385
+ DRM: 0,
386
+ /** An OpenGL device. */
387
+ GL: 1,
388
+ /** A script recording device. */
389
+ SCRIPT: 2,
390
+ /** An XCB device. */
391
+ XCB: 3,
392
+ /** An Xlib device. */
393
+ XLIB: 4,
394
+ /** An XML recording device. */
395
+ XML: 5,
396
+ /** A Cogl device. */
397
+ COGL: 6,
398
+ /** A Win32 device. */
399
+ WIN32: 7,
400
+ /** An invalid device. */
401
+ INVALID: -1,
402
+ } as const;
403
+
404
+ /**
405
+ * The backend behind a surface.
406
+ * @enum
407
+ */
408
+ const SurfaceType = {
409
+ /** An image surface backed by memory. */
410
+ IMAGE: 0,
411
+ /** A PDF surface. */
412
+ PDF: 1,
413
+ /** A PostScript surface. */
414
+ PS: 2,
415
+ /** An Xlib surface. */
416
+ XLIB: 3,
417
+ /** An XCB surface. */
418
+ XCB: 4,
419
+ /** A Glitz surface. */
420
+ GLITZ: 5,
421
+ /** A Quartz surface. */
422
+ QUARTZ: 6,
423
+ /** A Win32 surface. */
424
+ WIN32: 7,
425
+ /** A BeOS surface. */
426
+ BEOS: 8,
427
+ /** A DirectFB surface. */
428
+ DIRECTFB: 9,
429
+ /** An SVG surface. */
430
+ SVG: 10,
431
+ /** An OS/2 surface. */
432
+ OS2: 11,
433
+ /** A Win32 printing surface. */
434
+ WIN32_PRINTING: 12,
435
+ /** A Quartz image surface. */
436
+ QUARTZ_IMAGE: 13,
437
+ /** A script recording surface. */
438
+ SCRIPT: 14,
439
+ /** A Qt surface. */
440
+ QT: 15,
441
+ /** A recording surface that replays its drawing. */
442
+ RECORDING: 16,
443
+ /** An OpenVG surface. */
444
+ VG: 17,
445
+ /** An OpenGL surface. */
446
+ GL: 18,
447
+ /** A Direct Render Manager surface. */
448
+ DRM: 19,
449
+ /** A tee surface that forwards to several others. */
450
+ TEE: 20,
451
+ /** An XML recording surface. */
452
+ XML: 21,
453
+ /** A Skia surface. */
454
+ SKIA: 22,
455
+ /** A subsurface created with `Surface.createForRectangle`. */
456
+ SUBSURFACE: 23,
457
+ /** A Cogl surface. */
458
+ COGL: 24,
459
+ } as const;
460
+
461
+ /**
462
+ * The memory layout of the pixels of an image surface.
463
+ * @enum
464
+ */
465
+ const Format = {
466
+ /** No such format exists or is supported. */
467
+ INVALID: -1,
468
+ /** 32 bits per pixel with premultiplied alpha in the upper 8 bits, then red, green, blue. */
469
+ ARGB32: 0,
470
+ /** 32 bits per pixel with the upper 8 bits unused, then red, green, blue. */
471
+ RGB24: 1,
472
+ /** 8 bits per pixel holding an alpha value. */
473
+ A8: 2,
474
+ /** 1 bit per pixel holding an alpha value. */
475
+ A1: 3,
476
+ /** 16 bits per pixel with 5 bits red, 6 bits green and 5 bits blue. */
477
+ RGB16_565: 4,
478
+ /** 30 bits per pixel with 10 bits per color channel. */
479
+ RGB30: 5,
480
+ } as const;
481
+
482
+ /**
483
+ * The kind of a pattern.
484
+ * @enum
485
+ */
486
+ const PatternType = {
487
+ /** A single color. */
488
+ SOLID: 0,
489
+ /** A surface used as a source. */
490
+ SURFACE: 1,
491
+ /** A linear gradient. */
492
+ LINEAR: 2,
493
+ /** A radial gradient. */
494
+ RADIAL: 3,
495
+ /** A mesh gradient. */
496
+ MESH: 4,
497
+ /** A raster source pattern driven by callbacks. */
498
+ RASTER_SOURCE: 5,
499
+ } as const;
500
+
501
+ /**
502
+ * What a pattern draws outside its natural area.
503
+ * @enum
504
+ */
505
+ const Extend = {
506
+ /** Draws transparent outside the pattern. */
507
+ NONE: 0,
508
+ /** Tiles the pattern by repeating it. */
509
+ REPEAT: 1,
510
+ /** Tiles the pattern by reflecting it at its edges. */
511
+ REFLECT: 2,
512
+ /** Extends the pattern's closest edge color outward. */
513
+ PAD: 3,
514
+ } as const;
515
+
516
+ /**
517
+ * How a pattern is sampled when it is scaled.
518
+ * @enum
519
+ */
520
+ const Filter = {
521
+ /** A high-performance filter with a quality similar to `NEAREST`. */
522
+ FAST: 0,
523
+ /** A reasonable-performance filter with a quality similar to `BILINEAR`. */
524
+ GOOD: 1,
525
+ /** The highest-quality filter available. */
526
+ BEST: 2,
527
+ /** Nearest-neighbor filtering. */
528
+ NEAREST: 3,
529
+ /** Linear interpolation in two dimensions. */
530
+ BILINEAR: 4,
531
+ /** Gaussian interpolation in two dimensions. */
532
+ GAUSSIAN: 5,
533
+ } as const;
534
+
535
+ /**
536
+ * How a rectangle relates to a region.
537
+ * @enum
538
+ */
539
+ const RegionOverlap = {
540
+ /** The rectangle is entirely inside the region. */
541
+ IN: 0,
542
+ /** The rectangle is entirely outside the region. */
543
+ OUT: 1,
544
+ /** The rectangle is partially inside and partially outside the region. */
545
+ PART: 2,
546
+ } as const;
547
+
548
+ export {
549
+ Antialias,
550
+ Content,
551
+ DeviceType,
552
+ Extend,
553
+ FillRule,
554
+ Filter,
555
+ FontSlant,
556
+ FontType,
557
+ FontWeight,
558
+ Format,
559
+ HintMetrics,
560
+ HintStyle,
561
+ LineCap,
562
+ LineJoin,
563
+ Operator,
564
+ PathDataType,
565
+ PatternType,
566
+ RegionOverlap,
567
+ Status,
568
+ SubpixelOrder,
569
+ SurfaceType,
570
+ TextClusterFlags,
571
+ };