Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
An IBusText is the main text object in IBus. The text is decorated according to associated IBusAttribute, e.g. the foreground/background color, underline, and applied scope.
see_also: Attribute
Synopsis
- newtype Text = Text (ManagedPtr Text)
- class (GObject o, IsDescendantOf Text o) => IsText o
- toText :: (MonadIO m, IsText o) => o -> m Text
- textAppendAttribute :: (HasCallStack, MonadIO m, IsText a) => a -> Word32 -> Word32 -> Word32 -> Int32 -> m ()
- textGetAttributes :: (HasCallStack, MonadIO m, IsText a) => a -> m AttrList
- textGetLength :: (HasCallStack, MonadIO m, IsText a) => a -> m Word32
- textGetText :: (HasCallStack, MonadIO m, IsText a) => a -> m Text
- textNewFromString :: (HasCallStack, MonadIO m) => Text -> m Text
- textNewFromUcs4 :: (HasCallStack, MonadIO m) => Char -> m Text
- textNewFromUnichar :: (HasCallStack, MonadIO m) => Char -> m Text
- textSetAttributes :: (HasCallStack, MonadIO m, IsText a, IsAttrList b) => a -> b -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Text Source # | |
GObject Text Source # | |
Defined in GI.IBus.Objects.Text | |
ManagedPtrNewtype Text Source # | |
Defined in GI.IBus.Objects.Text toManagedPtr :: Text -> ManagedPtr Text | |
TypedObject Text Source # | |
Defined in GI.IBus.Objects.Text glibType :: IO GType | |
IsGValue Text Source # | Convert |
Defined in GI.IBus.Objects.Text fromGValue :: GValue -> IO Text | |
HasParentTypes Text Source # | |
Defined in GI.IBus.Objects.Text | |
type ParentTypes Text Source # | |
Defined in GI.IBus.Objects.Text |
class (GObject o, IsDescendantOf Text o) => IsText o Source #
Instances
(GObject o, IsDescendantOf Text o) => IsText o Source # | |
Defined in GI.IBus.Objects.Text |
Methods
Overloaded methods
appendAttribute
:: (HasCallStack, MonadIO m, IsText a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> Int32 |
|
-> m () |
Append an IBusAttribute for IBusText.
getAttributes
Return the attributes in an Text
. Should not be freed.
getLength
:: (HasCallStack, MonadIO m, IsText a) | |
=> a |
|
-> m Word32 | Returns: Number of character in |
Return number of characters in an Text
.
This function is based on utf8Strlen
, so unlike strlen()
,
it does not count by bytes but characters instead.
getText
Return the text in an Text
. Should not be freed.
newFromString
newFromUcs4
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m Text | Returns: A newly allocated |
Creates a new Text
from an UCS-4 encoded string.
str
will be duplicated in IBusText, so feel free to free str
after this
function.
newFromUnichar
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m Text | Returns: A newly allocated |
Creates a new Text
from a single UCS4-encoded character.
setAttributes
:: (HasCallStack, MonadIO m, IsText a, IsAttrList b) | |
=> a |
|
-> b |
|
-> m () |
No description available in the introspection data.