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 |
The TextBuffer
structure contains private
data and it should only be accessed using the provided API.
Since: 1.10
Synopsis
- newtype TextBuffer = TextBuffer (ManagedPtr TextBuffer)
- class (GObject o, IsDescendantOf TextBuffer o) => IsTextBuffer o
- toTextBuffer :: (MonadIO m, IsTextBuffer o) => o -> m TextBuffer
- textBufferDeleteText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Word32 -> Int32 -> m Word32
- textBufferEmitDeletedText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Word32 -> Word32 -> m ()
- textBufferEmitInsertedText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Word32 -> Text -> Word32 -> m ()
- textBufferGetBytes :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> m Word64
- textBufferGetLength :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> m Word32
- textBufferGetMaxLength :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> m Int32
- textBufferGetText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> m Text
- textBufferInsertText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Word32 -> Text -> Int32 -> m Word32
- textBufferNew :: (HasCallStack, MonadIO m) => m TextBuffer
- textBufferNewWithText :: (HasCallStack, MonadIO m) => Maybe Text -> Int64 -> m TextBuffer
- textBufferSetMaxLength :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Int32 -> m ()
- textBufferSetText :: (HasCallStack, MonadIO m, IsTextBuffer a) => a -> Text -> Int32 -> m ()
- getTextBufferLength :: (MonadIO m, IsTextBuffer o) => o -> m Word32
- constructTextBufferMaxLength :: (IsTextBuffer o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getTextBufferMaxLength :: (MonadIO m, IsTextBuffer o) => o -> m Int32
- setTextBufferMaxLength :: (MonadIO m, IsTextBuffer o) => o -> Int32 -> m ()
- getTextBufferText :: (MonadIO m, IsTextBuffer o) => o -> m Text
- type TextBufferDeletedTextCallback = Word32 -> Word32 -> IO ()
- afterTextBufferDeletedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferDeletedTextCallback) -> m SignalHandlerId
- onTextBufferDeletedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferDeletedTextCallback) -> m SignalHandlerId
- type TextBufferInsertedTextCallback = Word32 -> Text -> Word32 -> IO ()
- afterTextBufferInsertedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferInsertedTextCallback) -> m SignalHandlerId
- onTextBufferInsertedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferInsertedTextCallback) -> m SignalHandlerId
Exported types
newtype TextBuffer Source #
Memory-managed wrapper type.
TextBuffer (ManagedPtr TextBuffer) |
Instances
Eq TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer (==) :: TextBuffer -> TextBuffer -> Bool # (/=) :: TextBuffer -> TextBuffer -> Bool # | |
GObject TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer | |
ManagedPtrNewtype TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer toManagedPtr :: TextBuffer -> ManagedPtr TextBuffer | |
TypedObject TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer | |
HasParentTypes TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer | |
IsGValue (Maybe TextBuffer) Source # | Convert |
Defined in GI.Clutter.Objects.TextBuffer gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TextBuffer -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TextBuffer) | |
type ParentTypes TextBuffer Source # | |
Defined in GI.Clutter.Objects.TextBuffer type ParentTypes TextBuffer = '[Object] |
class (GObject o, IsDescendantOf TextBuffer o) => IsTextBuffer o Source #
Type class for types which can be safely cast to TextBuffer
, for instance with toTextBuffer
.
Instances
(GObject o, IsDescendantOf TextBuffer o) => IsTextBuffer o Source # | |
Defined in GI.Clutter.Objects.TextBuffer |
toTextBuffer :: (MonadIO m, IsTextBuffer o) => o -> m TextBuffer Source #
Cast to TextBuffer
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, deleteText, emitDeletedText, emitInsertedText, forceFloating, freezeNotify, getv, insertText, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBytes, getData, getLength, getMaxLength, getProperty, getQdata, getText.
Setters
deleteText
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Word32 |
|
-> Int32 |
|
-> m Word32 | Returns: The number of characters deleted. |
Deletes a sequence of characters from the buffer. nChars
characters are
deleted starting at position
. If nChars
is negative, then all characters
until the end of the text are deleted.
If position
or nChars
are out of bounds, then they are coerced to sane
values.
Note that the positions are specified in characters, not bytes.
Since: 1.10
emitDeletedText
textBufferEmitDeletedText Source #
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
emitInsertedText
textBufferEmitInsertedText Source #
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> Word32 |
|
-> m () |
getBytes
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> m Word64 | Returns: The byte length of the buffer. |
Retrieves the length in bytes of the buffer.
See textBufferGetLength
.
Since: 1.10
getLength
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> m Word32 | Returns: The number of characters in the buffer. |
Retrieves the length in characters of the buffer.
Since: 1.10
getMaxLength
textBufferGetMaxLength Source #
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> m Int32 | Returns: the maximum allowed number of characters
in |
Retrieves the maximum allowed length of the text in
buffer
. See textBufferSetMaxLength
.
Since: 1.10
getText
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> m Text | Returns: a pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored. |
Retrieves the contents of the buffer.
The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.
Since: 1.10
insertText
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> Int32 |
|
-> m Word32 | Returns: The number of characters actually inserted. |
Inserts nChars
characters of chars
into the contents of the
buffer, at position position
.
If nChars
is negative, then characters from chars will be inserted
until a null-terminator is found. If position
or nChars
are out of
bounds, or the maximum buffer text length is exceeded, then they are
coerced to sane values.
Note that the position and length are in characters, not in bytes.
Since: 1.10
new
:: (HasCallStack, MonadIO m) | |
=> m TextBuffer | Returns: A new ClutterTextBuffer object. |
Create a new ClutterTextBuffer object.
Since: 1.10
newWithText
textBufferNewWithText Source #
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Int64 |
|
-> m TextBuffer | Returns: A new ClutterTextBuffer object. |
Create a new ClutterTextBuffer object with some text.
Since: 1.10
setMaxLength
textBufferSetMaxLength Source #
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit.
Since: 1.10
setText
:: (HasCallStack, MonadIO m, IsTextBuffer a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m () |
Sets the text in the buffer.
This is roughly equivalent to calling textBufferDeleteText
and textBufferInsertText
.
Note that nChars
is in characters, not in bytes.
Since: 1.10
Properties
length
The length (in characters) of the text in buffer.
Since: 1.10
getTextBufferLength :: (MonadIO m, IsTextBuffer o) => o -> m Word32 Source #
Get the value of the “length
” property.
When overloading is enabled, this is equivalent to
get
textBuffer #length
maxLength
The maximum length (in characters) of the text in the buffer.
Since: 1.10
constructTextBufferMaxLength :: (IsTextBuffer o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “max-length
” property. This is rarely needed directly, but it is used by new
.
getTextBufferMaxLength :: (MonadIO m, IsTextBuffer o) => o -> m Int32 Source #
Get the value of the “max-length
” property.
When overloading is enabled, this is equivalent to
get
textBuffer #maxLength
setTextBufferMaxLength :: (MonadIO m, IsTextBuffer o) => o -> Int32 -> m () Source #
Set the value of the “max-length
” property.
When overloading is enabled, this is equivalent to
set
textBuffer [ #maxLength:=
value ]
text
The contents of the buffer.
Since: 1.10
getTextBufferText :: (MonadIO m, IsTextBuffer o) => o -> m Text Source #
Get the value of the “text
” property.
When overloading is enabled, this is equivalent to
get
textBuffer #text
Signals
deletedText
type TextBufferDeletedTextCallback Source #
= Word32 |
|
-> Word32 |
|
-> IO () |
This signal is emitted after text is deleted from the buffer.
Since: 1.10
afterTextBufferDeletedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferDeletedTextCallback) -> m SignalHandlerId Source #
Connect a signal handler for the deletedText signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
textBuffer #deletedText callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextBufferDeletedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferDeletedTextCallback) -> m SignalHandlerId Source #
Connect a signal handler for the deletedText signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
textBuffer #deletedText callback
insertedText
type TextBufferInsertedTextCallback Source #
= Word32 |
|
-> Text |
|
-> Word32 |
|
-> IO () |
This signal is emitted after text is inserted into the buffer.
Since: 1.10
afterTextBufferInsertedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferInsertedTextCallback) -> m SignalHandlerId Source #
Connect a signal handler for the insertedText signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
textBuffer #insertedText callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextBufferInsertedText :: (IsTextBuffer a, MonadIO m) => a -> ((?self :: a) => TextBufferInsertedTextCallback) -> m SignalHandlerId Source #
Connect a signal handler for the insertedText signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
textBuffer #insertedText callback