gi-graphene-1.0.4: Graphene bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Graphene.Structs.Size

Description

A size.

Since: 1.0

Synopsis

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 #

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

GBoxed Size Source # 
Instance details

Defined in GI.Graphene.Structs.Size

ManagedPtrNewtype Size Source # 
Instance details

Defined in GI.Graphene.Structs.Size

TypedObject Size Source # 
Instance details

Defined in GI.Graphene.Structs.Size

Methods

glibType :: IO GType #

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 #

IsGValue (Maybe Size) Source #

Convert Size to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Size

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 ]