gi-pango-1.0.19: Pango bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.Pango.Structs.Attribute

Contents

- Exported types
- Methods
  - destroy
  - equal
  - init
- Properties
  - endIndex
  - klass
  - startIndex

Description

The `Attribute` structure represents the common portions of all attributes. Particular types of attributes include this structure as their initial portion. The common portion of the attribute holds the range to which the value in the type-specific part of the attribute applies and should be initialized using `attributeInit`. By default an attribute will have an all-inclusive range of [0,`G_MAXUINT`].

Synopsis

- newtype Attribute = Attribute (ManagedPtr Attribute)
- noAttribute :: Maybe Attribute
- attributeDestroy :: (HasCallStack, MonadIO m) => Attribute -> m ()
- attributeEqual :: (HasCallStack, MonadIO m) => Attribute -> Attribute -> m Bool
- attributeInit :: (HasCallStack, MonadIO m) => Attribute -> AttrClass -> m ()
- getAttributeEndIndex :: MonadIO m => Attribute -> m Word32
- setAttributeEndIndex :: MonadIO m => Attribute -> Word32 -> m ()
- clearAttributeKlass :: MonadIO m => Attribute -> m ()
- getAttributeKlass :: MonadIO m => Attribute -> m (Maybe AttrClass)
- setAttributeKlass :: MonadIO m => Attribute -> Ptr AttrClass -> m ()
- getAttributeStartIndex :: MonadIO m => Attribute -> m Word32
- setAttributeStartIndex :: MonadIO m => Attribute -> Word32 -> m ()

# Exported types

newtype Attribute Source #

Memory-managed wrapper type.

Constructors

Attribute (ManagedPtr Attribute) |

Instances

WrappedPtr Attribute Source # |
Instance details Defined in GI.Pango.Structs.Attribute Methods wrappedPtrCalloc :: IO (Ptr Attribute) Source # wrappedPtrCopy :: Attribute -> IO Attribute Source # wrappedPtrFree :: Maybe (FunPtr (Ptr Attribute -> IO ())) Source #

noAttribute :: Maybe Attribute Source #

A convenience alias for `Nothing` :: `Maybe` `Attribute`.

# Methods

## destroy

attributeDestroy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Attribute | `attr`: a `Attribute`.
-> m () |

Destroy a `Attribute` and free all associated memory.

## equal

attributeEqual Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Attribute | `attr1`: a `Attribute`
-> Attribute | `attr2`: another `Attribute`
-> m Bool | Returns: `True` if the two attributes have the same value.

Compare two attributes for equality. This compares only the actual value of the two attributes and not the ranges that the attributes apply to.

## init

attributeInit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Attribute | `attr`: a `Attribute`
-> AttrClass | `klass`: a `AttrClass`
-> m () |

Initializes `attr`'s klass to `klass`, it's start_index to `ATTR_INDEX_FROM_TEXT_BEGINNING` and end_index to `PANGO_ATTR_INDEX_TO_TEXT_END` such that the attribute applies to the entire text by default.

Since: 1.20

# Properties

## endIndex

end index of the range (in bytes). The character at this index is not included in the range.

getAttributeEndIndex :: MonadIO m => Attribute -> m Word32 Source #

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

    get attribute #endIndex

setAttributeEndIndex :: MonadIO m => Attribute -> Word32 -> m () Source #

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

    set attribute [ #endIndex := value ]

## klass

the class structure holding information about the type of the attribute

clearAttributeKlass :: MonadIO m => Attribute -> m () Source #

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

    clear #klass

getAttributeKlass :: MonadIO m => Attribute -> m (Maybe AttrClass) Source #

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

    get attribute #klass

setAttributeKlass :: MonadIO m => Attribute -> Ptr AttrClass -> m () Source #

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

    set attribute [ #klass := value ]

## startIndex

the start index of the range (in bytes).

getAttributeStartIndex :: MonadIO m => Attribute -> m Word32 Source #

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

    get attribute #startIndex

setAttributeStartIndex :: MonadIO m => Attribute -> Word32 -> m () Source #

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

    set attribute [ #startIndex := value ]