Callbacks

ParseErrorFunc (start, end, error, *user_data)

PathForeachFunc (op, pts, weight, *user_data)

PathIntersectionFunc (path1, point1, path2, point2, kind, *user_data)

RenderReplayFontFilter (replay, font, *user_data)

RenderReplayNodeFilter (replay, node, *user_data)

RenderReplayNodeForeach (replay, node, *user_data)

RenderReplayTextureFilter (replay, texture, *user_data)

Details

Gsk.ParseErrorFunc(start, end, error, *user_data)
Parameters:

Type of callback that is called when an error occurs during node deserialization.

Gsk.PathForeachFunc(op, pts, weight, *user_data)
Parameters:
  • op (Gsk.PathOperation) – The operation

  • pts ([Graphene.Point]) – The points of the operation

  • weight (float) – The weight for conic curves, or unused if not a conic curve

  • user_data (object or None) – The user data provided with the function

Returns:

True to continue iterating the path, False to immediately abort and not call the function again.

Return type:

bool

Type of the callback to iterate through the operations of a path.

For each operation, the callback is given the op itself, the points that the operation is applied to in pts, and a weight for conic curves. The n_pts argument is somewhat redundant, since the number of points can be inferred from the operation.

Each contour of the path starts with a Gsk.PathOperation.MOVE operation. Closed contours end with a Gsk.PathOperation.CLOSE operation.

Gsk.PathIntersectionFunc(path1, point1, path2, point2, kind, *user_data)
Parameters:
Returns:

true to continue iterating, false to stop the iteration and not call the function again

Return type:

bool

Prototype of the callback to iterate through the intersections of two paths.

New in version 4.20.

Gsk.RenderReplayFontFilter(replay, font, *user_data)
Parameters:
Returns:

The filtered font

Return type:

Pango.Font

A function that filters fonts.

The function will be called by the default replay function for all nodes with fonts. They will then generate a node using the returned font.

It is valid for the function to return the passed in font if the font shuld not be modified.

New in version 4.22.

Gsk.RenderReplayNodeFilter(replay, node, *user_data)
Parameters:
Returns:

The replayed node

Return type:

Gsk.RenderNode or None

A function to replay a node.

The node may be returned unmodified.

The node may be discarded by returning None.

If you do not want to do any handling yourself, call [method`Gsk`.RenderReplay.default] to use the default handler that calls your function on the children of the node.

New in version 4.22.

Gsk.RenderReplayNodeForeach(replay, node, *user_data)
Parameters:
Returns:

True to descend into this node’s child nodes (if any) or False to skip them

Return type:

bool

A function called for every node.

If this function returns True, the replay will continue and call the filter function.

If it returns False, the filter function will not be called and any child nodes will be skipped.

New in version 4.22.

Gsk.RenderReplayTextureFilter(replay, texture, *user_data)
Parameters:
Returns:

The filtered texture

Return type:

Gdk.Texture

A function that filters textures.

The function will be called by the default replay function for all nodes with textures. They will then generate a node using the returned texture.

It is valid for the function to return the passed in texture if the texture shuld not be modified.

New in version 4.22.