gtksource.buffer

Module for [Buffer] class

Types 3

Methods
GType _gType() @property
Buffer self()Returns `this`, for use in `with` statements.
BufferGidBuilder builder()Get builder for [gtksource.buffer.Buffer] Returns: New builder object
bool highlightMatchingBrackets() @propertyGet `highlightMatchingBrackets` property. Returns: Whether to highlight matching brackets in the buffer.
void highlightMatchingBrackets(bool propval) @propertySet `highlightMatchingBrackets` property. Params: propval = Whether to highlight matching brackets in the buffer.
bool highlightSyntax() @propertyGet `highlightSyntax` property. Returns: Whether to highlight syntax in the buffer.
void highlightSyntax(bool propval) @propertySet `highlightSyntax` property. Params: propval = Whether to highlight syntax in the buffer.
bool implicitTrailingNewline() @propertyGet `implicitTrailingNewline` property. Returns: Whether the buffer has an implicit trailing newline. See [gtksource.buffer.Buffer.setImplicitTrailingNewline].
void implicitTrailingNewline(bool propval) @propertySet `implicitTrailingNewline` property. Params: propval = Whether the buffer has an implicit trailing newline. See [gtksource.buffer.Buffer.setImplicitTrailingNewline].
void language(gtksource.language.Language propval) @property
int maxUndoLevels() @propertyGet `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) @propertySet `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() @propertyGet `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) @propertySet `styleScheme` property. Params: propval = Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets st...
gtksource.buffer.Buffer newWithLanguage(gtksource.language.Language 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 [gtksource.buffer.Buffer.setLangua...
bool backwardIterToSourceMark(gtk.text_iter.TextIter iter, string category = null)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.
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 loadin...
bool canRedo()Determines 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()Determines 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)Changes the case of the text between the specified iterators.
gtksource.mark.Mark createSourceMark(string name, string category, gtk.text_iter.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 ...
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-e...
void ensureHighlight(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end)Forces buffer to analyze and highlight the given area synchronously.
bool forwardIterToSourceMark(gtk.text_iter.TextIter iter, string category = null)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.
string[] getContextClassesAtIter(gtk.text_iter.TextIter iter)Get all defined context classes at iter.
bool getHighlightMatchingBrackets()Determines whether bracket match highlighting is activated for the source buffer. Returns: true if the source buffer will highlight matching brackets.
bool getHighlightSyntax()Determines whether syntax highlighting is activated in the source buffer. Returns: true if syntax highlighting is enabled, false otherwise.
gtksource.language.Language getLanguage()Returns 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()Determines 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)Returns 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)Returns 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()Returns 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()Returns 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)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 togg...
bool iterForwardToContextClassToggle(gtk.text_iter.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 toggl...
bool iterHasContextClass(gtk.text_iter.TextIter iter, string contextClass)Check if the class context_class is set on iter.
void joinLines(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end)Joins the lines of text between the specified iterators.
void redo()Redoes 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)Remove 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)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...
void setHighlightSyntax(bool highlight)Controls whether syntax is highlighted in the buffer.
void setImplicitTrailingNewline(bool implicitTrailingNewline)Sets whether the buffer has an implicit trailing newline.
void setLanguage(gtksource.language.Language language = null)Associates a #GtkSourceLanguage with the buffer.
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.
void setStyleScheme(gtksource.style_scheme.StyleScheme scheme = null)Sets a #GtkSourceStyleScheme to be used by the buffer and the view.
void setUndoManager(gtksource.undo_manager.UndoManager manager = null)Set 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)Sort the lines of text between the specified iterators.
void undo()Undoes 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)Connect 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)Connect 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)Connect 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)Connect 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)Connect to `Undo` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtk.text_tag_table.TextTagTable table = null)Creates a new source buffer.
Methods
T highlightMatchingBrackets(bool propval)Set `highlightMatchingBrackets` property. Params: propval = Whether to highlight matching brackets in the buffer. Returns: Builder instance for fluent chaining
T highlightSyntax(bool propval)Set `highlightSyntax` property. Params: propval = Whether to highlight syntax in the buffer. Returns: Builder instance for fluent chaining
T implicitTrailingNewline(bool propval)Set `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)Set `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)Set `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