TextIter

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.

class TextIter : Boxed {}

Members

Functions

assign
void assign(gtk.text_iter.TextIter other)

Assigns the value of other to iter.

backwardChar
bool backwardChar()

Moves backward by one character offset.

backwardChars
bool backwardChars(int count)

Moves count characters backward, if possible.

backwardCursorPosition
bool backwardCursorPosition()

Like gtk.text_iter.TextIter.forwardCursorPosition, but moves backward.

backwardCursorPositions
bool backwardCursorPositions(int count)

Moves up to count cursor positions.

backwardFindChar
bool backwardFindChar(gtk.types.TextCharPredicate pred, gtk.text_iter.TextIter limit)

Same as gtk.text_iter.TextIter.forwardFindChar, but goes backward from iter.

backwardLine
bool backwardLine()

Moves iter to the start of the previous line.

backwardLines
bool backwardLines(int count)

Moves count lines backward, if possible.

backwardSearch
bool backwardSearch(string str, gtk.types.TextSearchFlags flags, gtk.text_iter.TextIter matchStart, gtk.text_iter.TextIter matchEnd, gtk.text_iter.TextIter limit)

Same as gtk.text_iter.TextIter.forwardSearch, but moves backward.

backwardSentenceStart
bool backwardSentenceStart()

Moves backward to the previous sentence start.

backwardSentenceStarts
bool backwardSentenceStarts(int count)

Calls gtk.text_iter.TextIter.backwardSentenceStart up to count times.

backwardToTagToggle
bool backwardToTagToggle(gtk.text_tag.TextTag tag)

Moves backward to the next toggle (on or off) of the tag, or to the next toggle of any tag if tag is null.

backwardVisibleCursorPosition
bool backwardVisibleCursorPosition()

Moves iter backward to the previous visible cursor position.

backwardVisibleCursorPositions
bool backwardVisibleCursorPositions(int count)

Moves up to count visible cursor positions.

backwardVisibleLine
bool backwardVisibleLine()

Moves iter to the start of the previous visible line.

backwardVisibleLines
bool backwardVisibleLines(int count)

Moves count visible lines backward, if possible.

backwardVisibleWordStart
bool backwardVisibleWordStart()

Moves backward to the previous visible word start.

backwardVisibleWordStarts
bool backwardVisibleWordStarts(int count)

Calls gtk.text_iter.TextIter.backwardVisibleWordStart up to count times.

backwardWordStart
bool backwardWordStart()

Moves backward to the previous word start.

backwardWordStarts
bool backwardWordStarts(int count)

Calls gtk.text_iter.TextIter.backwardWordStart up to count times.

canInsert
bool canInsert(bool defaultEditability)

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

compare
int compare(gtk.text_iter.TextIter rhs)

A 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.

copy
gtk.text_iter.TextIter copy()

Creates a dynamically-allocated copy of an iterator.

editable
bool editable(bool defaultSetting)

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

endsLine
bool endsLine()

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

endsSentence
bool endsSentence()

Determines whether iter ends a sentence.

endsTag
bool endsTag(gtk.text_tag.TextTag tag)

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

endsWord
bool endsWord()

Determines whether iter ends a natural-language word.

equal
bool equal(gtk.text_iter.TextIter rhs)

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

forwardChar
bool forwardChar()

Moves iter forward by one character offset.

forwardChars
bool forwardChars(int count)

Moves count characters if possible.

forwardCursorPosition
bool forwardCursorPosition()

Moves iter forward by a single cursor position.

forwardCursorPositions
bool forwardCursorPositions(int count)

Moves up to count cursor positions.

forwardFindChar
bool forwardFindChar(gtk.types.TextCharPredicate pred, gtk.text_iter.TextIter limit)

Advances iter, calling pred on each character.

forwardLine
bool forwardLine()

Moves iter to the start of the next line.

forwardLines
bool forwardLines(int count)

Moves count lines forward, if possible.

forwardSearch
bool forwardSearch(string str, gtk.types.TextSearchFlags flags, gtk.text_iter.TextIter matchStart, gtk.text_iter.TextIter matchEnd, gtk.text_iter.TextIter limit)

Searches forward for str.

forwardSentenceEnd
bool forwardSentenceEnd()

Moves forward to the next sentence end.

forwardSentenceEnds
bool forwardSentenceEnds(int count)

Calls gtk.text_iter.TextIter.forwardSentenceEnd count times.

