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

Contents

- Exported types
- Methods
  - copy
  - free
  - fromString
  - getDecimalPoint
  - getPositionsInPixels
  - getSize
  - getTab
  - new
  - resize
  - setDecimalPoint
  - setPositionsInPixels
  - setTab
  - sort
  - toString

Description

A `PangoTabArray` contains an array of tab stops.

`PangoTabArray` can be used to set tab stops in a `PangoLayout`. Each tab stop has an alignment, a position, and optionally a character to use as decimal point.

Synopsis

- newtype TabArray = TabArray (ManagedPtr TabArray)
- tabArrayCopy :: (HasCallStack, MonadIO m) => TabArray -> m TabArray
- tabArrayFree :: (HasCallStack, MonadIO m) => TabArray -> m ()
- tabArrayFromString :: (HasCallStack, MonadIO m) => Text -> m (Maybe TabArray)
- tabArrayGetDecimalPoint :: (HasCallStack, MonadIO m) => TabArray -> Int32 -> m Char
- tabArrayGetPositionsInPixels :: (HasCallStack, MonadIO m) => TabArray -> m Bool
- tabArrayGetSize :: (HasCallStack, MonadIO m) => TabArray -> m Int32
- tabArrayGetTab :: (HasCallStack, MonadIO m) => TabArray -> Int32 -> m (TabAlign, Int32)
- tabArrayNew :: (HasCallStack, MonadIO m) => Int32 -> Bool -> m TabArray
- tabArrayResize :: (HasCallStack, MonadIO m) => TabArray -> Int32 -> m ()
- tabArraySetDecimalPoint :: (HasCallStack, MonadIO m) => TabArray -> Int32 -> Char -> m ()
- tabArraySetPositionsInPixels :: (HasCallStack, MonadIO m) => TabArray -> Bool -> m ()
- tabArraySetTab :: (HasCallStack, MonadIO m) => TabArray -> Int32 -> TabAlign -> Int32 -> m ()
- tabArraySort :: (HasCallStack, MonadIO m) => TabArray -> m ()
- tabArrayToString :: (HasCallStack, MonadIO m) => TabArray -> m Text

# Exported types

newtype TabArray Source #

Memory-managed wrapper type.

Constructors

TabArray (ManagedPtr TabArray) |

#### Instances

Instances details

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

# Methods

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

Expand

#### Methods

copy, free, resize, sort, toString.

#### Getters

getDecimalPoint, getPositionsInPixels, getSize, getTab.

#### Setters

setDecimalPoint, setPositionsInPixels, setTab.

## copy

tabArrayCopy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `src`: `PangoTabArray` to copy
-> m TabArray | Returns: the newly allocated `PangoTabArray`, which should be freed with `tabArrayFree`.

Copies a `PangoTabArray`.

## free

tabArrayFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> m () |

Frees a tab array and associated resources.

## fromString

tabArrayFromString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `text`: a string
-> m (Maybe TabArray) | Returns: a new `PangoTabArray`

Deserializes a `PangoTabArray` from a string.

This is the counterpart to `tabArrayToString`. See that functions for details about the format.

Since: 1.50

## getDecimalPoint

tabArrayGetDecimalPoint Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Int32 | `tabIndex`: the index of a tab stop
-> m Char |

Gets the Unicode character to use as decimal point.

This is only relevant for tabs with `TabAlignDecimal` alignment, which align content at the first occurrence of the decimal point character.

The default value of 0 means that Pango will use the decimal point according to the current locale.

Since: 1.50

## getPositionsInPixels

tabArrayGetPositionsInPixels Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> m Bool | Returns: whether positions are in pixels.

Returns `True` if the tab positions are in pixels, `False` if they are in Pango units.

## getSize

tabArrayGetSize Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> m Int32 | Returns: the number of tab stops in the array.

Gets the number of tab stops in `tabArray`.

## getTab

tabArrayGetTab Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Int32 | `tabIndex`: tab stop index
-> m (TabAlign, Int32) |

Gets the alignment and position of a tab stop.

## new

tabArrayNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `initialSize`: Initial number of tab stops to allocate, can be 0
-> Bool | `positionsInPixels`: whether positions are in pixel units
-> m TabArray | Returns: the newly allocated `PangoTabArray`, which should be freed with `tabArrayFree`.

Creates an array of `initialSize` tab stops.

Tab stops are specified in pixel units if `positionsInPixels` is `True`, otherwise in Pango units. All stops are initially at position 0.

## resize

tabArrayResize Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Int32 | `newSize`: new size of the array
-> m () |

Resizes a tab array.

You must subsequently initialize any tabs that were added as a result of growing the array.

## setDecimalPoint

tabArraySetDecimalPoint Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Int32 | `tabIndex`: the index of a tab stop
-> Char | `decimalPoint`: the decimal point to use
-> m () |

Sets the Unicode character to use as decimal point.

This is only relevant for tabs with `TabAlignDecimal` alignment, which align content at the first occurrence of the decimal point character.

By default, Pango uses the decimal point according to the current locale.

Since: 1.50

## setPositionsInPixels

tabArraySetPositionsInPixels Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Bool | `positionsInPixels`: whether positions are in pixels
-> m () |

Sets whether positions in this array are specified in pixels.

Since: 1.50

## setTab

tabArraySetTab Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> Int32 | `tabIndex`: the index of a tab stop
-> TabAlign | `alignment`: tab alignment
-> Int32 | `location`: tab location in Pango units
-> m () |

Sets the alignment and location of a tab stop.

## sort

tabArraySort Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> m () |

Utility function to ensure that the tab stops are in increasing order.

Since: 1.50

## toString

tabArrayToString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TabArray | `tabArray`: a `PangoTabArray`
-> m Text | Returns: a newly allocated string

Serializes a `PangoTabArray` to a string.

In the resulting string, serialized tabs are separated by newlines or commas.

Individual tabs are serialized to a string of the form

ALIGNMENT:
  POSITION[:DECIMAL_POINT]

Where ALIGNMENT is one of _left_, _right_, _center_ or _decimal_, and POSITION is the position of the tab, optionally followed by the unit _px_. If ALIGNMENT is omitted, it defaults to _left_. If ALIGNMENT is _decimal_, the DECIMAL_POINT character may be specified as a Unicode codepoint.

Note that all tabs in the array must use the same unit.

A typical example:

100px 200px center:300px right:400px

Since: 1.50