gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.TextBuffer

Description

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

Synopsis

Exported types

newtype TextBuffer Source #

Memory-managed wrapper type.

Instances

Instances details
Eq TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

IsGValue TextBuffer Source #

Convert TextBuffer to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.TextBuffer

ManagedPtrNewtype TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

TypedObject TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

Methods

glibType :: IO GType #

GObject TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

HasParentTypes TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

type ParentTypes TextBuffer Source # 
Instance details

Defined in GI.Gtk.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

Instances details
(GObject o, IsDescendantOf TextBuffer o) => IsTextBuffer o Source # 
Instance details

Defined in GI.Gtk.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

Overloaded methods

addMark

textBufferAddMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextMark b) 
=> a

buffer: a TextBuffer

-> b

mark: the mark to add

-> TextIter

where: location to place mark

-> m () 

Adds the mark at position where. The mark must not be added to another buffer, and if its name is not Nothing then there must not be another mark in the buffer with the same name.

Emits the markSet signal as notification of the mark's initial placement.

addSelectionClipboard

textBufferAddSelectionClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsClipboard b) 
=> a

buffer: a TextBuffer

-> b

clipboard: a Clipboard

-> m () 

Adds clipboard to the list of clipboards in which the selection contents of buffer are available. In most cases, clipboard will be the Clipboard returned by widgetGetPrimaryClipboard for a view of buffer.

applyTag

textBufferApplyTag Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextTag b) 
=> a

buffer: a TextBuffer

-> b

tag: a TextTag

-> TextIter

start: one bound of range to be tagged

-> TextIter

end: other bound of range to be tagged

-> m () 

Emits the “apply-tag” signal on buffer. The default handler for the signal applies tag to the given range. start and end do not have to be in order.

applyTagByName

textBufferApplyTagByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

name: name of a named TextTag

-> TextIter

start: one bound of range to be tagged

-> TextIter

end: other bound of range to be tagged

-> m () 

Calls textTagTableLookup on the buffer’s tag table to get a TextTag, then calls textBufferApplyTag.

backspace

textBufferBackspace Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: a position in buffer

-> Bool

interactive: whether the deletion is caused by user interaction

-> Bool

defaultEditable: whether the buffer is editable by default

-> m Bool

Returns: True if the buffer was modified

Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by iter. In the normal case a single character will be deleted, but when combining accents are involved, more than one character can be deleted, and when precomposed character and accent combinations are involved, less than one character will be deleted.

Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, the iter will be re-initialized to point to the location where text was deleted.

beginIrreversibleAction

textBufferBeginIrreversibleAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Denotes the beginning of an action that may not be undone. This will cause any previous operations in the undo/redo queue to be cleared.

This should be paired with a call to textBufferEndIrreversibleAction after the irreversible action has completed.

You may nest calls to textBufferBeginIrreversibleAction and textBufferEndIrreversibleAction pairs.

beginUserAction

textBufferBeginUserAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Called to indicate that the buffer operations between here and a call to textBufferEndUserAction are part of a single user-visible operation. The operations between textBufferBeginUserAction and textBufferEndUserAction can then be grouped when creating an undo stack. TextBuffer maintains a count of calls to textBufferBeginUserAction that have not been closed with a call to textBufferEndUserAction, and emits the “begin-user-action” and “end-user-action” signals only for the outermost pair of calls. This allows you to build user actions from other user actions.

The “interactive” buffer mutation functions, such as textBufferInsertInteractive, automatically call begin/end user action around the buffer operations they perform, so there's no need to add extra calls if you user action consists solely of a single call to one of those functions.

copyClipboard

textBufferCopyClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsClipboard b) 
=> a

buffer: a TextBuffer

-> b

clipboard: the Clipboard object to copy to

-> m () 

Copies the currently-selected text to a clipboard.

createChildAnchor

textBufferCreateChildAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: location in the buffer

-> m TextChildAnchor

Returns: the created child anchor

This is a convenience function which simply creates a child anchor with textChildAnchorNew and inserts it into the buffer with textBufferInsertChildAnchor. The new anchor is owned by the buffer; no reference count is returned to the caller of textBufferCreateChildAnchor.

createMark

textBufferCreateMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Maybe Text

markName: name for mark, or Nothing

-> TextIter

where: location to place mark

-> Bool

leftGravity: whether the mark has left gravity

-> m TextMark

Returns: the new TextMark object

Creates a mark at position where. If markName is Nothing, the mark is anonymous; otherwise, the mark can be retrieved by name using textBufferGetMark. If a mark has left gravity, and text is inserted at the mark’s current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity (leftGravity = False), the mark will end up on the right of newly-inserted text. The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you’re typing).

The caller of this function does not own a reference to the returned TextMark, so you can ignore the return value if you like. Marks are owned by the buffer and go away when the buffer does.

Emits the markSet signal as notification of the mark's initial placement.

