1.182 <GtkSnapshot>

Class: <GtkSnapshot>

It derives from <GdkSnapshot>.

Assists in creating <GskRenderNode>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 Snapshot.pop to change the current node.

The typical way to obtain a <GtkSnapshot> object is as an argument to the widget:do-snapshot vfunc. If you need to create your own <GtkSnapshot>, use snapshot:new.

Note that <GtkSnapshot> applies some optimizations, so the node it produces may not match the API calls 1:1. For example, it will omit clip nodes if the child node is entirely contained within the clip rectangle.

Procedures

Method: snapshot:append-border self outline border-width border-color
Method: append-border self outline border-width border-color

Appends a stroked border rectangle inside the given outline.

The four sides of the border can have different widths and colors.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

outline

Passed: a <GskRoundedRect>.

the outline of the border

border-width

Passed: a f32vector, or a list or vector, each a real number.

the stroke width of the border on the top, right, bottom and left side respectively.

border-color

Passed: a list or vector, each a <GdkRGBA>.

the color used on the top, right, bottom and left side.

Method: snapshot:append-cairo self bounds ⇒ %return
Method: append-cairo self bounds ⇒ %return

Creates a new <GskCairoNode> and appends it to the current render node of self, without changing the current node.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the bounds for the new node

%return

Returned: a <CairoContext>.

a <CairoContext> suitable for drawing the contents of the newly created render node

Method: snapshot:append-color self color bounds
Method: append-color self color bounds

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

You should try to avoid calling this function if color is transparent.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

color

Passed: a <GdkRGBA>.

the color to draw

bounds

Passed: a <GrapheneRect>.

the bounds for the new node

Method: snapshot:append-conic-gradient self bounds center rotation stops
Method: append-conic-gradient self bounds center rotation stops

Appends a conic gradient node with the given stops to self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to render the gradient into

center

Passed: a <GraphenePoint>.

the center point of the conic gradient

rotation

Passed: a real number.

the clockwise rotation in degrees of the starting angle. 0 means the starting angle is the top.

stops

Passed: a list or vector, each a <GskColorStop>.

the color stops defining the gradient

n-stops

Not passed: guile-gi gives the length of stops.

the number of elements in stops

Method: snapshot:append-fill self path fill-rule color
Method: append-fill self path fill-rule color

A convenience method to fill a path with a color.

See snapshot:push-fill if you need to fill a path with more complex content than a color.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

path

Passed: a <GskPath>.

The path describing the area to fill

fill-rule

Passed: a <GskFillRule>, or one of its symbols.

The fill rule to use

color

Passed: a <GdkRGBA>.

the color to fill the path with

Method: snapshot:append-inset-shadow self outline color dx dy spread blur-radius
Method: append-inset-shadow self outline color dx dy spread blur-radius

Appends an inset shadow into the box given by outline.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

outline

Passed: a <GskRoundedRect>.

outline of the region surrounded by shadow

color

Passed: a <GdkRGBA>.

color of the shadow

dx

Passed: a real number.

horizontal offset of shadow

dy

Passed: a real number.

vertical offset of shadow

spread

Passed: a real number.

how far the shadow spreads towards the inside

blur-radius

Passed: a real number.

how much blur to apply to the shadow

Method: snapshot:append-layout self layout color
Method: append-layout self layout color

Creates render nodes for rendering layout in the given foregound color and appends them to the current node of self without changing the current node. The current theme’s foreground color for a widget can be obtained with widget:get-color!.

Note that if the layout does not produce any visible output, then nodes may not be added to the self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

layout

Passed: a <PangoLayout>.

the <PangoLayout> to render

color

Passed: a <GdkRGBA>.

the foreground color to render the layout in

Method: snapshot:append-linear-gradient self bounds start-point end-point stops
Method: append-linear-gradient self bounds start-point end-point stops

Appends a linear gradient node with the given stops to self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to render the linear gradient into

start-point

Passed: a <GraphenePoint>.

the point at which the linear gradient will begin

end-point

Passed: a <GraphenePoint>.

the point at which the linear gradient will finish

stops

Passed: a list or vector, each a <GskColorStop>.

the color stops defining the gradient

n-stops

Not passed: guile-gi gives the length of stops.

the number of elements in stops

Method: snapshot:append-node self node
Method: append-node self node

Appends node to the current render node of self, without changing the current node.

