gtk.text_iter

Module for [TextIter] class

class TextIter

Types 1

An iterator for the contents of a gtk.text_buffer.TextBuffer.

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

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup) nothrow
GType _getGType() static nothrow
GType _gType() @property nothrow
TextIter self() nothrowReturns `this`, for use in `with` statements.
void assign(gtk.text_iter.TextIter other) nothrowAssigns the value of other to iter.
bool backwardChar() nothrowMoves backward by one character offset.
bool backwardChars(int count) nothrowMoves count characters backward, if possible.
bool backwardCursorPosition() nothrowLike [gtk.text_iter.TextIter.forwardCursorPosition], but moves backward. Returns: true if we moved
bool backwardCursorPositions(int count) nothrowMoves up to count cursor positions.
bool backwardFindChar(gtk.types.TextCharPredicate pred, gtk.text_iter.TextIter limit = null) nothrowSame as [gtk.text_iter.TextIter.forwardFindChar], but goes backward from iter.
bool backwardLine() nothrowMoves iter to the start of the previous line.
bool backwardLines(int count) nothrowMoves count lines backward, if possible.
bool backwardSearch(string str, gtk.types.TextSearchFlags flags, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, gtk.text_iter.TextIter limit = null) nothrowSame as [gtk.text_iter.TextIter.forwardSearch], but moves backward.
bool backwardSentenceStart() nothrowMoves backward to the previous sentence start.
bool backwardSentenceStarts(int count) nothrowCalls [gtk.text_iter.TextIter.backwardSentenceStart] up to count times.
bool backwardToTagToggle(gtk.text_tag.TextTag tag = null) nothrowMoves backward to the next toggle (on or off) of the tag, or to the next toggle of any tag if tag is null.
bool backwardVisibleCursorPosition() nothrowMoves iter backward to the previous visible cursor position.
bool backwardVisibleCursorPositions(int count) nothrowMoves up to count visible cursor positions.
bool backwardVisibleLine() nothrowMoves iter to the start of the previous visible line.
bool backwardVisibleLines(int count) nothrowMoves count visible lines backward, if possible.
bool backwardVisibleWordStart() nothrowMoves backward to the previous visible word start.
bool backwardVisibleWordStarts(int count) nothrowCalls [gtk.text_iter.TextIter.backwardVisibleWordStart] up to count times.
bool backwardWordStart() nothrowMoves backward to the previous word start.
bool backwardWordStarts(int count) nothrowCalls [gtk.text_iter.TextIter.backwardWordStart] up to count times.
bool canInsert(bool defaultEditability) nothrowConsidering the default editability of the buffer, and tags that affect editability, determines whether text inserted at iter would be editable.
int compare(gtk.text_iter.TextIter rhs) nothrowA qsort()-style function that returns negative if lhs is less than rhs, positive if lhs is greater than rhs, and 0 if they’re equal.
gtk.text_iter.TextIter copy() nothrowCreates a dynamically-allocated copy of an iterator.
bool editable(bool defaultSetting) nothrowReturns whether the character at iter is within an editable region of text.
bool endsLine() nothrowReturns true if iter points to the start of the paragraph delimiter characters for a line.
bool endsSentence() nothrowDetermines whether iter ends a sentence.
bool endsTag(gtk.text_tag.TextTag tag = null) nothrowReturns true if tag is toggled off at exactly this point.
bool endsWord() nothrowDetermines whether iter ends a natural-language word.
bool equal(gtk.text_iter.TextIter rhs) nothrowTests whether two iterators are equal, using the fastest possible mechanism.
bool forwardChar() nothrowMoves iter forward by one character offset.
bool forwardChars(int count) nothrowMoves count characters if possible.
bool forwardCursorPosition() nothrowMoves iter forward by a single cursor position.
bool forwardCursorPositions(int count) nothrowMoves up to count cursor positions.
bool forwardFindChar(gtk.types.TextCharPredicate pred, gtk.text_iter.TextIter limit = null) nothrowAdvances iter, calling pred on each character.
bool forwardLine() nothrowMoves iter to the start of the next line.
bool forwardLines(int count) nothrowMoves count lines forward, if possible.
bool forwardSearch(string str, gtk.types.TextSearchFlags flags, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, gtk.text_iter.TextIter limit = null) nothrowSearches forward for str.
bool forwardSentenceEnd() nothrowMoves forward to the next sentence end.
bool forwardSentenceEnds(int count) nothrowCalls [gtk.text_iter.TextIter.forwardSentenceEnd] count times.
void forwardToEnd() nothrowMoves iter forward to the “end iterator”, which points one past the last valid character in the buffer.
bool forwardToLineEnd() nothrowMoves the iterator to point to the paragraph delimiter characters.
bool forwardToTagToggle(gtk.text_tag.TextTag tag = null) nothrowMoves forward to the next toggle (on or off) of the tag, or to the next toggle of any tag if tag is null.
bool forwardVisibleCursorPosition() nothrowMoves iter forward to the next visible cursor position.
bool forwardVisibleCursorPositions(int count) nothrowMoves up to count visible cursor positions.
bool forwardVisibleLine() nothrowMoves iter to the start of the next visible line.
bool forwardVisibleLines(int count) nothrowMoves count visible lines forward, if possible.
bool forwardVisibleWordEnd() nothrowMoves forward to the next visible word end.
bool forwardVisibleWordEnds(int count) nothrowCalls [gtk.text_iter.TextIter.forwardVisibleWordEnd] up to count times.
bool forwardWordEnd() nothrowMoves forward to the next word end.
bool forwardWordEnds(int count) nothrowCalls [gtk.text_iter.TextIter.forwardWordEnd] up to count times.
gtk.text_buffer.TextBuffer getBuffer() nothrowReturns the [gtk.text_buffer.TextBuffer] this iterator is associated with. Returns: the buffer
int getBytesInLine() nothrowReturns the number of bytes in the line containing iter, including the paragraph delimiters. Returns: number of bytes in the line
dchar getChar() nothrowThe Unicode character at this iterator is returned.
int getCharsInLine() nothrowReturns the number of characters in the line containing iter, including the paragraph delimiters. Returns: number of characters in the line
gtk.text_child_anchor.TextChildAnchor getChildAnchor() nothrowIf the location at iter contains a child anchor, the anchor is returned.
pango.language.Language getLanguage() nothrowReturns the language in effect at iter.
int getLine() nothrowReturns the line number containing the iterator.
int getLineIndex() nothrowReturns the byte index of the iterator, counting from the start of a newline-terminated line.
int getLineOffset() nothrowReturns the character offset of the iterator, counting from the start of a newline-terminated line.
gtk.text_mark.TextMark[] getMarks() nothrowReturns a list of all [gtk.text_mark.TextMark] at this location.
int getOffset() nothrowReturns the character offset of an iterator.
gdk.paintable.Paintable getPaintable() nothrowIf the element at iter is a paintable, the paintable is returned.
string getSlice(gtk.text_iter.TextIter end) nothrowReturns the text in the given range.
gtk.text_tag.TextTag[] getTags() nothrowReturns a list of tags that apply to iter, in ascending order of priority.
string getText(gtk.text_iter.TextIter end) nothrowReturns text in the given range.
gtk.text_tag.TextTag[] getToggledTags(bool toggledOn) nothrowReturns a list of [gtk.text_tag.TextTag] that are toggled on or off at this point.
int getVisibleLineIndex() nothrowReturns 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. Returns: byte index of iter wit...
int getVisibleLineOffset() nothrowReturns 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. Returns: offset in vi...
string getVisibleSlice(gtk.text_iter.TextIter end) nothrowReturns visible text in the given range.
string getVisibleText(gtk.text_iter.TextIter end) nothrowReturns visible text in the given range.
bool hasTag(gtk.text_tag.TextTag tag) nothrowReturns true if iter points to a character that is part of a range tagged with tag.
bool inRange(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end) nothrowChecks whether iter falls in the range [start, end).
bool insideSentence() nothrowDetermines 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).
bool insideWord() nothrowDetermines whether the character pointed by iter is part of a natural-language word (as opposed to say inside some whitespace).
bool isCursorPosition() nothrowDetermine if iter is at a cursor position.
bool isEnd() nothrowReturns true if iter is the end iterator.
bool isStart() nothrowReturns true if iter is the first iterator in the buffer. Returns: whether iter is the first in the buffer
void order(gtk.text_iter.TextIter second) nothrowSwaps the value of first and second if second comes before first in the buffer.
void setLine(int lineNumber) nothrowMoves iterator iter to the start of the line line_number.
void setLineIndex(int byteOnLine) nothrowSame as [gtk.text_iter.TextIter.setLineOffset], 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.
void setLineOffset(int charOnLine) nothrowMoves iter within a line, to a new character (not byte) offset.
void setOffset(int charOffset) nothrowSets iter to point to char_offset.
void setVisibleLineIndex(int byteOnLine) nothrowLike [gtk.text_iter.TextIter.setLineIndex], but the index is in visible bytes, i.e. text with a tag making it invisible is not counted in the index.
void setVisibleLineOffset(int charOnLine) nothrowLike [gtk.text_iter.TextIter.setLineOffset], but the offset is in visible characters, i.e. text with a tag making it invisible is not counted in the offset.
bool startsLine() nothrowReturns true if iter begins a paragraph.
bool startsSentence() nothrowDetermines whether iter begins a sentence.
bool startsTag(gtk.text_tag.TextTag tag = null) nothrowReturns true if tag is toggled on at exactly this point.
bool startsWord() nothrowDetermines whether iter begins a natural-language word.
bool togglesTag(gtk.text_tag.TextTag tag = null) nothrowGets whether a range with tag applied to it begins or ends at iter.
Constructors
this()Create a `text_iter.TextIter` boxed type.
this(void * ptr, Flag!"Take" take)