cutClipboard

textBufferCutClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsClipboard b) 
=> a

buffer: a TextBuffer

-> b

clipboard: the Clipboard object to cut to

-> Bool

defaultEditable: default editability of the buffer

-> m () 

Copies the currently-selected text to a clipboard, then deletes said text if it’s editable.

delete

textBufferDelete Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

start: a position in buffer

-> TextIter

end: another position in buffer

-> m () 

Deletes text between start and end. The order of start and end is not actually relevant; textBufferDelete will reorder them. This function actually emits the “delete-range” signal, and the default handler of that signal deletes the text. Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, the start and end will be re-initialized to point to the location where text was deleted.

deleteInteractive

textBufferDeleteInteractive Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

startIter: start of range to delete

-> TextIter

endIter: end of range

-> Bool

defaultEditable: whether the buffer is editable by default

-> m Bool

Returns: whether some text was actually deleted

Deletes all editable text in the given range. Calls textBufferDelete for each editable sub-range of [start,end). start and end are revalidated to point to the location of the last deleted range, or left untouched if no text was deleted.

deleteMark

textBufferDeleteMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextMark b) 
=> a

buffer: a TextBuffer

-> b

mark: a TextMark in buffer

-> m () 

Deletes mark, so that it’s no longer located anywhere in the buffer. Removes the reference the buffer holds to the mark, so if you haven’t called objectRef on the mark, it will be freed. Even if the mark isn’t freed, most operations on mark become invalid, until it gets added to a buffer again with textBufferAddMark. Use textMarkGetDeleted to find out if a mark has been removed from its buffer. The markDeleted signal will be emitted as notification after the mark is deleted.

deleteMarkByName

textBufferDeleteMarkByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

name: name of a mark in buffer

-> m () 

Deletes the mark named name; the mark must exist. See textBufferDeleteMark for details.

deleteSelection

textBufferDeleteSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Bool

interactive: whether the deletion is caused by user interaction

-> Bool

defaultEditable: whether the buffer is editable by default

-> m Bool

Returns: whether there was a non-empty selection to delete

Deletes the range between the “insert” and “selection_bound” marks, that is, the currently-selected text. If interactive is True, the editability of the selection will be considered (users can’t delete uneditable text).

endIrreversibleAction

textBufferEndIrreversibleAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Denotes the end of an action that may not be undone. This will cause any previous operations in the undo/redo queue to be cleared.

This should be called after completing modifications to the text buffer after textBufferBeginIrreversibleAction was called.

You may nest calls to textBufferBeginIrreversibleAction and textBufferEndIrreversibleAction pairs.

endUserAction

textBufferEndUserAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Should be paired with a call to textBufferBeginUserAction. See that function for a full explanation.

getBounds

textBufferGetBounds Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m (TextIter, TextIter) 

Retrieves the first and last iterators in the buffer, i.e. the entire buffer lies within the range [start,end).

getCanRedo

textBufferGetCanRedo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Bool

Returns: True if there is an redoable action

Gets whether there is a redoable action in the history.

getCanUndo

textBufferGetCanUndo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Bool

Returns: True if there is an undoable action

Gets whether there is an undoable action in the history.

getCharCount

textBufferGetCharCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Int32

Returns: number of characters in the buffer

Gets the number of characters in the buffer; note that characters and bytes are not the same, you can’t e.g. expect the contents of the buffer in string form to be this many bytes long. The character count is cached, so this function is very fast.

getEnableUndo

textBufferGetEnableUndo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Bool 

Gets whether the buffer is saving modifications to the buffer to allow for undo and redo actions.

See textBufferBeginIrreversibleAction and textBufferEndIrreversibleAction to create changes to the buffer that cannot be undone.

getEndIter

textBufferGetEndIter Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m TextIter 

Initializes iter with the “end iterator,” one past the last valid character in the text buffer. If dereferenced with textIterGetChar, the end iterator has a character value of 0. The entire buffer lies in the range from the first position in the buffer (call textBufferGetStartIter to get character position 0) to the end iterator.

getHasSelection

textBufferGetHasSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Bool

Returns: True if the there is text selected

Indicates whether the buffer has some text currently selected.

getInsert

textBufferGetInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m TextMark

Returns: insertion point mark

Returns the mark that represents the cursor (insertion point). Equivalent to calling textBufferGetMark to get the mark named “insert”, but very slightly more efficient, and involves less typing.

getIterAtChildAnchor

textBufferGetIterAtChildAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextChildAnchor b) 
=> a

buffer: a TextBuffer

-> b

anchor: a child anchor that appears in buffer

-> m TextIter 

Obtains the location of anchor within buffer.

getIterAtLine

textBufferGetIterAtLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Int32

lineNumber: line number counting from 0

-> m TextIter 

Initializes iter to the start of the given line. If lineNumber is greater than the number of lines in the buffer, the end iterator is returned.

