Class Svg.Builder<B extends Svg.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Svg
- Since:
- 4.22
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theSvgobject.onError(Svg.ErrorCallback handler) Signals that an error occurred.setFeatures(Set<SvgFeatures> features) Enabled features for this paintable.setFeatures(SvgFeatures... features) Enabled features for this paintable.setPlaying(boolean playing) Whether the paintable is currently animating its content.setResource(String resource) Resource to load SVG data from.setState(int state) The current state of the renderer.setWeight(double weight) If not set to -1, this value overrides the weight used when rendering the paintable.Methods inherited from class GObject.Builder
onNotifyMethods inherited from class Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theSvgobject. This will callGObject.withProperties(Type, String[], Value[])to create a new GObject instance, which is then cast toSvg.- Overrides:
buildin classGObject.Builder<B extends Svg.Builder<B>>- Returns:
- a new instance of
Svgwith the properties that were set in the Builder object.
-
setFeatures
Enabled features for this paintable.
Note that features have to be set before loading SVG data to take effect.
- Parameters:
features- the value for thefeaturesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
-
setPlaying
Whether the paintable is currently animating its content.
To set this property, use the
Svg.play()andSvg.pause()functions.- Parameters:
playing- the value for theplayingproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
-
setResource
-
setState
The current state of the renderer.
This can be a number between 0 and 63.
- Parameters:
state- the value for thestateproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
-
setWeight
If not set to -1, this value overrides the weight used when rendering the paintable.- Parameters:
weight- the value for theweightproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
-
setFeatures
Enabled features for this paintable.
Note that features have to be set before loading SVG data to take effect.
- Parameters:
features- the value for thefeaturesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
-
onError
Signals that an error occurred.
Errors can occur both during parsing and during rendering.
The expected error values are in the
Gtk.SvgErrorenumeration, context information about the location of parsing errors can be obtained with the variousgtk_svg_errorfunctions.Parsing errors are never fatal, so the parsing will resume after the error. Errors may however cause parts of the given data or even all of it to not be parsed at all. So it is a useful idea to check that the parsing succeeds by connecting to this signal.
::: note This signal is emitted in the middle of parsing or rendering, and if you handle it, you must be careful. Logging the errors you receive is fine, but modifying the widget hierarchy or changing the paintable state definitively isn't.
If in doubt, defer to an idle.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.22
- See Also:
-