If self does not have a current node yet, node will become the initial node.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

node

Passed: a <GskRenderNode>.

a <GskRenderNode>

Method: snapshot:append-outset-shadow self outline color dx dy spread blur-radius
Method: append-outset-shadow self outline color dx dy spread blur-radius

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

outline

Passed: a <GskRoundedRect>.

outline of the region surrounded by shadow

color

Passed: a <GdkRGBA>.

color of the shadow

dx

Passed: a real number.

horizontal offset of shadow

dy

Passed: a real number.

vertical offset of shadow

spread

Passed: a real number.

how far the shadow spreads towards the outside

blur-radius

Passed: a real number.

how much blur to apply to the shadow

Method: snapshot:append-paste self bounds nth
Method: append-paste self bounds nth

Creates a new render node that pastes the contents copied by a previous call to snapshot:push-copy

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the bounds for the new node

nth

Passed: an unsigned 64-bit integer.

the index of the copy, with 0 being the latest copy, 1 being the copy before that, and so on.

Method: snapshot:append-radial-gradient self bounds center hradius vradius start end stops
Method: append-radial-gradient self bounds center hradius vradius start end stops

Appends a radial gradient node with the given stops to self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to render the readial gradient into

center

Passed: a <GraphenePoint>.

the center point for the radial gradient

hradius

Passed: a real number.

the horizontal radius

vradius

Passed: a real number.

the vertical radius

start

Passed: a real number.

the start position (on the horizontal axis)

end

Passed: a real number.

the end position (on the horizontal axis)

stops

Passed: a list or vector, each a <GskColorStop>.

the color stops defining the gradient

n-stops

Not passed: guile-gi gives the length of stops.

the number of elements in stops

Method: snapshot:append-repeating-linear-gradient self bounds start-point end-point stops
Method: append-repeating-linear-gradient self bounds start-point end-point stops

Appends a repeating linear gradient node with the given stops to self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to render the linear gradient into

start-point

Passed: a <GraphenePoint>.

the point at which the linear gradient will begin

end-point

Passed: a <GraphenePoint>.

the point at which the linear gradient will finish

stops

Passed: a list or vector, each a <GskColorStop>.

the color stops defining the gradient

n-stops

Not passed: guile-gi gives the length of stops.

the number of elements in stops

Method: snapshot:append-repeating-radial-gradient self bounds center hradius vradius start end stops
Method: append-repeating-radial-gradient self bounds center hradius vradius start end stops

Appends a repeating radial gradient node with the given stops to self.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to render the readial gradient into

center

Passed: a <GraphenePoint>.

the center point for the radial gradient

hradius

Passed: a real number.

the horizontal radius

vradius

Passed: a real number.

the vertical radius

start

Passed: a real number.

the start position (on the horizontal axis)

end

Passed: a real number.

the end position (on the horizontal axis)

stops

Passed: a list or vector, each a <GskColorStop>.

the color stops defining the gradient

n-stops

Not passed: guile-gi gives the length of stops.

the number of elements in stops

Method: snapshot:append-scaled-texture self texture filter bounds
Method: append-scaled-texture self texture filter bounds

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

In contrast to snapshot:append-texture, this function provides control about how the filter that is used when scaling.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

texture

Passed: a <GdkTexture>.

the texture to render

filter

Passed: a <GskScalingFilter>, or one of its symbols.

the filter to use

bounds

Passed: a <GrapheneRect>.

the bounds for the new node

Method: snapshot:append-stroke self path stroke color
Method: append-stroke self path stroke color

A convenience method to stroke a path with a color.

See snapshot:push-stroke if you need to stroke a path with more complex content than a color.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

path

Passed: a <GskPath>.

The path describing the area to fill

stroke

Passed: a <GskStroke>.

The stroke attributes

color

Passed: a <GdkRGBA>.

the color to fill the path with

Method: snapshot:append-texture self texture bounds
Method: append-texture self texture bounds

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

If the texture needs to be scaled to fill bounds, linear filtering is used. See snapshot:append-scaled-texture if you need other filtering, such as nearest-neighbour.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

texture

Passed: a <GdkTexture>.

the texture to render

bounds

Passed: a <GrapheneRect>.

the bounds for the new node

Method: snapshot:gl-shader-pop-texture self
Method: gl-shader-pop-texture self