getIterAtLineIndex

textBufferGetIterAtLineIndex Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Int32

lineNumber: line number counting from 0

-> Int32

byteIndex: byte index from start of line

-> m TextIter 

Obtains an iterator pointing to byteIndex within the given line. byteIndex must be the start of a UTF-8 character. Note bytes, not characters; UTF-8 may encode one character as multiple bytes.

If lineNumber is greater than the number of lines in the buffer, the end iterator is returned. And if byteIndex is off the end of the line, the iterator at the end of the line is returned.

getIterAtLineOffset

textBufferGetIterAtLineOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Int32

lineNumber: line number counting from 0

-> Int32

charOffset: char offset from start of line

-> m TextIter 

Obtains an iterator pointing to charOffset within the given line. Note characters, not bytes; UTF-8 may encode one character as multiple bytes.

Before the 3.20 version, it was not allowed to pass an invalid location.

If lineNumber is greater than the number of lines in the buffer, the end iterator is returned. And if charOffset is off the end of the line, the iterator at the end of the line is returned.

getIterAtMark

textBufferGetIterAtMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextMark b) 
=> a

buffer: a TextBuffer

-> b

mark: a TextMark in buffer

-> m TextIter 

Initializes iter with the current position of mark.

getIterAtOffset

textBufferGetIterAtOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Int32

charOffset: char offset from start of buffer, counting from 0, or -1

-> m TextIter 

Initializes iter to a position charOffset chars from the start of the entire buffer. If charOffset is -1 or greater than the number of characters in the buffer, iter is initialized to the end iterator, the iterator one past the last valid character in the buffer.

getLineCount

textBufferGetLineCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Int32

Returns: number of lines in the buffer

Obtains the number of lines in the buffer. This value is cached, so the function is very fast.

getMark

textBufferGetMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

name: a mark name

-> m (Maybe TextMark)

Returns: a TextMark, or Nothing

Returns the mark named name in buffer buffer, or Nothing if no such mark exists in the buffer.

getMaxUndoLevels

textBufferGetMaxUndoLevels Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Word32 

Gets the maximum number of undo levels to perform. If 0, unlimited undo actions may be performed. Note that this may have a memory usage impact as it requires storing an additional copy of the inserted or removed text within the text buffer.

getModified

textBufferGetModified Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m Bool

Returns: True if the buffer has been modified

Indicates whether the buffer has been modified since the last call to textBufferSetModified set the modification flag to False. Used for example to enable a “save” function in a text editor.

getSelectionBound

textBufferGetSelectionBound Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m TextMark

Returns: selection bound mark

Returns the mark that represents the selection bound. Equivalent to calling textBufferGetMark to get the mark named “selection_bound”, but very slightly more efficient, and involves less typing.

The currently-selected text in buffer is the region between the “selection_bound” and “insert” marks. If “selection_bound” and “insert” are in the same place, then there is no current selection. textBufferGetSelectionBounds is another convenient function for handling the selection, if you just want to know whether there’s a selection and what its bounds are.

getSelectionBounds

textBufferGetSelectionBounds Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer a TextBuffer

-> m (Bool, TextIter, TextIter)

Returns: whether the selection has nonzero length

Returns True if some text is selected; places the bounds of the selection in start and end (if the selection has length 0, then start and end are filled in with the same value). start and end will be in ascending order. If start and end are NULL, then they are not filled in, but the return value still indicates whether text is selected.

getSelectionContent

textBufferGetSelectionContent Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m ContentProvider

Returns: a new ContentProvider.

Get a content provider for this buffer.

getSlice

textBufferGetSlice Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

start: start of a range

-> TextIter

end: end of a range

-> Bool

includeHiddenChars: whether to include invisible text

-> m Text

Returns: an allocated UTF-8 string

