Expand description
§Rust GSK 4 bindings
The project website is here.
Rust bindings of GSK 4, part of gtk4-rs.
GSK is an intermediate layer that isolates GTK from the details of the OpenGL or Vulkan implementation.
§Minimum supported Rust version
Currently, the minimum supported Rust version is 1.83.
§Documentation
- The Rust API Stable/Development
- The C API
- GTK Installation instructions
§Using
We recommend using crates from crates.io, as demonstrated here.
If you want to track the bleeding edge, use the git dependency instead:
[dependencies]
gsk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gsk4" }Avoid mixing versioned and git crates like this:
# This will not compile
[dependencies]
gdk = {version = "0.1", package = "gdk4"}
gsk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gsk4" }§Features
| Feature | Description | 
|---|---|
| vulkan | Enable vulkanRenderer. Only if GTK is compiled with Vulkan support | 
| broadway | Enable broadwayRenderer. Only if GTK is compiled with Broadway support | 
| v4_20 | Enable the new APIs part of GTK 4.20 | 
| v4_18 | Enable the new APIs part of GTK 4.18 | 
| v4_16 | Enable the new APIs part of GTK 4.16 | 
| v4_14 | Enable the new APIs part of GTK 4.14 | 
| v4_10 | Enable the new APIs part of GTK 4.10 | 
| v4_6 | Enable the new APIs part of GTK 4.6 | 
| v4_4 | Enable the new APIs part of GTK 4.4 | 
| v4_2 | Enable the new APIs part of GTK 4.2 | 
§See Also
§License
The Rust bindings of gsk4 are available under the MIT License, please refer to it.
Re-exports§
Modules§
Structs§
- BlendNode 
- A render node applying a blending function between its two child nodes.
- BlurNode 
- A render node applying a blur effect to its single child.
- BorderNode 
- A render node for a border.
- BroadwayRenderer broadway
- A Broadway based renderer.
- CairoNode 
- A render node for a Cairo surface.
- CairoRenderer 
- Renders a GSK rendernode tree with cairo.
- ClipNode 
- A render node applying a rectangular clip to its single child node.
- ColorMatrix Node 
- A render node controlling the color matrix of its single child node.
- ColorNode 
- A render node for a solid color.
- ColorStop 
- A color stop in a gradient node.
- ComponentTransfer v4_20
- Specifies a transfer function for a color component to be applied while rendering.
- ComponentTransfer Node v4_20
- GLib type: Shared boxed type with reference counted clone semantics.
- ConicGradient Node 
- A render node for a conic gradient.
- ContainerNode 
- A render node that can contain other render nodes.
- CrossFade Node 
- A render node cross fading between two child nodes.
- DebugNode 
- A render node that emits a debugging message when drawing its child node.
- FillNode v4_14
- A render node filling the area given by PathandFillRulewith the child node.
- GLRendererv4_2
- Renders a GSK rendernode tree with OpenGL.
- GLShaderDeprecated 
- This feature was deprecated in GTK 4.16 after the new rendering infrastructure introduced in 4.14 did not support it. The lack of Vulkan integration would have made it a very hard feature to support. If you want to use OpenGL directly, you should look at GtkGLArea, which uses a different approach and is still well-supported. Implements a fragment shader using GLSL.
- GLShaderNode 
- A render node using a GL shader when drawing its children nodes.
- InsetShadow Node 
- A render node for an inset shadow.
- LinearGradient Node 
- A render node for a linear gradient.
- MaskNode v4_10
- A render node masking one child node with another.
- NglRendererv4_2
- A GL based renderer.
- OpacityNode 
- A render node controlling the opacity of its single child node.
- OutsetShadow Node 
- A render node for an outset shadow.
- ParseLocation 
- A location in a parse buffer.
- Pathv4_14
- Describes lines and curves that are more complex than simple rectangles.
- PathBuilder v4_14
- Constructs Pathobjects.
- PathForeach Flags v4_14
- Flags that can be passed to gsk_path_foreach() to influence what kinds of operations the path is decomposed into.
- PathMeasure v4_14
- Performs measurements on paths such as determining the length of the path.
- PathPoint v4_14
- Represents a point on a path.
- RadialGradient Node 
- A render node for a radial gradient.
- RenderNode 
- The basic block in a scene graph to be rendered using Renderer.
- Renderer
- Renders a scene graph defined via a tree of RenderNodeinstances.
- RepeatNode 
- A render node repeating its single child node.
- RepeatingLinear Gradient Node 
- A render node for a repeating linear gradient.
- RepeatingRadial Gradient Node 
- A render node for a repeating radial gradient.
- RoundedClip Node 
- A render node applying a rounded rectangle clip to its single child.
- RoundedRect 
- A rectangular region with rounded corners.
- ShaderArgs Builder 
- Builds the uniforms data for a GLShader.
- Shadow
- The shadow parameters in a shadow node.
- ShadowNode 
- A render node drawing one or more shadows behind its single child node.
- Strokev4_14
- Collects the parameters that are needed when stroking a path.
- StrokeNode v4_14
- A render node that will fill the area determined by stroking the the given
Pathusing theStrokeattributes.
- TextNode 
- A render node drawing a set of glyphs.
- TextureNode 
- A render node for a gdk::Texture.
- TextureScale Node v4_10
- A render node for a gdk::Texture, with control over scaling.
- Transform
- Describes a 3D transform.
- TransformNode 
- A render node applying a Transformto its single child node.
- VulkanRenderer vulkan
- Renders a GSK rendernode tree with Vulkan.
Enums§
- BlendMode 
- The blend modes available for render nodes.
- Corner
- The corner indices used by RoundedRect.
- FillRule v4_14
- Specifies how paths are filled.
- GLUniformType Deprecated 
- Defines the types of the uniforms that GskGLShadersdeclare.
- LineCapv4_14
- Specifies how to render the start and end points of contours or dashes when stroking.
- LineJoin v4_14
- Specifies how to render the junction of two lines when stroking.
- MaskMode v4_10
- The mask modes available for mask nodes.
- PathDirection v4_14
- Used to pick one of the four tangents at a given point on the path.
- PathIntersection v4_20
- The values of this enumeration classify intersections between paths.
- PathOperation v4_14
- Describes the segments of a Path.
- RenderNode Type 
- The type of a node determines what the node is rendering.
- ScalingFilter 
- The filters used when scaling texture data.
- SerializationError 
- Errors that can happen during (de)serialization.
- TransformCategory 
- The categories of matrices relevant for GSK and GTK.