1// Package gsk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gsk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/cairo"
12 "github.com/bnema/puregotk/v4/glib"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/graphene"
15 "github.com/bnema/puregotk/v4/pango"
16)
17
18// Specifies a transfer function for a color component to be applied
19// while rendering.
20//
21// The available functions include linear, piecewise-linear,
22// gamma and step functions.
23//
24// Note that the transfer function is applied to un-premultiplied
25// values, and all results are clamped to the [0, 1] range.
26type ComponentTransfer struct {
27 _ structs.HostLayout
28}
29
30var xComponentTransferGLibType func() types.GType
31
32func ComponentTransferGLibType() types.GType {
33 return xComponentTransferGLibType()
34}
35
36func (x *ComponentTransfer) GoPointer() uintptr {
37 return uintptr(unsafe.Pointer(x))
38}
39
40var xNewComponentTransferDiscrete func(uint, []float32) *ComponentTransfer
41
42// Creates a new component transfer that applies
43// a step function.
44//
45// The new value is computed as
46//
47// C' = values[k]
48//
49// where k is the smallest value such that
50//
51// k / n <= C < (k + 1) / n
52//
53// <figure>
54//
55// <picture>
56// <source srcset="discrete-dark.png" media="(prefers-color-scheme: dark)">
57// <img alt="Component transfer: discrete" src="discrete-light.png">
58// </picture>
59//
60// </figure>
61func NewComponentTransferDiscrete(NVar uint, ValuesVar []float32) *ComponentTransfer {
62
63 cret := xNewComponentTransferDiscrete(NVar, ValuesVar)
64 return cret
65}
66
67var xNewComponentTransferGamma func(float32, float32, float32) *ComponentTransfer
68
69// Creates a new component transfer that applies
70// a gamma transform.
71//
72// The new value is computed as
73//
74// C' = amp * pow (C, exp) + ofs
75//
76// <figure>
77//
78// <picture>
79// <source srcset="gamma-dark.png" media="(prefers-color-scheme: dark)">
80// <img alt="Component transfer: gamma" src="gamma-light.png">
81// </picture>
82//
83// </figure>
84func NewComponentTransferGamma(AmpVar float32, ExpVar float32, OfsVar float32) *ComponentTransfer {
85
86 cret := xNewComponentTransferGamma(AmpVar, ExpVar, OfsVar)
87 return cret
88}
89
90var xNewComponentTransferIdentity func() *ComponentTransfer
91
92// Creates a new component transfer that doesn't
93// change the component value.
94//
95// <figure>
96//
97// <picture>
98// <source srcset="identity-dark.png" media="(prefers-color-scheme: dark)">
99// <img alt="Component transfer: identity" src="identity-light.png">
100// </picture>
101//
102// </figure>
103func NewComponentTransferIdentity() *ComponentTransfer {
104
105 cret := xNewComponentTransferIdentity()
106 return cret
107}
108
109var xNewComponentTransferLevels func(float32) *ComponentTransfer
110
111// Creates a new component transfer that limits
112// the values of the component to `n` levels.
113//
114// The new value is computed as
115//
116// C' = (floor (C * n) + 0.5) / n
117//
118// <figure>
119//
120// <picture>
121// <source srcset="levels-dark.png" media="(prefers-color-scheme: dark)">
122// <img alt="Component transfer: levels" src="levels-light.png">
123// </picture>
124//
125// </figure>
126func NewComponentTransferLevels(NVar float32) *ComponentTransfer {
127
128 cret := xNewComponentTransferLevels(NVar)
129 return cret
130}
131
132var xNewComponentTransferLinear func(float32, float32) *ComponentTransfer
133
134// Creates a new component transfer that applies
135// a linear transform.
136//
137// The new value is computed as
138//
139// C' = C * m + b
140//
141// <figure>
142//
143// <picture>
144// <source srcset="linear-dark.png" media="(prefers-color-scheme: dark)">
145// <img alt="Component transfer: linear" src="linear-light.png">
146// </picture>
147//
148// </figure>
149func NewComponentTransferLinear(MVar float32, BVar float32) *ComponentTransfer {
150
151 cret := xNewComponentTransferLinear(MVar, BVar)
152 return cret
153}
154
155var xNewComponentTransferTable func(uint, []float32) *ComponentTransfer
156
157// Creates a new component transfer that applies
158// a piecewise linear function.
159//
160// The new value is computed as
161//
162// C' = values[k] + (C - k / (n - 1)) * n * (values[k + 1] - values[k])
163//
164// where k is the smallest value such that
165//
166// k / (n - 1) <= C < (k + 1) / (n - 1)
167//
168// <figure>
169//
170// <picture>
171// <source srcset="table-dark.png" media="(prefers-color-scheme: dark)">
172// <img alt="Component transfer: table" src="table-light.png">
173// </picture>
174//
175// </figure>
176func NewComponentTransferTable(NVar uint, ValuesVar []float32) *ComponentTransfer {
177
178 cret := xNewComponentTransferTable(NVar, ValuesVar)
179 return cret
180}
181
182var xComponentTransferCopy func(uintptr) *ComponentTransfer
183
184// Creates a copy of @other.
185func (x *ComponentTransfer) Copy() *ComponentTransfer {
186
187 cret := xComponentTransferCopy(x.GoPointer())
188 return cret
189}
190
191var xComponentTransferFree func(uintptr)
192
193// Frees a component transfer.
194func (x *ComponentTransfer) Free() {
195
196 xComponentTransferFree(x.GoPointer())
197
198}
199
200// Describes lines and curves that are more complex than simple rectangles.
201//
202// Paths can used for rendering (filling or stroking) and for animations
203// (e.g. as trajectories).
204//
205// `GskPath` is an immutable, opaque, reference-counted struct.
206// After creation, you cannot change the types it represents. Instead,
207// new `GskPath` objects have to be created. The [struct@Gsk.PathBuilder]
208// structure is meant to help in this endeavor.
209//
210// Conceptually, a path consists of zero or more contours (continuous, connected
211// curves), each of which may or may not be closed. Contours are typically
212// constructed from Bézier segments.
213//
214// <picture>
215//
216// <source srcset="path-dark.png" media="(prefers-color-scheme: dark)">
217// <img alt="A Path" src="path-light.png">
218//
219// </picture>
220type Path struct {
221 _ structs.HostLayout
222}
223
224var xPathGLibType func() types.GType
225
226func PathGLibType() types.GType {
227 return xPathGLibType()
228}
229
230func (x *Path) GoPointer() uintptr {
231 return uintptr(unsafe.Pointer(x))
232}
233
234var xPathForeach func(uintptr, PathForeachFlags, uintptr, uintptr) bool
235
236// Calls @func for every operation of the path.
237//
238// Note that this may only approximate @self, because paths can contain
239// optimizations for various specialized contours, and depending on the
240// @flags, the path may be decomposed into simpler curves than the ones
241// that it contained originally.
242//
243// This function serves two purposes:
244//
245// - When the @flags allow everything, it provides access to the raw,
246// unmodified data of the path.
247// - When the @flags disallow certain operations, it provides
248// an approximation of the path using just the allowed operations.
249func (x *Path) Foreach(FlagsVar PathForeachFlags, FuncVar *PathForeachFunc, UserDataVar uintptr) bool {
250
251 var FuncVarRef uintptr
252 if FuncVar != nil {
253 FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
254 if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
255 FuncVarRef = cbRefPtr
256 } else {
257 fcb := func(arg0 PathOperation, arg1 []graphene.Point, arg2 uint, arg3 float32, arg4 uintptr) bool {
258 cbFn := *FuncVar
259 return cbFn(arg0, arg1, arg2, arg3, arg4)
260 }
261 FuncVarRef = purego.NewCallback(fcb)
262 glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
263 }
264 }
265
266 cret := xPathForeach(x.GoPointer(), FlagsVar, FuncVarRef, UserDataVar)
267 return cret
268}
269
270var xPathForeachIntersection func(uintptr, *Path, uintptr, uintptr) bool
271
272// Finds intersections between two paths.
273//
274// This function finds intersections between @path1 and @path2,
275// and calls @func for each of them, in increasing order for @path1.
276//
277// If @path2 is not provided or equal to @path1, the function finds
278// non-trivial self-intersections of @path1.
279//
280// When segments of the paths coincide, the callback is called once
281// for the start of the segment, with @GSK_PATH_INTERSECTION_START, and
282// once for the end of the segment, with @GSK_PATH_INTERSECTION_END.
283// Note that other intersections may occur between the start and end
284// of such a segment.
285//
286// If @func returns `FALSE`, the iteration is stopped.
287func (x *Path) ForeachIntersection(Path2Var *Path, FuncVar *PathIntersectionFunc, UserDataVar uintptr) bool {
288
289 var FuncVarRef uintptr
290 if FuncVar != nil {
291 FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
292 if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
293 FuncVarRef = cbRefPtr
294 } else {
295 fcb := func(arg0 *Path, arg1 *PathPoint, arg2 *Path, arg3 *PathPoint, arg4 PathIntersection, arg5 uintptr) bool {
296 cbFn := *FuncVar
297 return cbFn(arg0, arg1, arg2, arg3, arg4, arg5)
298 }
299 FuncVarRef = purego.NewCallback(fcb)
300 glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
301 }
302 }
303
304 cret := xPathForeachIntersection(x.GoPointer(), Path2Var, FuncVarRef, UserDataVar)
305 return cret
306}
307
308var xPathGetBounds func(uintptr, *graphene.Rect) bool
309
310// Computes the bounds of the given path.
311//
312// The returned bounds may be larger than necessary, because this
313// function aims to be fast, not accurate. The bounds are guaranteed
314// to contain the path.
315//
316// It is possible that the returned rectangle has 0 width and/or height.
317// This can happen when the path only describes a point or an
318// axis-aligned line.
319//
320// If the path is empty, false is returned and @bounds are set to
321// graphene_rect_zero(). This is different from the case where the path
322// is a single point at the origin, where the @bounds will also be set to
323// the zero rectangle but true will be returned.
324func (x *Path) GetBounds(BoundsVar *graphene.Rect) bool {
325
326 cret := xPathGetBounds(x.GoPointer(), BoundsVar)
327 return cret
328}
329
330var xPathGetClosestPoint func(uintptr, *graphene.Point, float32, *PathPoint, *float32) bool
331
332// Computes the closest point on the path to the given point.
333//
334// If there is no point closer than the given threshold,
335// false is returned.
336func (x *Path) GetClosestPoint(PointVar *graphene.Point, ThresholdVar float32, ResultVar *PathPoint, DistanceVar *float32) bool {
337
338 cret := xPathGetClosestPoint(x.GoPointer(), PointVar, ThresholdVar, ResultVar, DistanceVar)
339 return cret
340}
341
342var xPathGetEndPoint func(uintptr, *PathPoint) bool
343
344// Gets the end point of the path.
345//
346// An empty path has no points, so false
347// is returned in this case.
348func (x *Path) GetEndPoint(ResultVar *PathPoint) bool {
349
350 cret := xPathGetEndPoint(x.GoPointer(), ResultVar)
351 return cret
352}
353
354var xPathGetStartPoint func(uintptr, *PathPoint) bool
355
356// Gets the start point of the path.
357//
358// An empty path has no points, so false
359// is returned in this case.
360func (x *Path) GetStartPoint(ResultVar *PathPoint) bool {
361
362 cret := xPathGetStartPoint(x.GoPointer(), ResultVar)
363 return cret
364}
365
366var xPathGetStrokeBounds func(uintptr, *Stroke, *graphene.Rect) bool
367
368// Computes the bounds for stroking the given path with the
369// given parameters.
370//
371// The returned bounds may be larger than necessary, because this
372// function aims to be fast, not accurate. The bounds are guaranteed
373// to contain the area affected by the stroke, including protrusions
374// like miters.
375func (x *Path) GetStrokeBounds(StrokeVar *Stroke, BoundsVar *graphene.Rect) bool {
376
377 cret := xPathGetStrokeBounds(x.GoPointer(), StrokeVar, BoundsVar)
378 return cret
379}
380
381var xPathInFill func(uintptr, *graphene.Point, FillRule) bool
382
383// Returns whether a point is inside the fill area of a path.
384//
385// Note that this function assumes that filling a contour
386// implicitly closes it.
387func (x *Path) InFill(PointVar *graphene.Point, FillRuleVar FillRule) bool {
388
389 cret := xPathInFill(x.GoPointer(), PointVar, FillRuleVar)
390 return cret
391}
392
393var xPathIsClosed func(uintptr) bool
394
395// Returns if the path represents a single closed contour.
396func (x *Path) IsClosed() bool {
397
398 cret := xPathIsClosed(x.GoPointer())
399 return cret
400}
401
402var xPathIsEmpty func(uintptr) bool
403
404// Checks if the path is empty, i.e. contains no lines or curves.
405func (x *Path) IsEmpty() bool {
406
407 cret := xPathIsEmpty(x.GoPointer())
408 return cret
409}
410
411var xPathPrint func(uintptr, *glib.String)
412
413// Converts the path into a human-readable representation.
414//
415// The string is compatible with (a superset of)
416// [SVG path syntax](https://www.w3.org/TR/SVG11/paths.html#PathData),
417// see [func@Gsk.Path.parse] for a summary of the syntax.
418func (x *Path) Print(StringVar *glib.String) {
419
420 xPathPrint(x.GoPointer(), StringVar)
421
422}
423
424var xPathRef func(uintptr) *Path
425
426// Increases the reference count of a path by one.
427func (x *Path) Ref() *Path {
428
429 cret := xPathRef(x.GoPointer())
430 return cret
431}
432
433var xPathToCairo func(uintptr, *cairo.Context)
434
435// Appends the path to a cairo context for drawing with Cairo.
436//
437// This may cause some suboptimal conversions to be performed as
438// Cairo does not support all features of `GskPath`.
439//
440// This function does not clear the existing Cairo path. Call
441// cairo_new_path() if you want this.
442func (x *Path) ToCairo(CrVar *cairo.Context) {
443
444 xPathToCairo(x.GoPointer(), CrVar)
445
446}
447
448var xPathToString func(uintptr) string
449
450// Converts the path into a human-readable string.
451//
452// You can use this function in a debugger to get a quick overview
453// of the path.
454//
455// This is a wrapper around [method@Gsk.Path.print], see that function
456// for details.
457func (x *Path) ToString() string {
458
459 cret := xPathToString(x.GoPointer())
460 return cret
461}
462
463var xPathUnref func(uintptr)
464
465// Decreases the reference count of a path by one.
466//
467// If the resulting reference count is zero, frees the path.
468func (x *Path) Unref() {
469
470 xPathUnref(x.GoPointer())
471
472}
473
474// Constructs `GskPath` objects.
475//
476// A path is constructed like this:
477//
478// ```c
479// GskPath *
480// construct_path (void)
481//
482// {
483// GskPathBuilder *builder;
484//
485// builder = gsk_path_builder_new ();
486//
487// // add contours to the path here
488//
489// return gsk_path_builder_free_to_path (builder);
490//
491// ```
492//
493// Adding contours to the path can be done in two ways.
494// The easiest option is to use the `gsk_path_builder_add_*` group
495// of functions that add predefined contours to the current path,
496// either common shapes like [method@Gsk.PathBuilder.add_circle]
497// or by adding from other paths like [method@Gsk.PathBuilder.add_path].
498//
499// The `gsk_path_builder_add_*` methods always add complete contours,
500// and do not use or modify the current point.
501//
502// The other option is to define each line and curve manually with
503// the `gsk_path_builder_*_to` group of functions. You start with
504// a call to [method@Gsk.PathBuilder.move_to] to set the starting point
505// and then use multiple calls to any of the drawing functions to
506// move the pen along the plane. Once you are done, you can call
507// [method@Gsk.PathBuilder.close] to close the path by connecting it
508// back with a line to the starting point.
509//
510// This is similar to how paths are drawn in Cairo.
511//
512// Note that `GskPathBuilder` will reduce the degree of added Bézier
513// curves as much as possible, to simplify rendering.
514type PathBuilder struct {
515 _ structs.HostLayout
516}
517
518var xPathBuilderGLibType func() types.GType
519
520func PathBuilderGLibType() types.GType {
521 return xPathBuilderGLibType()
522}
523
524func (x *PathBuilder) GoPointer() uintptr {
525 return uintptr(unsafe.Pointer(x))
526}
527
528var xNewPathBuilder func() *PathBuilder
529
530// Create a new `GskPathBuilder` object.
531//
532// The resulting builder would create an empty `GskPath`.
533// Use addition functions to add types to it.
534func NewPathBuilder() *PathBuilder {
535
536 cret := xNewPathBuilder()
537 return cret
538}
539
540var xPathBuilderAddCairoPath func(uintptr, *cairo.Path)
541
542// Adds a Cairo path to the builder.
543//
544// You can use cairo_copy_path() to access the path
545// from a Cairo context.
546func (x *PathBuilder) AddCairoPath(PathVar *cairo.Path) {
547
548 xPathBuilderAddCairoPath(x.GoPointer(), PathVar)
549
550}
551
552var xPathBuilderAddCircle func(uintptr, *graphene.Point, float32)
553
554// Adds a circle as a new contour.
555//
556// The path is going around the circle in clockwise direction.
557//
558// If @radius is zero, the contour will be a closed point.
559func (x *PathBuilder) AddCircle(CenterVar *graphene.Point, RadiusVar float32) {
560
561 xPathBuilderAddCircle(x.GoPointer(), CenterVar, RadiusVar)
562
563}
564
565var xPathBuilderAddLayout func(uintptr, uintptr)
566
567// Adds the outlines for the glyphs in @layout to the builder.
568func (x *PathBuilder) AddLayout(LayoutVar *pango.Layout) {
569
570 xPathBuilderAddLayout(x.GoPointer(), LayoutVar.GoPointer())
571
572}
573
574var xPathBuilderAddPath func(uintptr, *Path)
575
576// Appends all of @path to the builder.
577func (x *PathBuilder) AddPath(PathVar *Path) {
578
579 xPathBuilderAddPath(x.GoPointer(), PathVar)
580
581}
582
583var xPathBuilderAddRect func(uintptr, *graphene.Rect)
584
585// Adds a rectangle as a new contour.
586//
587// The path is going around the rectangle in clockwise direction.
588//
589// If the the width or height are 0, the path will be a closed
590// horizontal or vertical line. If both are 0, it'll be a closed dot.
591func (x *PathBuilder) AddRect(RectVar *graphene.Rect) {
592
593 xPathBuilderAddRect(x.GoPointer(), RectVar)
594
595}
596
597var xPathBuilderAddReversePath func(uintptr, *Path)
598
599// Appends all of @path to the builder, in reverse order.
600func (x *PathBuilder) AddReversePath(PathVar *Path) {
601
602 xPathBuilderAddReversePath(x.GoPointer(), PathVar)
603
604}
605
606var xPathBuilderAddRoundedRect func(uintptr, *RoundedRect)
607
608// Adds a rounded rectangle as a new contour.
609//
610// The path is going around the rectangle in clockwise direction.
611func (x *PathBuilder) AddRoundedRect(RectVar *RoundedRect) {
612
613 xPathBuilderAddRoundedRect(x.GoPointer(), RectVar)
614
615}
616
617var xPathBuilderAddSegment func(uintptr, *Path, *PathPoint, *PathPoint)
618
619// Adds a segment of a path to the builder.
620//
621// If @start is equal to or after @end, the path will first add the
622// segment from @start to the end of the path, and then add the segment
623// from the beginning to @end. If the path is closed, these segments
624// will be connected.
625//
626// Note that this method always adds a path with the given start point
627// and end point. To add a closed path, use [method@Gsk.PathBuilder.add_path].
628func (x *PathBuilder) AddSegment(PathVar *Path, StartVar *PathPoint, EndVar *PathPoint) {
629
630 xPathBuilderAddSegment(x.GoPointer(), PathVar, StartVar, EndVar)
631
632}
633
634var xPathBuilderArcTo func(uintptr, float32, float32, float32, float32)
635
636// Adds an elliptical arc from the current point to @x2, @y2
637// with @x1, @y1 determining the tangent directions.
638//
639// After this, @x2, @y2 will be the new current point.
640//
641// Note: Two points and their tangents do not determine
642// a unique ellipse, so GSK just picks one. If you need more
643// precise control, use [method@Gsk.PathBuilder.conic_to]
644// or [method@Gsk.PathBuilder.svg_arc_to].
645//
646// <picture>
647//
648// <source srcset="arc-dark.png" media="(prefers-color-scheme: dark)">
649// <img alt="Arc To" src="arc-light.png">
650//
651// </picture>
652func (x *PathBuilder) ArcTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32) {
653
654 xPathBuilderArcTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var)
655
656}
657
658var xPathBuilderClose func(uintptr)
659
660// Ends the current contour with a line back to the start point.
661//
662// Note that this is different from calling [method@Gsk.PathBuilder.line_to]
663// with the start point in that the contour will be closed. A closed
664// contour behaves differently from an open one. When stroking, its
665// start and end point are considered connected, so they will be
666// joined via the line join, and not ended with line caps.
667func (x *PathBuilder) Close() {
668
669 xPathBuilderClose(x.GoPointer())
670
671}
672
673var xPathBuilderConicTo func(uintptr, float32, float32, float32, float32, float32)
674
675// Adds a [conic curve](https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline)
676// from the current point to @x2, @y2 with the given @weight and @x1, @y1 as the
677// control point.
678//
679// The weight determines how strongly the curve is pulled towards the control point.
680// A conic with weight 1 is identical to a quadratic Bézier curve with the same points.
681//
682// Conic curves can be used to draw ellipses and circles. They are also known as
683// rational quadratic Bézier curves.
684//
685// After this, @x2, @y2 will be the new current point.
686//
687// <picture>
688//
689// <source srcset="conic-dark.png" media="(prefers-color-scheme: dark)">
690// <img alt="Conic To" src="conic-light.png">
691//
692// </picture>
693func (x *PathBuilder) ConicTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, WeightVar float32) {
694
695 xPathBuilderConicTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, WeightVar)
696
697}
698
699var xPathBuilderCubicTo func(uintptr, float32, float32, float32, float32, float32, float32)
700
701// Adds a [cubic Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
702// from the current point to @x3, @y3 with @x1, @y1 and @x2, @y2 as the control
703// points.
704//
705// After this, @x3, @y3 will be the new current point.
706//
707// <picture>
708//
709// <source srcset="cubic-dark.png" media="(prefers-color-scheme: dark)">
710// <img alt="Cubic To" src="cubic-light.png">
711//
712// </picture>
713func (x *PathBuilder) CubicTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, X3Var float32, Y3Var float32) {
714
715 xPathBuilderCubicTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, X3Var, Y3Var)
716
717}
718
719var xPathBuilderFreeToPath func(uintptr) *Path
720
721// Creates a new path from the current state of the
722// builder, and unrefs the builder.
723func (x *PathBuilder) FreeToPath() *Path {
724
725 cret := xPathBuilderFreeToPath(x.GoPointer())
726 return cret
727}
728
729var xPathBuilderGetCurrentPoint func(uintptr) *graphene.Point
730
731// Gets the current point.
732//
733// The current point is used for relative drawing commands and
734// updated after every operation.
735//
736// When the builder is created, the default current point is set
737// to `0, 0`. Note that this is different from cairo, which starts
738// out without a current point.
739func (x *PathBuilder) GetCurrentPoint() *graphene.Point {
740
741 cret := xPathBuilderGetCurrentPoint(x.GoPointer())
742 return cret
743}
744
745var xPathBuilderHtmlArcTo func(uintptr, float32, float32, float32, float32, float32)
746
747// Implements arc-to according to the HTML Canvas spec.
748//
749// A convenience function that implements the
750// [HTML arc_to](https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-arcto-dev)
751// functionality.
752//
753// After this, the current point will be the point where
754// the circle with the given radius touches the line from
755// @x1, @y1 to @x2, @y2.
756func (x *PathBuilder) HtmlArcTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, RadiusVar float32) {
757
758 xPathBuilderHtmlArcTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, RadiusVar)
759
760}
761
762var xPathBuilderLineTo func(uintptr, float32, float32)
763
764// Draws a line from the current point to @x, @y and makes it
765// the new current point.
766//
767// <picture>
768//
769// <source srcset="line-dark.png" media="(prefers-color-scheme: dark)">
770// <img alt="Line To" src="line-light.png">
771//
772// </picture>
773func (x *PathBuilder) LineTo(XVar float32, YVar float32) {
774
775 xPathBuilderLineTo(x.GoPointer(), XVar, YVar)
776
777}
778
779var xPathBuilderMoveTo func(uintptr, float32, float32)
780
781// Starts a new contour by placing the pen at @x, @y.
782//
783// If this function is called twice in succession, the first
784// call will result in a contour made up of a single point.
785// The second call will start a new contour.
786func (x *PathBuilder) MoveTo(XVar float32, YVar float32) {
787
788 xPathBuilderMoveTo(x.GoPointer(), XVar, YVar)
789
790}
791
792var xPathBuilderQuadTo func(uintptr, float32, float32, float32, float32)
793
794// Adds a [quadratic Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
795// from the current point to @x2, @y2 with @x1, @y1 as the control point.
796//
797// After this, @x2, @y2 will be the new current point.
798//
799// <picture>
800//
801// <source srcset="quad-dark.png" media="(prefers-color-scheme: dark)">
802// <img alt="Quad To" src="quad-light.png">
803//
804// </picture>
805func (x *PathBuilder) QuadTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32) {
806
807 xPathBuilderQuadTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var)
808
809}
810
811var xPathBuilderRef func(uintptr) *PathBuilder
812
813// Acquires a reference on the given builder.
814//
815// This function is intended primarily for language bindings.
816// `GskPathBuilder` objects should not be kept around.
817func (x *PathBuilder) Ref() *PathBuilder {
818
819 cret := xPathBuilderRef(x.GoPointer())
820 return cret
821}
822
823var xPathBuilderRelArcTo func(uintptr, float32, float32, float32, float32)
824
825// Adds an elliptical arc from the current point to @x2, @y2
826// with @x1, @y1 determining the tangent directions.
827//
828// All coordinates are given relative to the current point.
829//
830// This is the relative version of [method@Gsk.PathBuilder.arc_to].
831func (x *PathBuilder) RelArcTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32) {
832
833 xPathBuilderRelArcTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var)
834
835}
836
837var xPathBuilderRelConicTo func(uintptr, float32, float32, float32, float32, float32)
838
839// Adds a [conic curve](https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline)
840// from the current point to @x2, @y2 with the given @weight and @x1, @y1 as the
841// control point.
842//
843// All coordinates are given relative to the current point.
844//
845// This is the relative version of [method@Gsk.PathBuilder.conic_to].
846func (x *PathBuilder) RelConicTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, WeightVar float32) {
847
848 xPathBuilderRelConicTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, WeightVar)
849
850}
851
852var xPathBuilderRelCubicTo func(uintptr, float32, float32, float32, float32, float32, float32)
853
854// Adds a [cubic Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
855// from the current point to @x3, @y3 with @x1, @y1 and @x2, @y2 as the control
856// points.
857//
858// All coordinates are given relative to the current point.
859//
860// This is the relative version of [method@Gsk.PathBuilder.cubic_to].
861func (x *PathBuilder) RelCubicTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, X3Var float32, Y3Var float32) {
862
863 xPathBuilderRelCubicTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, X3Var, Y3Var)
864
865}
866
867var xPathBuilderRelHtmlArcTo func(uintptr, float32, float32, float32, float32, float32)
868
869// Implements arc-to according to the HTML Canvas spec.
870//
871// All coordinates are given relative to the current point.
872//
873// This is the relative version of [method@Gsk.PathBuilder.html_arc_to].
874func (x *PathBuilder) RelHtmlArcTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32, RadiusVar float32) {
875
876 xPathBuilderRelHtmlArcTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var, RadiusVar)
877
878}
879
880var xPathBuilderRelLineTo func(uintptr, float32, float32)
881
882// Draws a line from the current point to a point offset from it
883// by @x, @y and makes it the new current point.
884//
885// This is the relative version of [method@Gsk.PathBuilder.line_to].
886func (x *PathBuilder) RelLineTo(XVar float32, YVar float32) {
887
888 xPathBuilderRelLineTo(x.GoPointer(), XVar, YVar)
889
890}
891
892var xPathBuilderRelMoveTo func(uintptr, float32, float32)
893
894// Starts a new contour by placing the pen at @x, @y
895// relative to the current point.
896//
897// This is the relative version of [method@Gsk.PathBuilder.move_to].
898func (x *PathBuilder) RelMoveTo(XVar float32, YVar float32) {
899
900 xPathBuilderRelMoveTo(x.GoPointer(), XVar, YVar)
901
902}
903
904var xPathBuilderRelQuadTo func(uintptr, float32, float32, float32, float32)
905
906// Adds a [quadratic Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
907// from the current point to @x2, @y2 with @x1, @y1 the control point.
908//
909// All coordinates are given relative to the current point.
910//
911// This is the relative version of [method@Gsk.PathBuilder.quad_to].
912func (x *PathBuilder) RelQuadTo(X1Var float32, Y1Var float32, X2Var float32, Y2Var float32) {
913
914 xPathBuilderRelQuadTo(x.GoPointer(), X1Var, Y1Var, X2Var, Y2Var)
915
916}
917
918var xPathBuilderRelSvgArcTo func(uintptr, float32, float32, float32, bool, bool, float32, float32)
919
920// Implements arc-to according to the SVG spec.
921//
922// All coordinates are given relative to the current point.
923//
924// This is the relative version of [method@Gsk.PathBuilder.svg_arc_to].
925func (x *PathBuilder) RelSvgArcTo(RxVar float32, RyVar float32, XAxisRotationVar float32, LargeArcVar bool, PositiveSweepVar bool, XVar float32, YVar float32) {
926
927 xPathBuilderRelSvgArcTo(x.GoPointer(), RxVar, RyVar, XAxisRotationVar, LargeArcVar, PositiveSweepVar, XVar, YVar)
928
929}
930
931var xPathBuilderSvgArcTo func(uintptr, float32, float32, float32, bool, bool, float32, float32)
932
933// Implements arc-to according to the SVG spec.
934//
935// A convenience function that implements the
936// [SVG arc_to](https://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands)
937// functionality.
938//
939// After this, @x, @y will be the new current point.
940func (x *PathBuilder) SvgArcTo(RxVar float32, RyVar float32, XAxisRotationVar float32, LargeArcVar bool, PositiveSweepVar bool, XVar float32, YVar float32) {
941
942 xPathBuilderSvgArcTo(x.GoPointer(), RxVar, RyVar, XAxisRotationVar, LargeArcVar, PositiveSweepVar, XVar, YVar)
943
944}
945
946var xPathBuilderToPath func(uintptr) *Path
947
948// Creates a new path from the given builder.
949//
950// The given `GskPathBuilder` is reset once this function returns;
951// you cannot call this function multiple times on the same builder
952// instance.
953//
954// This function is intended primarily for language bindings.
955// C code should use [method@Gsk.PathBuilder.free_to_path].
956func (x *PathBuilder) ToPath() *Path {
957
958 cret := xPathBuilderToPath(x.GoPointer())
959 return cret
960}
961
962var xPathBuilderUnref func(uintptr)
963
964// Releases a reference on the given builder.
965func (x *PathBuilder) Unref() {
966
967 xPathBuilderUnref(x.GoPointer())
968
969}
970
971// Performs measurements on paths such as determining the length of the path.
972//
973// Many measuring operations require sampling the path length
974// at intermediate points. Therefore, a `GskPathMeasure` has
975// a tolerance that determines what precision is required
976// for such approximations.
977//
978// A `GskPathMeasure` struct is a reference counted struct
979// and should be treated as opaque.
980type PathMeasure struct {
981 _ structs.HostLayout
982}
983
984var xPathMeasureGLibType func() types.GType
985
986func PathMeasureGLibType() types.GType {
987 return xPathMeasureGLibType()
988}
989
990func (x *PathMeasure) GoPointer() uintptr {
991 return uintptr(unsafe.Pointer(x))
992}
993
994var xNewPathMeasure func(*Path) *PathMeasure
995
996// Creates a measure object for the given @path with the
997// default tolerance.
998func NewPathMeasure(PathVar *Path) *PathMeasure {
999
1000 cret := xNewPathMeasure(PathVar)
1001 return cret
1002}
1003
1004var xNewPathMeasureWithTolerance func(*Path, float32) *PathMeasure
1005
1006// Creates a measure object for the given @path and @tolerance.
1007func NewPathMeasureWithTolerance(PathVar *Path, ToleranceVar float32) *PathMeasure {
1008
1009 cret := xNewPathMeasureWithTolerance(PathVar, ToleranceVar)
1010 return cret
1011}
1012
1013var xPathMeasureGetLength func(uintptr) float32
1014
1015// Gets the length of the path being measured.
1016//
1017// The length is cached, so this function does not do any work.
1018func (x *PathMeasure) GetLength() float32 {
1019
1020 cret := xPathMeasureGetLength(x.GoPointer())
1021 return cret
1022}
1023
1024var xPathMeasureGetPath func(uintptr) *Path
1025
1026// Returns the path that the measure was created for.
1027func (x *PathMeasure) GetPath() *Path {
1028
1029 cret := xPathMeasureGetPath(x.GoPointer())
1030 return cret
1031}
1032
1033var xPathMeasureGetPoint func(uintptr, float32, *PathPoint) bool
1034
1035// Gets the point at the given distance into the path.
1036//
1037// An empty path has no points, so false is returned in that case.
1038func (x *PathMeasure) GetPoint(DistanceVar float32, ResultVar *PathPoint) bool {
1039
1040 cret := xPathMeasureGetPoint(x.GoPointer(), DistanceVar, ResultVar)
1041 return cret
1042}
1043
1044var xPathMeasureGetTolerance func(uintptr) float32
1045
1046// Returns the tolerance that the measure was created with.
1047func (x *PathMeasure) GetTolerance() float32 {
1048
1049 cret := xPathMeasureGetTolerance(x.GoPointer())
1050 return cret
1051}
1052
1053var xPathMeasureRef func(uintptr) *PathMeasure
1054
1055// Increases the reference count of a `GskPathMeasure` by one.
1056func (x *PathMeasure) Ref() *PathMeasure {
1057
1058 cret := xPathMeasureRef(x.GoPointer())
1059 return cret
1060}
1061
1062var xPathMeasureUnref func(uintptr)
1063
1064// Decreases the reference count of a `GskPathMeasure` by one.
1065//
1066// If the resulting reference count is zero, frees the object.
1067func (x *PathMeasure) Unref() {
1068
1069 xPathMeasureUnref(x.GoPointer())
1070
1071}
1072
1073// Collects the parameters that are needed when stroking a path.
1074type Stroke struct {
1075 _ structs.HostLayout
1076}
1077
1078var xStrokeGLibType func() types.GType
1079
1080func StrokeGLibType() types.GType {
1081 return xStrokeGLibType()
1082}
1083
1084func (x *Stroke) GoPointer() uintptr {
1085 return uintptr(unsafe.Pointer(x))
1086}
1087
1088var xNewStroke func(float32) *Stroke
1089
1090// Creates a new `GskStroke` with the given @line_width.
1091func NewStroke(LineWidthVar float32) *Stroke {
1092
1093 cret := xNewStroke(LineWidthVar)
1094 return cret
1095}
1096
1097var xStrokeCopy func(uintptr) *Stroke
1098
1099// Creates a copy of a `GskStroke`.
1100func (x *Stroke) Copy() *Stroke {
1101
1102 cret := xStrokeCopy(x.GoPointer())
1103 return cret
1104}
1105
1106var xStrokeFree func(uintptr)
1107
1108// Frees a `GskStroke`.
1109func (x *Stroke) Free() {
1110
1111 xStrokeFree(x.GoPointer())
1112
1113}
1114
1115var xStrokeGetDash func(uintptr, *uint) uintptr
1116
1117// Gets the dash array in use.
1118func (x *Stroke) GetDash(NDashVar *uint) uintptr {
1119
1120 cret := xStrokeGetDash(x.GoPointer(), NDashVar)
1121 return cret
1122}
1123
1124var xStrokeGetDashOffset func(uintptr) float32
1125
1126// Gets the dash offset.
1127func (x *Stroke) GetDashOffset() float32 {
1128
1129 cret := xStrokeGetDashOffset(x.GoPointer())
1130 return cret
1131}
1132
1133var xStrokeGetLineCap func(uintptr) LineCap
1134
1135// Gets the line cap used.
1136//
1137// See [enum@Gsk.LineCap] for details.
1138func (x *Stroke) GetLineCap() LineCap {
1139
1140 cret := xStrokeGetLineCap(x.GoPointer())
1141 return cret
1142}
1143
1144var xStrokeGetLineJoin func(uintptr) LineJoin
1145
1146// Gets the line join used.
1147//
1148// See [enum@Gsk.LineJoin] for details.
1149func (x *Stroke) GetLineJoin() LineJoin {
1150
1151 cret := xStrokeGetLineJoin(x.GoPointer())
1152 return cret
1153}
1154
1155var xStrokeGetLineWidth func(uintptr) float32
1156
1157// Gets the line width used.
1158func (x *Stroke) GetLineWidth() float32 {
1159
1160 cret := xStrokeGetLineWidth(x.GoPointer())
1161 return cret
1162}
1163
1164var xStrokeGetMiterLimit func(uintptr) float32
1165
1166// Gets the miter limit.
1167func (x *Stroke) GetMiterLimit() float32 {
1168
1169 cret := xStrokeGetMiterLimit(x.GoPointer())
1170 return cret
1171}
1172
1173var xStrokeSetDash func(uintptr, []float32, uint)
1174
1175// Sets the dash pattern to use.
1176//
1177// A dash pattern is specified by an array of alternating non-negative
1178// values. Each value provides the length of alternate "on" and "off"
1179// portions of the stroke.
1180//
1181// Each "on" segment will have caps applied as if the segment were a
1182// separate contour. In particular, it is valid to use an "on" length
1183// of 0 with [enum@Gsk.LineCap.round] or [enum@Gsk.LineCap.square]
1184// to draw dots or squares along a path.
1185//
1186// If @n_dash is 0, if all elements in @dash are 0, or if there are
1187// negative values in @dash, then dashing is disabled.
1188//
1189// If @n_dash is 1, an alternating "on" and "off" pattern with the
1190// single dash length provided is assumed.
1191//
1192// If @n_dash is uneven, the dash array will be used with the first
1193// element in @dash defining an "on" or "off" in alternating passes
1194// through the array.
1195//
1196// You can specify a starting offset into the dash with
1197// [method@Gsk.Stroke.set_dash_offset].
1198func (x *Stroke) SetDash(DashVar []float32, NDashVar uint) {
1199
1200 xStrokeSetDash(x.GoPointer(), DashVar, NDashVar)
1201
1202}
1203
1204var xStrokeSetDashOffset func(uintptr, float32)
1205
1206// Sets the offset into the dash pattern where dashing should begin.
1207//
1208// This is an offset into the length of the path, not an index into
1209// the array values of the dash array.
1210//
1211// See [method@Gsk.Stroke.set_dash] for more details on dashing.
1212func (x *Stroke) SetDashOffset(OffsetVar float32) {
1213
1214 xStrokeSetDashOffset(x.GoPointer(), OffsetVar)
1215
1216}
1217
1218var xStrokeSetLineCap func(uintptr, LineCap)
1219
1220// Sets the line cap to be used when stroking.
1221//
1222// See [enum@Gsk.LineCap] for details.
1223func (x *Stroke) SetLineCap(LineCapVar LineCap) {
1224
1225 xStrokeSetLineCap(x.GoPointer(), LineCapVar)
1226
1227}
1228
1229var xStrokeSetLineJoin func(uintptr, LineJoin)
1230
1231// Sets the line join to be used when stroking.
1232//
1233// See [enum@Gsk.LineJoin] for details.
1234func (x *Stroke) SetLineJoin(LineJoinVar LineJoin) {
1235
1236 xStrokeSetLineJoin(x.GoPointer(), LineJoinVar)
1237
1238}
1239
1240var xStrokeSetLineWidth func(uintptr, float32)
1241
1242// Sets the line width to be used when stroking.
1243//
1244// The line width must be >= 0.
1245func (x *Stroke) SetLineWidth(LineWidthVar float32) {
1246
1247 xStrokeSetLineWidth(x.GoPointer(), LineWidthVar)
1248
1249}
1250
1251var xStrokeSetMiterLimit func(uintptr, float32)
1252
1253// Sets the miter limit to be used when stroking.
1254//
1255// The miter limit is the distance from the corner where sharp
1256// turns of joins get cut off.
1257//
1258// The limit is specfied in units of line width and must be non-negative.
1259//
1260// For joins of type [enum@Gsk.LineJoin.miter] that exceed the miter limit,
1261// the join gets rendered as if it was of type [enum@Gsk.LineJoin.bevel].
1262func (x *Stroke) SetMiterLimit(LimitVar float32) {
1263
1264 xStrokeSetMiterLimit(x.GoPointer(), LimitVar)
1265
1266}
1267
1268var xStrokeToCairo func(uintptr, *cairo.Context)
1269
1270// A helper function that sets the stroke parameters
1271// of a cairo context from a `GskStroke`.
1272func (x *Stroke) ToCairo(CrVar *cairo.Context) {
1273
1274 xStrokeToCairo(x.GoPointer(), CrVar)
1275
1276}
1277
1278// Describes a 3D transform.
1279//
1280// Unlike `graphene_matrix_t`, `GskTransform` retains the steps in how
1281// a transform was constructed, and allows inspecting them. It is modeled
1282// after the way CSS describes transforms.
1283//
1284// `GskTransform` objects are immutable and cannot be changed after creation.
1285// This means code can safely expose them as properties of objects without
1286// having to worry about others changing them.
1287type Transform struct {
1288 _ structs.HostLayout
1289}
1290
1291var xTransformGLibType func() types.GType
1292
1293func TransformGLibType() types.GType {
1294 return xTransformGLibType()
1295}
1296
1297func (x *Transform) GoPointer() uintptr {
1298 return uintptr(unsafe.Pointer(x))
1299}
1300
1301var xNewTransform func() *Transform
1302
1303// Creates a new identity transform.
1304//
1305// This function is meant to be used by language
1306// bindings. For C code, this is equivalent to using `NULL`.
1307func NewTransform() *Transform {
1308
1309 cret := xNewTransform()
1310 return cret
1311}
1312
1313var xTransformEqual func(uintptr, *Transform) bool
1314
1315// Checks two transforms for equality.
1316func (x *Transform) Equal(SecondVar *Transform) bool {
1317
1318 cret := xTransformEqual(x.GoPointer(), SecondVar)
1319 return cret
1320}
1321
1322var xTransformGetCategory func(uintptr) TransformCategory
1323
1324// Returns the category this transform belongs to.
1325func (x *Transform) GetCategory() TransformCategory {
1326
1327 cret := xTransformGetCategory(x.GoPointer())
1328 return cret
1329}
1330
1331var xTransformInvert func(uintptr) *Transform
1332
1333// Inverts the given transform.
1334//
1335// If @self is not invertible, `NULL` is returned.
1336// Note that inverting `NULL` also returns `NULL`, which is
1337// the correct inverse of `NULL`. If you need to differentiate
1338// between those cases, you should check @self is not `NULL`
1339// before calling this function.
1340//
1341// This function consumes @self. Use [method@Gsk.Transform.ref] first
1342// if you want to keep it around.
1343func (x *Transform) Invert() *Transform {
1344
1345 cret := xTransformInvert(x.GoPointer())
1346 return cret
1347}
1348
1349var xTransformMatrix func(uintptr, *graphene.Matrix) *Transform
1350
1351// Multiplies @next with the given @matrix.
1352//
1353// This function consumes @next. Use [method@Gsk.Transform.ref] first
1354// if you want to keep it around.
1355func (x *Transform) Matrix(MatrixVar *graphene.Matrix) *Transform {
1356
1357 cret := xTransformMatrix(x.GoPointer(), MatrixVar)
1358 return cret
1359}
1360
1361var xTransformMatrix2d func(uintptr, float32, float32, float32, float32, float32, float32) *Transform
1362
1363// Multiplies @next with the matrix [ xx yx x0; xy yy y0; 0 0 1 ].
1364//
1365// The result of calling [method@Gsk.Transform.to_2d] on the returned
1366// [struct@Gsk.Transform] should match the input passed to this
1367// function.
1368//
1369// This function consumes @next. Use [method@Gsk.Transform.ref] first
1370// if you want to keep it around.
1371func (x *Transform) Matrix2d(XxVar float32, YxVar float32, XyVar float32, YyVar float32, DxVar float32, DyVar float32) *Transform {
1372
1373 cret := xTransformMatrix2d(x.GoPointer(), XxVar, YxVar, XyVar, YyVar, DxVar, DyVar)
1374 return cret
1375}
1376
1377var xTransformPerspective func(uintptr, float32) *Transform
1378
1379// Applies a perspective projection transform.
1380//
1381// This transform scales points in X and Y based on their Z value,
1382// scaling points with positive Z values away from the origin, and
1383// those with negative Z values towards the origin. Points
1384// on the z=0 plane are unchanged.
1385//
1386// This function consumes @next. Use [method@Gsk.Transform.ref] first
1387// if you want to keep it around.
1388func (x *Transform) Perspective(DepthVar float32) *Transform {
1389
1390 cret := xTransformPerspective(x.GoPointer(), DepthVar)
1391 return cret
1392}
1393
1394var xTransformPrint func(uintptr, *glib.String)
1395
1396// Converts the transform into a human-readable representation.
1397//
1398// The result of this function can later be parsed with
1399// [func@Gsk.Transform.parse].
1400func (x *Transform) Print(StringVar *glib.String) {
1401
1402 xTransformPrint(x.GoPointer(), StringVar)
1403
1404}
1405
1406var xTransformRef func(uintptr) *Transform
1407
1408// Acquires a reference on the given transform.
1409func (x *Transform) Ref() *Transform {
1410
1411 cret := xTransformRef(x.GoPointer())
1412 return cret
1413}
1414
1415var xTransformRotate func(uintptr, float32) *Transform
1416
1417// Rotates @next by an angle around the Z axis.
1418//
1419// The rotation happens around the origin point of (0, 0).
1420//
1421// This function consumes @next. Use [method@Gsk.Transform.ref] first
1422// if you want to keep it around.
1423func (x *Transform) Rotate(AngleVar float32) *Transform {
1424
1425 cret := xTransformRotate(x.GoPointer(), AngleVar)
1426 return cret
1427}
1428
1429var xTransformRotate3d func(uintptr, float32, *graphene.Vec3) *Transform
1430
1431// Rotates @next @angle degrees around @axis.
1432//
1433// For a rotation in 2D space, use [method@Gsk.Transform.rotate]
1434//
1435// This function consumes @next. Use [method@Gsk.Transform.ref] first
1436// if you want to keep it around.
1437func (x *Transform) Rotate3d(AngleVar float32, AxisVar *graphene.Vec3) *Transform {
1438
1439 cret := xTransformRotate3d(x.GoPointer(), AngleVar, AxisVar)
1440 return cret
1441}
1442
1443var xTransformScale func(uintptr, float32, float32) *Transform
1444
1445// Scales @next in 2-dimensional space by the given factors.
1446//
1447// Use [method@Gsk.Transform.scale_3d] to scale in all 3 dimensions.
1448//
1449// This function consumes @next. Use [method@Gsk.Transform.ref] first
1450// if you want to keep it around.
1451func (x *Transform) Scale(FactorXVar float32, FactorYVar float32) *Transform {
1452
1453 cret := xTransformScale(x.GoPointer(), FactorXVar, FactorYVar)
1454 return cret
1455}
1456
1457var xTransformScale3d func(uintptr, float32, float32, float32) *Transform
1458
1459// Scales @next by the given factors.
1460//
1461// This function consumes @next. Use [method@Gsk.Transform.ref] first
1462// if you want to keep it around.
1463func (x *Transform) Scale3d(FactorXVar float32, FactorYVar float32, FactorZVar float32) *Transform {
1464
1465 cret := xTransformScale3d(x.GoPointer(), FactorXVar, FactorYVar, FactorZVar)
1466 return cret
1467}
1468
1469var xTransformSkew func(uintptr, float32, float32) *Transform
1470
1471// Applies a skew transform.
1472//
1473// This function consumes @next. Use [method@Gsk.Transform.ref] first
1474// if you want to keep it around.
1475func (x *Transform) Skew(SkewXVar float32, SkewYVar float32) *Transform {
1476
1477 cret := xTransformSkew(x.GoPointer(), SkewXVar, SkewYVar)
1478 return cret
1479}
1480
1481var xTransformTo2d func(uintptr, *float32, *float32, *float32, *float32, *float32, *float32)
1482
1483// Converts a transform to a 2D transformation matrix.
1484//
1485// @self must be a 2D transformation. If you are not
1486// sure, use
1487//
1488// gsk_transform_get_category() >= GSK_TRANSFORM_CATEGORY_2D
1489//
1490// to check.
1491//
1492// The returned values are a subset of the full 4x4 matrix that
1493// is computed by [method@Gsk.Transform.to_matrix] and have the
1494// following layout:
1495//
1496// ```
1497//
1498// | xx yx | | a b 0 |
1499// | xy yy | = | c d 0 |
1500// | dx dy | | tx ty 1 |
1501//
1502// ```
1503//
1504// This function can be used to convert between a `GskTransform`
1505// and a matrix type from other 2D drawing libraries, in particular
1506// Cairo.
1507func (x *Transform) To2d(OutXxVar *float32, OutYxVar *float32, OutXyVar *float32, OutYyVar *float32, OutDxVar *float32, OutDyVar *float32) {
1508
1509 xTransformTo2d(x.GoPointer(), OutXxVar, OutYxVar, OutXyVar, OutYyVar, OutDxVar, OutDyVar)
1510
1511}
1512
1513var xTransformTo2dComponents func(uintptr, *float32, *float32, *float32, *float32, *float32, *float32, *float32)
1514
1515// Converts a transform to 2D transformation factors.
1516//
1517// To recreate an equivalent transform from the factors returned
1518// by this function, use
1519//
1520// gsk_transform_skew (
1521// gsk_transform_scale (
1522// gsk_transform_rotate (
1523// gsk_transform_translate (NULL, &GRAPHENE_POINT_T (dx, dy)),
1524// angle),
1525// scale_x, scale_y),
1526// skew_x, skew_y)
1527//
1528// @self must be a 2D transformation. If you are not sure, use
1529//
1530// gsk_transform_get_category() >= GSK_TRANSFORM_CATEGORY_2D
1531//
1532// to check.
1533func (x *Transform) To2dComponents(OutSkewXVar *float32, OutSkewYVar *float32, OutScaleXVar *float32, OutScaleYVar *float32, OutAngleVar *float32, OutDxVar *float32, OutDyVar *float32) {
1534
1535 xTransformTo2dComponents(x.GoPointer(), OutSkewXVar, OutSkewYVar, OutScaleXVar, OutScaleYVar, OutAngleVar, OutDxVar, OutDyVar)
1536
1537}
1538
1539var xTransformToAffine func(uintptr, *float32, *float32, *float32, *float32)
1540
1541// Converts a transform to 2D affine transformation factors.
1542//
1543// To recreate an equivalent transform from the factors returned
1544// by this function, use
1545//
1546// gsk_transform_scale (
1547// gsk_transform_translate (
1548// NULL,
1549// &GRAPHENE_POINT_T (dx, dy)),
1550// sx, sy)
1551//
1552// @self must be a 2D affine transformation. If you are not
1553// sure, use
1554//
1555// gsk_transform_get_category() >= GSK_TRANSFORM_CATEGORY_2D_AFFINE
1556//
1557// to check.
1558func (x *Transform) ToAffine(OutScaleXVar *float32, OutScaleYVar *float32, OutDxVar *float32, OutDyVar *float32) {
1559
1560 xTransformToAffine(x.GoPointer(), OutScaleXVar, OutScaleYVar, OutDxVar, OutDyVar)
1561
1562}
1563
1564var xTransformToMatrix func(uintptr, *graphene.Matrix)
1565
1566// Computes the 4x4 matrix for the transform.
1567//
1568// The previous value of @out_matrix will be ignored.
1569func (x *Transform) ToMatrix(OutMatrixVar *graphene.Matrix) {
1570
1571 xTransformToMatrix(x.GoPointer(), OutMatrixVar)
1572
1573}
1574
1575var xTransformToString func(uintptr) string
1576
1577// Converts the transform into a human-readable string.
1578//
1579// The resulting string can be parsed with [func@Gsk.Transform.parse].
1580//
1581// This is a wrapper around [method@Gsk.Transform.print].
1582func (x *Transform) ToString() string {
1583
1584 cret := xTransformToString(x.GoPointer())
1585 return cret
1586}
1587
1588var xTransformToTranslate func(uintptr, *float32, *float32)
1589
1590// Converts a transform to a translation operation.
1591//
1592// @self must be a 2D transformation. If you are not
1593// sure, use
1594//
1595// gsk_transform_get_category() >= GSK_TRANSFORM_CATEGORY_2D_TRANSLATE
1596//
1597// to check.
1598func (x *Transform) ToTranslate(OutDxVar *float32, OutDyVar *float32) {
1599
1600 xTransformToTranslate(x.GoPointer(), OutDxVar, OutDyVar)
1601
1602}
1603
1604var xTransformTransform func(uintptr, *Transform) *Transform
1605
1606// Applies all the operations from @other to @next.
1607//
1608// This function consumes @next. Use [method@Gsk.Transform.ref] first
1609// if you want to keep it around.
1610func (x *Transform) Transform(OtherVar *Transform) *Transform {
1611
1612 cret := xTransformTransform(x.GoPointer(), OtherVar)
1613 return cret
1614}
1615
1616var xTransformTransformBounds func(uintptr, *graphene.Rect, *graphene.Rect)
1617
1618// Transforms a rectangle using the given transform.
1619//
1620// The result is the bounding box containing the coplanar quad.
1621func (x *Transform) TransformBounds(RectVar *graphene.Rect, OutRectVar *graphene.Rect) {
1622
1623 xTransformTransformBounds(x.GoPointer(), RectVar, OutRectVar)
1624
1625}
1626
1627var xTransformTransformPoint func(uintptr, *graphene.Point, *graphene.Point)
1628
1629// Transforms a point using the given transform.
1630func (x *Transform) TransformPoint(PointVar *graphene.Point, OutPointVar *graphene.Point) {
1631
1632 xTransformTransformPoint(x.GoPointer(), PointVar, OutPointVar)
1633
1634}
1635
1636var xTransformTranslate func(uintptr, *graphene.Point) *Transform
1637
1638// Translates @next in 2-dimensional space by @point.
1639//
1640// This function consumes @next. Use [method@Gsk.Transform.ref] first
1641// if you want to keep it around.
1642func (x *Transform) Translate(PointVar *graphene.Point) *Transform {
1643
1644 cret := xTransformTranslate(x.GoPointer(), PointVar)
1645 return cret
1646}
1647
1648var xTransformTranslate3d func(uintptr, *graphene.Point3D) *Transform
1649
1650// Translates @next by @point.
1651//
1652// This function consumes @next. Use [method@Gsk.Transform.ref] first
1653// if you want to keep it around.
1654func (x *Transform) Translate3d(PointVar *graphene.Point3D) *Transform {
1655
1656 cret := xTransformTranslate3d(x.GoPointer(), PointVar)
1657 return cret
1658}
1659
1660var xTransformUnref func(uintptr)
1661
1662// Releases a reference on the given transform.
1663//
1664// If the reference was the last, the resources associated to the @self are
1665// freed.
1666func (x *Transform) Unref() {
1667
1668 xTransformUnref(x.GoPointer())
1669
1670}
1671
1672func init() {
1673 core.SetPackageName("GSK", "gtk4")
1674 core.SetSharedLibraries("GSK", []string{"libgtk-4.so.1"})
1675 var libs []uintptr
1676 for _, libPath := range core.GetPaths("GSK") {
1677 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1678 if err != nil {
1679 panic(err)
1680 }
1681 libs = append(libs, lib)
1682 }
1683
1684 core.PuregoSafeRegister(&xComponentTransferGLibType, libs, "gsk_component_transfer_get_type")
1685
1686 core.PuregoSafeRegister(&xNewComponentTransferDiscrete, libs, "gsk_component_transfer_new_discrete")
1687 core.PuregoSafeRegister(&xNewComponentTransferGamma, libs, "gsk_component_transfer_new_gamma")
1688 core.PuregoSafeRegister(&xNewComponentTransferIdentity, libs, "gsk_component_transfer_new_identity")
1689 core.PuregoSafeRegister(&xNewComponentTransferLevels, libs, "gsk_component_transfer_new_levels")
1690 core.PuregoSafeRegister(&xNewComponentTransferLinear, libs, "gsk_component_transfer_new_linear")
1691 core.PuregoSafeRegister(&xNewComponentTransferTable, libs, "gsk_component_transfer_new_table")
1692
1693 core.PuregoSafeRegister(&xComponentTransferCopy, libs, "gsk_component_transfer_copy")
1694 core.PuregoSafeRegister(&xComponentTransferFree, libs, "gsk_component_transfer_free")
1695
1696 core.PuregoSafeRegister(&xPathGLibType, libs, "gsk_path_get_type")
1697
1698 core.PuregoSafeRegister(&xPathForeach, libs, "gsk_path_foreach")
1699 core.PuregoSafeRegister(&xPathForeachIntersection, libs, "gsk_path_foreach_intersection")
1700 core.PuregoSafeRegister(&xPathGetBounds, libs, "gsk_path_get_bounds")
1701 core.PuregoSafeRegister(&xPathGetClosestPoint, libs, "gsk_path_get_closest_point")
1702 core.PuregoSafeRegister(&xPathGetEndPoint, libs, "gsk_path_get_end_point")
1703 core.PuregoSafeRegister(&xPathGetStartPoint, libs, "gsk_path_get_start_point")
1704 core.PuregoSafeRegister(&xPathGetStrokeBounds, libs, "gsk_path_get_stroke_bounds")
1705 core.PuregoSafeRegister(&xPathInFill, libs, "gsk_path_in_fill")
1706 core.PuregoSafeRegister(&xPathIsClosed, libs, "gsk_path_is_closed")
1707 core.PuregoSafeRegister(&xPathIsEmpty, libs, "gsk_path_is_empty")
1708 core.PuregoSafeRegister(&xPathPrint, libs, "gsk_path_print")
1709 core.PuregoSafeRegister(&xPathRef, libs, "gsk_path_ref")
1710 core.PuregoSafeRegister(&xPathToCairo, libs, "gsk_path_to_cairo")
1711 core.PuregoSafeRegister(&xPathToString, libs, "gsk_path_to_string")
1712 core.PuregoSafeRegister(&xPathUnref, libs, "gsk_path_unref")
1713
1714 core.PuregoSafeRegister(&xPathBuilderGLibType, libs, "gsk_path_builder_get_type")
1715
1716 core.PuregoSafeRegister(&xNewPathBuilder, libs, "gsk_path_builder_new")
1717
1718 core.PuregoSafeRegister(&xPathBuilderAddCairoPath, libs, "gsk_path_builder_add_cairo_path")
1719 core.PuregoSafeRegister(&xPathBuilderAddCircle, libs, "gsk_path_builder_add_circle")
1720 core.PuregoSafeRegister(&xPathBuilderAddLayout, libs, "gsk_path_builder_add_layout")
1721 core.PuregoSafeRegister(&xPathBuilderAddPath, libs, "gsk_path_builder_add_path")
1722 core.PuregoSafeRegister(&xPathBuilderAddRect, libs, "gsk_path_builder_add_rect")
1723 core.PuregoSafeRegister(&xPathBuilderAddReversePath, libs, "gsk_path_builder_add_reverse_path")
1724 core.PuregoSafeRegister(&xPathBuilderAddRoundedRect, libs, "gsk_path_builder_add_rounded_rect")
1725 core.PuregoSafeRegister(&xPathBuilderAddSegment, libs, "gsk_path_builder_add_segment")
1726 core.PuregoSafeRegister(&xPathBuilderArcTo, libs, "gsk_path_builder_arc_to")
1727 core.PuregoSafeRegister(&xPathBuilderClose, libs, "gsk_path_builder_close")
1728 core.PuregoSafeRegister(&xPathBuilderConicTo, libs, "gsk_path_builder_conic_to")
1729 core.PuregoSafeRegister(&xPathBuilderCubicTo, libs, "gsk_path_builder_cubic_to")
1730 core.PuregoSafeRegister(&xPathBuilderFreeToPath, libs, "gsk_path_builder_free_to_path")
1731 core.PuregoSafeRegister(&xPathBuilderGetCurrentPoint, libs, "gsk_path_builder_get_current_point")
1732 core.PuregoSafeRegister(&xPathBuilderHtmlArcTo, libs, "gsk_path_builder_html_arc_to")
1733 core.PuregoSafeRegister(&xPathBuilderLineTo, libs, "gsk_path_builder_line_to")
1734 core.PuregoSafeRegister(&xPathBuilderMoveTo, libs, "gsk_path_builder_move_to")
1735 core.PuregoSafeRegister(&xPathBuilderQuadTo, libs, "gsk_path_builder_quad_to")
1736 core.PuregoSafeRegister(&xPathBuilderRef, libs, "gsk_path_builder_ref")
1737 core.PuregoSafeRegister(&xPathBuilderRelArcTo, libs, "gsk_path_builder_rel_arc_to")
1738 core.PuregoSafeRegister(&xPathBuilderRelConicTo, libs, "gsk_path_builder_rel_conic_to")
1739 core.PuregoSafeRegister(&xPathBuilderRelCubicTo, libs, "gsk_path_builder_rel_cubic_to")
1740 core.PuregoSafeRegister(&xPathBuilderRelHtmlArcTo, libs, "gsk_path_builder_rel_html_arc_to")
1741 core.PuregoSafeRegister(&xPathBuilderRelLineTo, libs, "gsk_path_builder_rel_line_to")
1742 core.PuregoSafeRegister(&xPathBuilderRelMoveTo, libs, "gsk_path_builder_rel_move_to")
1743 core.PuregoSafeRegister(&xPathBuilderRelQuadTo, libs, "gsk_path_builder_rel_quad_to")
1744 core.PuregoSafeRegister(&xPathBuilderRelSvgArcTo, libs, "gsk_path_builder_rel_svg_arc_to")
1745 core.PuregoSafeRegister(&xPathBuilderSvgArcTo, libs, "gsk_path_builder_svg_arc_to")
1746 core.PuregoSafeRegister(&xPathBuilderToPath, libs, "gsk_path_builder_to_path")
1747 core.PuregoSafeRegister(&xPathBuilderUnref, libs, "gsk_path_builder_unref")
1748
1749 core.PuregoSafeRegister(&xPathMeasureGLibType, libs, "gsk_path_measure_get_type")
1750
1751 core.PuregoSafeRegister(&xNewPathMeasure, libs, "gsk_path_measure_new")
1752 core.PuregoSafeRegister(&xNewPathMeasureWithTolerance, libs, "gsk_path_measure_new_with_tolerance")
1753
1754 core.PuregoSafeRegister(&xPathMeasureGetLength, libs, "gsk_path_measure_get_length")
1755 core.PuregoSafeRegister(&xPathMeasureGetPath, libs, "gsk_path_measure_get_path")
1756 core.PuregoSafeRegister(&xPathMeasureGetPoint, libs, "gsk_path_measure_get_point")
1757 core.PuregoSafeRegister(&xPathMeasureGetTolerance, libs, "gsk_path_measure_get_tolerance")
1758 core.PuregoSafeRegister(&xPathMeasureRef, libs, "gsk_path_measure_ref")
1759 core.PuregoSafeRegister(&xPathMeasureUnref, libs, "gsk_path_measure_unref")
1760
1761 core.PuregoSafeRegister(&xStrokeGLibType, libs, "gsk_stroke_get_type")
1762
1763 core.PuregoSafeRegister(&xNewStroke, libs, "gsk_stroke_new")
1764
1765 core.PuregoSafeRegister(&xStrokeCopy, libs, "gsk_stroke_copy")
1766 core.PuregoSafeRegister(&xStrokeFree, libs, "gsk_stroke_free")
1767 core.PuregoSafeRegister(&xStrokeGetDash, libs, "gsk_stroke_get_dash")
1768 core.PuregoSafeRegister(&xStrokeGetDashOffset, libs, "gsk_stroke_get_dash_offset")
1769 core.PuregoSafeRegister(&xStrokeGetLineCap, libs, "gsk_stroke_get_line_cap")
1770 core.PuregoSafeRegister(&xStrokeGetLineJoin, libs, "gsk_stroke_get_line_join")
1771 core.PuregoSafeRegister(&xStrokeGetLineWidth, libs, "gsk_stroke_get_line_width")
1772 core.PuregoSafeRegister(&xStrokeGetMiterLimit, libs, "gsk_stroke_get_miter_limit")
1773 core.PuregoSafeRegister(&xStrokeSetDash, libs, "gsk_stroke_set_dash")
1774 core.PuregoSafeRegister(&xStrokeSetDashOffset, libs, "gsk_stroke_set_dash_offset")
1775 core.PuregoSafeRegister(&xStrokeSetLineCap, libs, "gsk_stroke_set_line_cap")
1776 core.PuregoSafeRegister(&xStrokeSetLineJoin, libs, "gsk_stroke_set_line_join")
1777 core.PuregoSafeRegister(&xStrokeSetLineWidth, libs, "gsk_stroke_set_line_width")
1778 core.PuregoSafeRegister(&xStrokeSetMiterLimit, libs, "gsk_stroke_set_miter_limit")
1779 core.PuregoSafeRegister(&xStrokeToCairo, libs, "gsk_stroke_to_cairo")
1780
1781 core.PuregoSafeRegister(&xTransformGLibType, libs, "gsk_transform_get_type")
1782
1783 core.PuregoSafeRegister(&xNewTransform, libs, "gsk_transform_new")
1784
1785 core.PuregoSafeRegister(&xTransformEqual, libs, "gsk_transform_equal")
1786 core.PuregoSafeRegister(&xTransformGetCategory, libs, "gsk_transform_get_category")
1787 core.PuregoSafeRegister(&xTransformInvert, libs, "gsk_transform_invert")
1788 core.PuregoSafeRegister(&xTransformMatrix, libs, "gsk_transform_matrix")
1789 core.PuregoSafeRegister(&xTransformMatrix2d, libs, "gsk_transform_matrix_2d")
1790 core.PuregoSafeRegister(&xTransformPerspective, libs, "gsk_transform_perspective")
1791 core.PuregoSafeRegister(&xTransformPrint, libs, "gsk_transform_print")
1792 core.PuregoSafeRegister(&xTransformRef, libs, "gsk_transform_ref")
1793 core.PuregoSafeRegister(&xTransformRotate, libs, "gsk_transform_rotate")
1794 core.PuregoSafeRegister(&xTransformRotate3d, libs, "gsk_transform_rotate_3d")
1795 core.PuregoSafeRegister(&xTransformScale, libs, "gsk_transform_scale")
1796 core.PuregoSafeRegister(&xTransformScale3d, libs, "gsk_transform_scale_3d")
1797 core.PuregoSafeRegister(&xTransformSkew, libs, "gsk_transform_skew")
1798 core.PuregoSafeRegister(&xTransformTo2d, libs, "gsk_transform_to_2d")
1799 core.PuregoSafeRegister(&xTransformTo2dComponents, libs, "gsk_transform_to_2d_components")
1800 core.PuregoSafeRegister(&xTransformToAffine, libs, "gsk_transform_to_affine")
1801 core.PuregoSafeRegister(&xTransformToMatrix, libs, "gsk_transform_to_matrix")
1802 core.PuregoSafeRegister(&xTransformToString, libs, "gsk_transform_to_string")
1803 core.PuregoSafeRegister(&xTransformToTranslate, libs, "gsk_transform_to_translate")
1804 core.PuregoSafeRegister(&xTransformTransform, libs, "gsk_transform_transform")
1805 core.PuregoSafeRegister(&xTransformTransformBounds, libs, "gsk_transform_transform_bounds")
1806 core.PuregoSafeRegister(&xTransformTransformPoint, libs, "gsk_transform_transform_point")
1807 core.PuregoSafeRegister(&xTransformTranslate, libs, "gsk_transform_translate")
1808 core.PuregoSafeRegister(&xTransformTranslate3d, libs, "gsk_transform_translate_3d")
1809 core.PuregoSafeRegister(&xTransformUnref, libs, "gsk_transform_unref")
1810
1811}