Returns the text in the range [start,end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if includeHiddenChars is False. The returned string includes a 0xFFFC character whenever the buffer contains embedded images, so byte and character indexes into the returned string do correspond to byte and character indexes into the buffer. Contrast with textBufferGetText. Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a paintable or widget is in the buffer.

getStartIter

textBufferGetStartIter Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m TextIter 

Initialized iter with the first position in the text buffer. This is the same as using textBufferGetIterAtOffset to get the iter at character offset 0.

getTagTable

textBufferGetTagTable Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m TextTagTable

Returns: the buffer’s tag table

Get the TextTagTable associated with this buffer.

getText

textBufferGetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

start: start of a range

-> TextIter

end: end of a range

-> Bool

includeHiddenChars: whether to include invisible text

-> m Text

Returns: an allocated UTF-8 string

Returns the text in the range [start,end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if includeHiddenChars is False. Does not include characters representing embedded images, so byte and character indexes into the returned string do not correspond to byte and character indexes into the buffer. Contrast with textBufferGetSlice.

insert

textBufferInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: a position in the buffer

-> Text

text: text in UTF-8 format

-> Int32

len: length of text in bytes, or -1

-> m () 

Inserts len bytes of text at position iter. If len is -1, text must be nul-terminated and will be inserted in its entirety. Emits the “insert-text” signal; insertion actually occurs in the default handler for the signal. iter is invalidated when insertion occurs (because the buffer contents change), but the default signal handler revalidates it to point to the end of the inserted text.

insertAtCursor

textBufferInsertAtCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

text: text in UTF-8 format

-> Int32

len: length of text, in bytes

-> m () 

Simply calls textBufferInsert, using the current cursor position as the insertion point.

insertChildAnchor

textBufferInsertChildAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextChildAnchor b) 
=> a

buffer: a TextBuffer

-> TextIter

iter: location to insert the anchor

-> b

anchor: a TextChildAnchor

-> m () 

Inserts a child widget anchor into the text buffer at iter. The anchor will be counted as one character in character counts, and when obtaining the buffer contents as a string, will be represented by the Unicode “object replacement character” 0xFFFC. Note that the “slice” variants for obtaining portions of the buffer as a string include this character for child anchors, but the “text” variants do not. E.g. see textBufferGetSlice and textBufferGetText. Consider textBufferCreateChildAnchor as a more convenient alternative to this function. The buffer will add a reference to the anchor, so you can unref it after insertion.

insertInteractive

textBufferInsertInteractive Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: a position in buffer

-> Text

text: some UTF-8 text

-> Int32

len: length of text in bytes, or -1

-> Bool

defaultEditable: default editability of buffer

-> m Bool

Returns: whether text was actually inserted

Like textBufferInsert, but the insertion will not occur if iter is at a non-editable location in the buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).

defaultEditable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of textViewGetEditable is appropriate here.

insertInteractiveAtCursor

textBufferInsertInteractiveAtCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

text: text in UTF-8 format

-> Int32

len: length of text in bytes, or -1

-> Bool

defaultEditable: default editability of buffer

-> m Bool

Returns: whether text was actually inserted

Calls textBufferInsertInteractive at the cursor position.

defaultEditable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of textViewGetEditable is appropriate here.

insertMarkup

textBufferInsertMarkup Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: location to insert the markup

-> Text

markup: a nul-terminated UTF-8 string containing [Pango markup][PangoMarkupFormat]

-> Int32

len: length of markup in bytes, or -1

-> m () 

Inserts the text in markup at position iter. markup will be inserted in its entirety and must be nul-terminated and valid UTF-8. Emits the insertText signal, possibly multiple times; insertion actually occurs in the default handler for the signal. iter will point to the end of the inserted text on return.

insertPaintable

textBufferInsertPaintable Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsPaintable b) 
=> a

buffer: a TextBuffer

-> TextIter

iter: location to insert the paintable

-> b

paintable: a Paintable

-> m () 

Inserts an image into the text buffer at iter. The image will be counted as one character in character counts, and when obtaining the buffer contents as a string, will be represented by the Unicode “object replacement character” 0xFFFC. Note that the “slice” variants for obtaining portions of the buffer as a string include this character for paintable, but the “text” variants do not. e.g. see textBufferGetSlice and textBufferGetText.

insertRange

textBufferInsertRange Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: a position in buffer

-> TextIter

start: a position in a TextBuffer

-> TextIter

end: another position in the same buffer as start

-> m () 

Copies text, tags, and paintables between start and end (the order of start and end doesn’t matter) and inserts the copy at iter. Used instead of simply getting/inserting text because it preserves images and tags. If start and end are in a different buffer from buffer, the two buffers must share the same tag table.

Implemented via emissions of the insert_text and apply_tag signals, so expect those.

insertRangeInteractive

textBufferInsertRangeInteractive Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

iter: a position in buffer

-> TextIter

start: a position in a TextBuffer

-> TextIter

end: another position in the same buffer as start

-> Bool

defaultEditable: default editability of the buffer

-> m Bool

Returns: whether an insertion was possible at iter

Same as textBufferInsertRange, but does nothing if the insertion point isn’t editable. The defaultEditable parameter indicates whether the text is editable at iter if no tags enclosing iter affect editability. Typically the result of textViewGetEditable is appropriate here.

moveMark

textBufferMoveMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextMark b) 
=> a

buffer: a TextBuffer

-> b

mark: a TextMark

-> TextIter

where: new location for mark in buffer

-> m () 

Moves mark to the new location where. Emits the markSet signal as notification of the move.

moveMarkByName

textBufferMoveMarkByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

name: name of a mark

-> TextIter

where: new location for mark

-> m () 

Moves the mark named name (which must exist) to location where. See textBufferMoveMark for details.

new

textBufferNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextTagTable a) 
=> Maybe a

table: a tag table, or Nothing to create a new one

-> m TextBuffer

Returns: a new text buffer

