Path

A gsk.path.Path describes lines and curves that are more complex than simple rectangles.

Paths can used for rendering (filling or stroking) and for animations (e.g. as trajectories).

gsk.path.Path is an immutable, opaque, reference-counted struct. After creation, you cannot change the types it represents. Instead, new gsk.path.Path objects have to be created. The gsk.path_builder.PathBuilder structure is meant to help in this endeavor.

Conceptually, a path consists of zero or more contours (continuous, connected curves), each of which may or may not be closed. Contours are typically constructed from Bézier segments.

<picture> <source srcset="path-dark.png" media="(prefers-color-scheme: dark)"> <img alt="A Path" src="path-light.png"> </picture>

Members

Functions

foreach_
bool foreach_(gsk.types.PathForeachFlags flags, gsk.types.PathForeachFunc func)

Calls func for every operation of the path.

getBounds
bool getBounds(graphene.rect.Rect bounds)

Computes the bounds of the given path.

getStrokeBounds
bool getStrokeBounds(gsk.stroke.Stroke stroke, graphene.rect.Rect bounds)

Computes the bounds for stroking the given path with the parameters in stroke.

inFill
bool inFill(graphene.point.Point point, gsk.types.FillRule fillRule)

Returns whether the given point is inside the area that would be affected if the path was filled according to fill_rule.

isClosed
bool isClosed()

Returns if the path represents a single closed contour.

isEmpty
bool isEmpty()

Checks if the path is empty, i.e. contains no lines or curves.

print
void print(glib.string_.String string_)

Converts self into a human-readable string representation suitable for printing.

toCairo
void toCairo(cairo.context.Context cr)

Appends the given path to the given cairo context for drawing with Cairo.

toString_
string toString_()

Converts the path into a string that is suitable for printing.

Static functions

parse
gsk.path.Path parse(string string_)

This is a convenience function that constructs a gsk.path.Path from a serialized form.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.