SourceBuffer

class SourceBuffer : TextBuffer {}

Constructors

this
this(GtkSourceBuffer* gtkSourceBuffer, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(TextTagTable table)

Creates a new source buffer.

this
this(SourceLanguage language)

Creates a new source buffer using the highlighting patterns in @language. This is equivalent to creating a new source buffer with a new tag table and then calling gtk_source_buffer_set_language().

Members

Functions

addOnBracketMatched
void addOnBracketMatched(void delegate(TextIter, GtkSourceBracketMatchType, SourceBuffer) dlg, ConnectFlags connectFlags)

@iter is set to a valid iterator pointing to the matching bracket if @state is %GTK_SOURCE_BRACKET_MATCH_FOUND. Otherwise @iter is meaningless.

addOnHighlightUpdated
void addOnHighlightUpdated(void delegate(TextIter, TextIter, SourceBuffer) dlg, ConnectFlags connectFlags)

The ::highlight-updated signal is emitted when the syntax highlighting is updated in a certain region of the @buffer. This signal is useful to be notified when a context class region is updated (e.g. the no-spell-check context class).

addOnRedo
void addOnRedo(void delegate(SourceBuffer) dlg, ConnectFlags connectFlags)

The ::redo signal is emitted to redo the last undo operation.

addOnSourceMarkUpdated
void addOnSourceMarkUpdated(void delegate(TextMark, SourceBuffer) dlg, ConnectFlags connectFlags)

The ::source-mark-updated signal is emitted each time a mark is added to, moved or removed from the @buffer.

addOnUndo
void addOnUndo(void delegate(SourceBuffer) dlg, ConnectFlags connectFlags)

The ::undo signal is emitted to undo the last user action which modified the buffer.

backwardIterToSourceMark
bool backwardIterToSourceMark(TextIter iter, string category)

Moves @iter to the position of the previous #GtkSourceMark of the given category. Returns %TRUE if @iter was moved. If @category is NULL, the previous source mark can be of any category.

beginNotUndoableAction
void beginNotUndoableAction()

Marks the beginning of a not undoable action on the buffer, disabling the undo manager. Typically you would call this function before initially setting the contents of the buffer (e.g. when loading a file in a text editor).

canRedo
bool canRedo()

Determines whether a source buffer can redo the last action (i.e. if the last operation was an undo).

canUndo
bool canUndo()

Determines whether a source buffer can undo the last action.

changeCase
void changeCase(GtkSourceChangeCaseType caseType, TextIter start, TextIter end)

Changes the case of the text between the specified iterators.

createSourceMark
SourceMark createSourceMark(string name, string category, TextIter where)

Creates a source mark in the @buffer of category @category. A source mark is a #GtkTextMark but organised into categories. Depending on the category a pixbuf can be specified that will be displayed along the line of the mark.

endNotUndoableAction
void endNotUndoableAction()

Marks the end of a not undoable action on the buffer. When the last not undoable block is closed through the call to this function, the list of undo actions is cleared and the undo manager is re-enabled.

ensureHighlight
void ensureHighlight(TextIter start, TextIter end)

Forces buffer to analyze and highlight the given area synchronously.

forwardIterToSourceMark
bool forwardIterToSourceMark(TextIter iter, string category)

Moves @iter to the position of the next #GtkSourceMark of the given @category. Returns %TRUE if @iter was moved. If @category is NULL, the next source mark can be of any category.

getContextClassesAtIter
string[] getContextClassesAtIter(TextIter iter)

Get all defined context classes at @iter.

getHighlightMatchingBrackets
bool getHighlightMatchingBrackets()

Determines whether bracket match highlighting is activated for the source buffer.

getHighlightSyntax
bool getHighlightSyntax()

Determines whether syntax highlighting is activated in the source buffer.

getImplicitTrailingNewline
bool getImplicitTrailingNewline()

Return: whether the @buffer has an implicit trailing newline.

getLanguage
SourceLanguage getLanguage()

Returns the #GtkSourceLanguage associated with the buffer, see gtk_source_buffer_set_language(). The returned object should not be unreferenced by the user.

getMaxUndoLevels
int getMaxUndoLevels()

Determines the number of undo levels the buffer will track for buffer edits.

getSourceBufferStruct
GtkSourceBuffer* getSourceBufferStruct()

Get the main Gtk struct

getSourceMarksAtIter
ListSG getSourceMarksAtIter(TextIter iter, string category)

Returns the list of marks of the given category at @iter. If @category is %NULL it returns all marks at @iter.

getSourceMarksAtLine
ListSG getSourceMarksAtLine(int line, string category)

Returns the list of marks of the given category at @line. If @category is %NULL, all marks at @line are returned.

getStruct
void* getStruct()

the main Gtk struct as a void*

getStyleScheme
SourceStyleScheme getStyleScheme()

Returns the #GtkSourceStyleScheme associated with the buffer, see gtk_source_buffer_set_style_scheme(). The returned object should not be unreferenced by the user.

getUndoManager
SourceUndoManagerIF getUndoManager()

Returns the #GtkSourceUndoManager associated with the buffer, see gtk_source_buffer_set_undo_manager(). The returned object should not be unreferenced by the user.

iterBackwardToContextClassToggle
bool iterBackwardToContextClassToggle(TextIter iter, string contextClass)

Moves backward to the next toggle (on or off) of the context class. If no matching context class toggles are found, returns %FALSE, otherwise %TRUE. Does not return toggles located at @iter, only toggles after @iter. Sets @iter to the location of the toggle, or to the end of the buffer if no toggle is found.

iterForwardToContextClassToggle
bool iterForwardToContextClassToggle(TextIter iter, string contextClass)

Moves forward to the next toggle (on or off) of the context class. If no matching context class toggles are found, returns %FALSE, otherwise %TRUE. Does not return toggles located at @iter, only toggles after @iter. Sets @iter to the location of the toggle, or to the end of the buffer if no toggle is found.

iterHasContextClass
bool iterHasContextClass(TextIter iter, string contextClass)

Check if the class @context_class is set on @iter.

joinLines
void joinLines(TextIter start, TextIter end)

Joins the lines of text between the specified iterators.

redo
void redo()

Redoes the last undo operation. Use gtk_source_buffer_can_redo() to check whether a call to this function will have any effect.

removeSourceMarks
void removeSourceMarks(TextIter start, TextIter end, string category)

Remove all marks of @category between @start and @end from the buffer. If @category is NULL, all marks in the range will be removed.

setHighlightMatchingBrackets
void setHighlightMatchingBrackets(bool highlight)

Controls the bracket match highlighting function in the buffer. If activated, when you position your cursor over a bracket character (a parenthesis, a square bracket, etc.) the matching opening or closing bracket character will be highlighted.

setHighlightSyntax
void setHighlightSyntax(bool highlight)

Controls whether syntax is highlighted in the buffer.

setImplicitTrailingNewline
void setImplicitTrailingNewline(bool implicitTrailingNewline)

Sets whether the @buffer has an implicit trailing newline.

setLanguage
void setLanguage(SourceLanguage language)

Associates a #GtkSourceLanguage with the buffer.

setMaxUndoLevels
void setMaxUndoLevels(int maxUndoLevels)

Sets the number of undo levels for user actions the buffer will track. If the number of user actions exceeds the limit set by this function, older actions will be discarded.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setStyleScheme
void setStyleScheme(SourceStyleScheme scheme)

Sets a #GtkSourceStyleScheme to be used by the buffer and the view.

setUndoManager
void setUndoManager(SourceUndoManagerIF manager)

Set the buffer undo manager. If @manager is %NULL the default undo manager will be set.

sortLines
void sortLines(TextIter start, TextIter end, GtkSourceSortFlags flags, int column)

Sort the lines of text between the specified iterators.

undo
void undo()

Undoes the last user action which modified the buffer. Use gtk_source_buffer_can_undo() to check whether a call to this function will have any effect.

Static functions

callBackBracketMatched
void callBackBracketMatched(GtkSourceBuffer* sourcebufferStruct, GtkTextIter* iter, GtkSourceBracketMatchType state, SourceBuffer _sourcebuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackHighlightUpdated
void callBackHighlightUpdated(GtkSourceBuffer* sourcebufferStruct, GtkTextIter* start, GtkTextIter* end, SourceBuffer _sourcebuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackRedo
void callBackRedo(GtkSourceBuffer* sourcebufferStruct, SourceBuffer _sourcebuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSourceMarkUpdated
void callBackSourceMarkUpdated(GtkSourceBuffer* sourcebufferStruct, GtkTextMark* mark, SourceBuffer _sourcebuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackUndo
void callBackUndo(GtkSourceBuffer* sourcebufferStruct, SourceBuffer _sourcebuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()

Variables

connectedSignals
int[string] connectedSignals;
Undocumented in source.
gtkSourceBuffer
GtkSourceBuffer* gtkSourceBuffer;

the main Gtk struct

onBracketMatchedListeners
void delegate(TextIter, GtkSourceBracketMatchType, SourceBuffer)[] onBracketMatchedListeners;
Undocumented in source.
onHighlightUpdatedListeners
void delegate(TextIter, TextIter, SourceBuffer)[] onHighlightUpdatedListeners;
Undocumented in source.
onRedoListeners
void delegate(SourceBuffer)[] onRedoListeners;
Undocumented in source.
onSourceMarkUpdatedListeners
void delegate(TextMark, SourceBuffer)[] onSourceMarkUpdatedListeners;
Undocumented in source.
onUndoListeners
void delegate(SourceBuffer)[] onUndoListeners;
Undocumented in source.

Inherited Members

From TextBuffer

gtkTextBuffer
GtkTextBuffer* gtkTextBuffer;

the main Gtk struct

getTextBufferStruct
GtkTextBuffer* getTextBufferStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
insertWithTags
void insertWithTags(TextIter iter, string text, TextTag[] tags)

Inserts text into buffer at iter, applying the list of tags to the newly-inserted text. The last tag specified must be NULL to terminate the list. Equivalent to calling gtk_text_buffer_insert(), then gtk_text_buffer_apply_tag() on the inserted text; gtk_text_buffer_insert_with_tags() is just a convenience function.

insertWithTagsByName
void insertWithTagsByName(TextIter iter, string text, string[] tags)

Same as gtk_text_buffer_insert_with_tags(), but allows you to pass in tag names instead of tag objects.

createTag
TextTag createTag(string tagName, ...)

Creates a tag and adds it to the tag table for buffer. Equivalent to adding a new tag to the buffer's tag table.

getText
string getText()

Obtain the entire text

getType
GType getType()
addMark
void addMark(TextMark mark, TextIter where)

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

addSelectionClipboard
void addSelectionClipboard(Clipboard clipboard)

Adds @clipboard to the list of clipboards in which the selection contents of @buffer are available. In most cases, @clipboard will be the #GtkClipboard of type %GDK_SELECTION_PRIMARY for a view of @buffer.

applyTag
void applyTag(TextTag tag, TextIter start, TextIter end)

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
void applyTagByName(string name, TextIter start, TextIter end)

Calls gtk_text_tag_table_lookup() on the buffer’s tag table to get a #GtkTextTag, then calls gtk_text_buffer_apply_tag().

backspace
bool backspace(TextIter iter, bool interactive, bool defaultEditable)

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.

beginUserAction
void beginUserAction()

Called to indicate that the buffer operations between here and a call to gtk_text_buffer_end_user_action() are part of a single user-visible operation. The operations between gtk_text_buffer_begin_user_action() and gtk_text_buffer_end_user_action() can then be grouped when creating an undo stack. #GtkTextBuffer maintains a count of calls to gtk_text_buffer_begin_user_action() that have not been closed with a call to gtk_text_buffer_end_user_action(), 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.

copyClipboard
void copyClipboard(Clipboard clipboard)

Copies the currently-selected text to a clipboard.

createChildAnchor
TextChildAnchor createChildAnchor(TextIter iter)

This is a convenience function which simply creates a child anchor with gtk_text_child_anchor_new() and inserts it into the buffer with gtk_text_buffer_insert_child_anchor(). The new anchor is owned by the buffer; no reference count is returned to the caller of gtk_text_buffer_create_child_anchor().

createMark
TextMark createMark(string markName, TextIter where, bool leftGravity)

Creates a mark at position @where. If @mark_name is %NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using gtk_text_buffer_get_mark(). 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 (@left_gravity = %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).

cutClipboard
void cutClipboard(Clipboard clipboard, bool defaultEditable)

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

delet
void delet(TextIter start, TextIter end)

Deletes text between @start and @end. The order of @start and @end is not actually relevant; gtk_text_buffer_delete() 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
bool deleteInteractive(TextIter startIter, TextIter endIter, bool defaultEditable)

Deletes all editable text in the given range. Calls gtk_text_buffer_delete() 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
void deleteMark(TextMark mark)

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 g_object_ref() 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 gtk_text_buffer_add_mark(). Use gtk_text_mark_get_deleted() to find out if a mark has been removed from its buffer. The #GtkTextBuffer::mark-deleted signal will be emitted as notification after the mark is deleted.

deleteMarkByName
void deleteMarkByName(string name)

Deletes the mark named @name; the mark must exist. See gtk_text_buffer_delete_mark() for details.

deleteSelection
bool deleteSelection(bool interactive, bool defaultEditable)

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
bool deserialize(TextBuffer contentBuffer, GdkAtom format, TextIter iter, ubyte[] data)

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

deserializeGetCanCreateTags
bool deserializeGetCanCreateTags(GdkAtom format)

This functions returns the value set with gtk_text_buffer_deserialize_set_can_create_tags()

deserializeSetCanCreateTags
void deserializeSetCanCreateTags(GdkAtom format, bool canCreateTags)

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.

endUserAction
void endUserAction()

Should be paired with a call to gtk_text_buffer_begin_user_action(). See that function for a full explanation.

getBounds
void getBounds(TextIter start, TextIter end)

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

getCharCount
int getCharCount()

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
TargetList getCopyTargetList()

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 #GtkTextBufferTargetInfo enum, using gtk_target_list_add_rich_text_targets() and gtk_target_list_add_text_targets().

getDeserializeFormats
GdkAtom[] getDeserializeFormats()

This function returns the rich text deserialize formats registered with @buffer using gtk_text_buffer_register_deserialize_format() or gtk_text_buffer_register_deserialize_tagset()

getEndIter
void getEndIter(TextIter iter)

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

getHasSelection
bool getHasSelection()

Indicates whether the buffer has some text currently selected.

getInsert
TextMark getInsert()

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

getIterAtChildAnchor
void getIterAtChildAnchor(TextIter iter, TextChildAnchor anchor)

Obtains the location of @anchor within @buffer.

getIterAtLine
void getIterAtLine(TextIter iter, int lineNumber)

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

getIterAtLineIndex
void getIterAtLineIndex(TextIter iter, int lineNumber, int byteIndex)

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

getIterAtLineOffset
void getIterAtLineOffset(TextIter iter, int lineNumber, int charOffset)

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

getIterAtMark
void getIterAtMark(TextIter iter, TextMark mark)

Initializes @iter with the current position of @mark.

getIterAtOffset
void getIterAtOffset(TextIter iter, int charOffset)

Initializes @iter to a position @char_offset chars from the start of the entire buffer. If @char_offset 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
int getLineCount()

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

getMark
TextMark getMark(string name)

Returns the mark named @name in buffer @buffer, or %NULL if no such mark exists in the buffer.

getModified
bool getModified()

Indicates whether the buffer has been modified since the last call to gtk_text_buffer_set_modified() set the modification flag to %FALSE. Used for example to enable a “save” function in a text editor.

getPasteTargetList
TargetList getPasteTargetList()

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 #GtkTextBufferTargetInfo enum, using gtk_target_list_add_rich_text_targets() and gtk_target_list_add_text_targets().

getSelectionBound
TextMark getSelectionBound()

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

getSelectionBounds
bool getSelectionBounds(TextIter start, TextIter end)

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
GdkAtom[] getSerializeFormats()

This function returns the rich text serialize formats registered with @buffer using gtk_text_buffer_register_serialize_format() or gtk_text_buffer_register_serialize_tagset()

getSlice
string getSlice(TextIter start, TextIter end, bool includeHiddenChars)

Returns the text in the range [@start,@end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if @include_hidden_chars 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 gtk_text_buffer_get_text(). 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
void getStartIter(TextIter iter)

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

getTagTable
TextTagTable getTagTable()

Get the #GtkTextTagTable associated with this buffer.

getText
string getText(TextIter start, TextIter end, bool includeHiddenChars)

Returns the text in the range [@start,@end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if @include_hidden_chars 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 gtk_text_buffer_get_slice().

insert
void insert(TextIter iter, string text)

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
void insertAtCursor(string text)

Simply calls gtk_text_buffer_insert(), using the current cursor position as the insertion point.

insertChildAnchor
void insertChildAnchor(TextIter iter, TextChildAnchor anchor)

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 gtk_text_buffer_get_slice() and gtk_text_buffer_get_text(). Consider gtk_text_buffer_create_child_anchor() 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
bool insertInteractive(TextIter iter, string text, bool defaultEditable)

Like gtk_text_buffer_insert(), 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).

insertInteractiveAtCursor
bool insertInteractiveAtCursor(string text, bool defaultEditable)

Calls gtk_text_buffer_insert_interactive() at the cursor position.

insertMarkup
void insertMarkup(TextIter iter, string markup, int len)

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 #GtkTextBuffer::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.

insertPixbuf
void insertPixbuf(TextIter iter, Pixbuf pixbuf)

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 gtk_text_buffer_get_slice() and gtk_text_buffer_get_text().

insertRange
void insertRange(TextIter iter, TextIter start, TextIter end)

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.

insertRangeInteractive
bool insertRangeInteractive(TextIter iter, TextIter start, TextIter end, bool defaultEditable)

Same as gtk_text_buffer_insert_range(), but does nothing if the insertion point isn’t editable. The @default_editable parameter indicates whether the text is editable at @iter if no tags enclosing @iter affect editability. Typically the result of gtk_text_view_get_editable() is appropriate here.

moveMark
void moveMark(TextMark mark, TextIter where)

Moves @mark to the new location @where. Emits the #GtkTextBuffer::mark-set signal as notification of the move.

moveMarkByName
void moveMarkByName(string name, TextIter where)

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

pasteClipboard
void pasteClipboard(Clipboard clipboard, TextIter overrideLocation, bool defaultEditable)

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

placeCursor
void placeCursor(TextIter where)

This function moves the “insert” and “selection_bound” marks simultaneously. If you move them to the same place in two steps with gtk_text_buffer_move_mark(), 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
GdkAtom registerDeserializeFormat(string mimeType, GtkTextBufferDeserializeFunc funct, void* userData, GDestroyNotify userDataDestroy)

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

registerDeserializeTagset
GdkAtom registerDeserializeTagset(string tagsetName)

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

registerSerializeFormat
GdkAtom registerSerializeFormat(string mimeType, GtkTextBufferSerializeFunc funct, void* userData, GDestroyNotify userDataDestroy)

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

registerSerializeTagset
GdkAtom registerSerializeTagset(string tagsetName)

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 #GtkTextBuffer instances. It is capable of serializing all of a text buffer’s tags and embedded pixbufs.

removeAllTags
void removeAllTags(TextIter start, TextIter end)

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
void removeSelectionClipboard(Clipboard clipboard)

Removes a #GtkClipboard added with gtk_text_buffer_add_selection_clipboard().

removeTag
void removeTag(TextTag tag, TextIter start, TextIter end)

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
void removeTagByName(string name, TextIter start, TextIter end)

Calls gtk_text_tag_table_lookup() on the buffer’s tag table to get a #GtkTextTag, then calls gtk_text_buffer_remove_tag().

selectRange
void selectRange(TextIter ins, TextIter bound)

This function moves the “insert” and “selection_bound” marks simultaneously. If you move them in two steps with gtk_text_buffer_move_mark(), 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.

serialize
ubyte[] serialize(TextBuffer contentBuffer, GdkAtom format, TextIter start, TextIter end)

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

setModified
void setModified(bool setting)

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 #GtkTextBuffer::modified-changed signal.

setText
void setText(string text)

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
void unregisterDeserializeFormat(GdkAtom format)

This function unregisters a rich text format that was previously registered using gtk_text_buffer_register_deserialize_format() or gtk_text_buffer_register_deserialize_tagset().

unregisterSerializeFormat
void unregisterSerializeFormat(GdkAtom format)

This function unregisters a rich text format that was previously registered using gtk_text_buffer_register_serialize_format() or gtk_text_buffer_register_serialize_tagset()

connectedSignals
int[string] connectedSignals;
Undocumented in source.
onApplyTagListeners
void delegate(TextTag, TextIter, TextIter, TextBuffer)[] onApplyTagListeners;
Undocumented in source.
addOnApplyTag
void addOnApplyTag(void delegate(TextTag, TextIter, TextIter, TextBuffer) dlg, ConnectFlags connectFlags)

The ::apply-tag signal is emitted to apply a tag to a range of text in a #GtkTextBuffer. Applying actually occurs in the default handler.

callBackApplyTag
void callBackApplyTag(GtkTextBuffer* textbufferStruct, GtkTextTag* tag, GtkTextIter* start, GtkTextIter* end, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginUserActionListeners
void delegate(TextBuffer)[] onBeginUserActionListeners;
Undocumented in source.
addOnBeginUserAction
void addOnBeginUserAction(void delegate(TextBuffer) dlg, ConnectFlags connectFlags)

The ::begin-user-action signal is emitted at the beginning of a single user-visible operation on a #GtkTextBuffer.

callBackBeginUserAction
void callBackBeginUserAction(GtkTextBuffer* textbufferStruct, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onChangedListeners
void delegate(TextBuffer)[] onChangedListeners;
Undocumented in source.
addOnChanged
void addOnChanged(void delegate(TextBuffer) dlg, ConnectFlags connectFlags)

The ::changed signal is emitted when the content of a #GtkTextBuffer has changed.

callBackChanged
void callBackChanged(GtkTextBuffer* textbufferStruct, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onDeleteRangeListeners
void delegate(TextIter, TextIter, TextBuffer)[] onDeleteRangeListeners;
Undocumented in source.
addOnDeleteRange
void addOnDeleteRange(void delegate(TextIter, TextIter, TextBuffer) dlg, ConnectFlags connectFlags)

The ::delete-range signal is emitted to delete a range from a #GtkTextBuffer.

callBackDeleteRange
void callBackDeleteRange(GtkTextBuffer* textbufferStruct, GtkTextIter* start, GtkTextIter* end, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onEndUserActionListeners
void delegate(TextBuffer)[] onEndUserActionListeners;
Undocumented in source.
addOnEndUserAction
void addOnEndUserAction(void delegate(TextBuffer) dlg, ConnectFlags connectFlags)

The ::end-user-action signal is emitted at the end of a single user-visible operation on the #GtkTextBuffer.

callBackEndUserAction
void callBackEndUserAction(GtkTextBuffer* textbufferStruct, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onInsertChildAnchorListeners
void delegate(TextIter, TextChildAnchor, TextBuffer)[] onInsertChildAnchorListeners;
Undocumented in source.
addOnInsertChildAnchor
void addOnInsertChildAnchor(void delegate(TextIter, TextChildAnchor, TextBuffer) dlg, ConnectFlags connectFlags)

The ::insert-child-anchor signal is emitted to insert a #GtkTextChildAnchor in a #GtkTextBuffer. Insertion actually occurs in the default handler.

callBackInsertChildAnchor
void callBackInsertChildAnchor(GtkTextBuffer* textbufferStruct, GtkTextIter* location, GtkTextChildAnchor* anchor, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onInsertPixbufListeners
void delegate(TextIter, Pixbuf, TextBuffer)[] onInsertPixbufListeners;
Undocumented in source.
addOnInsertPixbuf
void addOnInsertPixbuf(void delegate(TextIter, Pixbuf, TextBuffer) dlg, ConnectFlags connectFlags)

The ::insert-pixbuf signal is emitted to insert a #GdkPixbuf in a #GtkTextBuffer. Insertion actually occurs in the default handler.

callBackInsertPixbuf
void callBackInsertPixbuf(GtkTextBuffer* textbufferStruct, GtkTextIter* location, GdkPixbuf* pixbuf, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onInsertTextListeners
void delegate(TextIter, string, int, TextBuffer)[] onInsertTextListeners;
Undocumented in source.
addOnInsertText
void addOnInsertText(void delegate(TextIter, string, int, TextBuffer) dlg, ConnectFlags connectFlags)

The ::insert-text signal is emitted to insert text in a #GtkTextBuffer. Insertion actually occurs in the default handler.

callBackInsertText
void callBackInsertText(GtkTextBuffer* textbufferStruct, GtkTextIter* location, char* text, int len, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onMarkDeletedListeners
void delegate(TextMark, TextBuffer)[] onMarkDeletedListeners;
Undocumented in source.
addOnMarkDeleted
void addOnMarkDeleted(void delegate(TextMark, TextBuffer) dlg, ConnectFlags connectFlags)

The ::mark-deleted signal is emitted as notification after a #GtkTextMark is deleted.

callBackMarkDeleted
void callBackMarkDeleted(GtkTextBuffer* textbufferStruct, GtkTextMark* mark, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onMarkSetListeners
void delegate(TextIter, TextMark, TextBuffer)[] onMarkSetListeners;
Undocumented in source.
addOnMarkSet
void addOnMarkSet(void delegate(TextIter, TextMark, TextBuffer) dlg, ConnectFlags connectFlags)

The ::mark-set signal is emitted as notification after a #GtkTextMark is set.

callBackMarkSet
void callBackMarkSet(GtkTextBuffer* textbufferStruct, GtkTextIter* location, GtkTextMark* mark, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onModifiedChangedListeners
void delegate(TextBuffer)[] onModifiedChangedListeners;
Undocumented in source.
addOnModifiedChanged
void addOnModifiedChanged(void delegate(TextBuffer) dlg, ConnectFlags connectFlags)

The ::modified-changed signal is emitted when the modified bit of a #GtkTextBuffer flips.

callBackModifiedChanged
void callBackModifiedChanged(GtkTextBuffer* textbufferStruct, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onPasteDoneListeners
void delegate(Clipboard, TextBuffer)[] onPasteDoneListeners;
Undocumented in source.
addOnPasteDone
void addOnPasteDone(void delegate(Clipboard, TextBuffer) dlg, ConnectFlags connectFlags)

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 gtk_text_buffer_paste_clipboard() for more details.

callBackPasteDone
void callBackPasteDone(GtkTextBuffer* textbufferStruct, GtkClipboard* clipboard, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.
onRemoveTagListeners
void delegate(TextTag, TextIter, TextIter, TextBuffer)[] onRemoveTagListeners;
Undocumented in source.
addOnRemoveTag
void addOnRemoveTag(void delegate(TextTag, TextIter, TextIter, TextBuffer) dlg, ConnectFlags connectFlags)

The ::remove-tag signal is emitted to remove all occurrences of @tag from a range of text in a #GtkTextBuffer. Removal actually occurs in the default handler.

callBackRemoveTag
void callBackRemoveTag(GtkTextBuffer* textbufferStruct, GtkTextTag* tag, GtkTextIter* start, GtkTextIter* end, TextBuffer _textbuffer)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta