Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Gsk.Structs.Stroke
Description
A GskStroke
struct collects the parameters that influence
the operation of stroking a path.
Since: 4.14
Synopsis
- newtype Stroke = Stroke (ManagedPtr Stroke)
- strokeCopy :: (HasCallStack, MonadIO m) => Stroke -> m Stroke
- strokeEqual :: (HasCallStack, MonadIO m) => Ptr () -> Ptr () -> m Bool
- strokeFree :: (HasCallStack, MonadIO m) => Stroke -> m ()
- strokeGetDash :: (HasCallStack, MonadIO m) => Stroke -> m (Maybe [Float])
- strokeGetDashOffset :: (HasCallStack, MonadIO m) => Stroke -> m Float
- strokeGetLineCap :: (HasCallStack, MonadIO m) => Stroke -> m LineCap
- strokeGetLineJoin :: (HasCallStack, MonadIO m) => Stroke -> m LineJoin
- strokeGetLineWidth :: (HasCallStack, MonadIO m) => Stroke -> m Float
- strokeGetMiterLimit :: (HasCallStack, MonadIO m) => Stroke -> m Float
- strokeNew :: (HasCallStack, MonadIO m) => Float -> m Stroke
- strokeSetDash :: (HasCallStack, MonadIO m) => Stroke -> Maybe [Float] -> m ()
- strokeSetDashOffset :: (HasCallStack, MonadIO m) => Stroke -> Float -> m ()
- strokeSetLineCap :: (HasCallStack, MonadIO m) => Stroke -> LineCap -> m ()
- strokeSetLineJoin :: (HasCallStack, MonadIO m) => Stroke -> LineJoin -> m ()
- strokeSetLineWidth :: (HasCallStack, MonadIO m) => Stroke -> Float -> m ()
- strokeSetMiterLimit :: (HasCallStack, MonadIO m) => Stroke -> Float -> m ()
- strokeToCairo :: (HasCallStack, MonadIO m) => Stroke -> Context -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Stroke Source # | |
GBoxed Stroke Source # | |
Defined in GI.Gsk.Structs.Stroke | |
ManagedPtrNewtype Stroke Source # | |
Defined in GI.Gsk.Structs.Stroke Methods toManagedPtr :: Stroke -> ManagedPtr Stroke | |
TypedObject Stroke Source # | |
Defined in GI.Gsk.Structs.Stroke | |
HasParentTypes Stroke Source # | |
Defined in GI.Gsk.Structs.Stroke | |
IsGValue (Maybe Stroke) Source # | Convert |
Defined in GI.Gsk.Structs.Stroke Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Stroke -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Stroke) | |
type ParentTypes Stroke Source # | |
Defined in GI.Gsk.Structs.Stroke |
Methods
Click to display all available methods, including inherited ones
Methods
Getters
getDash, getDashOffset, getLineCap, getLineJoin, getLineWidth, getMiterLimit.
Setters
setDash, setDashOffset, setLineCap, setLineJoin, setLineWidth, setMiterLimit.
copy
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m Stroke | Returns: a new |
Creates a copy of the given other
stroke.
Since: 4.14
equal
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Ptr () |
|
-> m Bool | Returns: |
Checks if 2 strokes are identical.
Since: 4.14
free
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m () |
Frees a GskStroke
.
Since: 4.14
getDash
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m (Maybe [Float]) | Returns:
The dash array or |
Gets the dash array in use or NULL
if dashing is disabled.
Since: 4.14
getDashOffset
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m Float |
Returns the dash_offset of a GskStroke
.
Since: 4.14
getLineCap
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m LineCap | Returns: The line cap |
getLineJoin
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m LineJoin | Returns: The line join |
getLineWidth
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m Float | Returns: The line width |
Gets the line width used.
Since: 4.14
getMiterLimit
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m Float |
Returns the miter limit of a GskStroke
.
Since: 4.14
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> m Stroke | Returns: a new |
Creates a new GskStroke
with the given lineWidth
.
Since: 4.14
setDash
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Maybe [Float] |
|
-> m () |
Sets the dash pattern to use by this stroke.
A dash pattern is specified by an array 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_LINE_CAP_ROUND
or GSK_LINE_CAP_SQUARE
to draw dots
or squares along a path.
If nDash
is 0, if all elements in dash
are 0, or if there are
negative values in dash
, then dashing is disabled.
If nDash
is 1, an alternating "on" and "off" pattern with the
single dash length provided is assumed.
If nDash
is uneven, the dash array will be used with the first
element in dash
defining an "on" or "off" in alternating passes
through the array.
You can specify a starting offset into the dash with
strokeSetDashOffset
.
Since: 4.14
setDashOffset
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Float |
|
-> m () |
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 strokeSetDash
for more details on dashing.
Since: 4.14
setLineCap
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> LineCap |
|
-> m () |
setLineJoin
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> LineJoin |
|
-> m () |
setLineWidth
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Float |
|
-> m () |
Sets the line width to be used when stroking.
The line width must be > 0.
Since: 4.14
setMiterLimit
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Float |
|
-> m () |
Sets the limit for the distance from the corner where sharp turns of joins get cut off.
The miter limit is in units of line width and must be non-negative.
For joins of type GSK_LINE_JOIN_MITER
that exceed the miter
limit, the join gets rendered as if it was of type
GSK_LINE_JOIN_BEVEL
.
Since: 4.14
toCairo
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Context |
|
-> m () |
A helper function that sets the stroke parameters
of cr
from the values found in self
.
Since: 4.14