Removes the top element from the stack of render nodes and adds it to the nearest <GskGLShaderNode> below it.

This must be called the same number of times as the number of textures is needed for the shader in snapshot:push-gl-shader.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

Procedure: snapshot:new ⇒ %return

Creates a new <GtkSnapshot>.

%return

Returned: a <GtkSnapshot>.

a newly-allocated <GtkSnapshot>

Method: snapshot:perspective self depth
Method: perspective self depth

Applies a perspective projection transform.

See transform:perspective for a discussion on the details.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

depth

Passed: a real number.

distance of the z=0 plane

Method: snapshot:pop self
Method: pop self

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

Method: snapshot:push-blend self blend-mode
Method: push-blend self blend-mode

Blends together two images with the given blend mode.

Until the first call to snapshot:pop, the bottom image for the blend operation will be recorded. After that call, the top image to be blended will be recorded until the second call to snapshot:pop.

Calling this function requires two subsequent calls to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

blend-mode

Passed: a <GskBlendMode>, or one of its symbols.

blend mode to use

Method: snapshot:push-blur self radius
Method: push-blur self radius

Blurs an image.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

radius

Passed: a real number.

the blur radius to use. Must be positive

Method: snapshot:push-clip self bounds
Method: push-clip self bounds

Clips an image to a rectangle.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the rectangle to clip to

Method: snapshot:push-color-matrix self color-matrix color-offset
Method: push-color-matrix self color-matrix color-offset

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

In particular, the colors will be transformed by applying

pixel = transpose(color_matrix) * pixel + color_offset

for every pixel. The transformation operates on unpremultiplied colors, with color components ordered R, G, B, A.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

color-matrix

Passed: a <GrapheneMatrix>.

the color matrix to use

color-offset

Passed: a <GrapheneVec4>.

the color offset to use

Method: snapshot:push-component-transfer self red green blue alpha
Method: push-component-transfer self red green blue alpha

Modifies the colors of an image by applying a transfer function for each component.

The transfer functions operate on unpremultiplied colors.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

red

Passed: a <GskComponentTransfer>.

the transfer for the red component

green

Passed: a <GskComponentTransfer>.

the transfer for the green component

blue

Passed: a <GskComponentTransfer>.

the transfer for the blue component

alpha

Passed: a <GskComponentTransfer>.

the transfer for the alpha component

Method: snapshot:push-composite self op
Method: push-composite self op

Until the first call to snapshot:pop, the mask image for the mask operation will be recorded.

After that call, the child image will be recorded until the second call to snapshot:pop.

Calling this function requires 2 subsequent calls to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

op

Passed: a <GskPorterDuff>, or one of its symbols.

The Porter/Duff compositing operator to use

Method: snapshot:push-copy self
Method: push-copy self

Stores the current rendering state for later pasting via snapshot:append-paste.

Pasting is possible until the matching call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

Method: snapshot:push-cross-fade self progress
Method: push-cross-fade self progress

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

Until the first call to snapshot:pop, the start image will be snapshot. After that call, the end image will be recorded until the second call to snapshot:pop.

Calling this function requires two subsequent calls to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

progress

Passed: a real number.

progress between 0.0 and 1.0

Method: snapshot:push-fill self path fill-rule
Method: push-fill self path fill-rule

Fills the area given by path and fill-rule with an image and discards everything outside of it.

The image is recorded until the next call to snapshot:pop.

If you want to fill the path with a color, snapshot:append-fill than rendering new ones, use snapshot:append-fill may be more convenient.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

path

Passed: a <GskPath>.

The path describing the area to fill

fill-rule

Passed: a <GskFillRule>, or one of its symbols.

The fill rule to use

Method: snapshot:push-gl-shader self shader bounds take-args
Method: push-gl-shader self shader bounds take-args

Push a <GskGLShaderNode>.

The node uses the given <GskGLShader> and uniform values Additionally this takes a list of n-children other nodes which will be passed to the <GskGLShaderNode>.

The take-args argument is a block of data to use for uniform arguments, as per types and offsets defined by the shader. Normally this is generated by Gsk.GLShader.format_args or <GskShaderArgsBuilder>.

The snapshotter takes ownership of take-args, so the caller should not free it after this.

If the renderer doesn’t support GL shaders, or if there is any problem when compiling the shader, then the node will draw pink. You should use Gsk.GLShader.compile to ensure the shader will work for the renderer before using it.

