| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Pango.Structs.Item
Description
The PangoItem structure stores information about a segment of text.
You typically obtain PangoItems by itemizing a piece of text
with [funcitemize].
Synopsis
- newtype Item = Item (ManagedPtr Item)
- newZeroItem :: MonadIO m => m Item
- itemApplyAttrs :: (HasCallStack, MonadIO m) => Item -> AttrIterator -> m ()
- itemCopy :: (HasCallStack, MonadIO m) => Maybe Item -> m (Maybe Item)
- itemFree :: (HasCallStack, MonadIO m) => Maybe Item -> m ()
- itemNew :: (HasCallStack, MonadIO m) => m Item
- itemSplit :: (HasCallStack, MonadIO m) => Item -> Int32 -> Int32 -> m Item
- getItemAnalysis :: MonadIO m => Item -> m Analysis
- getItemLength :: MonadIO m => Item -> m Int32
- setItemLength :: MonadIO m => Item -> Int32 -> m ()
- getItemNumChars :: MonadIO m => Item -> m Int32
- setItemNumChars :: MonadIO m => Item -> Int32 -> m ()
- getItemOffset :: MonadIO m => Item -> m Int32
- setItemOffset :: MonadIO m => Item -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq Item Source # | |
| GBoxed Item Source # | |
Defined in GI.Pango.Structs.Item | |
| ManagedPtrNewtype Item Source # | |
Defined in GI.Pango.Structs.Item Methods toManagedPtr :: Item -> ManagedPtr Item | |
| TypedObject Item Source # | |
Defined in GI.Pango.Structs.Item | |
| HasParentTypes Item Source # | |
Defined in GI.Pango.Structs.Item | |
| tag ~ 'AttrSet => Constructible Item tag Source # | |
| IsGValue (Maybe Item) Source # | Convert |
Defined in GI.Pango.Structs.Item Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Item -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Item) | |
| type ParentTypes Item Source # | |
Defined in GI.Pango.Structs.Item | |
Methods
Click to display all available methods, including inherited ones
applyAttrs
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Item |
|
| -> AttrIterator |
|
| -> m () |
Add attributes to a PangoItem.
The idea is that you have attributes that don't affect itemization,
such as font features, so you filter them out using
attrListFilter, itemize your text, then reapply the
attributes to the resulting items using this function.
The iter should be positioned before the range of the item,
and will be advanced past it. This function is meant to be called
in a loop over the items resulting from itemization, while passing
the iter to each call.
Since: 1.44
copy
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe Item |
|
| -> m (Maybe Item) | Returns: the newly allocated |
Copy an existing PangoItem structure.
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe Item |
|
| -> m () |
Free a PangoItem and all associated memory.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Item | Returns: the newly allocated |
Creates a new PangoItem structure initialized to default values.
split
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Item |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m Item | Returns: new item representing text before |
Modifies orig to cover only the text after splitIndex, and
returns a new item that covers the text before splitIndex that
used to be in orig.
You can think of splitIndex as the length of the returned item.
splitIndex may not be 0, and it may not be greater than or equal
to the length of orig (that is, there must be at least one byte
assigned to each item, you can't create a zero-length item).
splitOffset is the length of the first item in chars, and must be
provided because the text used to generate the item isn't available,
so pango_item_split() can't count the char length of the split items
itself.
Properties
analysis
analysis results for the item.
getItemAnalysis :: MonadIO m => Item -> m Analysis Source #
Get the value of the “analysis” field.
When overloading is enabled, this is equivalent to
get item #analysis
length
length of this item in bytes.
getItemLength :: MonadIO m => Item -> m Int32 Source #
Get the value of the “length” field.
When overloading is enabled, this is equivalent to
get item #length
setItemLength :: MonadIO m => Item -> Int32 -> m () Source #
Set the value of the “length” field.
When overloading is enabled, this is equivalent to
setitem [ #length:=value ]
numChars
number of Unicode characters in the item.
getItemNumChars :: MonadIO m => Item -> m Int32 Source #
Get the value of the “num_chars” field.
When overloading is enabled, this is equivalent to
get item #numChars
setItemNumChars :: MonadIO m => Item -> Int32 -> m () Source #
Set the value of the “num_chars” field.
When overloading is enabled, this is equivalent to
setitem [ #numChars:=value ]
offset
byte offset of the start of this item in text.
getItemOffset :: MonadIO m => Item -> m Int32 Source #
Get the value of the “offset” field.
When overloading is enabled, this is equivalent to
get item #offset
setItemOffset :: MonadIO m => Item -> Int32 -> m () Source #
Set the value of the “offset” field.
When overloading is enabled, this is equivalent to
setitem [ #offset:=value ]