@girs/cogl-10 4.4.0 → 4.5.0

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 (3) hide show
  1. package/README.md +36 -41
  2. package/cogl-10.d.ts +191 -156
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/cogl-10)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/cogl-10)
6
6
 
7
+ GJS TypeScript type definitions for Cogl-10 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Cogl-10 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
+ This package contains type declarations only. It ships no runtime code, so it adds
10
+ nothing to your program and works with any bundler or none at all.
9
11
 
10
12
  ## Install
11
13
 
12
- Install the type definitions with npm:
13
14
  ```bash
14
15
  npm install @girs/cogl-10
15
16
  ```
16
17
 
17
- ## Usage
18
+ Any package manager works. The package has no dependencies beyond other `@girs/*`
19
+ type packages.
20
+
21
+ ## What it exports
22
+
23
+ | Import | What you get |
24
+ |---|---|
25
+ | `@girs/cogl-10` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/cogl-10/ambient` | only the `gi://` module declarations |
27
+ | `@girs/cogl-10/import` | only the `imports.gi` declarations |
28
+ | `@girs/cogl-10/cogl-10` | the namespace, without the side-effecting declarations |
29
+
30
+ ## Three ways to import
31
+
32
+ Which one you use depends on how you write imports elsewhere, not on your toolchain.
33
+
34
+ ### As a module
18
35
 
19
- Import it like any other module:
20
36
  ```ts
21
37
  import Cogl from '@girs/cogl-10';
22
38
  ```
23
39
 
24
- ### Ambient Modules
40
+ ### As `gi://`
25
41
 
