-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Gsk-4.0.gir
4383 lines (4236 loc) · 224 KB
/
Gsk-4.0.gir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0" version="1.2">
<include name="Gdk" version="4.0"/>
<include name="Graphene" version="1.0"/>
<package name="gtk4"/>
<c:include name="gsk/gsk.h"/>
<namespace name="Gsk" version="4.0" shared-library="libgtk-4.so.1" c:identifier-prefixes="Gsk" c:symbol-prefixes="gsk">
<function-macro name="BROADWAY_RENDERER" c:identifier="GSK_BROADWAY_RENDERER" introspectable="0">
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="BROADWAY_RENDERER_CLASS" c:identifier="GSK_BROADWAY_RENDERER_CLASS" introspectable="0">
<parameters>
<parameter name="klass">
</parameter>
</parameters>
</function-macro>
<function-macro name="BROADWAY_RENDERER_GET_CLASS" c:identifier="GSK_BROADWAY_RENDERER_GET_CLASS" introspectable="0">
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<enumeration name="BlendMode" glib:type-name="GskBlendMode" glib:get-type="gsk_blend_mode_get_type" c:type="GskBlendMode">
<doc xml:space="preserve">The blend modes available for render nodes.
The implementation of each blend mode is deferred to the
rendering pipeline.
See <https://www.w3.org/TR/compositing-1/#blending> for more information
on blending and blend modes.</doc>
<member name="default" value="0" c:identifier="GSK_BLEND_MODE_DEFAULT" glib:nick="default" glib:name="GSK_BLEND_MODE_DEFAULT">
<doc xml:space="preserve">The default blend mode, which specifies no blending</doc>
</member>
<member name="multiply" value="1" c:identifier="GSK_BLEND_MODE_MULTIPLY" glib:nick="multiply" glib:name="GSK_BLEND_MODE_MULTIPLY">
<doc xml:space="preserve">The source color is multiplied by the destination
and replaces the destination</doc>
</member>
<member name="screen" value="2" c:identifier="GSK_BLEND_MODE_SCREEN" glib:nick="screen" glib:name="GSK_BLEND_MODE_SCREEN">
<doc xml:space="preserve">Multiplies the complements of the destination and source
color values, then complements the result.</doc>
</member>
<member name="overlay" value="3" c:identifier="GSK_BLEND_MODE_OVERLAY" glib:nick="overlay" glib:name="GSK_BLEND_MODE_OVERLAY">
<doc xml:space="preserve">Multiplies or screens the colors, depending on the
destination color value. This is the inverse of hard-list</doc>
</member>
<member name="darken" value="4" c:identifier="GSK_BLEND_MODE_DARKEN" glib:nick="darken" glib:name="GSK_BLEND_MODE_DARKEN">
<doc xml:space="preserve">Selects the darker of the destination and source colors</doc>
</member>
<member name="lighten" value="5" c:identifier="GSK_BLEND_MODE_LIGHTEN" glib:nick="lighten" glib:name="GSK_BLEND_MODE_LIGHTEN">
<doc xml:space="preserve">Selects the lighter of the destination and source colors</doc>
</member>
<member name="color_dodge" value="6" c:identifier="GSK_BLEND_MODE_COLOR_DODGE" glib:nick="color-dodge" glib:name="GSK_BLEND_MODE_COLOR_DODGE">
<doc xml:space="preserve">Brightens the destination color to reflect the source color</doc>
</member>
<member name="color_burn" value="7" c:identifier="GSK_BLEND_MODE_COLOR_BURN" glib:nick="color-burn" glib:name="GSK_BLEND_MODE_COLOR_BURN">
<doc xml:space="preserve">Darkens the destination color to reflect the source color</doc>
</member>
<member name="hard_light" value="8" c:identifier="GSK_BLEND_MODE_HARD_LIGHT" glib:nick="hard-light" glib:name="GSK_BLEND_MODE_HARD_LIGHT">
<doc xml:space="preserve">Multiplies or screens the colors, depending on the source color value</doc>
</member>
<member name="soft_light" value="9" c:identifier="GSK_BLEND_MODE_SOFT_LIGHT" glib:nick="soft-light" glib:name="GSK_BLEND_MODE_SOFT_LIGHT">
<doc xml:space="preserve">Darkens or lightens the colors, depending on the source color value</doc>
</member>
<member name="difference" value="10" c:identifier="GSK_BLEND_MODE_DIFFERENCE" glib:nick="difference" glib:name="GSK_BLEND_MODE_DIFFERENCE">
<doc xml:space="preserve">Subtracts the darker of the two constituent colors from the lighter color</doc>
</member>
<member name="exclusion" value="11" c:identifier="GSK_BLEND_MODE_EXCLUSION" glib:nick="exclusion" glib:name="GSK_BLEND_MODE_EXCLUSION">
<doc xml:space="preserve">Produces an effect similar to that of the difference mode but lower in contrast</doc>
</member>
<member name="color" value="12" c:identifier="GSK_BLEND_MODE_COLOR" glib:nick="color" glib:name="GSK_BLEND_MODE_COLOR">
<doc xml:space="preserve">Creates a color with the hue and saturation of the source color and the luminosity of the destination color</doc>
</member>
<member name="hue" value="13" c:identifier="GSK_BLEND_MODE_HUE" glib:nick="hue" glib:name="GSK_BLEND_MODE_HUE">
<doc xml:space="preserve">Creates a color with the hue of the source color and the saturation and luminosity of the destination color</doc>
</member>
<member name="saturation" value="14" c:identifier="GSK_BLEND_MODE_SATURATION" glib:nick="saturation" glib:name="GSK_BLEND_MODE_SATURATION">
<doc xml:space="preserve">Creates a color with the saturation of the source color and the hue and luminosity of the destination color</doc>
</member>
<member name="luminosity" value="15" c:identifier="GSK_BLEND_MODE_LUMINOSITY" glib:nick="luminosity" glib:name="GSK_BLEND_MODE_LUMINOSITY">
<doc xml:space="preserve">Creates a color with the luminosity of the source color and the hue and saturation of the destination color</doc>
</member>
</enumeration>
<class name="BlendNode" c:symbol-prefix="blend_node" c:type="GskBlendNode" parent="RenderNode" glib:type-name="GskBlendNode" glib:get-type="gsk_blend_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node applying a blending function between its two child nodes.</doc>
<constructor name="new" c:identifier="gsk_blend_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will use @blend_mode to blend the @top
node onto the @bottom node.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="BlendNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="bottom" transfer-ownership="none">
<doc xml:space="preserve">The bottom node to be drawn</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="top" transfer-ownership="none">
<doc xml:space="preserve">The node to be blended onto the @bottom node</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="blend_mode" transfer-ownership="none">
<doc xml:space="preserve">The blend mode to use</doc>
<type name="BlendMode" c:type="GskBlendMode"/>
</parameter>
</parameters>
</constructor>
<method name="get_blend_mode" c:identifier="gsk_blend_node_get_blend_mode">
<doc xml:space="preserve">Retrieves the blend mode used by @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the blend mode</doc>
<type name="BlendMode" c:type="GskBlendMode"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a blending `GskRenderNode`</doc>
<type name="BlendNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_bottom_child" c:identifier="gsk_blend_node_get_bottom_child">
<doc xml:space="preserve">Retrieves the bottom `GskRenderNode` child of the @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the bottom child node</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a blending `GskRenderNode`</doc>
<type name="BlendNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_top_child" c:identifier="gsk_blend_node_get_top_child">
<doc xml:space="preserve">Retrieves the top `GskRenderNode` child of the @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the top child node</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a blending `GskRenderNode`</doc>
<type name="BlendNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="BlurNode" c:symbol-prefix="blur_node" c:type="GskBlurNode" parent="RenderNode" glib:type-name="GskBlurNode" glib:get-type="gsk_blur_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node applying a blur effect to its single child.</doc>
<constructor name="new" c:identifier="gsk_blur_node_new">
<doc xml:space="preserve">Creates a render node that blurs the child.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new `GskRenderNode`</doc>
<type name="BlurNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="child" transfer-ownership="none">
<doc xml:space="preserve">the child node to blur</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="radius" transfer-ownership="none">
<doc xml:space="preserve">the blur radius. Must be positive</doc>
<type name="gfloat" c:type="float"/>
</parameter>
</parameters>
</constructor>
<method name="get_child" c:identifier="gsk_blur_node_get_child">
<doc xml:space="preserve">Retrieves the child `GskRenderNode` of the blur @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the blurred child node</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a blur `GskRenderNode`</doc>
<type name="BlurNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_radius" c:identifier="gsk_blur_node_get_radius">
<doc xml:space="preserve">Retrieves the blur radius of the @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the blur radius</doc>
<type name="gfloat" c:type="float"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a blur `GskRenderNode`</doc>
<type name="BlurNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="BorderNode" c:symbol-prefix="border_node" c:type="GskBorderNode" parent="RenderNode" glib:type-name="GskBorderNode" glib:get-type="gsk_border_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node for a border.</doc>
<constructor name="new" c:identifier="gsk_border_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will stroke a border rectangle inside the
given @outline.
The 4 sides of the border can have different widths and colors.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="BorderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="outline" transfer-ownership="none">
<doc xml:space="preserve">a `GskRoundedRect` describing the outline of the border</doc>
<type name="RoundedRect" c:type="const GskRoundedRect*"/>
</parameter>
<parameter name="border_width" transfer-ownership="none">
<doc xml:space="preserve">the stroke width of the border on
the top, right, bottom and left side respectively.</doc>
<array zero-terminated="0" c:type="const float*" fixed-size="4">
<type name="gfloat" c:type="float"/>
</array>
</parameter>
<parameter name="border_color" transfer-ownership="none">
<doc xml:space="preserve">the color used on the top, right,
bottom and left side.</doc>
<array zero-terminated="0" c:type="const GdkRGBA*" fixed-size="4">
<type name="Gdk.RGBA" c:type="GdkRGBA"/>
</array>
</parameter>
</parameters>
</constructor>
<method name="get_colors" c:identifier="gsk_border_node_get_colors">
<doc xml:space="preserve">Retrieves the colors of the border.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">an array of 4 `GdkRGBA` structs
for the top, right, bottom and left color of the border</doc>
<type name="Gdk.RGBA" c:type="const GdkRGBA*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a border</doc>
<type name="BorderNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_outline" c:identifier="gsk_border_node_get_outline">
<doc xml:space="preserve">Retrieves the outline of the border.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the outline of the border</doc>
<type name="RoundedRect" c:type="const GskRoundedRect*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a border</doc>
<type name="BorderNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_widths" c:identifier="gsk_border_node_get_widths">
<doc xml:space="preserve">Retrieves the stroke widths of the border.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">an array of 4 floats
for the top, right, bottom and left stroke width of the border,
respectively</doc>
<array zero-terminated="0" c:type="const float*" fixed-size="4">
<type name="gfloat" c:type="float"/>
</array>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a border</doc>
<type name="BorderNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="BroadwayRenderer" c:symbol-prefix="broadway_renderer" c:type="GskBroadwayRenderer" parent="Renderer" glib:type-name="GskBroadwayRenderer" glib:get-type="gsk_broadway_renderer_get_type" glib:type-struct="BroadwayRendererClass">
<constructor name="new" c:identifier="gsk_broadway_renderer_new">
<doc xml:space="preserve">Creates a new Broadway renderer.
The Broadway renderer is the default renderer for the broadway backend.
It will only work with broadway surfaces, otherwise it will fail the
call to gsk_renderer_realize().
This function is only available when GTK was compiled with Broadway
support.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new Broadway renderer.</doc>
<type name="Renderer" c:type="GskRenderer*"/>
</return-value>
</constructor>
</class>
<record name="BroadwayRendererClass" c:type="GskBroadwayRendererClass" disguised="1" glib:is-gtype-struct-for="BroadwayRenderer"/>
<function-macro name="CAIRO_RENDERER" c:identifier="GSK_CAIRO_RENDERER" introspectable="0">
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="CAIRO_RENDERER_CLASS" c:identifier="GSK_CAIRO_RENDERER_CLASS" introspectable="0">
<parameters>
<parameter name="klass">
</parameter>
</parameters>
</function-macro>
<function-macro name="CAIRO_RENDERER_GET_CLASS" c:identifier="GSK_CAIRO_RENDERER_GET_CLASS" introspectable="0">
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<class name="CairoNode" c:symbol-prefix="cairo_node" c:type="GskCairoNode" parent="RenderNode" glib:type-name="GskCairoNode" glib:get-type="gsk_cairo_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node for a Cairo surface.</doc>
<constructor name="new" c:identifier="gsk_cairo_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will render a cairo surface
into the area given by @bounds.
You can draw to the cairo surface using [[email protected]_draw_context].</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="CairoNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="bounds" transfer-ownership="none">
<doc xml:space="preserve">the rectangle to render to</doc>
<type name="Graphene.Rect" c:type="const graphene_rect_t*"/>
</parameter>
</parameters>
</constructor>
<method name="get_draw_context" c:identifier="gsk_cairo_node_get_draw_context">
<doc xml:space="preserve">Creates a Cairo context for drawing using the surface associated
to the render node.
If no surface exists yet, a surface will be created optimized for
rendering to @renderer.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a Cairo context used for drawing; use
cairo_destroy() when done drawing</doc>
<type name="cairo.Context" c:type="cairo_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a Cairo surface</doc>
<type name="CairoNode" c:type="GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_surface" c:identifier="gsk_cairo_node_get_surface">
<doc xml:space="preserve">Retrieves the Cairo surface used by the render node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a Cairo surface</doc>
<type name="cairo.Surface" c:type="cairo_surface_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a Cairo surface</doc>
<type name="CairoNode" c:type="GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="CairoRenderer" c:symbol-prefix="cairo_renderer" c:type="GskCairoRenderer" parent="Renderer" glib:type-name="GskCairoRenderer" glib:get-type="gsk_cairo_renderer_get_type" glib:type-struct="CairoRendererClass">
<doc xml:space="preserve">A GSK renderer that is using cairo.
Since it is using cairo, this renderer cannot support
3D transformations.</doc>
<constructor name="new" c:identifier="gsk_cairo_renderer_new">
<doc xml:space="preserve">Creates a new Cairo renderer.
The Cairo renderer is the fallback renderer drawing in ways similar
to how GTK 3 drew its content. Its primary use is as comparison tool.
The Cairo renderer is incomplete. It cannot render 3D transformed
content and will instead render an error marker. Its usage should be
avoided.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new Cairo renderer.</doc>
<type name="Renderer" c:type="GskRenderer*"/>
</return-value>
</constructor>
</class>
<record name="CairoRendererClass" c:type="GskCairoRendererClass" disguised="1" glib:is-gtype-struct-for="CairoRenderer"/>
<class name="ClipNode" c:symbol-prefix="clip_node" c:type="GskClipNode" parent="RenderNode" glib:type-name="GskClipNode" glib:get-type="gsk_clip_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node applying a rectangular clip to its single child node.</doc>
<constructor name="new" c:identifier="gsk_clip_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will clip the @child to the area
given by @clip.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="ClipNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="child" transfer-ownership="none">
<doc xml:space="preserve">The node to draw</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="clip" transfer-ownership="none">
<doc xml:space="preserve">The clip to apply</doc>
<type name="Graphene.Rect" c:type="const graphene_rect_t*"/>
</parameter>
</parameters>
</constructor>
<method name="get_child" c:identifier="gsk_clip_node_get_child">
<doc xml:space="preserve">Gets the child node that is getting clipped by the given @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">The child that is getting clipped</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a clip @GskRenderNode</doc>
<type name="ClipNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_clip" c:identifier="gsk_clip_node_get_clip">
<doc xml:space="preserve">Retrieves the clip rectangle for @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a clip rectangle</doc>
<type name="Graphene.Rect" c:type="const graphene_rect_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskClipNode`</doc>
<type name="ClipNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="ColorMatrixNode" c:symbol-prefix="color_matrix_node" c:type="GskColorMatrixNode" parent="RenderNode" glib:type-name="GskColorMatrixNode" glib:get-type="gsk_color_matrix_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node controlling the color matrix of its single child node.</doc>
<constructor name="new" c:identifier="gsk_color_matrix_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will drawn the @child with
@color_matrix.
In particular, the node will transform the operation
pixel = color_matrix * pixel + color_offset
for every pixel.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="ColorMatrixNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="child" transfer-ownership="none">
<doc xml:space="preserve">The node to draw</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="color_matrix" transfer-ownership="none">
<doc xml:space="preserve">The matrix to apply</doc>
<type name="Graphene.Matrix" c:type="const graphene_matrix_t*"/>
</parameter>
<parameter name="color_offset" transfer-ownership="none">
<doc xml:space="preserve">Values to add to the color</doc>
<type name="Graphene.Vec4" c:type="const graphene_vec4_t*"/>
</parameter>
</parameters>
</constructor>
<method name="get_child" c:identifier="gsk_color_matrix_node_get_child">
<doc xml:space="preserve">Gets the child node that is getting its colors modified by the given @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">The child that is getting its colors modified</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a color matrix `GskRenderNode`</doc>
<type name="ColorMatrixNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_color_matrix" c:identifier="gsk_color_matrix_node_get_color_matrix">
<doc xml:space="preserve">Retrieves the color matrix used by the @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a 4x4 color matrix</doc>
<type name="Graphene.Matrix" c:type="const graphene_matrix_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a color matrix `GskRenderNode`</doc>
<type name="ColorMatrixNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_color_offset" c:identifier="gsk_color_matrix_node_get_color_offset">
<doc xml:space="preserve">Retrieves the color offset used by the @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a color vector</doc>
<type name="Graphene.Vec4" c:type="const graphene_vec4_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a color matrix `GskRenderNode`</doc>
<type name="ColorMatrixNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="ColorNode" c:symbol-prefix="color_node" c:type="GskColorNode" parent="RenderNode" glib:type-name="GskColorNode" glib:get-type="gsk_color_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node for a solid color.</doc>
<constructor name="new" c:identifier="gsk_color_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will render the color specified by @rgba into
the area given by @bounds.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="ColorNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="rgba" transfer-ownership="none">
<doc xml:space="preserve">a `GdkRGBA` specifying a color</doc>
<type name="Gdk.RGBA" c:type="const GdkRGBA*"/>
</parameter>
<parameter name="bounds" transfer-ownership="none">
<doc xml:space="preserve">the rectangle to render the color into</doc>
<type name="Graphene.Rect" c:type="const graphene_rect_t*"/>
</parameter>
</parameters>
</constructor>
<method name="get_color" c:identifier="gsk_color_node_get_color">
<doc xml:space="preserve">Retrieves the color of the given @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the color of the node</doc>
<type name="Gdk.RGBA" c:type="const GdkRGBA*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode`</doc>
<type name="ColorNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<record name="ColorStop" c:type="GskColorStop">
<doc xml:space="preserve">A color stop in a gradient node.</doc>
<field name="offset" writable="1">
<doc xml:space="preserve">the offset of the color stop</doc>
<type name="gfloat" c:type="float"/>
</field>
<field name="color" writable="1">
<doc xml:space="preserve">the color at the given offset</doc>
<type name="Gdk.RGBA" c:type="GdkRGBA"/>
</field>
</record>
<class name="ConicGradientNode" c:symbol-prefix="conic_gradient_node" c:type="GskConicGradientNode" parent="RenderNode" glib:type-name="GskConicGradientNode" glib:get-type="gsk_conic_gradient_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node for a conic gradient.</doc>
<constructor name="new" c:identifier="gsk_conic_gradient_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that draws a conic gradient.
The conic gradient
starts around @center in the direction of @rotation. A rotation of 0 means
that the gradient points up. Color stops are then added clockwise.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="ConicGradientNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="bounds" transfer-ownership="none">
<doc xml:space="preserve">the bounds of the node</doc>
<type name="Graphene.Rect" c:type="const graphene_rect_t*"/>
</parameter>
<parameter name="center" transfer-ownership="none">
<doc xml:space="preserve">the center of the gradient</doc>
<type name="Graphene.Point" c:type="const graphene_point_t*"/>
</parameter>
<parameter name="rotation" transfer-ownership="none">
<doc xml:space="preserve">the rotation of the gradient in degrees</doc>
<type name="gfloat" c:type="float"/>
</parameter>
<parameter name="color_stops" transfer-ownership="none">
<doc xml:space="preserve">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.</doc>
<array length="4" zero-terminated="0" c:type="const GskColorStop*">
<type name="ColorStop" c:type="GskColorStop"/>
</array>
</parameter>
<parameter name="n_color_stops" transfer-ownership="none">
<doc xml:space="preserve">the number of elements in @color_stops</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
</parameters>
</constructor>
<method name="get_angle" c:identifier="gsk_conic_gradient_node_get_angle" version="4.2">
<doc xml:space="preserve">Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].
The angle is starting at the top and going clockwise, as expressed
in the css specification:
angle = 90 - gsk_conic_gradient_node_get_rotation()</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the angle for the gradient</doc>
<type name="gfloat" c:type="float"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a conic gradient</doc>
<type name="ConicGradientNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_center" c:identifier="gsk_conic_gradient_node_get_center">
<doc xml:space="preserve">Retrieves the center pointer for the gradient.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the center point for the gradient</doc>
<type name="Graphene.Point" c:type="const graphene_point_t*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a conic gradient</doc>
<type name="ConicGradientNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_color_stops" c:identifier="gsk_conic_gradient_node_get_color_stops">
<doc xml:space="preserve">Retrieves the color stops in the gradient.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the color stops in the gradient</doc>
<array length="0" zero-terminated="0" c:type="const GskColorStop*">
<type name="ColorStop" c:type="GskColorStop"/>
</array>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a conic gradient</doc>
<type name="ConicGradientNode" c:type="const GskRenderNode*"/>
</instance-parameter>
<parameter name="n_stops" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve">the number of color stops in the returned array</doc>
<type name="gsize" c:type="gsize*"/>
</parameter>
</parameters>
</method>
<method name="get_n_color_stops" c:identifier="gsk_conic_gradient_node_get_n_color_stops">
<doc xml:space="preserve">Retrieves the number of color stops in the gradient.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the number of color stops</doc>
<type name="gsize" c:type="gsize"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a conic gradient</doc>
<type name="ConicGradientNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_rotation" c:identifier="gsk_conic_gradient_node_get_rotation">
<doc xml:space="preserve">Retrieves the rotation for the gradient in degrees.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the rotation for the gradient</doc>
<type name="gfloat" c:type="float"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode` for a conic gradient</doc>
<type name="ConicGradientNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="ContainerNode" c:symbol-prefix="container_node" c:type="GskContainerNode" parent="RenderNode" glib:type-name="GskContainerNode" glib:get-type="gsk_container_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node that can contain other render nodes.</doc>
<constructor name="new" c:identifier="gsk_container_node_new">
<doc xml:space="preserve">Creates a new `GskRenderNode` instance for holding the given @children.
The new node will acquire a reference to each of the children.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">the new `GskRenderNode`</doc>
<type name="ContainerNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="children" transfer-ownership="none">
<doc xml:space="preserve">The children of the node</doc>
<array length="1" zero-terminated="0" c:type="GskRenderNode**">
<type name="RenderNode" c:type="GskRenderNode*"/>
</array>
</parameter>
<parameter name="n_children" transfer-ownership="none">
<doc xml:space="preserve">Number of children in the @children array</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</constructor>
<method name="get_child" c:identifier="gsk_container_node_get_child">
<doc xml:space="preserve">Gets one of the children of @container.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the @idx'th child of @container</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a container `GskRenderNode`</doc>
<type name="ContainerNode" c:type="const GskRenderNode*"/>
</instance-parameter>
<parameter name="idx" transfer-ownership="none">
<doc xml:space="preserve">the position of the child to get</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<method name="get_n_children" c:identifier="gsk_container_node_get_n_children">
<doc xml:space="preserve">Retrieves the number of direct children of @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the number of children of the `GskRenderNode`</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a container `GskRenderNode`</doc>
<type name="ContainerNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<enumeration name="Corner" glib:type-name="GskCorner" glib:get-type="gsk_corner_get_type" c:type="GskCorner">
<doc xml:space="preserve">The corner indices used by `GskRoundedRect`.</doc>
<member name="top_left" value="0" c:identifier="GSK_CORNER_TOP_LEFT" glib:nick="top-left" glib:name="GSK_CORNER_TOP_LEFT">
<doc xml:space="preserve">The top left corner</doc>
</member>
<member name="top_right" value="1" c:identifier="GSK_CORNER_TOP_RIGHT" glib:nick="top-right" glib:name="GSK_CORNER_TOP_RIGHT">
<doc xml:space="preserve">The top right corner</doc>
</member>
<member name="bottom_right" value="2" c:identifier="GSK_CORNER_BOTTOM_RIGHT" glib:nick="bottom-right" glib:name="GSK_CORNER_BOTTOM_RIGHT">
<doc xml:space="preserve">The bottom right corner</doc>
</member>
<member name="bottom_left" value="3" c:identifier="GSK_CORNER_BOTTOM_LEFT" glib:nick="bottom-left" glib:name="GSK_CORNER_BOTTOM_LEFT">
<doc xml:space="preserve">The bottom left corner</doc>
</member>
</enumeration>
<class name="CrossFadeNode" c:symbol-prefix="cross_fade_node" c:type="GskCrossFadeNode" parent="RenderNode" glib:type-name="GskCrossFadeNode" glib:get-type="gsk_cross_fade_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node cross fading between two child nodes.</doc>
<constructor name="new" c:identifier="gsk_cross_fade_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will do a cross-fade between @start and @end.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="CrossFadeNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="start" transfer-ownership="none">
<doc xml:space="preserve">The start node to be drawn</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="end" transfer-ownership="none">
<doc xml:space="preserve">The node to be cross_fadeed onto the @start node</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="progress" transfer-ownership="none">
<doc xml:space="preserve">How far the fade has progressed from start to end. The value will
be clamped to the range [0 ... 1]</doc>
<type name="gfloat" c:type="float"/>
</parameter>
</parameters>
</constructor>
<method name="get_end_child" c:identifier="gsk_cross_fade_node_get_end_child">
<doc xml:space="preserve">Retrieves the child `GskRenderNode` at the end of the cross-fade.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode`</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a cross-fading `GskRenderNode`</doc>
<type name="CrossFadeNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_progress" c:identifier="gsk_cross_fade_node_get_progress">
<doc xml:space="preserve">Retrieves the progress value of the cross fade.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the progress value, between 0 and 1</doc>
<type name="gfloat" c:type="float"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a cross-fading `GskRenderNode`</doc>
<type name="CrossFadeNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_start_child" c:identifier="gsk_cross_fade_node_get_start_child">
<doc xml:space="preserve">Retrieves the child `GskRenderNode` at the beginning of the cross-fade.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a `GskRenderNode`</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a cross-fading `GskRenderNode`</doc>
<type name="CrossFadeNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="DebugNode" c:symbol-prefix="debug_node" c:type="GskDebugNode" parent="RenderNode" glib:type-name="GskDebugNode" glib:get-type="gsk_debug_node_get_type" glib:fundamental="1">
<doc xml:space="preserve">A render node that emits a debugging message when drawing its
child node.</doc>
<constructor name="new" c:identifier="gsk_debug_node_new">
<doc xml:space="preserve">Creates a `GskRenderNode` that will add debug information about
the given @child.
Adding this node has no visual effect.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskRenderNode`</doc>
<type name="DebugNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<parameter name="child" transfer-ownership="none">
<doc xml:space="preserve">The child to add debug info for</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</parameter>
<parameter name="message" transfer-ownership="full">
<doc xml:space="preserve">The debug message</doc>
<type name="utf8" c:type="char*"/>
</parameter>
</parameters>
</constructor>
<method name="get_child" c:identifier="gsk_debug_node_get_child">
<doc xml:space="preserve">Gets the child node that is getting drawn by the given @node.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the child `GskRenderNode`</doc>
<type name="RenderNode" c:type="GskRenderNode*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a debug `GskRenderNode`</doc>
<type name="DebugNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_message" c:identifier="gsk_debug_node_get_message">
<doc xml:space="preserve">Gets the debug message that was set on this node</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">The debug message</doc>
<type name="utf8" c:type="const char*"/>
</return-value>
<parameters>
<instance-parameter name="node" transfer-ownership="none">
<doc xml:space="preserve">a debug `GskRenderNode`</doc>
<type name="DebugNode" c:type="const GskRenderNode*"/>
</instance-parameter>
</parameters>
</method>
</class>
<class name="GLRenderer" c:symbol-prefix="gl_renderer" c:type="GskGLRenderer" parent="Renderer" glib:type-name="GskGLRenderer" glib:get-type="gsk_gl_renderer_get_type" glib:type-struct="GLRendererClass">
<constructor name="new" c:identifier="gsk_gl_renderer_new" version="4.2">
<doc xml:space="preserve">Creates a new `GskRenderer` using the new OpenGL renderer.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new GL renderer</doc>
<type name="Renderer" c:type="GskRenderer*"/>
</return-value>
</constructor>
</class>
<record name="GLRendererClass" c:type="GskGLRendererClass" disguised="1" glib:is-gtype-struct-for="GLRenderer"/>
<class name="GLShader" c:symbol-prefix="gl_shader" c:type="GskGLShader" parent="GObject.Object" glib:type-name="GskGLShader" glib:get-type="gsk_gl_shader_get_type" glib:type-struct="GLShaderClass">
<doc xml:space="preserve">A `GskGLShader` is a snippet of GLSL that is meant to run in the
fragment shader of the rendering pipeline.
A fragment shader gets the coordinates being rendered as input and
produces the pixel values for that particular pixel. Additionally,
the shader can declare a set of other input arguments, called
uniforms (as they are uniform over all the calls to your shader in
each instance of use). A shader can also receive up to 4
textures that it can use as input when producing the pixel data.
`GskGLShader` is usually used with gtk_snapshot_push_gl_shader()
to produce a [[email protected]] in the rendering hierarchy,
and then its input textures are constructed by rendering the child
nodes to textures before rendering the shader node itself. (You can
pass texture nodes as children if you want to directly use a texture
as input).
The actual shader code is GLSL code that gets combined with
some other code into the fragment shader. Since the exact
capabilities of the GPU driver differs between different OpenGL
drivers and hardware, GTK adds some defines that you can use
to ensure your GLSL code runs on as many drivers as it can.
If the OpenGL driver is GLES, then the shader language version
is set to 100, and GSK_GLES will be defined in the shader.
Otherwise, if the OpenGL driver does not support the 3.2 core profile,
then the shader will run with language version 110 for GL2 and 130 for GL3,
and GSK_LEGACY will be defined in the shader.
If the OpenGL driver supports the 3.2 code profile, it will be used,
the shader language version is set to 150, and GSK_GL3 will be defined
in the shader.
The main function the shader must implement is:
```glsl
void mainImage(out vec4 fragColor,
in vec2 fragCoord,
in vec2 resolution,
in vec2 uv)
```
Where the input @fragCoord is the coordinate of the pixel we're
currently rendering, relative to the boundary rectangle that was
specified in the `GskGLShaderNode`, and @resolution is the width and
height of that rectangle. This is in the typical GTK coordinate
system with the origin in the top left. @uv contains the u and v
coordinates that can be used to index a texture at the
corresponding point. These coordinates are in the [0..1]x[0..1]
region, with 0, 0 being in the lower left corder (which is typical
for OpenGL).
The output @fragColor should be a RGBA color (with
premultiplied alpha) that will be used as the output for the
specified pixel location. Note that this output will be
automatically clipped to the clip region of the glshader node.
In addition to the function arguments the shader can define
up to 4 uniforms for textures which must be called u_textureN
(i.e. u_texture1 to u_texture4) as well as any custom uniforms
you want of types int, uint, bool, float, vec2, vec3 or vec4.
All textures sources contain premultiplied alpha colors, but if some
there are outer sources of colors there is a gsk_premultiply() helper
to compute premultiplication when needed.
Note that GTK parses the uniform declarations, so each uniform has to
be on a line by itself with no other code, like so:
```glsl
uniform float u_time;
uniform vec3 u_color;
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;
```
GTK uses the "gsk" namespace in the symbols it uses in the
shader, so your code should not use any symbols with the prefix gsk
or GSK. There are some helper functions declared that you can use:
```glsl
vec4 GskTexture(sampler2D sampler, vec2 texCoords);
```
This samples a texture (e.g. u_texture1) at the specified
coordinates, and containes some helper ifdefs to ensure that
it works on all OpenGL versions.
You can compile the shader yourself using [[email protected]],
otherwise the GSK renderer will do it when it handling the glshader
node. If errors occurs, the returned @error will include the glsl
sources, so you can see what GSK was passing to the compiler. You
can also set GSK_DEBUG=shaders in the environment to see the sources
and other relevant information about all shaders that GSK is handling.
# An example shader
```glsl
uniform float position;
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;
void mainImage(out vec4 fragColor,
in vec2 fragCoord,
in vec2 resolution,
in vec2 uv) {
vec4 source1 = GskTexture(u_texture1, uv);
vec4 source2 = GskTexture(u_texture2, uv);
fragColor = position * source1 + (1.0 - position) * source2;
}
```</doc>
<constructor name="new_from_bytes" c:identifier="gsk_gl_shader_new_from_bytes">
<doc xml:space="preserve">Creates a `GskGLShader` that will render pixels using the specified code.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskGLShader`</doc>
<type name="GLShader" c:type="GskGLShader*"/>
</return-value>
<parameters>
<parameter name="sourcecode" transfer-ownership="none">
<doc xml:space="preserve">GLSL sourcecode for the shader, as a `GBytes`</doc>
<type name="GLib.Bytes" c:type="GBytes*"/>
</parameter>
</parameters>
</constructor>
<constructor name="new_from_resource" c:identifier="gsk_gl_shader_new_from_resource">
<doc xml:space="preserve">Creates a `GskGLShader` that will render pixels using the specified code.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new `GskGLShader`</doc>
<type name="GLShader" c:type="GskGLShader*"/>
</return-value>
<parameters>
<parameter name="resource_path" transfer-ownership="none">
<doc xml:space="preserve">path to a resource that contains the GLSL sourcecode for
the shader</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
</parameters>
</constructor>
<method name="compile" c:identifier="gsk_gl_shader_compile" throws="1">
<doc xml:space="preserve">Tries to compile the @shader for the given @renderer.
If there is a problem, this function returns %FALSE and reports
an error. You should use this function before relying on the shader
for rendering and use a fallback with a simpler shader or without