Creates a new text buffer.

pasteClipboard

textBufferPasteClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsClipboard b) 
=> a

buffer: a TextBuffer

-> b

clipboard: the Clipboard to paste from

-> Maybe TextIter

overrideLocation: location to insert pasted text, or Nothing

-> Bool

defaultEditable: whether the buffer is editable by default

-> m () 

Pastes the contents of a clipboard. If overrideLocation is Nothing, the pasted text will be inserted at the cursor position, or the buffer selection will be replaced if the selection is non-empty.

Note: pasting is asynchronous, that is, we’ll ask for the paste data and return, and at some point later after the main loop runs, the paste data will be inserted.

placeCursor

textBufferPlaceCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

where: where to put the cursor

-> m () 

This function moves the “insert” and “selection_bound” marks simultaneously. If you move them to the same place in two steps with textBufferMoveMark, you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.

redo

textBufferRedo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Redoes the next redoable action on the buffer, if there is one.

removeAllTags

textBufferRemoveAllTags Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

start: one bound of range to be untagged

-> TextIter

end: other bound of range to be untagged

-> m () 

Removes all tags in the range between start and end. Be careful with this function; it could remove tags added in code unrelated to the code you’re currently writing. That is, using this function is probably a bad idea if you have two or more unrelated code sections that add tags.

removeSelectionClipboard

textBufferRemoveSelectionClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsClipboard b) 
=> a

buffer: a TextBuffer

-> b

clipboard: a Clipboard added to buffer by textBufferAddSelectionClipboard

-> m () 

removeTag

textBufferRemoveTag Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a, IsTextTag b) 
=> a

buffer: a TextBuffer

-> b

tag: a TextTag

-> TextIter

start: one bound of range to be untagged

-> TextIter

end: other bound of range to be untagged

-> m () 

Emits the “remove-tag” signal. The default handler for the signal removes all occurrences of tag from the given range. start and end don’t have to be in order.

removeTagByName

textBufferRemoveTagByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

name: name of a TextTag

-> TextIter

start: one bound of range to be untagged

-> TextIter

end: other bound of range to be untagged

-> m () 

Calls textTagTableLookup on the buffer’s tag table to get a TextTag, then calls textBufferRemoveTag.

selectRange

textBufferSelectRange Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> TextIter

ins: where to put the “insert” mark

-> TextIter

bound: where to put the “selection_bound” mark

-> m () 

This function moves the “insert” and “selection_bound” marks simultaneously. If you move them in two steps with textBufferMoveMark, you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.

setEnableUndo

textBufferSetEnableUndo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Bool

enableUndo: True to enable undo

-> m () 

Sets whether or not to enable undoable actions in the text buffer. If enabled, the user will be able to undo the last number of actions up to textBufferGetMaxUndoLevels.

See textBufferBeginIrreversibleAction and textBufferEndIrreversibleAction to create changes to the buffer that cannot be undone.

setMaxUndoLevels

textBufferSetMaxUndoLevels Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Word32

maxUndoLevels: the maximum number of undo actions to perform

-> m () 

Sets the maximum number of undo levels to perform. If 0, unlimited undo actions may be performed. Note that this may have a memory usage impact as it requires storing an additional copy of the inserted or removed text within the text buffer.

setModified

textBufferSetModified Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Bool

setting: modification flag setting

-> m () 

Used to keep track of whether the buffer has been modified since the last time it was saved. Whenever the buffer is saved to disk, call gtk_text_buffer_set_modified (buffer, FALSE). When the buffer is modified, it will automatically toggled on the modified bit again. When the modified bit flips, the buffer emits the modifiedChanged signal.

setText

textBufferSetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> Text

text: UTF-8 text to insert

-> Int32

len: length of text in bytes

-> m () 

Deletes current contents of buffer, and inserts text instead. If len is -1, text must be nul-terminated. text must be valid UTF-8.

undo

textBufferUndo Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextBuffer a) 
=> a

buffer: a TextBuffer

-> m () 

Undoes the last undoable action on the buffer, if there is one.

Properties

canRedo

The TextBuffer:can-redo property denotes that the buffer can reapply the last undone action.

getTextBufferCanRedo :: (MonadIO m, IsTextBuffer o) => o -> m Bool Source #

Get the value of the “can-redo” property. When overloading is enabled, this is equivalent to

get textBuffer #canRedo

canUndo

The TextBuffer:can-undo property denotes that the buffer can undo the last applied action.

getTextBufferCanUndo :: (MonadIO m, IsTextBuffer o) => o -> m Bool Source #

Get the value of the “can-undo” property. When overloading is enabled, this is equivalent to

get textBuffer #canUndo

copyTargetList

The list of targets this buffer supports for clipboard copying and as DND source.

getTextBufferCopyTargetList :: (MonadIO m, IsTextBuffer o) => o -> m (Maybe ContentFormats) Source #

