TextIter

class TextIter(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

An iterator for the contents of a GtkTextBuffer.

You may wish to begin by reading the section-text-widget.html, which gives an overview of all the objects and data types related to the text widget and how they work together.

Constructors

Link copied to clipboard
constructor()

Allocate a new TextIter.

constructor(scope: <Error class: unknown class>)

Allocate a new TextIter using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gtkTextIterPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun assign(other: TextIter)

Assigns the value of @other to @iter.

Link copied to clipboard

Moves backward by one character offset.

Link copied to clipboard
fun backwardChars(count: <Error class: unknown class>): Boolean

Moves @count characters backward, if possible.

Link copied to clipboard

Like method@Gtk.TextIter.forward_cursor_position, but moves backward.

Link copied to clipboard
fun backwardCursorPositions(count: <Error class: unknown class>): Boolean

Moves up to @count cursor positions.

Link copied to clipboard

Same as method@Gtk.TextIter.forward_find_char, but goes backward from @iter.

Link copied to clipboard

Moves @iter to the start of the previous line.

Link copied to clipboard
fun backwardLines(count: <Error class: unknown class>): Boolean

Moves @count lines backward, if possible.

Link copied to clipboard
fun backwardSearch(str: String, flags: TextSearchFlags, matchStart: TextIter?, matchEnd: TextIter?, limit: TextIter? = null): Boolean

Same as method@Gtk.TextIter.forward_search, but moves backward.

Link copied to clipboard

Moves backward to the previous sentence start.

Link copied to clipboard
fun backwardSentenceStarts(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.backward_sentence_start up to @count times.

Link copied to clipboard

Moves backward to the next toggle (on or off) of the

Link copied to clipboard

Moves @iter backward to the previous visible cursor position.

Link copied to clipboard
fun backwardVisibleCursorPositions(count: <Error class: unknown class>): Boolean

Moves up to @count visible cursor positions.

Link copied to clipboard

Moves @iter to the start of the previous visible line.

Link copied to clipboard
fun backwardVisibleLines(count: <Error class: unknown class>): Boolean

Moves @count visible lines backward, if possible.

Link copied to clipboard

Moves backward to the previous visible word start.

Link copied to clipboard
fun backwardVisibleWordStarts(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.backward_visible_word_start up to @count times.

Link copied to clipboard

Moves backward to the previous word start.

Link copied to clipboard
fun backwardWordStarts(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.backward_word_start up to @count times.

Link copied to clipboard
fun canInsert(defaultEditability: Boolean): Boolean

Considering the default editability of the buffer, and tags that affect editability, determines whether text inserted at @iter would be editable.

Link copied to clipboard
fun compare(rhs: TextIter): <Error class: unknown class>

A qsort()-style function that returns negative if @lhs is less than

Link copied to clipboard
fun copy(): TextIter

Creates a dynamically-allocated copy of an iterator.

Link copied to clipboard
fun editable(defaultSetting: Boolean): Boolean

Returns whether the character at @iter is within an editable region of text.

Link copied to clipboard

Returns true if @iter points to the start of the paragraph delimiter characters for a line.

Link copied to clipboard

Determines whether @iter ends a sentence.

Link copied to clipboard
fun endsTag(tag: TextTag? = null): Boolean

Returns true if @tag is toggled off at exactly this point.

Link copied to clipboard

Determines whether @iter ends a natural-language word.

Link copied to clipboard

Tests whether two iterators are equal, using the fastest possible mechanism.

Link copied to clipboard

Moves @iter forward by one character offset.

Link copied to clipboard
fun forwardChars(count: <Error class: unknown class>): Boolean

Moves @count characters if possible.

Link copied to clipboard

Moves @iter forward by a single cursor position.

Link copied to clipboard
fun forwardCursorPositions(count: <Error class: unknown class>): Boolean

Moves up to @count cursor positions.

Link copied to clipboard

Advances @iter, calling @pred on each character.

Link copied to clipboard

Moves @iter to the start of the next line.

Link copied to clipboard
fun forwardLines(count: <Error class: unknown class>): Boolean

Moves @count lines forward, if possible.

Link copied to clipboard
fun forwardSearch(str: String, flags: TextSearchFlags, matchStart: TextIter?, matchEnd: TextIter?, limit: TextIter? = null): Boolean

Searches forward for @str.

Link copied to clipboard

Moves forward to the next sentence end.

Link copied to clipboard
fun forwardSentenceEnds(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.forward_sentence_end @count times.

Link copied to clipboard

Moves @iter forward to the “end iterator”, which points one past the last valid character in the buffer.

Link copied to clipboard

Moves the iterator to point to the paragraph delimiter characters.

Link copied to clipboard

Moves forward to the next toggle (on or off) of the

Link copied to clipboard

Moves @iter forward to the next visible cursor position.

Link copied to clipboard
fun forwardVisibleCursorPositions(count: <Error class: unknown class>): Boolean

Moves up to @count visible cursor positions.

Link copied to clipboard

Moves @iter to the start of the next visible line.

Link copied to clipboard
fun forwardVisibleLines(count: <Error class: unknown class>): Boolean

Moves @count visible lines forward, if possible.

Link copied to clipboard

Moves forward to the next visible word end.

Link copied to clipboard
fun forwardVisibleWordEnds(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.forward_visible_word_end up to @count times.

Link copied to clipboard

Moves forward to the next word end.

Link copied to clipboard
fun forwardWordEnds(count: <Error class: unknown class>): Boolean

Calls method@Gtk.TextIter.forward_word_end up to @count times.

Link copied to clipboard
fun free()

Free an iterator allocated on the heap.

Link copied to clipboard

Returns the GtkTextBuffer this iterator is associated with.

Link copied to clipboard
fun getBytesInLine(): <Error class: unknown class>

Returns the number of bytes in the line containing @iter, including the paragraph delimiters.

Link copied to clipboard
fun getChar(): <Error class: unknown class>

The Unicode character at this iterator is returned.

Link copied to clipboard
fun getCharsInLine(): <Error class: unknown class>

Returns the number of characters in the line containing @iter, including the paragraph delimiters.

Link copied to clipboard

If the location at @iter contains a child anchor, the anchor is returned.

Link copied to clipboard
fun getLanguage(): <Error class: unknown class>

Returns the language in effect at @iter.

Link copied to clipboard
fun getLine(): <Error class: unknown class>

Returns the line number containing the iterator.

Link copied to clipboard
fun getLineIndex(): <Error class: unknown class>

Returns the byte index of the iterator, counting from the start of a newline-terminated line.

Link copied to clipboard
fun getLineOffset(): <Error class: unknown class>

Returns the character offset of the iterator, counting from the start of a newline-terminated line.

Link copied to clipboard
fun getMarks(): <Error class: unknown class>

Returns a list of all GtkTextMark at this location.

Link copied to clipboard
fun getOffset(): <Error class: unknown class>

Returns the character offset of an iterator.

Link copied to clipboard
fun getPaintable(): <Error class: unknown class>?

If the element at @iter is a paintable, the paintable is returned.

Link copied to clipboard

Returns the text in the given range.

Link copied to clipboard
fun getTags(): <Error class: unknown class>

Returns a list of tags that apply to @iter, in ascending order of priority.

Link copied to clipboard

Returns text in the given range.

Link copied to clipboard
fun getToggledTags(toggledOn: Boolean): <Error class: unknown class>

Returns a list of GtkTextTag that are toggled on or off at this point.

Link copied to clipboard
fun getVisibleLineIndex(): <Error class: unknown class>

Returns the number of bytes from the start of the line to the given @iter, not counting bytes that are invisible due to tags with the “invisible” flag toggled on.

Link copied to clipboard
fun getVisibleLineOffset(): <Error class: unknown class>

Returns the offset in characters from the start of the line to the given @iter, not counting characters that are invisible due to tags with the “invisible” flag toggled on.

Link copied to clipboard

Returns visible text in the given range.

Link copied to clipboard

Returns visible text in the given range.

Link copied to clipboard

Returns true if @iter points to a character that is part of a range tagged with @tag.

Link copied to clipboard
fun inRange(start: TextIter, end: TextIter): Boolean

Checks whether @iter falls in the range [@start, @end).

Link copied to clipboard

Determines whether @iter is inside a sentence (as opposed to in between two sentences, e.g. after a period and before the first letter of the next sentence).

Link copied to clipboard

Determines whether the character pointed by @iter is part of a natural-language word (as opposed to say inside some whitespace).

Link copied to clipboard

Determine if @iter is at a cursor position.

Link copied to clipboard
fun isEnd(): Boolean

Returns true if @iter is the end iterator.

Link copied to clipboard

Returns true if @iter is the first iterator in the buffer.

Link copied to clipboard
fun order(second: TextIter)

Swaps the value of @first and @second if @second comes before

Link copied to clipboard
fun setLine(lineNumber: <Error class: unknown class>)

Moves iterator @iter to the start of the line @line_number.

Link copied to clipboard
fun setLineIndex(byteOnLine: <Error class: unknown class>)

Same as method@Gtk.TextIter.set_line_offset, but works with a byte index. The given byte index must be at the start of a character, it can’t be in the middle of a UTF-8 encoded character.

Link copied to clipboard
fun setLineOffset(charOnLine: <Error class: unknown class>)

Moves @iter within a line, to a new character (not byte) offset.

Link copied to clipboard
fun setOffset(charOffset: <Error class: unknown class>)

Sets @iter to point to @char_offset.

Link copied to clipboard
fun setVisibleLineIndex(byteOnLine: <Error class: unknown class>)

Like method@Gtk.TextIter.set_line_index, but the index is in visible bytes, i.e. text with a tag making it invisible is not counted in the index.

Link copied to clipboard
fun setVisibleLineOffset(charOnLine: <Error class: unknown class>)

Like method@Gtk.TextIter.set_line_offset, but the offset is in visible characters, i.e. text with a tag making it invisible is not counted in the offset.

Link copied to clipboard

Returns true if @iter begins a paragraph.

Link copied to clipboard

Determines whether @iter begins a sentence.

Link copied to clipboard
fun startsTag(tag: TextTag? = null): Boolean

Returns true if @tag is toggled on at exactly this point.

Link copied to clipboard

Determines whether @iter begins a natural-language word.

Link copied to clipboard
fun togglesTag(tag: TextTag? = null): Boolean

Gets whether a range with @tag applied to it begins or ends at @iter.