Collects the parameters that are needed when stroking a path.
More...
#include <gskmm/stroke.h>
|
| static GType | get_type () |
| | Get the GType for this class, for use with the underlying GObject type system.
|
|
(Note that these are not member symbols.)
|
| void | swap (Stroke & lhs, Stroke & rhs) noexcept |
| Gsk::Stroke | wrap (GskStroke * object, bool take_copy=false) |
| | A Glib::wrap() method for this object.
|
Collects the parameters that are needed when stroking a path.
- Since gtkmm 4.24
◆ Stroke() [1/5]
◆ Stroke() [2/5]
| Gsk::Stroke::Stroke |
( |
GskStroke * | gobject, |
|
|
bool | make_a_copy = true ) |
|
explicit |
◆ Stroke() [3/5]
| Gsk::Stroke::Stroke |
( |
const Stroke & | other | ) |
|
◆ Stroke() [4/5]
| Gsk::Stroke::Stroke |
( |
Stroke && | other | ) |
|
|
noexcept |
◆ ~Stroke()
◆ Stroke() [5/5]
| Gsk::Stroke::Stroke |
( |
float | line_width | ) |
|
◆ equal()
| bool Gsk::Stroke::equal |
( |
const Stroke & | stroke2 | ) |
const |
Checks if two strokes are identical.
- Since gtkmm 4.24
- Parameters
-
| stroke2 | The second stroke. |
- Returns
- True if the two strokes are equal, false otherwise.
◆ get_dash()
Gets the dash vector in use.
- Since gtkmm 4.24
- Returns
- The dash vector. Can be empty.
◆ get_dash_offset()
| float Gsk::Stroke::get_dash_offset |
( |
| ) |
const |
◆ get_line_cap()
| LineCap Gsk::Stroke::get_line_cap |
( |
| ) |
const |
◆ get_line_join()
| LineJoin Gsk::Stroke::get_line_join |
( |
| ) |
const |
◆ get_line_width()
| float Gsk::Stroke::get_line_width |
( |
| ) |
const |
◆ get_miter_limit()
| float Gsk::Stroke::get_miter_limit |
( |
| ) |
const |
◆ get_type()
| GType Gsk::Stroke::get_type |
( |
| ) |
|
|
static |
Get the GType for this class, for use with the underlying GObject type system.
◆ gobj() [1/2]
| GskStroke * Gsk::Stroke::gobj |
( |
| ) |
|
|
inline |
Provides access to the underlying C instance.
◆ gobj() [2/2]
| const GskStroke * Gsk::Stroke::gobj |
( |
| ) |
const |
|
inline |
Provides access to the underlying C instance.
◆ gobj_copy()
| GskStroke * Gsk::Stroke::gobj_copy |
( |
| ) |
const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_dash()
| void Gsk::Stroke::set_dash |
( |
const std::vector< float > & | dash | ) |
|
Sets the dash pattern to use.
A dash pattern is specified by a vector of alternating non-negative values. Each value provides the length of alternate "on" and "off" portions of the stroke.
Each "on" segment will have caps applied as if the segment were a separate contour. In particular, it is valid to use an "on" length of 0 with Gsk::LineCap::ROUND or Gsk::LineCap::SQUARE to draw dots or squares along a path.
If dash is an empty vector, if all elements in dash are 0, or if there are negative values in dash, then dashing is disabled.
If dash.size() is 1, an alternating "on" and "off" pattern with the single dash length provided is assumed.
If dash.size() is uneven, the dash vector will be used with the first element in dash defining an "on" or "off" in alternating passes through the vector.
You can specify a starting offset into the dash with set_dash_offset().
- Since gtkmm 4.24
- Parameters
-
| dash | The vector of dashes. |
◆ set_dash_offset()
| void Gsk::Stroke::set_dash_offset |
( |
float | offset | ) |
|
Sets the offset into the dash pattern where dashing should begin.
This is an offset into the length of the path, not an index into the array values of the dash array.
See set_dash() for more details on dashing.
- Since gtkmm 4.24
- Parameters
-
| offset | Offset into the dash pattern. |
◆ set_line_width()
| void Gsk::Stroke::set_line_width |
( |
float | line_width | ) |
|
Sets the line width to be used when stroking.
The line width must be >= 0.
- Since gtkmm 4.24
- Parameters
-
| line_width | Width of the line in pixels. |
◆ set_miter_limit()
| void Gsk::Stroke::set_miter_limit |
( |
float | limit | ) |
|
◆ swap()
| void Gsk::Stroke::swap |
( |
Stroke & | other | ) |
|
|
noexcept |
◆ to_cairo()
A helper function that sets the stroke parameters of a cairo context from a Gsk::Stroke.
- Since gtkmm 4.24
- Parameters
-
| cr | The cairo context to configure. |
◆ swap()
- Parameters
-
| lhs | The left-hand side |
| rhs | The right-hand side |
◆ wrap()
| Gsk::Stroke wrap |
( |
GskStroke * | object, |
|
|
bool | take_copy = false ) |
|
related |
A Glib::wrap() method for this object.
- Parameters
-
| 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. |
- Returns
- A C++ instance that wraps this C instance.
◆ gobject_
| GskStroke* Gsk::Stroke::gobject_ |
|
protected |