gi-gsk-4.0.9: Gsk bindings

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

Contents

- Exported types
- Methods
  - copy
  - equal
  - free
  - getDash
  - getDashOffset
  - getLineCap
  - getLineJoin
  - getLineWidth
  - getMiterLimit
  - new
  - setDash
  - setDashOffset
  - setLineCap
  - setLineJoin
  - setLineWidth
  - setMiterLimit
  - toCairo

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

newtype Stroke Source #

Memory-managed wrapper type.

Constructors

Stroke (ManagedPtr Stroke) |

#### Instances

Instances details

Eq Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke Methods (==) :: Stroke -> Stroke -> Bool Source # (/=) :: Stroke -> Stroke -> Bool Source #
GBoxed Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke
ManagedPtrNewtype Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke Methods toManagedPtr :: Stroke -> ManagedPtr Stroke Source #
TypedObject Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke Methods glibType :: IO GType Source #
HasParentTypes Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke
IsGValue (Maybe Stroke) Source # | Convert `Stroke` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gsk.Structs.Stroke Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Stroke -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Stroke) Source #
type ParentTypes Stroke Source # |
Instance details Defined in GI.Gsk.Structs.Stroke type ParentTypes Stroke = '[] :: [Type]

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

copy, free, toCairo.

#### Getters

getDash, getDashOffset, getLineCap, getLineJoin, getLineWidth, getMiterLimit.

#### Setters

setDash, setDashOffset, setLineCap, setLineJoin, setLineWidth, setMiterLimit.

## copy

strokeCopy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `other`: the stroke to copy
-> m Stroke | Returns: a new `GskStroke`. Use `strokeFree` to free it

Creates a copy of a `GskStroke`.

Since: 4.14

## equal

strokeEqual Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Ptr () | `stroke1`: the first stroke
-> Ptr () | `stroke2`: the second stroke
-> m Bool | Returns: true if the two strokes are equal, false otherwise

Checks if two strokes are identical.

Since: 4.14

## free

strokeFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m () |

Frees a `GskStroke`.

Since: 4.14

## getDash

strokeGetDash Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m (Maybe [Float]) | Returns: the dash array or `NULL` if the dash array is empty

Gets the dash array in use.

Since: 4.14

## getDashOffset

strokeGetDashOffset Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m Float | Returns: the dash offset

Gets the dash offset.

Since: 4.14

## getLineCap

strokeGetLineCap Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m LineCap | Returns: the line cap

Gets the line cap used.

See `LineCap` for details.

Since: 4.14

## getLineJoin

strokeGetLineJoin Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m LineJoin | Returns: the line join

Gets the line join used.

See `LineJoin` for details.

Since: 4.14

## getLineWidth

strokeGetLineWidth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m Float | Returns: the line width

Gets the line width used.

Since: 4.14

## getMiterLimit

strokeGetMiterLimit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> m Float | Returns: the miter limit

Gets the miter limit.

Since: 4.14

## new

strokeNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Float | `lineWidth`: line width of the stroke. Must be > 0
-> m Stroke | Returns: a new `GskStroke`

Creates a new `GskStroke` with the given `lineWidth`.

Since: 4.14

## setDash

strokeSetDash Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> Maybe [Float] | `dash`: the array of dashes
-> 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

strokeSetDashOffset Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> Float | `offset`: offset into the dash pattern
-> 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

strokeSetLineCap Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> LineCap | `lineCap`: the line cap
-> m () |

Sets the line cap to be used when stroking.

See `LineCap` for details.

Since: 4.14

## setLineJoin

strokeSetLineJoin Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> LineJoin | `lineJoin`: the line join to use
-> m () |

Sets the line join to be used when stroking.

See `LineJoin` for details.

Since: 4.14

## setLineWidth

strokeSetLineWidth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> Float | `lineWidth`: width of the line in pixels
-> m () |

Sets the line width to be used when stroking.

The line width must be >= 0.

Since: 4.14

## setMiterLimit

strokeSetMiterLimit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> Float | `limit`: the miter limit
-> 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

strokeToCairo Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Stroke | `self`: a stroke
-> Context | `cr`: the cairo context to configure
-> m () |

A helper function that sets the stroke parameters of a cairo context from a `GskStroke`.

Since: 4.14