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

Contents

- Exported types
- Methods
  - alloc
  - bounds
  - contains
  - free
  - getPoint
  - init
  - initFromPoints
  - initFromRect

Description

A 4 vertex quadrilateral, as represented by four `Point`.

The contents of a `Quad` are private and should never be accessed directly.

Since: 1.0

Synopsis

- newtype Quad = Quad (ManagedPtr Quad)
- newZeroQuad :: MonadIO m => m Quad
- quadAlloc :: (HasCallStack, MonadIO m) => m Quad
- quadBounds :: (HasCallStack, MonadIO m) => Quad -> m Rect
- quadContains :: (HasCallStack, MonadIO m) => Quad -> Point -> m Bool
- quadFree :: (HasCallStack, MonadIO m) => Quad -> m ()
- quadGetPoint :: (HasCallStack, MonadIO m) => Quad -> Word32 -> m Point
- quadInit :: (HasCallStack, MonadIO m) => Quad -> Point -> Point -> Point -> Point -> m Quad
- quadInitFromPoints :: (HasCallStack, MonadIO m) => Quad -> [Point] -> m Quad
- quadInitFromRect :: (HasCallStack, MonadIO m) => Quad -> Rect -> m Quad

# Exported types

newtype Quad Source #

Memory-managed wrapper type.

Constructors

Quad (ManagedPtr Quad) |

#### Instances

Instances details

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

newZeroQuad :: MonadIO m => m Quad Source #

Construct a `Quad` struct initialized to zero.

# Methods

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

Expand

#### Methods

bounds, contains, free, init, initFromPoints, initFromRect.

#### Getters

getPoint.

#### Setters

None.

## alloc

quadAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Quad | Returns: the newly created `Quad` instance

Allocates a new `Quad` instance.

The contents of the returned instance are undefined.

Since: 1.0

## bounds

quadBounds Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: a `Quad`
-> m Rect |

Computes the bounding rectangle of `q` and places it into `r`.

Since: 1.0

## contains

quadContains Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: a `Quad`
-> Point | `p`: a `Point`
-> m Bool | Returns: `true` if the point is inside the `Quad`

Checks if the given `Quad` contains the given `Point`.

Since: 1.0

## free

quadFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: a `Quad`
-> m () |

Frees the resources allocated by `quadAlloc`

Since: 1.0

## getPoint

quadGetPoint Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: a `Quad`
-> Word32 | `index_`: the index of the point to retrieve
-> m Point | Returns: a `Point`

Retrieves the point of a `Quad` at the given index.

Since: 1.0

## init

quadInit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: the `Quad` to initialize
-> Point | `p1`: the first point of the quadrilateral
-> Point | `p2`: the second point of the quadrilateral
-> Point | `p3`: the third point of the quadrilateral
-> Point | `p4`: the fourth point of the quadrilateral
-> m Quad | Returns: the initialized `Quad`

Initializes a `Quad` with the given points.

Since: 1.0

## initFromPoints

quadInitFromPoints Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: the `Quad` to initialize
-> [Point] | `points`: an array of 4 `Point`
-> m Quad | Returns: the initialized `Quad`

Initializes a `Quad` using an array of points.

Since: 1.2

## initFromRect

quadInitFromRect Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Quad | `q`: the `Quad` to initialize
-> Rect | `r`: a `Rect`
-> m Quad | Returns: the initialized `Quad`

Initializes a `Quad` using the four corners of the given `Rect`.

Since: 1.0