Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gsk.ParseErrorFunc(start, end, error, *user_data)¶
- Parameters:
start (
Gsk.ParseLocation) – start of the error locationend (
Gsk.ParseLocation) – end of the error locationerror (
GLib.Error) – the error
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 operationpts ([
Graphene.Point]) – The points of the operationweight (
float) – The weight for conic curves, or unused if not a conic curveuser_data (
objectorNone) – The user data provided with the function
- Returns:
Trueto continue iterating the path,Falseto immediately abort and not call the function again.- Return type:
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.MOVEoperation. Closed contours end with aGsk.PathOperation.CLOSEoperation.
- Gsk.PathIntersectionFunc(path1, point1, path2, point2, kind, *user_data)¶
- Parameters:
path1 (
Gsk.Path) – the first pathpoint1 (
Gsk.PathPoint) – the intersection as point on path1path2 (
Gsk.Path) – the second pathpoint2 (
Gsk.PathPoint) – the intersection as point on path2kind (
Gsk.PathIntersection) – the nature of the intersection
- Returns:
true to continue iterating, false to stop the iteration and not call the function again
- Return type:
Prototype of the callback to iterate through the intersections of two paths.
New in version 4.20.
- Gsk.RenderReplayFontFilter(replay, font, *user_data)¶
- Parameters:
replay (
Gsk.RenderReplay) – The replay object used to replay the nodefont (
Pango.Font) – The font to filter
- Returns:
The filtered font
- Return type:
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:
replay (
Gsk.RenderReplay) – The replay object used to replay the nodenode (
Gsk.RenderNode) – The node to replay
- Returns:
The replayed node
- Return type:
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:
replay (
Gsk.RenderReplay) – The replay object used to replay the nodenode (
Gsk.RenderNode) – The node to replay
- Returns:
Trueto descend into this node’s child nodes (if any) orFalseto skip them- Return type:
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:
replay (
Gsk.RenderReplay) – The replay object used to replay the nodetexture (
Gdk.Texture) – The texture to filter
- Returns:
The filtered texture
- Return type:
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.