If the shader requires textures (see Gsk.GLShader.get_n_textures), then it is expected that you call snapshot:gl-shader-pop-texture the number of times that are required. Each of these calls will generate a node that is added as a child to the <GskGLShaderNode>, which in turn will render these offscreen and pass as a texture to the shader.

Once all textures (if any) are pop:ed, you must call the regular snapshot:pop.

If you want to use pre-existing textures as input to the shader rather than rendering new ones, use snapshot:append-texture to push a texture node. These will be used directly rather than being re-rendered.

For details on how to write shaders, see <GskGLShader>.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

shader

Passed: a <GskGLShader>.

The code to run

bounds

Passed: a <GrapheneRect>.

the rectangle to render into

take-args

Passed: a <GBytes>.

Data block with arguments for the shader.

Method: snapshot:push-isolation self features
Method: push-isolation self features

Isolates the following drawing operations from previous ones.

You can express "everything but these flags" in a forward compatible way by using bit math: GSK_ISOLATION_ALL & ~(GSK_ISOLATION_BACKGROUND | GSK_ISOLATION_COPY_PASTE) will isolate everything but background and copy/paste.

For what isolation features exist, see <GskIsolation>.

Content is isolated until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

features

Passed: a <GskIsolation>, or a list of its symbols, or one of them.

features that are isolated

Method: snapshot:push-mask self mask-mode
Method: push-mask self mask-mode

Until the first call to snapshot:pop, the mask image for the mask operation will be recorded.

After that call, the source image will be recorded until the second call to snapshot:pop.

Calling this function requires 2 subsequent calls to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

mask-mode

Passed: a <GskMaskMode>, or one of its symbols.

mask mode to use

Method: snapshot:push-opacity self opacity
Method: push-opacity self opacity

Modifies the opacity of an image.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

opacity

Passed: a real number.

the opacity to use

Method: snapshot:push-repeat self bounds [child-bounds]
Method: push-repeat self bounds [child-bounds]

Creates a node that repeats the child node.

The child is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GrapheneRect>.

the bounds within which to repeat

child-bounds

Passed, or left out: a <GrapheneRect>, or #f.

the bounds of the child or #f to use the full size of the collected child node

Method: snapshot:push-rounded-clip self bounds
Method: push-rounded-clip self bounds

Clips an image to a rounded rectangle.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

bounds

Passed: a <GskRoundedRect>.

the rounded rectangle to clip to

Method: snapshot:push-shadow self shadow
Method: push-shadow self shadow

Applies a shadow to an image.

The image is recorded until the next call to snapshot:pop.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

shadow

Passed: a list or vector, each a <GskShadow>.

the first shadow specification

n-shadows

Not passed: guile-gi gives the length of shadow.

number of shadow specifications

Method: snapshot:push-stroke self path stroke
Method: push-stroke self path stroke

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

The image is recorded until the next call to snapshot:pop.

Note that the strokes are subject to the same transformation as everything else, so uneven scaling will cause horizontal and vertical strokes to have different widths.

If you want to stroke the path with a color, snapshot:append-stroke may be more convenient.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

path

Passed: a <GskPath>.

The path to stroke

stroke

Passed: a <GskStroke>.

The stroke attributes

Method: snapshot:render-background self context x y width height
Method: render-background self context x y width height

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

context

Passed: a <GtkStyleContext>.

the style context that defines the background

x

Passed: a real number.

X origin of the rectangle

y

Passed: a real number.

Y origin of the rectangle

width

Passed: a real number.

rectangle width

height

Passed: a real number.

rectangle height

Method: snapshot:render-focus self context x y width height
Method: render-focus self context x y width height

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

context

Passed: a <GtkStyleContext>.

the style context that defines the focus ring

x

Passed: a real number.

X origin of the rectangle

y

Passed: a real number.

Y origin of the rectangle

width

Passed: a real number.

rectangle width

height

Passed: a real number.

rectangle height

Method: snapshot:render-frame self context x y width height
Method: render-frame self context x y width height

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

context

Passed: a <GtkStyleContext>.

the style context that defines the frame

x

Passed: a real number.

X origin of the rectangle

y

Passed: a real number.

Y origin of the rectangle

width

Passed: a real number.

rectangle width

height

Passed: a real number.

rectangle height

