gi-pango-1.0.30: Pango 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.Pango.Structs.AttrShape

Contents

- Exported types
- Methods
  - new
  - newWithData
- Properties
  - attr
  - copyFunc
  - data
  - destroyFunc
  - inkRect
  - logicalRect

Description

The `PangoAttrShape` structure is used to represent attributes which impose shape restrictions.

Synopsis

- newtype AttrShape = AttrShape (ManagedPtr AttrShape)
- newZeroAttrShape :: MonadIO m => m AttrShape
- attrShapeNew :: (HasCallStack, MonadIO m) => Rectangle -> Rectangle -> m Attribute
- attrShapeNewWithData :: (HasCallStack, MonadIO m) => Rectangle -> Rectangle -> Ptr () -> Maybe AttrDataCopyFunc -> Maybe DestroyNotify -> m Attribute
- getAttrShapeAttr :: MonadIO m => AttrShape -> m Attribute
- clearAttrShapeCopyFunc :: MonadIO m => AttrShape -> m ()
- getAttrShapeCopyFunc :: MonadIO m => AttrShape -> m (Maybe AttrDataCopyFunc_WithClosures)
- setAttrShapeCopyFunc :: MonadIO m => AttrShape -> FunPtr C_AttrDataCopyFunc -> m ()
- clearAttrShapeData :: MonadIO m => AttrShape -> m ()
- getAttrShapeData :: MonadIO m => AttrShape -> m (Ptr ())
- setAttrShapeData :: MonadIO m => AttrShape -> Ptr () -> m ()
- clearAttrShapeDestroyFunc :: MonadIO m => AttrShape -> m ()
- getAttrShapeDestroyFunc :: MonadIO m => AttrShape -> m (Maybe DestroyNotify)
- setAttrShapeDestroyFunc :: MonadIO m => AttrShape -> FunPtr C_DestroyNotify -> m ()
- getAttrShapeInkRect :: MonadIO m => AttrShape -> m Rectangle
- getAttrShapeLogicalRect :: MonadIO m => AttrShape -> m Rectangle

# Exported types

newtype AttrShape Source #

Memory-managed wrapper type.

Constructors

AttrShape (ManagedPtr AttrShape) |

#### Instances

Instances details

Eq AttrShape Source # |
Instance details Defined in GI.Pango.Structs.AttrShape Methods (==) :: AttrShape -> AttrShape -> Bool Source # (/=) :: AttrShape -> AttrShape -> Bool Source #
BoxedPtr AttrShape Source # |
Instance details Defined in GI.Pango.Structs.AttrShape Methods boxedPtrCopy :: AttrShape -> IO AttrShape Source # boxedPtrFree :: AttrShape -> IO () Source #
CallocPtr AttrShape Source # |
Instance details Defined in GI.Pango.Structs.AttrShape Methods boxedPtrCalloc :: IO (Ptr AttrShape) Source #
ManagedPtrNewtype AttrShape Source # |
Instance details Defined in GI.Pango.Structs.AttrShape Methods toManagedPtr :: AttrShape -> ManagedPtr AttrShape Source #
tag ~ 'AttrSet => Constructible AttrShape tag Source # |
Instance details Defined in GI.Pango.Structs.AttrShape Methods new :: MonadIO m => (ManagedPtr AttrShape -> AttrShape) -> [AttrOp AttrShape tag] -> m AttrShape Source #

newZeroAttrShape :: MonadIO m => m AttrShape Source #

Construct a `AttrShape` struct initialized to zero.

# Methods

## new

attrShapeNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Rectangle | `inkRect`: ink rectangle to assign to each character
-> Rectangle | `logicalRect`: logical rectangle to assign to each character
-> m Attribute | Returns: the newly allocated `PangoAttribute`, which should be freed with `attributeDestroy`

Create a new shape attribute.

A shape is used to impose a particular ink and logical rectangle on the result of shaping a particular glyph. This might be used, for instance, for embedding a picture or a widget inside a `PangoLayout`.

## newWithData

attrShapeNewWithData Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Rectangle | `inkRect`: ink rectangle to assign to each character
-> Rectangle | `logicalRect`: logical rectangle to assign to each character
-> Ptr () | `data`: user data pointer
-> Maybe AttrDataCopyFunc | `copyFunc`: function to copy `data` when the attribute is copied. If `Nothing`, `data` is simply copied as a pointer
-> Maybe DestroyNotify | `destroyFunc`: function to free `data` when the attribute is freed
-> m Attribute | Returns: the newly allocated `PangoAttribute`, which should be freed with `attributeDestroy`

Creates a new shape attribute.

Like `attrShapeNew`, but a user data pointer is also provided; this pointer can be accessed when later rendering the glyph.

Since: 1.8

# Properties

## attr

the common portion of the attribute

getAttrShapeAttr :: MonadIO m => AttrShape -> m Attribute Source #

Get the value of the “`attr`” field. When overloading is enabled, this is equivalent to

    get attrShape #attr

## copyFunc

copy function for the user data

clearAttrShapeCopyFunc :: MonadIO m => AttrShape -> m () Source #

Set the value of the “`copy_func`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #copyFunc

getAttrShapeCopyFunc :: MonadIO m => AttrShape -> m (Maybe AttrDataCopyFunc_WithClosures) Source #

Get the value of the “`copy_func`” field. When overloading is enabled, this is equivalent to

    get attrShape #copyFunc

setAttrShapeCopyFunc :: MonadIO m => AttrShape -> FunPtr C_AttrDataCopyFunc -> m () Source #

Set the value of the “`copy_func`” field. When overloading is enabled, this is equivalent to

    set attrShape [ #copyFunc := value ]

## data

user data set (see `attrShapeNewWithData`)

clearAttrShapeData :: MonadIO m => AttrShape -> m () Source #

Set the value of the “`data`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #data

getAttrShapeData :: MonadIO m => AttrShape -> m (Ptr ()) Source #

Get the value of the “`data`” field. When overloading is enabled, this is equivalent to

    get attrShape #data

setAttrShapeData :: MonadIO m => AttrShape -> Ptr () -> m () Source #

Set the value of the “`data`” field. When overloading is enabled, this is equivalent to

    set attrShape [ #data := value ]

## destroyFunc

destroy function for the user data

clearAttrShapeDestroyFunc :: MonadIO m => AttrShape -> m () Source #

Set the value of the “`destroy_func`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #destroyFunc

getAttrShapeDestroyFunc :: MonadIO m => AttrShape -> m (Maybe DestroyNotify) Source #

Get the value of the “`destroy_func`” field. When overloading is enabled, this is equivalent to

    get attrShape #destroyFunc

setAttrShapeDestroyFunc :: MonadIO m => AttrShape -> FunPtr C_DestroyNotify -> m () Source #

Set the value of the “`destroy_func`” field. When overloading is enabled, this is equivalent to

    set attrShape [ #destroyFunc := value ]

## inkRect

the ink rectangle to restrict to

getAttrShapeInkRect :: MonadIO m => AttrShape -> m Rectangle Source #

Get the value of the “`ink_rect`” field. When overloading is enabled, this is equivalent to

    get attrShape #inkRect

## logicalRect

the logical rectangle to restrict to

getAttrShapeLogicalRect :: MonadIO m => AttrShape -> m Rectangle Source #

Get the value of the “`logical_rect`” field. When overloading is enabled, this is equivalent to

    get attrShape #logicalRect