Inherits Glib::Object.

Classes | |
| class | Nodes |
Public Member Functions | |
| virtual | ~Path () |
| ClutterPath* | gobj () |
| Provides access to the underlying C GObject. | |
| const ClutterPath* | gobj () const |
| Provides access to the underlying C GObject. | |
| ClutterPath* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| Nodes | nodes () |
| const Nodes | nodes () const |
| void | add_move_to (int x, int y) |
| Adds a Clutter::PATH_MOVE_TO type node to the path. | |
| void | add_rel_move_to (int x, int y) |
| Same as add_move_to() except the coordinates are relative to the previous node. | |
| void | add_line_to (int x, int y) |
| Adds a Clutter::PATH_LINE_TO type node to the path. | |
| void | add_rel_line_to (int x, int y) |
| Same as add_line_to() except the coordinates are relative to the previous node. | |
| void | add_curve_to (int x1, int y1, int x2, int y2, int x3, int y3) |
| Adds a Clutter::PATH_CURVE_TO type node to the path. | |
| void | add_rel_curve_to (int x1, int y1, int x2, int y2, int x3, int y3) |
| Same as add_curve_to() except the coordinates are relative to the previous node. | |
| void | add_close () |
| Adds a Clutter::PATH_CLOSE type node to the path. | |
| bool | add_string (const Glib::ustring& str) |
| Adds new nodes to the end of the path as described in str. | |
| Glib::ustring | get_description () const |
| Returns a newly allocated string describing the path in the same format as used by add_string(). | |
| void | set_description (const Glib::ustring& str) |
| Replaces all of the nodes in the path with nodes described by str. | |
| void | add_cairo_path (const Glib::RefPtr< Cairo::Path >& path) |
| Add the nodes of the Cairo path to the end of path. | |
| void | to_cairo_path (Glib::RefPtr< Cairo::Context >& context) const |
| Add the nodes of the ClutterPath to the path in the Cairo context. | |
| void | clear () |
| Removes all nodes from the path. | |
| guint | get_position (double progress, Knot& position) |
| The value in progress represents a position along the path where 0.0 is the beginning and 1.0 is the end of the path. | |
| guint | get_length () const |
| Retrieves an approximation of the total length of the path. | |
| Glib::PropertyProxy < Glib::ustring > | property_description () |
| SVG-style description of the path. | |
| Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_description () const |
| SVG-style description of the path. | |
| Glib::PropertyProxy_ReadOnly < guint > | property_length () const |
| An approximation of the total length of the path. | |
Static Public Member Functions | |
| static Glib::RefPtr< Path > | create () |
| static Glib::RefPtr< Path > | create (const Glib::ustring& description) |
Protected Member Functions | |
| Path () | |
| Path (const Glib::ustring& description) | |
Related Functions | |
(Note that these are not member functions.) | |
| Glib::RefPtr< Clutter::Path > | wrap (ClutterPath* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
| virtual Clutter::Path::~Path | ( | ) | [virtual] |
| Clutter::Path::Path | ( | ) | [protected] |
| Clutter::Path::Path | ( | const Glib::ustring & | description | ) | [explicit, protected] |
| void Clutter::Path::add_cairo_path | ( | const Glib::RefPtr< Cairo::Path > & | path | ) |
| void Clutter::Path::add_close | ( | ) |
Adds a Clutter::PATH_CLOSE type node to the path.
This creates a straight line from the last node to the last Clutter::PATH_MOVE_TO type node.
| void Clutter::Path::add_curve_to | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| int | x3, | |||
| int | y3 | |||
| ) |
Adds a Clutter::PATH_CURVE_TO type node to the path.
This causes the actor to follow a bezier from the last node to ( x_3, y_3) using ( x_1, y_1) and ( x_2, y_2) as control points.
| x_1 | The x coordinate of the first control point. | |
| y_1 | The y coordinate of the first control point. | |
| x_2 | The x coordinate of the second control point. | |
| y_2 | The y coordinate of the second control point. | |
| x_3 | The x coordinate of the third control point. | |
| y_3 | The y coordinate of the third control point. |
| void Clutter::Path::add_line_to | ( | int | x, | |
| int | y | |||
| ) |
Adds a Clutter::PATH_LINE_TO type node to the path.
This causes the actor to move to the new coordinates in a straight line.
| x | The x coordinate. | |
| y | The y coordinate. |
| void Clutter::Path::add_move_to | ( | int | x, | |
| int | y | |||
| ) |
Adds a Clutter::PATH_MOVE_TO type node to the path.
This is usually used as the first node in a path. It can also be used in the middle of the path to cause the actor to jump to the new coordinate.
| x | The x coordinate. | |
| y | The y coordinate. |
| void Clutter::Path::add_rel_curve_to | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| int | x3, | |||
| int | y3 | |||
| ) |
Same as add_curve_to() except the coordinates are relative to the previous node.
| x_1 | The x coordinate of the first control point. | |
| y_1 | The y coordinate of the first control point. | |
| x_2 | The x coordinate of the second control point. | |
| y_2 | The y coordinate of the second control point. | |
| x_3 | The x coordinate of the third control point. | |
| y_3 | The y coordinate of the third control point. |
| void Clutter::Path::add_rel_line_to | ( | int | x, | |
| int | y | |||
| ) |
Same as add_line_to() except the coordinates are relative to the previous node.
| x | The x coordinate. | |
| y | The y coordinate. |
| void Clutter::Path::add_rel_move_to | ( | int | x, | |
| int | y | |||
| ) |
Same as add_move_to() except the coordinates are relative to the previous node.
| x | The x coordinate. | |
| y | The y coordinate. |
| bool Clutter::Path::add_string | ( | const Glib::ustring & | str | ) |
Adds new nodes to the end of the path as described in str.
The format is a subset of the SVG path format. Each node is represented by a letter and is followed by zero, one or three pairs of coordinates. The coordinates can be separated by spaces or a comma. The types are:
<variablelist> <varlistentry>M <listitem>
Adds a Clutter::PATH_MOVE_TO node. Takes one pair of coordinates.
</listitem></varlistentry> <varlistentry>L <listitem>
Adds a Clutter::PATH_LINE_TO node. Takes one pair of coordinates.
</listitem></varlistentry> <varlistentry>C <listitem>
Adds a Clutter::PATH_CURVE_TO node. Takes three pairs of coordinates.
</listitem></varlistentry> <varlistentry>z <listitem>
Adds a Clutter::PATH_CLOSE node. No coordinates are needed.
</listitem></varlistentry> </variablelist>
The M, L and C commands can also be specified in lower case which means the coordinates are relative to the previous node.
For example, to move an actor in a 100 by 100 pixel square centered on the point 300,300 you could use the following path:
<informalexample> <programlisting> M 250,350 l 0 -100 L 350,250 l 0 100 z </programlisting> </informalexample>
If the path description isn't valid false will be returned and no nodes will be added.
| str | A string describing the new nodes. |
true is the path description was valid or false otherwise. | void Clutter::Path::clear | ( | ) |
Removes all nodes from the path.
| static Glib::RefPtr<Path> Clutter::Path::create | ( | const Glib::ustring & | description | ) | [static] |
| static Glib::RefPtr<Path> Clutter::Path::create | ( | ) | [static] |
| Glib::ustring Clutter::Path::get_description | ( | ) | const |
Returns a newly allocated string describing the path in the same format as used by add_string().
| guint Clutter::Path::get_length | ( | ) | const |
Retrieves an approximation of the total length of the path.
| guint Clutter::Path::get_position | ( | double | progress, | |
| Knot& | position | |||
| ) |
The value in progress represents a position along the path where 0.0 is the beginning and 1.0 is the end of the path.
An interpolated position is then stored in position.
| progress | A position along the path as a fraction of its length. | |
| position | Location to store the position. |
| const ClutterPath* Clutter::Path::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
| ClutterPath* Clutter::Path::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
| ClutterPath* Clutter::Path::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
| const Nodes Clutter::Path::nodes | ( | ) | const [inline] |
| Nodes Clutter::Path::nodes | ( | ) | [inline] |
| Glib::PropertyProxy_ReadOnly<Glib::ustring> Clutter::Path::property_description | ( | ) | const |
SVG-style description of the path.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy<Glib::ustring> Clutter::Path::property_description | ( | ) |
SVG-style description of the path.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly<guint> Clutter::Path::property_length | ( | ) | const |
An approximation of the total length of the path.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| void Clutter::Path::set_description | ( | const Glib::ustring & | str | ) |
Replaces all of the nodes in the path with nodes described by str.
See add_string() for details of the format.
If the string is invalid then false is returned and the path is unaltered.
| str | A string describing the path. |
true is the path was valid, false otherwise. | void Clutter::Path::to_cairo_path | ( | Glib::RefPtr< Cairo::Context > & | context | ) | const |
| Glib::RefPtr< Clutter::Path > wrap | ( | ClutterPath * | object, | |
| bool | take_copy = false | |||
| ) | [related] |
A Glib::wrap() method for this object.
| object | The C instance. | |
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
1.6.1