6 Functions

Procedure: component-transfer-equal? self other ⇒ %return

Compares two component transfers for equality.

self

Passed: a foreign pointer, or a bytevector.

a component transfer

other

Passed: a foreign pointer, or a bytevector.

another component transfer

%return

Returned: a boolean.

true if self and other are equal

Procedure: path-parse string ⇒ %return

Constructs a path from a serialized form.

The string is expected to be in (a superset of) SVG path syntax, as e.g. produced by path:to-string.

A high-level summary of the syntax:

  • M x y Move to (x, y)
  • L x y Add a line from the current point to (x, y)
  • Q x1 y1 x2 y2 Add a quadratic Bézier from the current point to (x2, y2), with control point (x1, y1)
  • C x1 y1 x2 y2 x3 y3 Add a cubic Bézier from the current point to (x3, y3), with control points (x1, y1) and (x2, y2)
  • Z Close the contour by drawing a line back to the start point
  • H x Add a horizontal line from the current point to the given x value
  • V y Add a vertical line from the current point to the given y value
  • T x2 y2 Add a quadratic Bézier, using the reflection of the previous segments’ control point as control point
  • S x2 y2 x3 y3 Add a cubic Bézier, using the reflection of the previous segments’ second control point as first control point
  • A rx ry r l s x y Add an elliptical arc from the current point to (x, y) with radii rx and ry. See the SVG documentation for how the other parameters influence the arc.
  • O x1 y1 x2 y2 w Add a rational quadratic Bézier from the current point to (x2, y2) with control point (x1, y1) and weight w.

All the commands have lowercase variants that interpret coordinates relative to the current point.

The O command is an extension that is not supported in SVG.

string

Passed: a string.

a string

%return

Returned: a <GskPath>, or #f.

a new <GskPath>, or NULL if string could not be parsed

Procedure: serialization-error-quark ⇒ %return

Registers an error quark for <GskRenderNode> errors.

%return

Returned: an unsigned 32-bit integer.

the error quark

Procedure: stroke-equal? [stroke1] [stroke2] ⇒ %return

Checks if two strokes are identical.

stroke1

Passed, or left out: a foreign pointer, or a bytevector, or #f.

the first stroke

stroke2

Passed, or left out: a foreign pointer, or a bytevector, or #f.

the second stroke

%return

Returned: a boolean.

true if the two strokes are equal, false otherwise

Procedure: transform-parse string ⇒ %return out-transform

Parses a given into a transform.

Strings printed via transform:to-string can be read in again successfully using this function.

If string does not describe a valid transform, false is returned and NULL is put in out-transform.

string

Passed: a string.

the string to parse

%return

Returned: a boolean.

true if string described a valid transform

out-transform

Returned: a <GskTransform>.

return location for the transform

Procedure: value-dup-render-node value ⇒ %return

Retrieves the render node stored inside a <GValue>, and acquires a reference to it.

value

Passed: a <GValue>.

a <GValue> initialized with type GSK_TYPE_RENDER_NODE

%return

Returned: a <GskRenderNode>, or #f.

the render node

Procedure: value-get-render-node value ⇒ %return

Retrieves the render node stored inside a <GValue>.

value

Passed: a <GValue>.

a <GValue> initialized with type GSK_TYPE_RENDER_NODE

%return

Returned: a <GskRenderNode>, or #f.

the render node

Procedure: value-set-render-node value node

Stores the given render node inside a <GValue>.

The <GValue> will acquire a reference to the render node.

value

Passed: a <GValue>.

a <GValue> initialized with type GSK_TYPE_RENDER_NODE

node

Passed: a <GskRenderNode>.

a render node

Procedure: value-take-render-node value [node]

Stores the given render node inside a <GValue>.

This function transfers the ownership of the render node to the <GValue>.

value

Passed: a <GValue>.

a <GValue> initialized with type GSK_TYPE_RENDER_NODE

node

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

a render node