26
- [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
- For this you need to include `@girs/cogl-10` or `@girs/cogl-10/ambient` in your `tsconfig` or entry point Typescript file:
42
+ GJS resolves `gi://` at runtime. To give it types, reference the package once, either
43
+ from your entry point or from `tsconfig.json`:
28
44
 
29
- `index.ts`:
30
45
  ```ts
31
- import '@girs/cogl-10'
46
+ import '@girs/cogl-10';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/cogl-10"],
41
- ...
42
- }
50
+ { "include": ["@girs/cogl-10"] }
43
51
  ```
44
52
 
45
- The ambient module now resolves with types:
53
+ Then the runtime spelling type-checks:
46
54
 
47
55
  ```ts
48
56
  import Cogl from 'gi://Cogl?version=10';
49
57
  ```
50
58
 
51
- ### Global import
52
-
53
- GJS's global `imports.gi` works too, with types.
54
- For this you need to include `@girs/cogl-10` or `@girs/cogl-10/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/cogl-10/ambient` instead pulls in these declarations
60
+ alone. See [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules).
55
61
 
56
- `index.ts`:
57
- ```ts
58
- import '@girs/cogl-10'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/cogl-10"],
68
- ...
69
- }
70
- ```
62
+ ### As `imports.gi`
71
63
 
72
- That form carries types as well:
64
+ GJS's global object works the same way, via `@girs/cogl-10/import`:
73
65
 
74
66
  ```ts
75
67
  const Cogl = imports.gi.Cogl;
76
68
  ```
77
69
 
78
- ### Bundle
70
+ ## Building
79
71
 
80
- Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
72
+ The declarations need no build step. If you bundle, every bundler works, since there is
73
+ no runtime code to resolve. The [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples)
74
+ show working setups for several.
81
75
 
82
76
  ## Other packages
83
77
 
84
- All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
78
+ Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
79
+
85
80
 
package/cogl-10.d.ts CHANGED
@@ -33,25 +33,25 @@ export namespace Cogl {
33
33
  /**
34
34
  * Data is the same size of a byte
35
35
  */
36
- BYTE,
36
+ BYTE = 5120,
37
37
  /**
38
38
  * Data is the same size of an
39
39
  * unsigned byte
40
40
  */
41
- UNSIGNED_BYTE,
41
+ UNSIGNED_BYTE = 5121,
42
42
  /**
43
43
  * Data is the same size of a short integer
44
44
  */
45
- SHORT,
45
+ SHORT = 5122,
46
46
  /**
47
47
  * Data is the same size of
48
48
  * an unsigned short integer
49
49
  */
50
- UNSIGNED_SHORT,
50
+ UNSIGNED_SHORT = 5123,
51
51
  /**
52
52
  * Data is the same size of a float
53
53
  */
54
- FLOAT,
54
+ FLOAT = 5126,
55
55
  }
56
56
 
57
57
 
@@ -69,15 +69,15 @@ export namespace Cogl {
69
69
  * Generic failure code, something went
70
70
  * wrong.
71
71
  */
72
- FAILED,
72
+ FAILED = 0,
73
73
  /**
74
74
  * Unknown image type.
75
75
  */
76
- UNKNOWN_TYPE,
76
+ UNKNOWN_TYPE = 1,
77
77
  /**
78
78
  * An image file was broken somehow.
79
79
  */
80
- CORRUPT_IMAGE,
80
+ CORRUPT_IMAGE = 2,
81
81
  }
82
82
 
83
83
 
@@ -90,20 +90,20 @@ export namespace Cogl {
90
90
  /**
91
91
  * Generic parse error
92
92
  */
93
- PARSE_ERROR,
93
+ PARSE_ERROR = 0,
94
94
  /**
95
95
  * Argument parse error
96
96
  */
97
- ARGUMENT_PARSE_ERROR,
97
+ ARGUMENT_PARSE_ERROR = 1,
98
98
  /**
99
99
  * Internal parser error
100
100
  */
101
- INVALID_ERROR,
101
+ INVALID_ERROR = 2,
102
102
  /**
103
103
  * Blend string not
104
104
  * supported by the GPU
105
105
  */
106
- GPU_UNSUPPORTED_ERROR,
106
+ GPU_UNSUPPORTED_ERROR = 3,
107
107
  }
108
108
 
109
109
 
@@ -121,41 +121,41 @@ export namespace Cogl {
121
121
  /**
122
122
  * Never passes.
123
123
  */
124
- NEVER,
124
+ NEVER = 512,
125
125
  /**
126
126
  * Passes if the fragment's depth
127
127
  * value is less than the value currently in the depth buffer.
128
128
  */
129
- LESS,
129
+ LESS = 513,
130
130
  /**
131
131
  * Passes if the fragment's depth
132
132
  * value is equal to the value currently in the depth buffer.
133
133
  */
134
- EQUAL,
134
+ EQUAL = 514,
135
135
  /**
136
136
  * Passes if the fragment's depth
137
137
  * value is less or equal to the value currently in the depth buffer.
138
138
  */
139
- LEQUAL,
139
+ LEQUAL = 515,
140
140
  /**
141
141
  * Passes if the fragment's depth
142
142
  * value is greater than the value currently in the depth buffer.
143
143
  */
144
- GREATER,
144
+ GREATER = 516,
145
145
  /**
146
146
  * Passes if the fragment's depth
147
147
  * value is not equal to the value currently in the depth buffer.
148
148
  */
149
- NOTEQUAL,
149
+ NOTEQUAL = 517,
150
150
  /**
151
151
  * Passes if the fragment's depth
152
152
  * value greater than or equal to the value currently in the depth buffer.
153
153
  */
154
- GEQUAL,
154
+ GEQUAL = 518,
155
155
  /**
156
156
  * Always passes.
157
157
  */
158
- ALWAYS,
158
+ ALWAYS = 519,
159
159
  }
160
160
 
161
161
 
@@ -172,37 +172,37 @@ export namespace Cogl {
172
172
  * {@link Cogl.IndicesType.INT} is supported in
173
173
  * `cogl_indices_new()`.
174
174
  */
175
- OGL_FEATURE_ID_UNSIGNED_INT_INDICES,
175
+ OGL_FEATURE_ID_UNSIGNED_INT_INDICES = 0,
176
176
  /**
177
177
  * Whether `cogl_buffer_map()` is
178
178
  * supported with CoglBufferAccess including read support.
179
179
  */
180
- OGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
180
+ OGL_FEATURE_ID_MAP_BUFFER_FOR_READ = 1,
181
181
  /**
182
182
  * Whether `cogl_buffer_map()` is
183
183
  * supported with CoglBufferAccess including write support.
184
184
  */
185
- OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
186
- OGL_FEATURE_ID_FENCE,
185
+ OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE = 2,
186
+ OGL_FEATURE_ID_FENCE = 3,
187
187
  /**
188
188
  * Support for
189
189
  * {@link Cogl.TextureComponents.RG} as the internal components of a
190
190
  * texture.
191
191
  */
192
- OGL_FEATURE_ID_TEXTURE_RG,
192
+ OGL_FEATURE_ID_TEXTURE_RG = 4,
193
193
  /**
194
194
  * Available if the age of {@link Cogl.Onscreen} back
195
195
  * buffers are tracked and so `cogl_onscreen_get_buffer_age()` can be
196
196
  * expected to return age values other than 0.
197
197
  */
198
- OGL_FEATURE_ID_BUFFER_AGE,
199
- OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
198
+ OGL_FEATURE_ID_BUFFER_AGE = 5,
199
+ OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL = 6,
200
200
  /**
201
201
  * Whether blitting using
202
202
  * `cogl_blit_framebuffer()` is supported.
203
203
  */
204
- OGL_FEATURE_ID_BLIT_FRAMEBUFFER,
205
- OGL_FEATURE_ID_TIMESTAMP_QUERY,
204
+ OGL_FEATURE_ID_BLIT_FRAMEBUFFER = 7,
205
+ OGL_FEATURE_ID_TIMESTAMP_QUERY = 8,
206
206
  }
207
207
 
208
208
 
@@ -215,11 +215,11 @@ export namespace Cogl {
215
215
  * The event was not handled, continues the
216
216
  * processing
217
217
  */
218
- CONTINUE,
218
+ CONTINUE = 0,
219
219
  /**
220
220
  * Remove the event, stops the processing
221
221
  */
222
- REMOVE,
222
+ REMOVE = 1,
223
223
  }
224
224
 
225
225
 
@@ -247,7 +247,7 @@ export namespace Cogl {
247
247
  * acknowledged a frame and is ready for a
248
248
  * new frame to be created.
249
249
  */
250
- SYNC,
250
+ SYNC = 1,
251
251
  /**
252
252
  * Notifies that a frame has ended. This
253
253
  * is a good time for applications to
@@ -257,7 +257,7 @@ export namespace Cogl {
257
257
  * events should be expected after a
258
258
  * `COGL_FRAME_EVENT_COMPLETE` event.
259
259
  */
260
- COMPLETE,
260
+ COMPLETE = 2,
261
261
  }
262
262
 
263
263
 
@@ -265,7 +265,7 @@ export namespace Cogl {
265
265
  * @gir-type Enum
266
266
  */
267
267
  enum FramebufferError {
268
- FRAMEBUFFER_ERROR_ALLOCATE,
268
+ FRAMEBUFFER_ERROR_ALLOCATE = 0,
269
269
  }
270
270
 
271
271
 
@@ -277,11 +277,11 @@ export namespace Cogl {
277
277
  * @gir-type Enum
278
278
  */
279
279
  enum GraphicsResetStatus {
280
- NO_ERROR,
281
- GUILTY_CONTEXT_RESET,
282
- INNOCENT_CONTEXT_RESET,
283
- UNKNOWN_CONTEXT_RESET,
284
- PURGED_CONTEXT_RESET,
280
+ NO_ERROR = 0,
281
+ GUILTY_CONTEXT_RESET = 1,
282
+ INNOCENT_CONTEXT_RESET = 2,
283
+ UNKNOWN_CONTEXT_RESET = 3,
284
+ PURGED_CONTEXT_RESET = 4,
285
285
  }
286
286
 
287
287
 
@@ -301,15 +301,15 @@ export namespace Cogl {
301
301
  /**
302
302
  * Your indices are unsigned bytes
303
303
  */
304
- BYTE,
304
+ BYTE = 0,
305
305
  /**
306
306
  * Your indices are unsigned shorts
307
307
  */
308
- SHORT,
308
+ SHORT = 1,
309
309
  /**
310
310
  * Your indices are unsigned ints
311
311
  */
312
- INT,
312
+ INT = 2,
313
313
  }
314
314
 
315
315
 
@@ -324,41 +324,41 @@ export namespace Cogl {
324
324
  /**
325
325
  * Never let the fragment through.
326
326
  */
327
- NEVER,
327
+ NEVER = 512,
328
328
  /**
329
329
  * Let the fragment through if the incoming
330
330
  * alpha value is less than the reference alpha value
331
331
  */
332
- LESS,
332
+ LESS = 513,
333
333
  /**
334
334
  * Let the fragment through if the incoming
335
335
  * alpha value equals the reference alpha value
336
336
  */
337
- EQUAL,
337
+ EQUAL = 514,
338
338
  /**
339
339
  * Let the fragment through if the incoming
340
340
  * alpha value is less than or equal to the reference alpha value
341
341
  */
342
- LEQUAL,
342
+ LEQUAL = 515,
343
343
  /**
344
344
  * Let the fragment through if the incoming
345
345
  * alpha value is greater than the reference alpha value
346
346
  */
347
- GREATER,
347
+ GREATER = 516,
348
348
  /**
349
349
  * Let the fragment through if the incoming
350
350
  * alpha value does not equal the reference alpha value
351
351
  */
352
- NOTEQUAL,
352
+ NOTEQUAL = 517,
353
353
  /**
354
354
  * Let the fragment through if the incoming
355
355
  * alpha value is greater than or equal to the reference alpha value.
356
356
  */
357
- GEQUAL,
357
+ GEQUAL = 518,
358
358
  /**
359
359
  * Always let the fragment through.
360
360
  */
361
- ALWAYS,
361
+ ALWAYS = 519,
362
362
  }
363
363
 
364
364
 
@@ -372,19 +372,19 @@ export namespace Cogl {
372
372
  * Neither face will be
373
373
  * culled. This is the default.
374
374
  */
375
- NONE,
375
+ NONE = 0,
376
376
  /**
377
377
  * Front faces will be culled.
378
378
  */
379
- FRONT,
379
+ FRONT = 1,
380
380
  /**
381
381
  * Back faces will be culled.
382
382
  */
383
- BACK,
383
+ BACK = 2,
384
384
  /**
385
385
  * All faces will be culled.
386
386
  */
387
- BOTH,
387
+ BOTH = 3,
388
388
  }
389
389
 
390
390
 
@@ -401,38 +401,38 @@ export namespace Cogl {
401
401
  * Measuring in manhatten distance from the,
402
402
  * current pixel center, use the nearest texture texel
403
403
  */
404
- NEAREST,
404
+ NEAREST = 9728,
405
405
  /**
406
406
  * Use the weighted average of the 4 texels
407
407
  * nearest the current pixel center
408
408
  */
409
- LINEAR,
409
+ LINEAR = 9729,
410
410
  /**
411
411
  * Select the mimap level whose
412
412
  * texel size most closely matches the current pixel, and use the
413
413
  * {@link Cogl.PipelineFilter.NEAREST} criterion
414
414
  */
415
- NEAREST_MIPMAP_NEAREST,
415
+ NEAREST_MIPMAP_NEAREST = 9984,
416
416
  /**
417
417
  * Select the mimap level whose
418
418
  * texel size most closely matches the current pixel, and use the
419
419
  * {@link Cogl.PipelineFilter.LINEAR} criterion
420
420
  */
421
- LINEAR_MIPMAP_NEAREST,
421
+ LINEAR_MIPMAP_NEAREST = 9985,
422
422
  /**
423
423
  * Select the two mimap levels
424
424
  * whose texel size most closely matches the current pixel, use
425
425
  * the {@link Cogl.PipelineFilter.NEAREST} criterion on each one and take
426
426
  * their weighted average
427
427
  */
428
- NEAREST_MIPMAP_LINEAR,
428
+ NEAREST_MIPMAP_LINEAR = 9986,
429
429
  /**
430
430
  * Select the two mimap levels
431
431
  * whose texel size most closely matches the current pixel, use
432
432
  * the {@link Cogl.PipelineFilter.LINEAR} criterion on each one and take
433
433
  * their weighted average
434
434
  */
435
- LINEAR_MIPMAP_LINEAR,
435
+ LINEAR_MIPMAP_LINEAR = 9987,
436
436
  }
437
437
 
438
438
 
@@ -453,15 +453,15 @@ export namespace Cogl {
453
453
  * The texture will be repeated. This
454
454
  * is useful for example to draw a tiled background.
455
455
  */
456
- REPEAT,
457
- MIRRORED_REPEAT,
456
+ REPEAT = 10497,
457
+ MIRRORED_REPEAT = 33648,
458
458
  /**
459
459
  * The coordinates outside the
460
460
  * range 0→1 will sample copies of the edge pixels of the
461
461
  * texture. This is useful to avoid artifacts if only one copy of
462
462
  * the texture is being rendered.
463
463
  */
464
- CLAMP_TO_EDGE,
464
+ CLAMP_TO_EDGE = 33071,
465
465
  /**
466
466
  * Cogl will try to automatically
467
467
  * decide which of the above two to use. For `cogl_rectangle()`, it
@@ -472,7 +472,7 @@ export namespace Cogl {
472
472
  * layers that have point sprite coordinate generation enabled. This
473
473
  * is the default value.
474
474
  */
475
- AUTOMATIC,
475
+ AUTOMATIC = 519,
476
476
  }
477
477
 
478
478
 
@@ -480,8 +480,8 @@ export namespace Cogl {
480
480
  * @gir-type Enum
481
481
  */
482
482
  enum RendererError {
483
- XLIB_DISPLAY_OPEN,
484
- BAD_CONSTRAINT,
483
+ XLIB_DISPLAY_OPEN = 0,
484
+ BAD_CONSTRAINT = 1,
485
485
  }
486
486
 
487
487
 
@@ -508,11 +508,11 @@ export namespace Cogl {
508
508
  /**
509
509
  * A program for processing vertices
510
510
  */
511
- VERTEX,
511
+ VERTEX = 0,
512
512
  /**
513
513
  * A program for processing fragments
514
514
  */
515
- FRAGMENT,
515
+ FRAGMENT = 1,
516
516
  }
517
517
 
518
518
 
@@ -525,15 +525,15 @@ export namespace Cogl {
525
525
  /**
526
526
  * draw to both stereo buffers
527
527
  */
528
- BOTH,
528
+ BOTH = 0,
529
529
  /**
530
530
  * draw only to the left stereo buffer
531
531
  */
532
- LEFT,
532
+ LEFT = 1,
533
533
  /**
534
534
  * draw only to the left stereo buffer
535
535
  */
536
- RIGHT,
536
+ RIGHT = 2,
537
537
  }
538
538
 
539
539
 
@@ -563,12 +563,12 @@ export namespace Cogl {
563
563
  * You tried to use a feature or
564
564
  * configuration not currently available.
565
565
  */
566
- UNSUPPORTED,
566
+ UNSUPPORTED = 0,
567
567
  /**
568
568
  * You tried to allocate a resource
569
569
  * such as a texture and there wasn't enough memory.
570
570
  */
571
- NO_MEMORY,
571
+ NO_MEMORY = 1,
572
572
  }
573
573
 
574
574
 
@@ -581,25 +581,25 @@ export namespace Cogl {
581
581
  /**
582
582
  * Only the alpha component
583
583
  */
584
- A,
584
+ A = 1,
585
585
  /**
586
586
  * Red and green components. Note that
587
587
  * this can only be used if the {@link Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_RG} feature
588
588
  * is advertised.
589
589
  */
590
- RG,
590
+ RG = 2,
591
591
  /**
592
592
  * Red, green and blue components
593
593
  */
594
- RGB,
594
+ RGB = 3,
595
595
  /**
596
596
  * Red, green, blue and alpha components
597
597
  */
598
- RGBA,
598
+ RGBA = 4,
599
599
  /**
600
600
  * Only a depth component
601
601
  */
602
- DEPTH,
602
+ DEPTH = 5,
603
603
  }
604
604
 
605
605
 
@@ -612,17 +612,17 @@ export namespace Cogl {
612
612
  /**
613
613
  * Unsupported size
614
614
  */
615
- SIZE,
615
+ SIZE = 0,
616
616
  /**
617
617
  * Unsupported format
618
618
  */
619
- FORMAT,
620
- BAD_PARAMETER,
619
+ FORMAT = 1,
620
+ BAD_PARAMETER = 2,
621
621
  /**
622
622
  * A primitive texture type that is
623
623
  * unsupported by the driver was used
624
624
  */
625
- TYPE,
625
+ TYPE = 3,
626
626
  }
627
627
 
628
628
 
@@ -636,35 +636,35 @@ export namespace Cogl {
636
636
  * FIXME, equivalent to
637
637
  * <constant>GL_POINTS</constant>
638
638
  */
639
- POINTS,
639
+ POINTS = 0,
640
640
  /**
641
641
  * FIXME, equivalent to <constant>GL_LINES</constant>
642
642
  */
643
- LINES,
643
+ LINES = 1,
644
644
  /**
645
645
  * FIXME, equivalent to
646
646
  * <constant>GL_LINE_LOOP</constant>
647
647
  */
648
- LINE_LOOP,
648
+ LINE_LOOP = 2,
649
649
  /**
650
650
  * FIXME, equivalent to
651
651
  * <constant>GL_LINE_STRIP</constant>
652
652
  */
653
- LINE_STRIP,
653
+ LINE_STRIP = 3,
654
654
  /**
655
655
  * FIXME, equivalent to
656
656
  * <constant>GL_TRIANGLES</constant>
657
657
  */
658
- TRIANGLES,
658
+ TRIANGLES = 4,
659
659
  /**
660
660
  * FIXME, equivalent to
661
661
  * <constant>GL_TRIANGLE_STRIP</constant>
662
662
  */
663
- TRIANGLE_STRIP,
663
+ TRIANGLE_STRIP = 5,
664
664
  /**
665
665
  * FIXME, equivalent to <constant>GL_TRIANGLE_FAN</constant>
666
666
  */
667
- TRIANGLE_FAN,
667
+ TRIANGLE_FAN = 6,
668
668
  }
669
669
 
670
670
 
@@ -678,11 +678,11 @@ export namespace Cogl {
678
678
  /**
679
679
  * Vertices are in a clockwise order
680
680
  */
681
- CLOCKWISE,
681
+ CLOCKWISE = 0,
682
682
  /**
683
683
  * Vertices are in a counter-clockwise order
684
684
  */
685
- COUNTER_CLOCKWISE,
685
+ COUNTER_CLOCKWISE = 1,
686
686
  }
687
687
 
688
688
 
@@ -690,37 +690,59 @@ export namespace Cogl {
690
690
  * @gir-type Enum
691
691
  */
692
692
  enum WinsysFeature {
693
- VBLANK_COUNTER,
694
- VBLANK_WAIT,
695
- TEXTURE_FROM_PIXMAP,
696
- SWAP_BUFFERS_EVENT,
697
- SWAP_REGION,
698
- SWAP_REGION_THROTTLE,
699
- SWAP_REGION_SYNCHRONIZED,
700
- BUFFER_AGE,
701
- SYNC_AND_COMPLETE_EVENT,
702
- N_FEATURES,
693
+ VBLANK_COUNTER = 0,
694
+ VBLANK_WAIT = 1,
695
+ TEXTURE_FROM_PIXMAP = 2,
696
+ SWAP_BUFFERS_EVENT = 3,
697
+ SWAP_REGION = 4,
698
+ SWAP_REGION_THROTTLE = 5,
699
+ SWAP_REGION_SYNCHRONIZED = 6,
700
+ BUFFER_AGE = 7,
701
+ SYNC_AND_COMPLETE_EVENT = 8,
702
+ N_FEATURES = 9,
703
703
  }
704
704
 
705
705
 
706
+ /**
707
+ * @default 64
708
+ */
706
709
  const AFIRST_BIT: number;
707
710
 
711
+ /**
712
+ * @default 16
713
+ */
708
714
  const A_BIT: number;
709
715
 
716
+ /**
717
+ * @default 32
718
+ */
710
719
  const BGR_BIT: number;
711
720
 
721
+ /**
722
+ * @default 256
723
+ */
712
724
  const DEPTH_BIT: number;
713
725
 
714
726
  /**
715
727
  * The maximum number of planes of a pixel format (see also
716
728
  * `cogl_pixel_format_get_planes()`).
729
+ * @default 4
717
730
  */
718
731
  const PIXEL_FORMAT_MAX_PLANES: number;
719
732
 
733
+ /**
734
+ * @default 128
735
+ */
720
736
  const PREMULT_BIT: number;
721
737
 
738
+ /**
739
+ * @default 512
740
+ */
722
741
  const STENCIL_BIT: number;
723
742
 
743
+ /**
744
+ * @default 127
745
+ */
724
746
  const TEXTURE_MAX_WASTE: number;
725
747
 
726
748
  function blend_string_error_quark(): number;
@@ -773,6 +795,7 @@ export namespace Cogl {
773
795
  * @param dst_y Destination y position
774
796
  * @param width Width of region to copy
775
797
  * @param height Height of region to copy
798
+ * @throws GLib.Error
776
799
  */
777
800
  function blit_framebuffer(framebuffer: Framebuffer, dst: Framebuffer, src_x: number, src_y: number, dst_x: number, dst_y: number, width: number, height: number): boolean;
778
801
 
@@ -1184,6 +1207,7 @@ export namespace Cogl {
1184
1207
  * @returns A newly created {@link Cogl.Texture} or `null` on failure
1185
1208
  * @since 0.8
1186
1209
  * @deprecated since 1.18: Use specific constructors such as `cogl_texture_2d_new_from_file()`
1210
+ * @throws GLib.Error
1187
1211
  */
1188
1212
  function texture_new_from_file(filename: string, flags: TextureFlags, internal_format: PixelFormat): Texture;
1189
1213
 
@@ -1249,15 +1273,15 @@ export namespace Cogl {
1249
1273
  /**
1250
1274
  * Selects the primary color buffer
1251
1275
  */
1252
- COLOR,
1276
+ COLOR = 1,
1253
1277
  /**
1254
1278
  * Selects the depth buffer
1255
1279
  */
1256
- DEPTH,
1280
+ DEPTH = 2,
1257
1281
  /**
1258
1282
  * Selects the stencil buffer
1259
1283
  */
1260
- STENCIL,
1284
+ STENCIL = 4,
1261
1285
  }
1262
1286
 
1263
1287
 
@@ -1270,11 +1294,11 @@ export namespace Cogl {
1270
1294
  /**
1271
1295
  * FIXME
1272
1296
  */
1273
- WINDOW_BUFFER,
1297
+ WINDOW_BUFFER = 2,
1274
1298
  /**
1275
1299
  * FIXME
1276
1300
  */
1277
- OFFSCREEN_BUFFER,
1301
+ OFFSCREEN_BUFFER = 4,
1278
1302
  }
1279
1303
 
1280
1304
 
@@ -1282,8 +1306,8 @@ export namespace Cogl {
1282
1306
  * @gir-type Flags
1283
1307
  */
1284
1308
  enum EglImageFlags {
1285
- NONE,
1286
- NO_GET_DATA,
1309
+ NONE = 0,
1310
+ NO_GET_DATA = 1,
1287
1311
  }
1288
1312
 
1289
1313
 
@@ -1313,156 +1337,156 @@ export namespace Cogl {
1313
1337
  /**
1314
1338
  * Any format
1315
1339
  */
1316
- ANY,
1340
+ ANY = 0,
1317
1341
  /**
1318
1342
  * 8 bits alpha mask
1319
1343
  */
1320
- A_8,
1344
+ A_8 = 17,
1321
1345
  /**
1322
1346
  * RGB, 16 bits
1323
1347
  */
1324
- RGB_565,
1348
+ RGB_565 = 4,
1325
1349
  /**
1326
1350
  * RGBA, 16 bits
1327
1351
  */
1328
- RGBA_4444,
1352
+ RGBA_4444 = 21,
1329
1353
  /**
1330
1354
  * RGBA, 16 bits
1331
1355
  */
1332
- RGBA_5551,
1356
+ RGBA_5551 = 22,
1333
1357
  /**
1334
1358
  * Not currently supported
1335
1359
  */
1336
- YUV,
1360
+ YUV = 7,
1337
1361
  /**
1338
1362
  * Single luminance component
1339
1363
  */
1340
- G_8,
1364
+ G_8 = 8,
1341
1365
  /**
1342
1366
  * RG, 16 bits. Note that red-green textures
1343
1367
  * are only available if {@link Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_RG} is advertised.
1344
1368
  * See `cogl_texture_set_components()` for details.
1345
1369
  */
1346
- RG_88,
1370
+ RG_88 = 9,
1347
1371
  /**
1348
1372
  * RGB, 24 bits
1349
1373
  */
1350
- RGB_888,
1374
+ RGB_888 = 2,
1351
1375
  /**
1352
1376
  * BGR, 24 bits
1353
1377
  */
1354
- BGR_888,
1378
+ BGR_888 = 34,
1355
1379
  /**
1356
1380
  * RGBA, 32 bits
1357
1381
  */
1358
- RGBA_8888,
1382
+ RGBA_8888 = 19,
1359
1383
  /**
1360
1384
  * BGRA, 32 bits
1361
1385
  */
1362
- BGRA_8888,
1386
+ BGRA_8888 = 51,
1363
1387
  /**
1364
1388
  * ARGB, 32 bits
1365
1389
  */
1366
- ARGB_8888,
1390
+ ARGB_8888 = 83,
1367
1391
  /**
1368
1392
  * ABGR, 32 bits
1369
1393
  */
1370
- ABGR_8888,
1394
+ ABGR_8888 = 115,
1371
1395
  /**
1372
1396
  * RGBA, 32 bits, 10 bpc
1373
1397
  */
1374
- RGBA_1010102,
1398
+ RGBA_1010102 = 29,
1375
1399
  /**
1376
1400
  * BGRA, 32 bits, 10 bpc
1377
1401
  */
1378
- BGRA_1010102,
1379
- XRGB_2101010,
1402
+ BGRA_1010102 = 61,
1403
+ XRGB_2101010 = 77,
1380
1404
  /**
1381
1405
  * ARGB, 32 bits, 10 bpc
1382
1406
  */
1383
- ARGB_2101010,
1384
- XBGR_2101010,
1407
+ ARGB_2101010 = 93,
1408
+ XBGR_2101010 = 109,
1385
1409
  /**
1386
1410
  * ABGR, 32 bits, 10 bpc
1387
1411
  */
1388
- ABGR_2101010,
1412
+ ABGR_2101010 = 125,
1389
1413
  /**
1390
1414
  * RGBA half floating point, 64 bit
1391
1415
  */
1392
- RGBA_FP_16161616,
1416
+ RGBA_FP_16161616 = 27,
1393
1417
  /**
1394
1418
  * BGRA half floating point, 64 bit
1395
1419
  */
1396
- BGRA_FP_16161616,
1397
- XRGB_FP_16161616,
1420
+ BGRA_FP_16161616 = 59,
1421
+ XRGB_FP_16161616 = 75,
1398
1422
  /**
1399
1423
  * ARGB half floating point, 64 bit
1400
1424
  */
1401
- ARGB_FP_16161616,
1402
- XBGR_FP_16161616,
1425
+ ARGB_FP_16161616 = 91,
1426
+ XBGR_FP_16161616 = 107,
1403
1427
  /**
1404
1428
  * ABGR half floating point, 64 bit
1405
1429
  */
1406
- ABGR_FP_16161616,
1430
+ ABGR_FP_16161616 = 123,
1407
1431
  /**
1408
1432
  * Premultiplied RGBA, 32 bits
1409
1433
  */
1410
- RGBA_8888_PRE,
1434
+ RGBA_8888_PRE = 147,
1411
1435
  /**
1412
1436
  * Premultiplied BGRA, 32 bits
1413
1437
  */
1414
- BGRA_8888_PRE,
1438
+ BGRA_8888_PRE = 179,
1415
1439
  /**
1416
1440
  * Premultiplied ARGB, 32 bits
1417
1441
  */
1418
- ARGB_8888_PRE,
1442
+ ARGB_8888_PRE = 211,
1419
1443
  /**
1420
1444
  * Premultiplied ABGR, 32 bits
1421
1445
  */
1422
- ABGR_8888_PRE,
1446
+ ABGR_8888_PRE = 243,
1423
1447
  /**
1424
1448
  * Premultiplied RGBA, 16 bits
1425
1449
  */
1426
- RGBA_4444_PRE,
1450
+ RGBA_4444_PRE = 149,
1427
1451
  /**
1428
1452
  * Premultiplied RGBA, 16 bits
1429
1453
  */
1430
- RGBA_5551_PRE,
1454
+ RGBA_5551_PRE = 150,
1431
1455
  /**
1432
1456
  * Premultiplied RGBA, 32 bits, 10 bpc
1433
1457
  */
1434
- RGBA_1010102_PRE,
1458
+ RGBA_1010102_PRE = 157,
1435
1459
  /**
1436
1460
  * Premultiplied BGRA, 32 bits, 10 bpc
1437
1461
  */
1438
- BGRA_1010102_PRE,
1462
+ BGRA_1010102_PRE = 189,
1439
1463
  /**
1440
1464
  * Premultiplied ARGB, 32 bits, 10 bpc
1441
1465
  */
1442
- ARGB_2101010_PRE,
1466
+ ARGB_2101010_PRE = 221,
1443
1467
  /**
1444
1468
  * Premultiplied ABGR, 32 bits, 10 bpc
1445
1469
  */
1446
- ABGR_2101010_PRE,
1470
+ ABGR_2101010_PRE = 253,
1447
1471
  /**
1448
1472
  * Premultiplied RGBA half floating point, 64 bit
1449
1473
  */
1450
- RGBA_FP_16161616_PRE,
1474
+ RGBA_FP_16161616_PRE = 155,
1451
1475
  /**
1452
1476
  * Premultiplied BGRA half floating point, 64 bit
1453
1477
  */
1454
- BGRA_FP_16161616_PRE,
1478
+ BGRA_FP_16161616_PRE = 187,
1455
1479
  /**
1456
1480
  * Premultiplied ARGB half floating point, 64 bit
1457
1481
  */
1458
- ARGB_FP_16161616_PRE,
1482
+ ARGB_FP_16161616_PRE = 219,
1459
1483
  /**
1460
1484
  * Premultiplied ABGR half floating point, 64 bit
1461
1485
  */
1462
- ABGR_FP_16161616_PRE,
1463
- DEPTH_16,
1464
- DEPTH_32,
1465
- DEPTH_24_STENCIL_8,
1486
+ ABGR_FP_16161616_PRE = 251,
1487
+ DEPTH_16 = 265,
1488
+ DEPTH_32 = 259,
1489
+ DEPTH_24_STENCIL_8 = 771,
1466
1490
  }
1467
1491
 
1468
1492
 
@@ -1475,7 +1499,7 @@ export namespace Cogl {
1475
1499
  /**
1476
1500
  * Read from the color buffer
1477
1501
  */
1478
- READ_PIXELS_COLOR_BUFFER,
1502
+ READ_PIXELS_COLOR_BUFFER = 1,
1479
1503
  }
1480
1504
 
1481
1505
 
@@ -1488,7 +1512,7 @@ export namespace Cogl {
1488
1512
  /**
1489
1513
  * No flags specified
1490
1514
  */
1491
- NONE,
1515
+ NONE = 0,
1492
1516
  /**
1493
1517
  * Disables the automatic generation of
1494
1518
  * the mipmap pyramid from the base level image whenever it is
@@ -1496,16 +1520,16 @@ export namespace Cogl {
1496
1520
  * rendered with a mipmap filter so it should be free to leave out
1497
1521
  * this flag when using other filtering modes
1498
1522
  */
1499
- NO_AUTO_MIPMAP,
1523
+ NO_AUTO_MIPMAP = 1,
1500
1524
  /**
1501
1525
  * Disables the slicing of the texture
1502
1526
  */
1503
- NO_SLICING,
1527
+ NO_SLICING = 2,
1504
1528
  /**
1505
1529
  * Disables the insertion of the texture inside
1506
1530
  * the texture atlas used by Cogl
1507
1531
  */
1508
- NO_ATLAS,
1532
+ NO_ATLAS = 4,
1509
1533
  }
1510
1534
 
1511
1535
 
@@ -1836,6 +1860,7 @@ export namespace Cogl {
1836
1860
  * automatic allocation.</note>
1837
1861
  * @returns `true` if there were no error allocating the framebuffer, else `false`.
1838
1862
  * @since 1.8
1863
+ * @throws GLib.Error
1839
1864
  */
1840
1865
  allocate(): boolean;
1841
1866
 
@@ -3441,6 +3466,7 @@ export namespace Cogl {
3441
3466
  * @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired blend function.
3442
3467
  * @returns `true` if the blend string was successfully parsed, and the described blending is supported by the underlying driver/hardware. If there was an error, `false` is returned and `error` is set accordingly (if present).
3443
3468
  * @since 2.0
3469
+ * @throws GLib.Error
3444
3470
  */
3445
3471
  set_blend(blend_string: string): boolean;
3446
3472
 
@@ -3606,6 +3632,7 @@ export namespace Cogl {
3606
3632
  * @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired texture combine function.
3607
3633
  * @returns `true` if the blend string was successfully parsed, and the described texture combining is supported by the underlying driver and or hardware. On failure, `false` is returned and `error` is set
3608
3634
  * @since 2.0
3635
+ * @throws GLib.Error
3609
3636
  */
3610
3637
  set_layer_combine(layer_index: number, blend_string: string): boolean;
3611
3638
 
@@ -3673,6 +3700,7 @@ export namespace Cogl {
3673
3700
  * @param enable whether to enable point sprite coord generation.
3674
3701
  * @returns `true` if the function succeeds, `false` otherwise.
3675
3702
  * @since 2.0
3703
+ * @throws GLib.Error
3676
3704
  */
3677
3705
  set_layer_point_sprite_coords_enabled(layer_index: number, enable: boolean): boolean;
3678
3706
 
@@ -3723,6 +3751,7 @@ export namespace Cogl {
3723
3751
  * @param enable whether to enable per-vertex point size
3724
3752
  * @returns `true` if the change succeeded or `false` otherwise
3725
3753
  * @since 2.0
3754
+ * @throws GLib.Error
3726
3755
  */
3727
3756
  set_per_vertex_point_size(enable: boolean): boolean;
3728
3757
 
@@ -3940,6 +3969,7 @@ export namespace Cogl {
3940
3969
  * the texture, or if the texture is attached to a {@link Cogl.Offscreen}
3941
3970
  * framebuffer and rendered too.</note>
3942
3971
  * @returns `true` if the texture was successfully allocated, otherwise `false` and `error` will be updated if it wasn't `null`.
3972
+ * @throws GLib.Error
3943
3973
  */
3944
3974
  allocate(): boolean;
3945
3975
 
@@ -4088,6 +4118,7 @@ export namespace Cogl {
4088
4118
  * @param data the source data, pointing to the first top-left pixel to set
4089
4119
  * @param level The mipmap level to update (Normally 0 for the largest, base texture)
4090
4120
  * @returns `true` if the data upload was successful, and `false` otherwise
4121
+ * @throws GLib.Error
4091
4122
  */
4092
4123
  set_data(format: PixelFormat, rowstride: number, data: Uint8Array | string, level: number): boolean;
4093
4124
 
@@ -4200,6 +4231,7 @@ export namespace Cogl {
4200
4231
  * the texture, or if the texture is attached to a {@link Cogl.Offscreen}
4201
4232
  * framebuffer and rendered too.</note>
4202
4233
  * @returns `true` if the texture was successfully allocated, otherwise `false` and `error` will be updated if it wasn't `null`.
4234
+ * @throws GLib.Error
4203
4235
  */
4204
4236
  allocate(): boolean;
4205
4237
 
@@ -4348,6 +4380,7 @@ export namespace Cogl {
4348
4380
  * @param data the source data, pointing to the first top-left pixel to set
4349
4381
  * @param level The mipmap level to update (Normally 0 for the largest, base texture)
4350
4382
  * @returns `true` if the data upload was successful, and `false` otherwise
4383
+ * @throws GLib.Error
4351
4384
  */
4352
4385
  set_data(format: PixelFormat, rowstride: number, data: Uint8Array | string, level: number): boolean;
4353
4386
 
@@ -4985,6 +5018,7 @@ export namespace Cogl {
4985
5018
  * the texture, or if the texture is attached to a {@link Cogl.Offscreen}
4986
5019
  * framebuffer and rendered too.</note>
4987
5020
  * @returns `true` if the texture was successfully allocated, otherwise `false` and `error` will be updated if it wasn't `null`.
5021
+ * @throws GLib.Error
4988
5022
  */
4989
5023
  allocate(): boolean;
4990
5024
 
@@ -5133,6 +5167,7 @@ export namespace Cogl {
5133
5167
  * @param data the source data, pointing to the first top-left pixel to set
5134
5168
  * @param level The mipmap level to update (Normally 0 for the largest, base texture)
5135
5169
  * @returns `true` if the data upload was successful, and `false` otherwise
5170
+ * @throws GLib.Error
5136
5171
  */
5137
5172
  set_data(format: PixelFormat, rowstride: number, data: Uint8Array | string, level: number): boolean;
5138
5173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/cogl-10",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for Cogl-10",
5
5
  "type": "module",
6
6
  "module": "cogl-10.js",
@@ -31,12 +31,12 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.4.0",
35
- "@girs/cairo-1.0": "^4.4.0",
36
- "@girs/gobject-2.0": "^4.4.0",
37
- "@girs/glib-2.0": "^4.4.0",
38
- "@girs/graphene-1.0": "^4.4.0",
39
- "@girs/gl-1.0": "^4.4.0" },
34
+ "@girs/gjs": "^4.5.0",
35
+ "@girs/cairo-1.0": "^4.5.0",
36
+ "@girs/gobject-2.0": "^4.5.0",
37
+ "@girs/glib-2.0": "^4.5.0",
38
+ "@girs/graphene-1.0": "^4.5.0",
39
+ "@girs/gl-1.0": "^4.5.0" },
40
40
  "devDependencies": {
41
41
  "typescript": "*"
42
42
  },