gi-graphene-1.0.8: Graphene 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.Graphene.Structs.Size

Contents

- Exported types
- Methods
  - alloc
  - equal
  - free
  - init
  - initFromSize
  - interpolate
  - scale
  - zero
- Properties
  - height
  - width

Description

A size.

Since: 1.0

Synopsis

- newtype Size = Size (ManagedPtr Size)
- newZeroSize :: MonadIO m => m 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

newtype Size Source #

Memory-managed wrapper type.

Constructors

Size (ManagedPtr Size) |

#### Instances

Instances details

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

newZeroSize :: MonadIO m => m Size Source #

Construct a `Size` struct initialized to zero.

# Methods

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

Expand

#### Methods

equal, free, init, initFromSize, interpolate, scale.

#### Getters

None.

#### Setters

None.

## alloc

sizeAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Size | Returns: the newly allocated `Size`

Allocates a new `Size`.

The contents of the returned value are undefined.

Since: 1.0

## equal

sizeEqual Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `a`: a `Size`
-> Size | `b`: a `Size`
-> m Bool | Returns: `true` if the sizes are equal

Checks whether the two give `Size` are equal.

Since: 1.0

## free

sizeFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `s`: a `Size`
-> m () |

Frees the resources allocated by `sizeAlloc`.

Since: 1.0

## init

sizeInit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `s`: a `Size`
-> Float | `width`: the width
-> Float | `height`: the height
-> m Size | Returns: the initialized `Size`

Initializes a `Size` using the given `width` and `height`.

Since: 1.0

## initFromSize

sizeInitFromSize Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `s`: a `Size`
-> Size | `src`: a `Size`
-> m Size | Returns: the initialized `Size`

Initializes a `Size` using the width and height of the given `src`.

Since: 1.0

## interpolate

sizeInterpolate Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `a`: a `Size`
-> Size | `b`: a `Size`
-> Double | `factor`: the linear interpolation factor
-> m Size |

Linearly interpolates the two given `Size` using the given interpolation `factor`.

Since: 1.0

## scale

sizeScale Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Size | `s`: a `Size`
-> Float | `factor`: the scaling factor
-> m Size |

Scales the components of a `Size` using the given `factor`.

Since: 1.0

## zero

sizeZero Source #

Arguments

:: (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 ]