TextIter

class TextIter(pointer: <Error class: unknown class><<Error class: unknown class>>)

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.

Skipped during bindings generation

  • field dummy1: Record field dummy1 is private

  • field dummy2: Record field dummy2 is private

  • field dummy3: Record field dummy3 is private

  • field dummy4: Record field dummy4 is private

  • field dummy5: Record field dummy5 is private

  • field dummy6: Record field dummy6 is private

  • field dummy7: Record field dummy7 is private

  • field dummy8: Record field dummy8 is private

  • field dummy9: Record field dummy9 is private

  • field dummy10: Record field dummy10 is private

  • field dummy11: Record field dummy11 is private

  • field dummy12: Record field dummy12 is private

  • field dummy13: Record field dummy13 is private

  • field dummy14: Record field dummy14 is private

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

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

Moves @count characters backward, if possible.

Link copied to clipboard

Like gtk_text_iter_forward_cursor_position(), but moves backward.

Link copied to clipboard

Moves up to @count cursor positions.

Link copied to clipboard

Same as gtk_text_iter_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

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 gtk_text_iter_forward_search(), but moves backward.

Link copied to clipboard

Moves backward to the previous sentence start.

Link copied to clipboard

Calls gtk_text_iter_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 forward to the previous visible cursor position.

Link copied to clipboard

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

Moves @count visible lines backward, if possible.

Link copied to clipboard

Moves backward to the previous visible word start.

Link copied to clipboard

Calls gtk_text_iter_backward_visible_word_start() up to @count times.

Link copied to clipboard

Moves backward to the previous word start.

Link copied to clipboard

Calls gtk_text_iter_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): Int

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: Int): Boolean

Moves @count characters if possible.

Link copied to clipboard

Moves @iter forward by a single cursor position.

Link copied to clipboard

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: Int): 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

Calls gtk_text_iter_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

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

Moves @count visible lines forward, if possible.

Link copied to clipboard

Moves forward to the next visible word end.

Link copied to clipboard

Calls gtk_text_iter_forward_visible_word_end() up to @count times.

Link copied to clipboard

Moves forward to the next word end.

Link copied to clipboard

Calls gtk_text_iter_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

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

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(): Int

Returns the line number containing the iterator.

Link copied to clipboard

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

Link copied to clipboard

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(): Int

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

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

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: Int)

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

Link copied to clipboard
fun setLineIndex(byteOnLine: Int)

Same as gtk_text_iter_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: Int)

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

Link copied to clipboard
fun setOffset(charOffset: Int)

Sets @iter to point to @char_offset.

Link copied to clipboard
fun setVisibleLineIndex(byteOnLine: Int)

Like gtk_text_iter_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: Int)

Like gtk_text_iter_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.