Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gsk.Structs.Stroke
Description
Collects the parameters that are needed when 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.
Constructors
Stroke (ManagedPtr Stroke) |
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 type ParentTypes Stroke = '[] :: [Type] |
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 a GskStroke
.
Since: 4.14
equal
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Ptr () |
|
-> m Bool | Returns: true if the two strokes are equal, false otherwise |
Checks if two 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.
Since: 4.14
getDashOffset
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> m Float | Returns: the dash offset |
Gets the dash offset.
Since: 4.14
getLineCap
getLineJoin
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 |
Gets the miter limit.
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.
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 LineCapRound
or LineCapSquare
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
setLineJoin
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 miter limit to be used when stroking.
The miter limit is the distance from the corner where sharp turns of joins get cut off.
The limit is specfied in units of line width and must be non-negative.
For joins of type LineJoinMiter
that exceed the miter limit,
the join gets rendered as if it was of type LineJoinBevel
.
Since: 4.14
toCairo
Arguments
:: (HasCallStack, MonadIO m) | |
=> Stroke |
|
-> Context |
|
-> m () |
A helper function that sets the stroke parameters
of a cairo context from a GskStroke
.
Since: 4.14