gi-gsk-4.0.8: Gsk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gsk.Structs.Stroke

Description

A GskStroke struct collects the parameters that influence the operation of stroking a path.

Since: 4.14

Synopsis

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 #

(/=) :: Stroke -> Stroke -> Bool #

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

TypedObject Stroke Source # 
Instance details

Defined in GI.Gsk.Structs.Stroke

Methods

glibType :: IO GType

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

gvalueSet_ :: Ptr GValue -> Maybe Stroke -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Stroke)

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: GskStroke to copy

-> m Stroke

Returns: a new GskStroke. Use strokeFree to free it

Creates a copy of the given other stroke.

Since: 4.14

equal

strokeEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ptr ()

stroke1: the first GskStroke

-> Ptr ()

stroke2: the second GskStroke

-> m Bool

Returns: TRUE if the 2 strokes are equal, FALSE otherwise

Checks if 2 strokes are identical.

Since: 4.14

free

strokeFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> m () 

Frees a GskStroke.

Since: 4.14

getDash

strokeGetDash Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> m (Maybe [Float])

Returns: The dash array or NULL if the dash array is empty.

Gets the dash array in use or NULL if dashing is disabled.

Since: 4.14

getDashOffset

strokeGetDashOffset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> m Float 

Returns the dash_offset of a GskStroke.

Since: 4.14

getLineCap

strokeGetLineCap Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> 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 GskStroke

-> 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 GskStroke

-> m Float

Returns: The line width

Gets the line width used.

Since: 4.14

getMiterLimit

strokeGetMiterLimit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> m Float 

Returns the miter limit of a GskStroke.

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 GskStroke

-> Maybe [Float]

dash: the array of dashes

-> 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

strokeSetDashOffset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> 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: aGskStroke

-> LineCap

lineCap: the GskLineCap

-> 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 GskStroke

-> 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 GskStroke

-> 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 GskStroke

-> Float

limit: the miter limit

-> 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

strokeToCairo Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Stroke

self: a GskStroke

-> Context

cr: the cairo context to configure

-> m () 

A helper function that sets the stroke parameters of cr from the values found in self.

Since: 4.14