gi-pango-1.0.25: Pango bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Pango.Structs.TabArray

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

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

GBoxed TabArray Source # 
Instance details

Defined in GI.Pango.Structs.TabArray

ManagedPtrNewtype TabArray Source # 
Instance details

Defined in GI.Pango.Structs.TabArray

TypedObject TabArray Source # 
Instance details

Defined in GI.Pango.Structs.TabArray

Methods

glibType :: IO GType #

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

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.

No guarantees are made about the format of the string, it may change between Pango versions.

The intended use of this function is testing and debugging. The format is not meant as a permanent storage format.

Since: 1.50