Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A size.
Since: 1.0
Synopsis
- newtype Size = Size (ManagedPtr Size)
- newZeroSize :: MonadIO m => m Size
- noSize :: Maybe Size
- sizeAlloc :: (HasCallStack, MonadIO m) => m Size
- sizeEqual :: (HasCallStack, MonadIO m) => Size -> Size -> m Bool
- sizeFree :: (HasCallStack, MonadIO m) => Size -> m ()
- sizeInit :: (HasCallStack, MonadIO m) => Size -> Float -> Float -> m Size
- sizeInitFromSize :: (HasCallStack, MonadIO m) => Size -> Size -> m Size
- sizeInterpolate :: (HasCallStack, MonadIO m) => Size -> Size -> Double -> m Size
- sizeScale :: (HasCallStack, MonadIO m) => Size -> Float -> m Size
- sizeZero :: (HasCallStack, MonadIO m) => m Size
- getSizeHeight :: MonadIO m => Size -> m Float
- setSizeHeight :: MonadIO m => Size -> Float -> m ()
- getSizeWidth :: MonadIO m => Size -> m Float
- setSizeWidth :: MonadIO m => Size -> Float -> m ()
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Size | Returns: the newly allocated |
equal
:: (HasCallStack, MonadIO m) | |
=> Size |
|
-> Size |
|
-> m Bool | Returns: |
Checks whether the two give Size
are equal.
Since: 1.0
free
:: (HasCallStack, MonadIO m) | |
=> Size |
|
-> m () |
Frees the resources allocated by sizeAlloc
.
Since: 1.0
init
:: (HasCallStack, MonadIO m) | |
=> Size |
|
-> Float |
|
-> Float |
|
-> m Size | Returns: the initialized |
Initializes a Size
using the given width
and height
.
Since: 1.0
initFromSize
:: (HasCallStack, MonadIO m) | |
=> Size |
|
-> Size |
|
-> m Size | Returns: the initialized |
Initializes a Size
using the width and height of
the given src
.
Since: 1.0
interpolate
:: (HasCallStack, MonadIO m) | |
=> Size |
|
-> Size |
|
-> Double |
|
-> m Size |
Linearly interpolates the two given Size
using the given
interpolation factor
.
Since: 1.0
scale
Scales the components of a Size
using the given factor
.
Since: 1.0
zero
:: (HasCallStack, MonadIO m) | |
=> m Size | Returns: a constant size |
A constant pointer to a zero Size
, useful for
equality checks and interpolations.
Since: 1.0
Properties
height
the height
getSizeHeight :: MonadIO m => Size -> m Float Source #
Get the value of the “height
” field.
When overloading is enabled, this is equivalent to
get
size #height
setSizeHeight :: MonadIO m => Size -> Float -> m () Source #
Set the value of the “height
” field.
When overloading is enabled, this is equivalent to
set
size [ #height:=
value ]
width
the width
getSizeWidth :: MonadIO m => Size -> m Float Source #
Get the value of the “width
” field.
When overloading is enabled, this is equivalent to
get
size #width
setSizeWidth :: MonadIO m => Size -> Float -> m () Source #
Set the value of the “width
” field.
When overloading is enabled, this is equivalent to
set
size [ #width:=
value ]