gi-gtk-3.0.24: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.TextBuffer

Contents

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
GObject TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

IsObject TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

IsTextBuffer TextBuffer Source # 
Instance details

Defined in GI.Gtk.Objects.TextBuffer

class GObject o => IsTextBuffer o Source #

Type class for types which can be safely cast to TextBuffer, for instance with toTextBuffer.

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

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 TextBuffer::mark-set signal as notification of the mark's initial placement.

Since: 2.12

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 of type GDK_SELECTION_PRIMARY 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.

Since: 2.6

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 TextBuffer::mark-set 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 TextBuffer::mark-deleted 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).

deserialize

textBufferDeserialize Source #

Arguments

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

registerBuffer: the TextBuffer format is registered with

-> b

contentBuffer: the TextBuffer to deserialize into

-> Atom

format: the rich text format to use for deserializing

-> TextIter

iter: insertion point for the deserialized text

-> ByteString

data: data to deserialize

-> m ()

(Can throw GError)

This function deserializes rich text in format format and inserts it at iter.

formats to be used must be registered using textBufferRegisterDeserializeFormat or textBufferRegisterDeserializeTagset beforehand.

Since: 2.10

deserializeGetCanCreateTags

textBufferDeserializeGetCanCreateTags Source #

Arguments

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

buffer: a TextBuffer

-> Atom

format: a Atom representing a registered rich text format

-> m Bool

Returns: whether deserializing this format may create tags

This functions returns the value set with textBufferDeserializeSetCanCreateTags

Since: 2.10

deserializeSetCanCreateTags

textBufferDeserializeSetCanCreateTags Source #

Arguments

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

buffer: a TextBuffer

-> Atom

format: a Atom representing a registered rich text format

-> Bool

canCreateTags: whether deserializing this format may create tags

-> m () 

Use this function to allow a rich text deserialization function to create new tags in the receiving buffer. Note that using this function is almost always a bad idea, because the rich text functions you register should know how to map the rich text format they handler to your text buffers set of tags.

The ability of creating new (arbitrary!) tags in the receiving buffer is meant for special rich text formats like the internal one that is registered using textBufferRegisterDeserializeTagset, because that format is essentially a dump of the internal structure of the source buffer, including its tag names.

You should allow creation of tags only if you know what you are doing, e.g. if you defined a tagset name for your application suite’s text buffers and you know that it’s fine to receive new tags from these buffers, because you know that your application can handle the newly created tags.

Since: 2.10

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).

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.

getCopyTargetList

textBufferGetCopyTargetList Source #

Arguments

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

buffer: a TextBuffer

-> m TargetList

Returns: the TargetList

This function returns the list of targets this text buffer can provide for copying and as DND source. The targets in the list are added with info values from the TextBufferTargetInfo enum, using targetListAddRichTextTargets and targetListAddTextTargets.

Since: 2.10

getDeserializeFormats

textBufferGetDeserializeFormats Source #

Arguments

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

buffer: a TextBuffer

-> m [Atom]

Returns: an array of GdkAtoms representing the registered formats.

This function returns the rich text deserialize formats registered with buffer using textBufferRegisterDeserializeFormat or textBufferRegisterDeserializeTagset

Since: 2.10

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.

Since: 2.10

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.

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

Since the 3.20 version, 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.

Since the 3.20 version, 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.

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.

getPasteTargetList

textBufferGetPasteTargetList Source #

Arguments

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

buffer: a TextBuffer

-> m TargetList

Returns: the TargetList

This function returns the list of targets this text buffer supports for pasting and as DND destination. The targets in the list are added with info values from the TextBufferTargetInfo enum, using targetListAddRichTextTargets and targetListAddTextTargets.

Since: 2.10

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.

getSerializeFormats

textBufferGetSerializeFormats Source #

Arguments

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

buffer: a TextBuffer

-> m [Atom]

Returns: an array of GdkAtoms representing the registered formats.

This function returns the rich text serialize formats registered with buffer using textBufferRegisterSerializeFormat or textBufferRegisterSerializeTagset

Since: 2.10

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 pixbuf 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 TextBuffer::insert-text 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.

Since: 3.16

insertPixbuf

textBufferInsertPixbuf Source #

Arguments

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

buffer: a TextBuffer

-> TextIter

iter: location to insert the pixbuf

-> b

pixbuf: a Pixbuf

-> 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 pixbufs, 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 pixbufs 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 TextBuffer::mark-set 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.

registerDeserializeFormat

textBufferRegisterDeserializeFormat Source #

Arguments

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

buffer: a TextBuffer

-> Text

mimeType: the format’s mime-type

-> FunPtr C_TextBufferDeserializeFunc

function: the deserialize function to register

-> m Atom

Returns: the Atom that corresponds to the newly registered format’s mime-type.

This function registers a rich text deserialization function along with its mimeType with the passed buffer.

Since: 2.10

registerDeserializeTagset

textBufferRegisterDeserializeTagset Source #

Arguments

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

buffer: a TextBuffer

-> Maybe Text

tagsetName: an optional tagset name, on Nothing

-> m Atom

Returns: the Atom that corresponds to the newly registered format’s mime-type.

This function registers GTK+’s internal rich text serialization format with the passed buffer. See textBufferRegisterSerializeTagset for details.

