Snapshot

open class Snapshot(val gtkSnapshotPointer: <Error class: unknown class><<Error class: unknown class>>)

GtkSnapshot assists in creating class@Gsk.RenderNodes for widgets.

It functions in a similar way to a cairo context, and maintains a stack of render nodes and their associated transformations.

The node at the top of the stack is the one that gtk_snapshot_append_…() functions operate on. Use the gtk_snapshot_push_…() functions and method@Snapshot.pop to change the current node.

The typical way to obtain a GtkSnapshot object is as an argument to the vfunc@Gtk.Widget.snapshot vfunc. If you need to create your own GtkSnapshot, use ctor@Gtk.Snapshot.new.

Skipped during bindings generation

  • parameter border_width: Array parameter of type gfloat is not supported

  • parameter stops: Array parameter of type Gsk.ColorStop is not supported

  • parameter stops: Array parameter of type Gsk.ColorStop is not supported

  • parameter stops: Array parameter of type Gsk.ColorStop is not supported

  • parameter stops: Array parameter of type Gsk.ColorStop is not supported

  • parameter stops: Array parameter of type Gsk.ColorStop is not supported

  • method push_debug: Varargs parameter is not supported

  • parameter shadow: Array parameter of type Gsk.Shadow is not supported

Constructors

Link copied to clipboard
constructor()

Creates a new GtkSnapshot.

