| 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
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
Memory-managed wrapper type.
Constructors
| TabArray (ManagedPtr TabArray) |
Instances
| Eq TabArray Source # | |
| GBoxed TabArray Source # | |
Defined in GI.Pango.Structs.TabArray | |
| ManagedPtrNewtype TabArray Source # | |
Defined in GI.Pango.Structs.TabArray Methods | |
| TypedObject TabArray Source # | |
| HasParentTypes TabArray Source # | |
Defined in GI.Pango.Structs.TabArray | |
| IsGValue (Maybe TabArray) Source # | Convert |
| type ParentTypes TabArray Source # | |
Defined in GI.Pango.Structs.TabArray | |
Methods
Click to display all available methods, including inherited ones
Methods
copy, free, resize, sort, toString.
Getters
getDecimalPoint, getPositionsInPixels, getSize, getTab.
Setters
copy
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> m TabArray | Returns: the newly allocated |
Copies a PangoTabArray.
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> m () |
Frees a tab array and associated resources.
fromString
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe TabArray) | Returns: a new |
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 |
|
| -> Int32 |
|
| -> 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 |
|
| -> m Bool | Returns: whether positions are in pixels. |
getSize
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> m Int32 | Returns: the number of tab stops in the array. |
Gets the number of tab stops in tabArray.
getTab
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> Int32 |
|
| -> m (TabAlign, Int32) |
Gets the alignment and position of a tab stop.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Int32 |
|
| -> Bool |
|
| -> m TabArray | Returns: the newly allocated |
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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> Int32 |
|
| -> 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 |
|
| -> Int32 |
|
| -> Char |
|
| -> 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 |
|
| -> Bool |
|
| -> m () |
Sets whether positions in this array are specified in pixels.
Since: 1.50
setTab
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> Int32 |
|
| -> TabAlign |
|
| -> Int32 |
|
| -> m () |
Sets the alignment and location of a tab stop.
sort
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> m () |
Utility function to ensure that the tab stops are in increasing order.
Since: 1.50
toString
Arguments
| :: (HasCallStack, MonadIO m) | |
| => TabArray |
|
| -> 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