forwardToEnd
void forwardToEnd()

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

forwardToLineEnd
bool forwardToLineEnd()

Moves the iterator to point to the paragraph delimiter characters.

forwardToTagToggle
bool forwardToTagToggle(gtk.text_tag.TextTag tag)

Moves forward to the next toggle (on or off) of the tag, or to the next toggle of any tag if tag is null.

forwardVisibleCursorPosition
bool forwardVisibleCursorPosition()

Moves iter forward to the next visible cursor position.

forwardVisibleCursorPositions
bool forwardVisibleCursorPositions(int count)

Moves up to count visible cursor positions.

forwardVisibleLine
bool forwardVisibleLine()

Moves iter to the start of the next visible line.

forwardVisibleLines
bool forwardVisibleLines(int count)

Moves count visible lines forward, if possible.

forwardVisibleWordEnd
bool forwardVisibleWordEnd()

Moves forward to the next visible word end.

forwardVisibleWordEnds
bool forwardVisibleWordEnds(int count)

Calls gtk.text_iter.TextIter.forwardVisibleWordEnd up to count times.

forwardWordEnd
bool forwardWordEnd()

Moves forward to the next word end.

forwardWordEnds
bool forwardWordEnds(int count)

Calls gtk.text_iter.TextIter.forwardWordEnd up to count times.

getBuffer
gtk.text_buffer.TextBuffer getBuffer()

Returns the gtk.text_buffer.TextBuffer this iterator is associated with.

getBytesInLine
int getBytesInLine()

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

getChar
dchar getChar()

The Unicode character at this iterator is returned.

getCharsInLine
int getCharsInLine()

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

getChildAnchor
gtk.text_child_anchor.TextChildAnchor getChildAnchor()

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

getLanguage
pango.language.Language getLanguage()

Returns the language in effect at iter.

getLine
int getLine()

Returns the line number containing the iterator.

getLineIndex
int getLineIndex()

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

getLineOffset
int getLineOffset()

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

getMarks
gtk.text_mark.TextMark[] getMarks()

Returns a list of all gtk.text_mark.TextMark at this location.

getOffset
int getOffset()

Returns the character offset of an iterator.

getPaintable
gdk.paintable.Paintable getPaintable()

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

getSlice
string getSlice(gtk.text_iter.TextIter end)

Returns the text in the given range.

getTags
gtk.text_tag.TextTag[] getTags()

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

getText
string getText(gtk.text_iter.TextIter end)

Returns text in the given range.

getToggledTags
gtk.text_tag.TextTag[] getToggledTags(bool toggledOn)

Returns a list of gtk.text_tag.TextTag that are toggled on or off at this point.

getVisibleLineIndex
int getVisibleLineIndex()

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.

getVisibleLineOffset
int getVisibleLineOffset()

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.

getVisibleSlice
string getVisibleSlice(gtk.text_iter.TextIter end)

Returns visible text in the given range.

getVisibleText
string getVisibleText(gtk.text_iter.TextIter end)

Returns visible text in the given range.

hasTag
bool hasTag(gtk.text_tag.TextTag tag)

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

inRange
bool inRange(gtk.text_iter.TextIter start, gtk.text_iter.TextIter end)

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

insideSentence
bool insideSentence()

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).

insideWord
bool insideWord()

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

isCursorPosition
bool isCursorPosition()

Determine if iter is at a cursor position.

isEnd
bool isEnd()

Returns true if iter is the end iterator.

isStart
bool isStart()

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

order
void order(gtk.text_iter.TextIter second)

Swaps the value of first and second if second comes before first in the buffer.

setLine
void setLine(int lineNumber)

Moves iterator iter to the start of the line line_number.

setLineIndex
void setLineIndex(int byteOnLine)

Same 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.

setLineOffset
void setLineOffset(int charOnLine)

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

setOffset
void setOffset(int charOffset)

Sets iter to point to char_offset.

setVisibleLineIndex
void setVisibleLineIndex(int byteOnLine)

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

setVisibleLineOffset
void setVisibleLineOffset(int charOnLine)

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

startsLine
bool startsLine()

Returns true if iter begins a paragraph.

startsSentence
bool startsSentence()

Determines whether iter begins a sentence.

startsTag
bool startsTag(gtk.text_tag.TextTag tag)

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

startsWord
bool startsWord()

Determines whether iter begins a natural-language word.

togglesTag
bool togglesTag(gtk.text_tag.TextTag tag)

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

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.