Crate gsk4

Source
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.80.

§Documentation

§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

FeatureDescription
vulkanEnable vulkan Renderer. Only if GTK is compiled with Vulkan support
broadwayEnable broadway Renderer. Only if GTK is compiled with Broadway support
v4_18Enable the new APIs part of GTK 4.18
v4_16Enable the new APIs part of GTK 4.16
v4_14Enable the new APIs part of GTK 4.14
v4_10Enable the new APIs part of GTK 4.10
v4_6Enable the new APIs part of GTK 4.6
v4_4Enable the new APIs part of GTK 4.4
v4_2Enable 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§

pub use cairo;
pub use gdk;
pub use glib;
pub use graphene;
pub use gsk4_sys as ffi;
pub use pango;

Modules§

builders
Builder pattern types.
prelude
Traits intended for blanket imports.

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.
BroadwayRendererbroadway
A Broadway based renderer.
CairoNode
A render node for a Cairo surface.
CairoRenderer
A GSK renderer that is using cairo.
ClipNode
A render node applying a rectangular clip to its single child node.
ColorMatrixNode
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.
ConicGradientNode
A render node for a conic gradient.
ContainerNode
A render node that can contain other render nodes.
CrossFadeNode
A render node cross fading between two child nodes.
DebugNode
A render node that emits a debugging message when drawing its child node.
FillNodev4_14
A render node filling the area given by Path and FillRule with the child node.
GLRendererv4_2
A GL based renderer.
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. A GLShader is a snippet of GLSL that is meant to run in the fragment shader of the rendering pipeline.
GLShaderNode
A render node using a GL shader when drawing its children nodes.
InsetShadowNode
A render node for an inset shadow.
LinearGradientNode
A render node for a linear gradient.
MaskNodev4_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.
OutsetShadowNode
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.
PathBuilderv4_14
Constructs Path objects.
PathForeachFlagsv4_14
Flags that can be passed to gsk_path_foreach() to influence what kinds of operations the path is decomposed into.
PathMeasurev4_14
Performs measurements on paths such as determining the length of the path.
PathPointv4_14
An opaque type representing a point on a path.
RadialGradientNode
A render node for a radial gradient.
RenderNode
RenderNode is the basic block in a scene graph to be rendered using Renderer.
Renderer
A class that renders a scene graph defined via a tree of RenderNode instances.
RepeatNode
A render node repeating its single child node.
RepeatingLinearGradientNode
A render node for a repeating linear gradient.
RepeatingRadialGradientNode
A render node for a repeating radial gradient.
RoundedClipNode
A render node applying a rounded rectangle clip to its single child.
RoundedRect
A rectangular region with rounded corners.
ShaderArgsBuilder
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.
StrokeNodev4_14
A render node that will fill the area determined by stroking the the given Path using the Stroke attributes.
TextNode
A render node drawing a set of glyphs.
TextureNode
A render node for a gdk::Texture.
TextureScaleNodev4_10
A render node for a gdk::Texture, with control over scaling.
Transform
Describes a 3D transform.
TransformNode
A render node applying a Transform to its single child node.
VulkanRenderervulkan
A GSK renderer that is using Vulkan.

Enums§

BlendMode
The blend modes available for render nodes.
Corner
The corner indices used by RoundedRect.
FillRulev4_14
Specifies how paths are filled.
GLUniformTypeDeprecated
Defines the types of the uniforms that GskGLShaders declare.
LineCapv4_14
Specifies how to render the start and end points of contours or dashes when stroking.
LineJoinv4_14
Specifies how to render the junction of two lines when stroking.
MaskModev4_10
The mask modes available for mask nodes.
PathDirectionv4_14
Used to pick one of the four tangents at a given point on the path.
PathOperationv4_14
Describes the segments of a Path.
RenderNodeType
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.