gtk.snapshot

Module for [Snapshot] class

Types 3

classSnapshot : gdk.snapshot.Snapshot

[gtk.snapshot.Snapshot] assists in creating [gsk.render_node.RenderNode]s 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 [gtk.snapshot.Snapshot.pop] to change the current node.

The typical way to obtain a [gtk.snapshot.Snapshot] object is as an argument to the vfunc@Gtk.Widget.snapshot vfunc. If you need to create your own [gtk.snapshot.Snapshot], use [gtk.snapshot.Snapshot.new_].

Methods
GType _gType() @property
Snapshot self()Returns `this`, for use in `with` statements.
SnapshotGidBuilder builder()Get builder for [gtk.snapshot.Snapshot] Returns: New builder object
void appendBorder(gsk.rounded_rect.RoundedRect outline, float[] borderWidth, gdk.rgba.RGBA[] borderColor)Appends a stroked border rectangle inside the given outline.
cairo.context.Context appendCairo(graphene.rect.Rect bounds)Creates a new [gsk.cairo_node.CairoNode] and appends it to the current render node of snapshot, without changing the current node.
void appendColor(gdk.rgba.RGBA color, graphene.rect.Rect bounds)Creates a new render node drawing the color into the given bounds and appends it to the current render node of snapshot.
void appendFill(gsk.path.Path path, gsk.types.FillRule fillRule, gdk.rgba.RGBA color)A convenience method to fill a path with a color.
void appendInsetShadow(gsk.rounded_rect.RoundedRect outline, gdk.rgba.RGBA color, float dx, float dy, float spread, float blurRadius)Appends an inset shadow into the box given by outline.
void appendNode(gsk.render_node.RenderNode node)Appends node to the current render node of snapshot, without changing the current node.
void appendOutsetShadow(gsk.rounded_rect.RoundedRect outline, gdk.rgba.RGBA color, float dx, float dy, float spread, float blurRadius)Appends an outset shadow node around the box given by outline.
void appendScaledTexture(gdk.texture.Texture texture, gsk.types.ScalingFilter filter, graphene.rect.Rect bounds)Creates a new render node drawing the texture into the given bounds and appends it to the current render node of snapshot.
void appendStroke(gsk.path.Path path, gsk.stroke.Stroke stroke, gdk.rgba.RGBA color)A convenience method to stroke a path with a color.
void appendTexture(gdk.texture.Texture texture, graphene.rect.Rect bounds)Creates a new render node drawing the texture into the given bounds and appends it to the current render node of snapshot.
void glShaderPopTexture()Removes the top element from the stack of render nodes and adds it to the nearest [gsk.glshader_node.GLShaderNode] below it.
void perspective(float depth)Applies a perspective projection transform.
void pop()Removes the top element from the stack of render nodes, and appends it to the node underneath it.
void pushBlend(gsk.types.BlendMode blendMode)Blends together two images with the given blend mode.
void pushBlur(double radius)Blurs an image.
void pushClip(graphene.rect.Rect bounds)Clips an image to a rectangle.
void pushColorMatrix(graphene.matrix.Matrix colorMatrix, graphene.vec4.Vec4 colorOffset)Modifies the colors of an image by applying an affine transformation in RGB space.
void pushCrossFade(double progress)Snapshots a cross-fade operation between two images with the given progress.
void pushFill(gsk.path.Path path, gsk.types.FillRule fillRule)Fills the area given by path and fill_rule with an image and discards everything outside of it.
void pushGlShader(gsk.glshader.GLShader shader, graphene.rect.Rect bounds, glib.bytes.Bytes takeArgs)Push a [gsk.glshader_node.GLShaderNode].
void pushMask(gsk.types.MaskMode maskMode)Until the first call to [gtk.snapshot.Snapshot.pop], the mask image for the mask operation will be recorded.
void pushOpacity(double opacity)Modifies the opacity of an image.
void pushRepeat(graphene.rect.Rect bounds, graphene.rect.Rect childBounds = null)Creates a node that repeats the child node.
void pushRoundedClip(gsk.rounded_rect.RoundedRect bounds)Clips an image to a rounded rectangle.
void pushStroke(gsk.path.Path path, gsk.stroke.Stroke stroke)Strokes the given path with the attributes given by stroke and an image.
void renderBackground(gtk.style_context.StyleContext context, double x, double y, double width, double height)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.
void renderFocus(gtk.style_context.StyleContext context, double x, double y, double width, double height)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.
void renderFrame(gtk.style_context.StyleContext context, double x, double y, double width, double height)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.
void renderInsertionCursor(gtk.style_context.StyleContext context, double x, double y, pango.layout.Layout layout, int index, pango.types.Direction direction)Draws a text caret using snapshot at the specified index of layout.
void renderLayout(gtk.style_context.StyleContext context, double x, double y, pango.layout.Layout layout)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.
void restore()Restores snapshot to the state saved by a preceding call to [gtk.snapshot.Snapshot.save] and removes that state from the stack of saved states.
void rotate(float angle)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 coor...
void rotate3d(float angle, graphene.vec3.Vec3 axis)Rotates snapshot's coordinate system by angle degrees around axis.
void save()Makes a copy of the current state of snapshot and saves it on an internal stack.
void scale(float factorX, float factorY)Scales snapshot's coordinate system in 2-dimensional space by the given factors.
void scale3d(float factorX, float factorY, float factorZ)Scales snapshot's coordinate system by the given factors.
gsk.render_node.RenderNode toNode()Returns the render node that was constructed by snapshot.
gdk.paintable.Paintable toPaintable(graphene.size.Size size)Returns a paintable encapsulating the render node that was constructed by snapshot.
void transform(gsk.transform.Transform transform = null)Transforms snapshot's coordinate system with the given transform.
void transformMatrix(graphene.matrix.Matrix matrix)Transforms snapshot's coordinate system with the given matrix.
void translate(graphene.point.Point point)Translates snapshot's coordinate system by point in 2-dimensional space.
void translate3d(graphene.point3_d.Point3D point)Translates snapshot's coordinate system by point.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [gtk.snapshot.Snapshot]. Returns: a newly-allocated [gtk.snapshot.Snapshot]

Fluent builder for [gtk.snapshot.Snapshot]

Methods
Snapshot build()