Method: snapshot:render-insertion-cursor self context x y layout index direction
Method: render-insertion-cursor self context x y layout index direction

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

self

Passed: a <GtkSnapshot>.

snapshot to render to

context

Passed: a <GtkStyleContext>.

a GtkStyleContext

x

Passed: a real number.

X origin

y

Passed: a real number.

Y origin

layout

Passed: a <PangoLayout>.

the <PangoLayout> of the text

index

Passed: a 32-bit integer.

the index in the <PangoLayout>

direction

Passed: a <PangoDirection>, or one of its symbols.

the <PangoDirection> of the text

Method: snapshot:render-layout self context x y layout
Method: render-layout self context x y layout

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

context

Passed: a <GtkStyleContext>.

the style context that defines the text

x

Passed: a real number.

X origin of the rectangle

y

Passed: a real number.

Y origin of the rectangle

layout

Passed: a <PangoLayout>.

the <PangoLayout> to render

Method: snapshot:restore self
Method: restore self

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

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

Method: snapshot:rotate self angle
Method: rotate self 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 self’s current coordinate system.

To rotate around axes other than the Z axis, use transform:rotate-3d.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

angle

Passed: a real number.

the rotation angle, in degrees (clockwise)

Method: snapshot:rotate-3d self angle axis
Method: rotate-3d self angle axis

Rotates self’s coordinate system by angle degrees around axis.

For a rotation in 2D space, use transform:rotate.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

angle

Passed: a real number.

the rotation angle, in degrees (clockwise)

axis

Passed: a <GrapheneVec3>.

The rotation axis

Method: snapshot:save self
Method: save self

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

When snapshot:restore is called, self will be restored to the saved state.

Multiple calls to snapshot:save and snapshot:restore can be nested; each call to snapshot:restore restores the state from the matching paired snapshot:save.

It is necessary to clear all saved states with corresponding calls to snapshot:restore.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

Method: snapshot:scale self factor-x factor-y
Method: scale self factor-x factor-y

Scales self’s coordinate system in 2-dimensional space by the given factors.

Use snapshot:scale-3d to scale in all 3 dimensions.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

factor-x

Passed: a real number.

scaling factor on the X axis

factor-y

Passed: a real number.

scaling factor on the Y axis

Method: snapshot:scale-3d self factor-x factor-y factor-z
Method: scale-3d self factor-x factor-y factor-z

Scales self’s coordinate system by the given factors.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

factor-x

Passed: a real number.

scaling factor on the X axis

factor-y

Passed: a real number.

scaling factor on the Y axis

factor-z

Passed: a real number.

scaling factor on the Z axis

Method: snapshot:to-node self ⇒ %return
Method: to-node self ⇒ %return

Returns the render node that was constructed by self.

Note that this function may return #f if nothing has been added to the snapshot or if its content does not produce pixels to be rendered.

After calling this function, it is no longer possible to add more nodes to self. The only function that should be called after this is object:unref.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

%return

Returned: a <GskRenderNode>, or #f.

the constructed <GskRenderNode> or #f if there are no nodes to render.

Method: snapshot:to-paintable self [size] ⇒ %return
Method: to-paintable self [size] ⇒ %return

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

After calling this function, it is no longer possible to add more nodes to self. The only function that should be called after this is object:unref.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

size

Passed, or left out: a <GrapheneSize>, or #f.

The size of the resulting paintable or #f to use the bounds of the snapshot

%return

Returned: a <GdkPaintable>, or #f.

a new <GdkPaintable>

Method: snapshot:transform self [transform]
Method: transform self [transform]

Transforms self’s coordinate system with the given transform.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

transform

Passed, or left out: a <GskTransform>, or #f.

the transform to apply

Method: snapshot:transform-matrix self matrix
Method: transform-matrix self matrix

Transforms self’s coordinate system with the given matrix.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

matrix

Passed: a <GrapheneMatrix>.

the matrix to multiply the transform with

Method: snapshot:translate self point
Method: translate self point

Translates self’s coordinate system by point in 2-dimensional space.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

point

Passed: a <GraphenePoint>.

the point to translate the snapshot by

Method: snapshot:translate-3d self point
Method: translate-3d self point

Translates self’s coordinate system by point.

self

Passed: a <GtkSnapshot>.

a <GtkSnapshot>

point

Passed: a <GraphenePoint3D>.

the point to translate the snapshot by