Class: Gtk::Svg
- Inherits:
-
Object
- Object
- Gtk::Svg
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#features ⇒ Gtk::SvgFeatures
Enabled features for this paintable.
-
#features=(features) ⇒ Gtk::SvgFeatures
Enabled features for this paintable.
-
#frame_clock=(clock) ⇒ nil
Sets a frame clock.
-
#get_state_names(length) ⇒ Array<String>
Returns a
NULL-terminated array of state names, if available. -
#initialize(path) ⇒ Gtk::Svg
constructor
Parses the SVG data in the resource and creates a paintable.
-
#load_from_bytes(bytes) ⇒ nil
Loads SVG content into an existing SVG paintable.
-
#load_from_resource(path) ⇒ nil
Loads SVG content into an existing SVG paintable.
-
#pause ⇒ nil
Stop any playing animations and state transitions.
-
#play ⇒ nil
Start playing animations and state transitions.
-
#playing=(playing) ⇒ Boolean
Whether the paintable is currently animating its content.
-
#playing? ⇒ Boolean
Whether the paintable is currently animating its content.
-
#resource ⇒ String
Resource to load SVG data from.
-
#resource=(resource) ⇒ String
Resource to load SVG data from.
-
#serialize ⇒ GLib::Bytes
Serializes the content of the renderer as SVG.
-
#state ⇒ Integer
The current state of the renderer.
-
#state=(state) ⇒ Integer
The current state of the renderer.
-
#weight ⇒ Float
If not set to -1, this value overrides the weight used when rendering the paintable.
-
#weight=(weight) ⇒ Float
If not set to -1, this value overrides the weight used when rendering the paintable.
-
#write_to_file(filename) ⇒ Boolean
Serializes the paintable, and saves the result to a file.
Constructor Details
#initialize(path) ⇒ Gtk::Svg
Parses the SVG data in the resource and creates a paintable.
Instance Method Details
#features ⇒ Gtk::SvgFeatures
Enabled features for this paintable.
Note that features have to be set before
loading SVG data to take effect.
#features=(features) ⇒ Gtk::SvgFeatures
Enabled features for this paintable.
Note that features have to be set before
loading SVG data to take effect.
#frame_clock=(clock) ⇒ nil
Sets a frame clock.
Without a frame clock, GtkSvg will not advance animations.
#get_state_names(length) ⇒ Array<String>
Returns a NULL-terminated array of
state names, if available.
Note that the returned array and the strings
contained in it will only be valid until the
GtkSvg is cleared or reloaded, so if you
want to keep it around, you should make a copy.
#load_from_bytes(bytes) ⇒ nil
Loads SVG content into an existing SVG paintable.
To track errors while loading SVG content,
connect to the [signalGtk.Svg::error] signal.
This clears any previously loaded content.
#load_from_resource(path) ⇒ nil
Loads SVG content into an existing SVG paintable.
To track errors while loading SVG content,
connect to the [signalGtk.Svg::error] signal.
This clears any previously loaded content.
#pause ⇒ nil
Stop any playing animations and state transitions.
Animations can be paused and started repeatedly.
#play ⇒ nil
Start playing animations and state transitions.
Animations can be paused and started repeatedly.
#playing=(playing) ⇒ Boolean
Whether the paintable is currently animating its content.
To set this property, use the [methodGtk.Svg.play] and
[methodGtk.Svg.pause] functions.
#playing? ⇒ Boolean
Whether the paintable is currently animating its content.
To set this property, use the [methodGtk.Svg.play] and
[methodGtk.Svg.pause] functions.
#resource ⇒ String
Resource to load SVG data from.
This property is meant to create a paintable
from a resource in ui files.
#resource=(resource) ⇒ String
Resource to load SVG data from.
This property is meant to create a paintable
from a resource in ui files.
#serialize ⇒ GLib::Bytes
Serializes the content of the renderer as SVG.
The SVG will be similar to the orignally loaded one,
but is not guaranteed to be 100% identical.
This function serializes the DOM, i.e. the results
of parsing the SVG. It does not reflect the effect
of applying animations.
#state ⇒ Integer
The current state of the renderer.
This can be a number between 0 and 63.
#state=(state) ⇒ Integer
The current state of the renderer.
This can be a number between 0 and 63.
#weight ⇒ Float
If not set to -1, this value overrides the weight used
when rendering the paintable.
#weight=(weight) ⇒ Float
If not set to -1, this value overrides the weight used
when rendering the paintable.
#write_to_file(filename) ⇒ Boolean
Serializes the paintable, and saves the result to a file.