gtksource.buffer

Module for [Buffer] class

Types 3

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
Buffer self() nothrowReturns `this`, for use in `with` statements.
BufferGidBuilder builder() static nothrowGet builder for [gtksource.buffer.Buffer] Returns: New builder object
bool highlightMatchingBrackets() @property nothrowGet `highlightMatchingBrackets` property. Returns: Whether to highlight matching brackets in the buffer.
void highlightMatchingBrackets(bool propval) @property nothrowSet `highlightMatchingBrackets` property. Params: propval = Whether to highlight matching brackets in the buffer.
bool highlightSyntax() @property nothrowGet `highlightSyntax` property. Returns: Whether to highlight syntax in the buffer.
void highlightSyntax(bool propval) @property nothrowSet `highlightSyntax` property. Params: propval = Whether to highlight syntax in the buffer.
bool implicitTrailingNewline() @property nothrowGet `implicitTrailingNewline` property. Returns: Whether the buffer has an implicit trailing newline. See [gtksource.buffer.Buffer.setImplicitTrailingNewline].
void implicitTrailingNewline(bool propval) @property nothrowSet `implicitTrailingNewline` property. Params: propval = Whether the buffer has an implicit trailing newline. See [gtksource.buffer.Buffer.setImplicitTrailingNewline].
void language(gtksource.language.Language propval) @property nothrow
int maxUndoLevels() @property nothrowGet `maxUndoLevels` property. Returns: Number of undo levels for the buffer. -1 means no limit. This property will only affect the default undo manager.
void maxUndoLevels(int propval) @property nothrowSet `maxUndoLevels` property. Params: propval = Number of undo levels for the buffer. -1 means no limit. This property will only affect the default undo manager.
gtksource.style_scheme.StyleScheme styleScheme() @property nothrowGet `styleScheme` property. Returns: Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets style.
void styleScheme(gtksource.style_scheme.StyleScheme propval) @property nothrowSet `styleScheme` property. Params: propval = Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets st...
void undoManager(gtksource.undo_manager.UndoManager propval) @property nothrow
gtksource.buffer.Buffer newWithLanguage(gtksource.language.Language language) static nothrowCreates 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 [gtksource.buffer.Buffer.setLangua...
bool backwardIterToSourceMark(gtk.text_iter.TextIter iter, string category = null) nothrowMoves 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.
void beginNotUndoableAction() nothrowMarks 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 loadin...
bool canRedo() nothrowDetermines whether a source buffer can redo the last action (i.e. if the last operation was an undo). Returns: true if a redo is possible.
bool canUndo() nothrowDetermines whether a source buffer can undo the last action. Returns: true if it's possible to undo the last action.
void changeCase(gtksource.types.ChangeCaseType caseType, gtk.text_iter.TextIter start, gtk.text_iter.TextIter end) nothrowChanges the case of the text between the specified iterators.
gtksource.mark.Mark createSourceMark(string name, string category, gtk.text_iter.TextIter where) nothrowCreates 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 ...
void endNotUndoableAction() nothrowMarks 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-e...
void ensureHighlight(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end) nothrowForces buffer to analyze and highlight the given area synchronously.
bool forwardIterToSourceMark(gtk.text_iter.TextIter iter, string category = null) nothrowMoves 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.
string[] getContextClassesAtIter(gtk.text_iter.TextIter iter) nothrowGet all defined context classes at iter.
bool getHighlightMatchingBrackets() nothrowDetermines whether bracket match highlighting is activated for the source buffer. Returns: true if the source buffer will highlight matching brackets.
bool getHighlightSyntax() nothrowDetermines whether syntax highlighting is activated in the source buffer. Returns: true if syntax highlighting is enabled, false otherwise.
gtksource.language.Language getLanguage() nothrowReturns the #GtkSourceLanguage associated with the buffer, see [gtksource.buffer.Buffer.setLanguage]. The returned object should not be unreferenced by the user. Returns: the #GtkSourceLanguage as...
int getMaxUndoLevels() nothrowDetermines the number of undo levels the buffer will track for buffer edits. Returns: the maximum number of possible undo levels or -1 if no limit is set.
gtksource.mark.Mark[] getSourceMarksAtIter(gtk.text_iter.TextIter iter, string category = null) nothrowReturns the list of marks of the given category at iter. If category is null it returns all marks at iter.
gtksource.mark.Mark[] getSourceMarksAtLine(int line, string category = null) nothrowReturns the list of marks of the given category at line. If category is null, all marks at line are returned.
gtksource.style_scheme.StyleScheme getStyleScheme() nothrowReturns the #GtkSourceStyleScheme associated with the buffer, see [gtksource.buffer.Buffer.setStyleScheme]. The returned object should not be unreferenced by the user. Returns: the #GtkSourceStyleS...
gtksource.undo_manager.UndoManager getUndoManager() nothrowReturns the #GtkSourceUndoManager associated with the buffer, see [gtksource.buffer.Buffer.setUndoManager]. The returned object should not be unreferenced by the user. Returns: the #GtkSourceUndoM...
bool iterBackwardToContextClassToggle(gtk.text_iter.TextIter iter, string contextClass) nothrowMoves 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 togg...
bool iterForwardToContextClassToggle(gtk.text_iter.TextIter iter, string contextClass) nothrowMoves 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 toggl...
bool iterHasContextClass(gtk.text_iter.TextIter iter, string contextClass) nothrowCheck if the class context_class is set on iter.
void joinLines(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end) nothrowJoins the lines of text between the specified iterators.
void redo() nothrowRedoes the last undo operation. Use [gtksource.buffer.Buffer.canRedo] to check whether a call to this function will have any effect.
void removeSourceMarks(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end, string category = null) nothrowRemove all marks of category between start and end from the buffer. If category is NULL, all marks in the range will be removed.
void setHighlightMatchingBrackets(bool highlight) nothrowControls 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...
void setHighlightSyntax(bool highlight) nothrowControls whether syntax is highlighted in the buffer.
void setImplicitTrailingNewline(bool implicitTrailingNewline) nothrowSets whether the buffer has an implicit trailing newline.
void setLanguage(gtksource.language.Language language = null) nothrowAssociates a #GtkSourceLanguage with the buffer.
void setMaxUndoLevels(int maxUndoLevels) nothrowSets 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.
void setStyleScheme(gtksource.style_scheme.StyleScheme scheme = null) nothrowSets a #GtkSourceStyleScheme to be used by the buffer and the view.
void setUndoManager(gtksource.undo_manager.UndoManager manager = null) nothrowSet the buffer undo manager. If manager is null the default undo manager will be set.
void sortLines(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end, gtksource.types.SortFlags flags, int column) nothrowSort the lines of text between the specified iterators.
void undo() nothrowUndoes the last user action which modified the buffer. Use [gtksource.buffer.Buffer.canUndo] to check whether a call to this function will have any effect.
gulong connectBracketMatched(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gtksource.types.BracketMatchType))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.buffer.Buffer))) && Parameters!T.length < 4) nothrowConnect to `BracketMatched` signal.
gulong connectHighlightUpdated(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gtk.text_iter.TextIter))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.buffer.Buffer))) && Parameters!T.length < 4) nothrowConnect to `HighlightUpdated` signal.
gulong connectRedo(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtksource.buffer.Buffer))) && Parameters!T.length < 2) nothrowConnect to `Redo` signal.
gulong connectSourceMarkUpdated(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.text_mark.TextMark))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtksource.buffer.Buffer))) && Parameters!T.length < 3) nothrowConnect to `SourceMarkUpdated` signal.
gulong connectUndo(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtksource.buffer.Buffer))) && Parameters!T.length < 2) nothrowConnect to `Undo` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtk.text_tag_table.TextTagTable table = null)Creates a new source buffer.

Fluent builder implementation template for gtksource.buffer.Buffer

Methods
T highlightMatchingBrackets(bool propval) nothrowSet `highlightMatchingBrackets` property. Params: propval = Whether to highlight matching brackets in the buffer. Returns: Builder instance for fluent chaining
T highlightSyntax(bool propval) nothrowSet `highlightSyntax` property. Params: propval = Whether to highlight syntax in the buffer. Returns: Builder instance for fluent chaining
T implicitTrailingNewline(bool propval) nothrowSet `implicitTrailingNewline` property. Params: propval = Whether the buffer has an implicit trailing newline. See [gtksource.buffer.Buffer.setImplicitTrailingNewline]. Returns: Builder instance fo...
T maxUndoLevels(int propval) nothrowSet `maxUndoLevels` property. Params: propval = Number of undo levels for the buffer. -1 means no limit. This property will only affect the default undo manager. Returns: Builder instance for fluen...
T styleScheme(gtksource.style_scheme.StyleScheme propval) nothrowSet `styleScheme` property. Params: propval = Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets st...

Fluent builder for gtksource.buffer.Buffer

Methods
Buffer build() nothrowCreate object from builder. Returns: New object