Since: 2.10

registerSerializeFormat

textBufferRegisterSerializeFormat Source #

Arguments

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

buffer: a TextBuffer

-> Text

mimeType: the format’s mime-type

-> TextBufferSerializeFunc

function: the serialize function to register

-> m Atom

Returns: the Atom that corresponds to the newly registered format’s mime-type.

This function registers a rich text serialization function along with its mimeType with the passed buffer.

Since: 2.10

registerSerializeTagset

textBufferRegisterSerializeTagset Source #

Arguments

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

buffer: a TextBuffer

-> Maybe Text

tagsetName: an optional tagset name, on Nothing

-> m Atom

Returns: the Atom that corresponds to the newly registered format’s mime-type.

This function registers GTK+’s internal rich text serialization format with the passed buffer. The internal format does not comply to any standard rich text format and only works between TextBuffer instances. It is capable of serializing all of a text buffer’s tags and embedded pixbufs.

This function is just a wrapper around textBufferRegisterSerializeFormat. The mime type used for registering is “application/x-gtk-text-buffer-rich-text”, or “application/x-gtk-text-buffer-rich-text;format=tagsetName” if a tagsetName was passed.

The tagsetName can be used to restrict the transfer of rich text to buffers with compatible sets of tags, in order to avoid unknown tags from being pasted. It is probably the common case to pass an identifier != Nothing here, since the Nothing tagset requires the receiving buffer to deal with with pasting of arbitrary tags.

Since: 2.10

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

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.

Since: 2.4

serialize

textBufferSerialize Source #

Arguments

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

registerBuffer: the TextBuffer format is registered with

-> b

contentBuffer: the TextBuffer to serialize

-> Atom

format: the rich text format to use for serializing

-> TextIter

start: start of block of text to serialize

-> TextIter

end: end of block of test to serialize

-> m ByteString

Returns: the serialized data, encoded as format

This function serializes the portion of text between start and end in the rich text format represented by format.

formats to be used must be registered using textBufferRegisterSerializeFormat or textBufferRegisterSerializeTagset beforehand.

Since: 2.10

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 TextBuffer::modified-changed 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.

unregisterDeserializeFormat

textBufferUnregisterDeserializeFormat Source #

Arguments

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

buffer: a TextBuffer

-> Atom

format: a Atom representing a registered rich text format.

-> m () 

This function unregisters a rich text format that was previously registered using textBufferRegisterDeserializeFormat or textBufferRegisterDeserializeTagset.

Since: 2.10

unregisterSerializeFormat

textBufferUnregisterSerializeFormat Source #

Arguments

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

buffer: a TextBuffer

-> Atom

format: a Atom representing a registered rich text format.

-> m () 

This function unregisters a rich text format that was previously registered using textBufferRegisterSerializeFormat or textBufferRegisterSerializeTagset

Since: 2.10

Properties

copyTargetList

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

Since: 2.10

getTextBufferCopyTargetList :: (MonadIO m, IsTextBuffer o) => o -> m TargetList 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.

Since: 2.10

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

hasSelection

Whether the buffer has some text currently selected.

Since: 2.10

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.

Since: 2.10

getTextBufferPasteTargetList :: (MonadIO m, IsTextBuffer o) => o -> m TargetList 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, IsTextTagTable a) => a -> IO (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.

Since: 2.8

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 => Text -> IO (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 ::apply-tag 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 “apply-tag” 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 “apply-tag” 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 “begin-user-action” 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 “begin-user-action” 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 ::delete-range 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 “delete-range” 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 “delete-range” 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 “end-user-action” 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 “end-user-action” 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 ::insert-child-anchor 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 “insert-child-anchor” 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 “insert-child-anchor” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #insertChildAnchor callback

insertPixbuf

type C_TextBufferInsertPixbufCallback = Ptr () -> Ptr TextIter -> Ptr Pixbuf -> Ptr () -> IO () Source #

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

type TextBufferInsertPixbufCallback Source #

Arguments

 = TextIter

location: position to insert pixbuf in textbuffer

-> Pixbuf

pixbuf: the Pixbuf to be inserted

-> IO () 

The ::insert-pixbuf signal is emitted to insert a Pixbuf 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 pixbuf.

See also: textBufferInsertPixbuf.

afterTextBufferInsertPixbuf :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertPixbufCallback -> m SignalHandlerId Source #

Connect a signal handler for the “insert-pixbuf” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after textBuffer #insertPixbuf callback

onTextBufferInsertPixbuf :: (IsTextBuffer a, MonadIO m) => a -> TextBufferInsertPixbufCallback -> m SignalHandlerId Source #

Connect a signal handler for the “insert-pixbuf” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #insertPixbuf 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 ::insert-text 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 “insert-text” 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 “insert-text” 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 ::mark-deleted 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 “mark-deleted” 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 “mark-deleted” 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 ::mark-set 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 “mark-set” 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 “mark-set” 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 ::modified-changed 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 “modified-changed” 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 “modified-changed” 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.

Since: 2.16

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

Connect a signal handler for the “paste-done” 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 “paste-done” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #pasteDone 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 ::remove-tag 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 “remove-tag” 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 “remove-tag” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on textBuffer #removeTag callback