// Package gsk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gsk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/graphene" ) // Type of the callback to iterate through the operations of a path. // // For each operation, the callback is given the @op itself, the points // that the operation is applied to in @pts, and a @weight for conic // curves. The @n_pts argument is somewhat redundant, since the number // of points can be inferred from the operation. // // Each contour of the path starts with a @GSK_PATH_MOVE operation. // Closed contours end with a @GSK_PATH_CLOSE operation. type PathForeachFunc func(PathOperation, []graphene.Point, uint, float32, uintptr) bool // Prototype of the callback to iterate through the // intersections of two paths. type PathIntersectionFunc func(*Path, *PathPoint, *Path, *PathPoint, PathIntersection, uintptr) bool // Flags that can be passed to gsk_path_foreach() to influence what // kinds of operations the path is decomposed into. // // By default, [method@Gsk.Path.foreach] will only emit a path with all // operations flattened to straight lines to allow for maximum compatibility. // The only operations emitted will be `GSK_PATH_MOVE`, `GSK_PATH_LINE` and // `GSK_PATH_CLOSE`. type PathForeachFlags int var xPathForeachFlagsGLibType func() types.GType func PathForeachFlagsGLibType() types.GType { return xPathForeachFlagsGLibType() } const ( // The default behavior, only allow lines. PathForeachAllowOnlyLinesValue PathForeachFlags = 0 // Allow emission of `GSK_PATH_QUAD` operations PathForeachAllowQuadValue PathForeachFlags = 1 // Allow emission of `GSK_PATH_CUBIC` operations. PathForeachAllowCubicValue PathForeachFlags = 2 // Allow emission of `GSK_PATH_CONIC` operations. PathForeachAllowConicValue PathForeachFlags = 4 ) // The values of this enumeration classify intersections // between paths. type PathIntersection int var xPathIntersectionGLibType func() types.GType func PathIntersectionGLibType() types.GType { return xPathIntersectionGLibType() } const ( // No intersection PathIntersectionNoneValue PathIntersection = 0 // A normal intersection, where the two paths // cross each other PathIntersectionNormalValue PathIntersection = 1 // The start of a segment where the two paths coincide PathIntersectionStartValue PathIntersection = 2 // The end of a segment where the two paths coincide PathIntersectionEndValue PathIntersection = 3 ) var xPathParse func(string) *Path // Constructs a path from a serialized form. // // The string is expected to be in (a superset of) // [SVG path syntax](https://www.w3.org/TR/SVG11/paths.html#PathData), // as e.g. produced by [method@Gsk.Path.to_string]. // // A high-level summary of the syntax: // // - `M x y` Move to `(x, y)` // - `L x y` Add a line from the current point to `(x, y)` // - `Q x1 y1 x2 y2` Add a quadratic Bézier from the current point to `(x2, y2)`, with control point `(x1, y1)` // - `C x1 y1 x2 y2 x3 y3` Add a cubic Bézier from the current point to `(x3, y3)`, with control points `(x1, y1)` and `(x2, y2)` // - `Z` Close the contour by drawing a line back to the start point // - `H x` Add a horizontal line from the current point to the given x value // - `V y` Add a vertical line from the current point to the given y value // - `T x2 y2` Add a quadratic Bézier, using the reflection of the previous segments' control point as control point // - `S x2 y2 x3 y3` Add a cubic Bézier, using the reflection of the previous segments' second control point as first control point // - `A rx ry r l s x y` Add an elliptical arc from the current point to `(x, y)` with radii rx and ry. See the SVG documentation for how the other parameters influence the arc. // - `O x1 y1 x2 y2 w` Add a rational quadratic Bézier from the current point to `(x2, y2)` with control point `(x1, y1)` and weight `w`. // // All the commands have lowercase variants that interpret coordinates // relative to the current point. // // The `O` command is an extension that is not supported in SVG. func PathParse(StringVar string) *Path { cret := xPathParse(StringVar) return cret } func init() { core.SetPackageName("GSK", "gtk4") core.SetSharedLibraries("GSK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GSK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xPathForeachFlagsGLibType, libs, "gsk_path_foreach_flags_get_type") core.PuregoSafeRegister(&xPathIntersectionGLibType, libs, "gsk_path_intersection_get_type") core.PuregoSafeRegister(&xPathParse, libs, "gsk_path_parse") }