Get the value of the “copy-target-list” property. When overloading is enabled, this is equivalent to

get textBuffer #copyTargetList

cursorPosition

The position of the insert mark (as offset from the beginning of the buffer). It is useful for getting notified when the cursor moves.

getTextBufferCursorPosition :: (MonadIO m, IsTextBuffer o) => o -> m Int32 Source #

Get the value of the “cursor-position” property. When overloading is enabled, this is equivalent to

get textBuffer #cursorPosition

enableUndo

The TextBuffer:enable-undo property denotes if support for undoing and redoing changes to the buffer is allowed.

constructTextBufferEnableUndo :: (IsTextBuffer o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “enable-undo” property. This is rarely needed directly, but it is used by new.

getTextBufferEnableUndo :: (MonadIO m, IsTextBuffer o) => o -> m Bool Source #

Get the value of the “enable-undo” property. When overloading is enabled, this is equivalent to

get textBuffer #enableUndo

setTextBufferEnableUndo :: (MonadIO m, IsTextBuffer o) => o -> Bool -> m () Source #

Set the value of the “enable-undo” property. When overloading is enabled, this is equivalent to

set textBuffer [ #enableUndo := value ]

hasSelection

Whether the buffer has some text currently selected.

getTextBufferHasSelection :: (MonadIO m, IsTextBuffer o) => o -> m Bool Source #

Get the value of the “has-selection” property. When overloading is enabled, this is equivalent to

get textBuffer #hasSelection

pasteTargetList

The list of targets this buffer supports for clipboard pasting and as DND destination.

getTextBufferPasteTargetList :: (MonadIO m, IsTextBuffer o) => o -> m (Maybe ContentFormats) Source #

Get the value of the “paste-target-list” property. When overloading is enabled, this is equivalent to

get textBuffer #pasteTargetList

tagTable

No description available in the introspection data.

constructTextBufferTagTable :: (IsTextBuffer o, MonadIO m, IsTextTagTable a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “tag-table” property. This is rarely needed directly, but it is used by new.

getTextBufferTagTable :: (MonadIO m, IsTextBuffer o) => o -> m TextTagTable Source #

Get the value of the “tag-table” property. When overloading is enabled, this is equivalent to

get textBuffer #tagTable

text

The text content of the buffer. Without child widgets and images, see textBufferGetText for more information.

clearTextBufferText :: (MonadIO m, IsTextBuffer o) => o -> m () Source #

Set the value of the “text” property to Nothing. When overloading is enabled, this is equivalent to

clear #text

constructTextBufferText :: (IsTextBuffer o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “text” property. This is rarely needed directly, but it is used by new.

getTextBufferText :: (MonadIO m, IsTextBuffer o) => o -> m (Maybe Text) Source #

Get the value of the “text” property. When overloading is enabled, this is equivalent to

get textBuffer #text

setTextBufferText :: (MonadIO m, IsTextBuffer o) => o -> Text -> m () Source #

Set the value of the “text” property. When overloading is enabled, this is equivalent to

set textBuffer [ #text := value ]

Signals

applyTag

type C_TextBufferApplyTagCallback = Ptr () -> Ptr TextTag -> Ptr TextIter -> Ptr TextIter -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferApplyTagCallback Source #

Arguments

 = TextTag

tag: the applied tag

-> TextIter

start: the start of the range the tag is applied to

-> TextIter

end: the end of the range the tag is applied to

-> IO () 

The applyTag signal is emitted to apply a tag to a range of text in a TextBuffer. Applying actually occurs in the default handler.

Note that if your handler runs before the default handler it must not invalidate the start and end iters (or has to revalidate them).

See also: textBufferApplyTag, gtk_text_buffer_insert_with_tags(), textBufferInsertRange.

afterTextBufferApplyTag :: (IsTextBuffer a, MonadIO m) => a -> TextBufferApplyTagCallback -> m SignalHandlerId Source #

Connect a signal handler for the applyTag signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #applyTag callback

onTextBufferApplyTag :: (IsTextBuffer a, MonadIO m) => a -> TextBufferApplyTagCallback -> m SignalHandlerId Source #

Connect a signal handler for the applyTag signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #applyTag callback

beginUserAction

type C_TextBufferBeginUserActionCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterTextBufferBeginUserAction :: (IsTextBuffer a, MonadIO m) => a -> TextBufferBeginUserActionCallback -> m SignalHandlerId Source #

Connect a signal handler for the beginUserAction signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #beginUserAction callback

onTextBufferBeginUserAction :: (IsTextBuffer a, MonadIO m) => a -> TextBufferBeginUserActionCallback -> m SignalHandlerId Source #

Connect a signal handler for the beginUserAction signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #beginUserAction callback

changed

type C_TextBufferChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferChangedCallback = IO () Source #

The changed signal is emitted when the content of a TextBuffer has changed.

afterTextBufferChanged :: (IsTextBuffer a, MonadIO m) => a -> TextBufferChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #changed callback

onTextBufferChanged :: (IsTextBuffer a, MonadIO m) => a -> TextBufferChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #changed callback

deleteRange

type C_TextBufferDeleteRangeCallback = Ptr () -> Ptr TextIter -> Ptr TextIter -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferDeleteRangeCallback Source #

Arguments

 = TextIter

start: the start of the range to be deleted

-> TextIter

end: the end of the range to be deleted

-> IO () 

The deleteRange signal is emitted to delete a range from a TextBuffer.

Note that if your handler runs before the default handler it must not invalidate the start and end iters (or has to revalidate them). The default signal handler revalidates the start and end iters to both point to the location where text was deleted. Handlers which run after the default handler (see g_signal_connect_after()) do not have access to the deleted text.

See also: textBufferDelete.

afterTextBufferDeleteRange :: (IsTextBuffer a, MonadIO m) => a -> TextBufferDeleteRangeCallback -> m SignalHandlerId Source #

Connect a signal handler for the deleteRange signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #deleteRange callback

onTextBufferDeleteRange :: (IsTextBuffer a, MonadIO m) => a -> TextBufferDeleteRangeCallback -> m SignalHandlerId Source #

Connect a signal handler for the deleteRange signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #deleteRange callback

endUserAction

type C_TextBufferEndUserActionCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterTextBufferEndUserAction :: (IsTextBuffer a, MonadIO m) => a -> TextBufferEndUserActionCallback -> m SignalHandlerId Source #

Connect a signal handler for the endUserAction signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #endUserAction callback

onTextBufferEndUserAction :: (IsTextBuffer a, MonadIO m) => a -> TextBufferEndUserActionCallback -> m SignalHandlerId Source #

Connect a signal handler for the endUserAction signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #endUserAction callback

insertChildAnchor

type C_TextBufferInsertChildAnchorCallback = Ptr () -> Ptr TextIter -> Ptr TextChildAnchor -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferInsertChildAnchorCallback Source #

Arguments

 = TextIter

location: position to insert anchor in textbuffer

-> TextChildAnchor

anchor: the TextChildAnchor to be inserted

-> IO () 

The insertChildAnchor signal is emitted to insert a TextChildAnchor in a TextBuffer. Insertion actually occurs in the default handler.

Note that if your handler runs before the default handler it must not invalidate the location iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted anchor.

See also: textBufferInsertChildAnchor.

afterTextBufferInsertChildAnchor :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertChildAnchorCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertChildAnchor signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #insertChildAnchor callback

onTextBufferInsertChildAnchor :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertChildAnchorCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertChildAnchor signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #insertChildAnchor callback

insertPaintable

type C_TextBufferInsertPaintableCallback = Ptr () -> Ptr TextIter -> Ptr Paintable -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferInsertPaintableCallback Source #

Arguments

 = TextIter

location: position to insert paintable in textbuffer

-> Paintable

paintable: the Paintable to be inserted

-> IO () 

The insertPaintable signal is emitted to insert a Paintable in a TextBuffer. Insertion actually occurs in the default handler.

Note that if your handler runs before the default handler it must not invalidate the location iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted paintable.

See also: textBufferInsertPaintable.

afterTextBufferInsertPaintable :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertPaintableCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertPaintable signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #insertPaintable callback

onTextBufferInsertPaintable :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertPaintableCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertPaintable signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #insertPaintable callback

insertText

type C_TextBufferInsertTextCallback = Ptr () -> Ptr TextIter -> CString -> Int32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferInsertTextCallback Source #

Arguments

 = TextIter

location: position to insert text in textbuffer

-> Text

text: the UTF-8 text to be inserted

-> Int32

len: length of the inserted text in bytes

-> IO () 

The insertText signal is emitted to insert text in a TextBuffer. Insertion actually occurs in the default handler.

Note that if your handler runs before the default handler it must not invalidate the location iter (or has to revalidate it). The default signal handler revalidates it to point to the end of the inserted text.

See also: textBufferInsert, textBufferInsertRange.

afterTextBufferInsertText :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertTextCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertText signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #insertText callback

onTextBufferInsertText :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertTextCallback -> m SignalHandlerId Source #

Connect a signal handler for the insertText signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #insertText callback

markDeleted

type C_TextBufferMarkDeletedCallback = Ptr () -> Ptr TextMark -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferMarkDeletedCallback Source #

Arguments

 = TextMark

mark: The mark that was deleted

-> IO () 

The markDeleted signal is emitted as notification after a TextMark is deleted.

See also: textBufferDeleteMark.

afterTextBufferMarkDeleted :: (IsTextBuffer a, MonadIO m) => a -> TextBufferMarkDeletedCallback -> m SignalHandlerId Source #

Connect a signal handler for the markDeleted signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #markDeleted callback

onTextBufferMarkDeleted :: (IsTextBuffer a, MonadIO m) => a -> TextBufferMarkDeletedCallback -> m SignalHandlerId Source #

Connect a signal handler for the markDeleted signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #markDeleted callback

markSet

type C_TextBufferMarkSetCallback = Ptr () -> Ptr TextIter -> Ptr TextMark -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferMarkSetCallback Source #

Arguments

 = TextIter

location: The location of mark in textbuffer

-> TextMark

mark: The mark that is set

-> IO () 

The markSet signal is emitted as notification after a TextMark is set.

See also: textBufferCreateMark, textBufferMoveMark.

afterTextBufferMarkSet :: (IsTextBuffer a, MonadIO m) => a -> TextBufferMarkSetCallback -> m SignalHandlerId Source #

Connect a signal handler for the markSet signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #markSet callback

onTextBufferMarkSet :: (IsTextBuffer a, MonadIO m) => a -> TextBufferMarkSetCallback -> m SignalHandlerId Source #

Connect a signal handler for the markSet signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #markSet callback

modifiedChanged

type C_TextBufferModifiedChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferModifiedChangedCallback = IO () Source #

The modifiedChanged signal is emitted when the modified bit of a TextBuffer flips.

See also: textBufferSetModified.

afterTextBufferModifiedChanged :: (IsTextBuffer a, MonadIO m) => a -> TextBufferModifiedChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the modifiedChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #modifiedChanged callback

onTextBufferModifiedChanged :: (IsTextBuffer a, MonadIO m) => a -> TextBufferModifiedChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the modifiedChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #modifiedChanged callback

pasteDone

type C_TextBufferPasteDoneCallback = Ptr () -> Ptr Clipboard -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferPasteDoneCallback Source #

Arguments

 = Clipboard

clipboard: the Clipboard pasted from

-> IO () 

The paste-done signal is emitted after paste operation has been completed. This is useful to properly scroll the view to the end of the pasted text. See textBufferPasteClipboard for more details.

afterTextBufferPasteDone :: (IsTextBuffer a, MonadIO m) => a -> TextBufferPasteDoneCallback -> m SignalHandlerId Source #

Connect a signal handler for the pasteDone signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #pasteDone callback

onTextBufferPasteDone :: (IsTextBuffer a, MonadIO m) => a -> TextBufferPasteDoneCallback -> m SignalHandlerId Source #

Connect a signal handler for the pasteDone signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #pasteDone callback

redo

type C_TextBufferRedoCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferRedoCallback = IO () Source #

The "redo" signal is emitted when a request has been made to redo the previously undone operation.

afterTextBufferRedo :: (IsTextBuffer a, MonadIO m) => a -> TextBufferRedoCallback -> m SignalHandlerId Source #

Connect a signal handler for the redo signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #redo callback

onTextBufferRedo :: (IsTextBuffer a, MonadIO m) => a -> TextBufferRedoCallback -> m SignalHandlerId Source #

Connect a signal handler for the redo signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #redo callback

removeTag

type C_TextBufferRemoveTagCallback = Ptr () -> Ptr TextTag -> Ptr TextIter -> Ptr TextIter -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferRemoveTagCallback Source #

Arguments

 = TextTag

tag: the tag to be removed

-> TextIter

start: the start of the range the tag is removed from

-> TextIter

end: the end of the range the tag is removed from

-> IO () 

The removeTag signal is emitted to remove all occurrences of tag from a range of text in a TextBuffer. Removal actually occurs in the default handler.

Note that if your handler runs before the default handler it must not invalidate the start and end iters (or has to revalidate them).

See also: textBufferRemoveTag.

afterTextBufferRemoveTag :: (IsTextBuffer a, MonadIO m) => a -> TextBufferRemoveTagCallback -> m SignalHandlerId Source #

Connect a signal handler for the removeTag signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #removeTag callback

onTextBufferRemoveTag :: (IsTextBuffer a, MonadIO m) => a -> TextBufferRemoveTagCallback -> m SignalHandlerId Source #

Connect a signal handler for the removeTag signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #removeTag callback

undo

type C_TextBufferUndoCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TextBufferUndoCallback = IO () Source #

The "undo" signal is emitted when a request has been made to undo the previous operation or set of operations that have been grouped together.

afterTextBufferUndo :: (IsTextBuffer a, MonadIO m) => a -> TextBufferUndoCallback -> m SignalHandlerId Source #

Connect a signal handler for the undo signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #undo callback

onTextBufferUndo :: (IsTextBuffer a, MonadIO m) => a -> TextBufferUndoCallback -> m SignalHandlerId Source #

Connect a signal handler for the undo signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #undo callback