constructor(gtkSnapshotPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gtkSnapshotPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun appendCairo(bounds: <Error class: unknown class>): <Error class: unknown class>

Creates a new class@Gsk.CairoNode and appends it to the current render node of @snapshot, without changing the current node.

Link copied to clipboard
open fun appendColor(color: <Error class: unknown class>, bounds: <Error class: unknown class>)

Creates a new render node drawing the @color into the given @bounds and appends it to the current render node of @snapshot.

Link copied to clipboard
open fun appendFill(path: <Error class: unknown class>, fillRule: <Error class: unknown class>, color: <Error class: unknown class>)

A convenience method to fill a path with a color.

Link copied to clipboard
open fun appendInsetShadow(outline: <Error class: unknown class>, color: <Error class: unknown class>, dx: <Error class: unknown class>, dy: <Error class: unknown class>, spread: <Error class: unknown class>, blurRadius: <Error class: unknown class>)

Appends an inset shadow into the box given by @outline.

Link copied to clipboard
open fun appendLayout(layout: <Error class: unknown class>, color: <Error class: unknown class>)

Creates render nodes for rendering @layout in the given foregound @color and appends them to the current node of @snapshot without changing the current node. The current theme's foreground color for a widget can be obtained with method@Gtk.Widget.get_color.

Link copied to clipboard
open fun appendNode(node: <Error class: unknown class>)

Appends @node to the current render node of @snapshot, without changing the current node.

Link copied to clipboard
open fun appendOutsetShadow(outline: <Error class: unknown class>, color: <Error class: unknown class>, dx: <Error class: unknown class>, dy: <Error class: unknown class>, spread: <Error class: unknown class>, blurRadius: <Error class: unknown class>)

Appends an outset shadow node around the box given by @outline.

Link copied to clipboard
open fun appendScaledTexture(texture: <Error class: unknown class>, filter: <Error class: unknown class>, bounds: <Error class: unknown class>)

Creates a new render node drawing the @texture into the given @bounds and appends it to the current render node of @snapshot.

Link copied to clipboard
open fun appendStroke(path: <Error class: unknown class>, stroke: <Error class: unknown class>, color: <Error class: unknown class>)

A convenience method to stroke a path with a color.

Link copied to clipboard
open fun appendTexture(texture: <Error class: unknown class>, bounds: <Error class: unknown class>)

Creates a new render node drawing the @texture into the given @bounds and appends it to the current render node of @snapshot.

Link copied to clipboard
open fun freeToNode(): <Error class: unknown class>?

Returns the node that was constructed by @snapshot and frees @snapshot.

Link copied to clipboard
open fun freeToPaintable(size: <Error class: unknown class>? = null): <Error class: unknown class>?

Returns a paintable for the node that was constructed by @snapshot and frees @snapshot.

Link copied to clipboard

Removes the top element from the stack of render nodes and adds it to the nearest class@Gsk.GLShaderNode below it.

Link copied to clipboard
open fun perspective(depth: <Error class: unknown class>)

Applies a perspective projection transform.

Link copied to clipboard
open fun pop()

Removes the top element from the stack of render nodes, and appends it to the node underneath it.

Link copied to clipboard
open fun pushBlend(blendMode: <Error class: unknown class>)

Blends together two images with the given blend mode.

Link copied to clipboard
open fun pushBlur(radius: <Error class: unknown class>)

Blurs an image.

Link copied to clipboard
open fun pushClip(bounds: <Error class: unknown class>)

Clips an image to a rectangle.

Link copied to clipboard
open fun pushColorMatrix(colorMatrix: <Error class: unknown class>, colorOffset: <Error class: unknown class>)

Modifies the colors of an image by applying an affine transformation in RGB space.

Link copied to clipboard
open fun pushCrossFade(progress: <Error class: unknown class>)

Snapshots a cross-fade operation between two images with the given @progress.

Link copied to clipboard
open fun pushFill(path: <Error class: unknown class>, fillRule: <Error class: unknown class>)

Fills the area given by @path and @fill_rule with an image and discards everything outside of it.

Link copied to clipboard
open fun pushGlShader(shader: <Error class: unknown class>, bounds: <Error class: unknown class>, takeArgs: <Error class: unknown class>)

Push a class@Gsk.GLShaderNode.

Link copied to clipboard
open fun pushMask(maskMode: <Error class: unknown class>)

Until the first call to method@Gtk.Snapshot.pop, the mask image for the mask operation will be recorded.

Link copied to clipboard
open fun pushOpacity(opacity: <Error class: unknown class>)

Modifies the opacity of an image.

Link copied to clipboard
open fun pushRepeat(bounds: <Error class: unknown class>, childBounds: <Error class: unknown class>? = null)

Creates a node that repeats the child node.

Link copied to clipboard
open fun pushRoundedClip(bounds: <Error class: unknown class>)

Clips an image to a rounded rectangle.

Link copied to clipboard
open fun pushStroke(path: <Error class: unknown class>, stroke: <Error class: unknown class>)

Strokes the given @path with the attributes given by @stroke and an image.

Link copied to clipboard
open fun renderBackground(context: StyleContext, x: <Error class: unknown class>, y: <Error class: unknown class>, width: <Error class: unknown class>, height: <Error class: unknown class>)

Creates a render node for the CSS background according to @context, and appends it to the current node of @snapshot, without changing the current node.

Link copied to clipboard
open fun renderFocus(context: StyleContext, x: <Error class: unknown class>, y: <Error class: unknown class>, width: <Error class: unknown class>, height: <Error class: unknown class>)

Creates a render node for the focus outline according to @context, and appends it to the current node of @snapshot, without changing the current node.

Link copied to clipboard
open fun renderFrame(context: StyleContext, x: <Error class: unknown class>, y: <Error class: unknown class>, width: <Error class: unknown class>, height: <Error class: unknown class>)

Creates a render node for the CSS border according to @context, and appends it to the current node of @snapshot, without changing the current node.

Link copied to clipboard
open fun renderInsertionCursor(context: StyleContext, x: <Error class: unknown class>, y: <Error class: unknown class>, layout: <Error class: unknown class>, index: <Error class: unknown class>, direction: <Error class: unknown class>)

Draws a text caret using @snapshot at the specified index of @layout.

Link copied to clipboard
open fun renderLayout(context: StyleContext, x: <Error class: unknown class>, y: <Error class: unknown class>, layout: <Error class: unknown class>)

Creates a render node for rendering @layout according to the style information in @context, and appends it to the current node of @snapshot, without changing the current node.

Link copied to clipboard
open fun restore()

Restores @snapshot to the state saved by a preceding call to method@Snapshot.save and removes that state from the stack of saved states.

Link copied to clipboard
open fun rotate(angle: <Error class: unknown class>)

Rotates @@snapshot's coordinate system by @angle degrees in 2D space - or in 3D speak, rotates around the Z axis. The rotation happens around the origin point of (0, 0) in the @snapshot's current coordinate system.

Link copied to clipboard
open fun rotate3d(angle: <Error class: unknown class>, axis: <Error class: unknown class>)

Rotates @snapshot's coordinate system by @angle degrees around @axis.

Link copied to clipboard
open fun save()

Makes a copy of the current state of @snapshot and saves it on an internal stack.

Link copied to clipboard
open fun scale(factorX: <Error class: unknown class>, factorY: <Error class: unknown class>)

Scales @snapshot's coordinate system in 2-dimensional space by the given factors.

Link copied to clipboard
open fun scale3d(factorX: <Error class: unknown class>, factorY: <Error class: unknown class>, factorZ: <Error class: unknown class>)

Scales @snapshot's coordinate system by the given factors.

Link copied to clipboard
open fun toNode(): <Error class: unknown class>?

Returns the render node that was constructed by @snapshot.

Link copied to clipboard
open fun toPaintable(size: <Error class: unknown class>? = null): <Error class: unknown class>?

Returns a paintable encapsulating the render node that was constructed by @snapshot.

Link copied to clipboard
open fun transform(transform: <Error class: unknown class>? = null)

Transforms @snapshot's coordinate system with the given @transform.

Link copied to clipboard
open fun transformMatrix(matrix: <Error class: unknown class>)

Transforms @snapshot's coordinate system with the given @matrix.

Link copied to clipboard
open fun translate(point: <Error class: unknown class>)

Translates @snapshot's coordinate system by @point in 2-dimensional space.

Link copied to clipboard
open fun translate3d(point: <Error class: unknown class>)

Translates @snapshot's coordinate system by @point.