Name

TextIter —

* An iterator is an abstract datatype representing a pointer into a TextBuffer.

Synopsis

type
        TextCharPredicate
type
        TextCharPredicateCB
newtype
        TextIter
textIterBackwardChar:: TextIter -> IO Bool
textIterBackwardChars:: TextIter -> Int -> IO Bool
textIterBackwardCursorPosition:: TextIter -> IO Bool
textIterBackwardCursorPositions:: TextIter -> Int -> IO Bool
textIterBackwardFindChar:: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool
textIterBackwardLine:: TextIter -> IO Bool
textIterBackwardLines:: TextIter -> Int -> IO Bool
textIterBackwardSearch:: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter,TextIter))
textIterBackwardSentenceStart:: TextIter -> IO Bool
textIterBackwardSentenceStarts:: TextIter -> Int -> IO Bool
textIterBackwardToTagToggle:: TextIter -> Maybe TextTag -> IO Bool
textIterBackwardWordStart:: TextIter -> IO Bool
textIterBackwardWordStarts:: TextIter -> Int -> IO Bool
textIterBeginsTag:: TextIter -> TextTag -> IO Bool
textIterCanInsert:: TextIter -> Bool -> IO Bool
textIterCompare:: TextIter -> TextIter -> IO Ordering
textIterCopy:: TextIter -> IO TextIter
textIterEditable:: TextIter -> Bool -> IO Bool
textIterEndsLine:: TextIter -> IO Bool
textIterEndsSentence:: TextIter -> IO Bool
textIterEndsTag:: TextIter -> TextTag -> IO Bool
textIterEndsWord:: TextIter -> IO Bool
textIterEqual:: TextIter -> TextIter -> IO Bool
textIterForwardChar:: TextIter -> IO Bool
textIterForwardChars:: TextIter -> Int -> IO Bool
textIterForwardCursorPosition:: TextIter -> IO Bool
textIterForwardCursorPositions:: TextIter -> Int -> IO Bool
textIterForwardFindChar:: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool
textIterForwardLine:: TextIter -> IO Bool
textIterForwardLines:: TextIter -> Int -> IO Bool
textIterForwardSearch:: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter,TextIter))
textIterForwardSentenceEnd:: TextIter -> IO Bool
textIterForwardSentenceEnds:: TextIter -> Int -> IO Bool
textIterForwardToEnd:: TextIter -> IO ()
textIterForwardToLineEnd:: TextIter -> IO Bool
textIterForwardToTagToggle:: TextIter -> Maybe TextTag -> IO Bool
textIterForwardWordEnd:: TextIter -> IO Bool
textIterForwardWordEnds:: TextIter -> Int -> IO Bool

textIterGetAttributes <no type information>

textIterGetBuffer:: TextIter -> IO TextBuffer
textIterGetChar:: TextIter -> IO (Maybe Char)
textIterGetCharsInLine:: TextIter -> IO Int
textIterGetLine:: TextIter -> IO Int
textIterGetLineOffset:: TextIter -> IO Int
textIterGetOffset:: TextIter -> IO Int
textIterGetPixbuf:: TextIter -> IO (Maybe Pixbuf)
textIterGetSlice:: TextIter -> TextIter -> IO String
textIterGetText:: TextIter -> TextIter -> IO String
textIterGetVisibleLineOffset:: TextIter -> IO Int
textIterGetVisibleSlice:: TextIter -> TextIter -> IO String
textIterGetVisibleText:: TextIter -> TextIter -> IO String
textIterHasTag:: TextIter -> TextTag -> IO Bool
textIterInsideSentence:: TextIter -> IO Bool
textIterInsideWord:: TextIter -> IO Bool
textIterIsCursorPosition:: TextIter -> IO Bool
textIterIsEnd:: TextIter -> IO Bool
textIterIsStart:: TextIter -> IO Bool
textIterSetLine:: TextIter -> Int -> IO ()
textIterSetLineOffset:: TextIter -> Int -> IO ()
textIterSetOffset:: TextIter -> Int -> IO ()
textIterSetVisibleLineOffset:: TextIter -> Int -> IO ()
textIterStartsLine:: TextIter -> IO Bool
textIterStartsSentence:: TextIter -> IO Bool
textIterStartsWord:: TextIter -> IO Bool
textIterTogglesTag:: TextIter -> TextTag -> IO Bool

Introduction

The following functions do not make sense due to Haskell's wide character representation of Unicode: gtk_text_iter_get_line_index gtk_text_iter_get_visible_line_index gtk_text_iter_get_bytes_in_line gtk_text_iter_set_line_index gtk_text_iter_set_visible_line_index

The functions gtk_text_iter_in_range and gtk_text_iter_order are not bound because they are only convenience functions which can replaced by calls to textIterCompare.

All offsets are counted from 0.

Todo

Bind the following function when GSList is bound: gtk_text_iter_get_marks gtk_text_iter_get_toggled_tags gtk_text_iter_get_tags

Bind the following functions when we are sure about anchors (see TextBuffer): gtk_text_iter_get_anchor

Bind TextAttribute functions when I am clear how to model them. gtk_text_iter_get_attribute

Forward exceptions in the two callback functions.

Datatypes

type TextCharPredicate

TextCharPredicateFunPtr ((CUInt -> ((Ptr ()) -> (IO CInt))))

type TextCharPredicateCB

TextCharPredicateCBChar -> Bool

newtype TextIter

newtype TextIter =TextIter (ForeignPtr (TextIter))

Methods

textIterBackwardChar

Move TextIter backwards.

textIterBackwardChar:: TextIter:: IO Bool
ti

Retuns True if the movement was possible.

textIterBackwardChars

Move TextIter backwards by n characters.

textIterBackwardChars:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new character (and False if the iterator points to a picture or has not moved).

textIterBackwardCursorPosition

Move TextIter backwards to the next cursor position.

textIterBackwardCursorPosition:: TextIter:: IO Bool
ti

Some characters are composed of two Unicode codes. This function ensures that TextIter does not point inbetween such double characters.

Returns True if TextIter moved and points to a character (not to an object).

textIterBackwardCursorPositions

Move TextIter backwards by n cursor positions.

textIterBackwardCursorPositions:: TextIter:: Int:: IO Bool
tin

Returns True if TextIter moved and points to a character (not to an object).

textIterBackwardFindChar

Move TextIter backward until a predicate function returns True.

textIterBackwardFindChar:: TextIter:: (Char -> Bool):: Maybe TextIter:: IO Bool
tipredlimit

If pred returns True before limit is reached, the search is stopped and the return value is True.

If limit is Nothing, the search stops at the end of the buffer.

textIterBackwardLine

Move TextIter backwards.

textIterBackwardLine:: TextIter:: IO Bool
ti

Retuns True if the iterator is pointing to a new line (and False if the iterator points to a picture or has not moved).

If TextIter is on the first line, it will be moved to the end of the buffer.

textIterBackwardLines

Move TextIter backwards by n lines.

textIterBackwardLines:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new line (and False if the iterator points to a picture or has not moved).

If TextIter is on the first line, it will be moved to the end of the buffer.

n can be negative.

textIterBackwardSearch

Search backward for a specific string.

textIterBackwardSearch:: TextIter:: String:: [TextSearchFlags]:: Maybe TextIter:: IO (Maybe (TextIter,TextIter))
tistrflagslimit

If specified, the last character which is tested against that start of the search pattern will be limit.

TextSearchFlags my be empty.

Returns the start and end position of the string found.

textIterBackwardSentenceStart

Move TextIter backwards to the next sentence beginning.

textIterBackwardSentenceStart:: TextIter:: IO Bool
ti

Retuns True if the iterator has moved to a new sentence beginning.

textIterBackwardSentenceStarts

Move TextIter backwards by n sentence beginnings.

textIterBackwardSentenceStarts:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new sentence start.

textIterBackwardToTagToggle

Moves TextIter backward to the next change of a TextTag.

textIterBackwardToTagToggle:: TextIter:: Maybe TextTag:: IO Bool
titt

If Nothing is supplied, any TextTag will be matched.

Returns True if there was a tag toggle before TextIter.

textIterBackwardWordStart

Move TextIter backwards to the next word beginning.

textIterBackwardWordStart:: TextIter:: IO Bool
ti

Retuns True if the iterator has moved to a new word beginning.

textIterBackwardWordStarts

Move TextIter backwards by n word beginnings.

textIterBackwardWordStarts:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new word start.

textIterBeginsTag

Query whether a TextIter is at the start of a TextTag.

textIterBeginsTag:: TextIter:: TextTag:: IO Bool
titt

textIterCanInsert

Check if new text can be inserted at TextIter.

textIterCanInsert:: TextIter:: Bool:: IO Bool
tidef

Use textBufferInsertInteractive if you want to insert text depending on the current editable status.

textIterCompare

Compare two TextIter.

textIterCompare:: TextIter:: TextIter:: IO Ordering
ti2ti1

TextIter could be in class Eq and Ord if there is a guarantee that each iterator is copied before it is modified in place. This could be done the next abstraction layer.

textIterCopy

Copy the iterator.

textIterCopy:: TextIter:: IO TextIter
ti

textIterEditable

Check if TextIter is within an editable region.

textIterEditable:: TextIter:: Bool:: IO Bool
tidef

If no tags that affect editability are attached to the current position def will be returned.

This function cannot be used to decide whether text can be inserted at TextIter. Use the textIterCanInsert function for this purpose.

textIterEndsLine

Determine if TextIter point to the beginning of a line delimiter.

textIterEndsLine:: TextIter:: IO Bool
ti

Returns False if TextIter points to the \n in a \r\n sequence.

textIterEndsSentence

Determine if TextIter ends a sentence.

textIterEndsSentence:: TextIter:: IO Bool
ti

textIterEndsTag

Query whether a TextIter is at the end of a TextTag.

textIterEndsTag:: TextIter:: TextTag:: IO Bool
titt

textIterEndsWord

Determine if TextIter ends a new natural-language word.

textIterEndsWord:: TextIter:: IO Bool
ti

textIterEqual

Compare two TextIter for equality.

textIterEqual:: TextIter:: TextIter:: IO Bool
ti2ti1

TextIter could be in class Eq and Ord if there is a guarantee that each iterator is copied before it is modified in place. This is done the next abstraction layer.

textIterForwardChar

Move TextIter forwards.

textIterForwardChar:: TextIter:: IO Bool
ti

Retuns True if the iterator is pointing to a character.

textIterForwardChars

Move TextIter forwards by n characters.

textIterForwardChars:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new character (and False if the iterator points to a picture or has not moved).

textIterForwardCursorPosition

Move TextIter forwards to the next cursor position.

textIterForwardCursorPosition:: TextIter:: IO Bool
ti

Some characters are composed of two Unicode codes. This function ensures that TextIter does not point inbetween such double characters.

Returns True if TextIter moved and points to a character (not to an object).

textIterForwardCursorPositions

Move TextIter forwards by n cursor positions.

textIterForwardCursorPositions:: TextIter:: Int:: IO Bool
tin

Returns True if TextIter moved and points to a character (not to an object).

textIterForwardFindChar

Move TextIter forward until a predicate function returns True.

textIterForwardFindChar:: TextIter:: (Char -> Bool):: Maybe TextIter:: IO Bool
tipredlimit

If pred returns True before limit is reached, the search is stopped and the return value is True.

If limit is Nothing, the search stops at the end of the buffer.

textIterForwardLine

Move TextIter forwards.

textIterForwardLine:: TextIter:: IO Bool
ti

Retuns True if the iterator is pointing to a new line (and False if the iterator points to a picture or has not moved).

If TextIter is on the first line, it will be moved to the beginning of the buffer.

textIterForwardLines

Move TextIter forwards by n lines.

textIterForwardLines:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new line (and False if the iterator points to a picture or has not moved).

If TextIter is on the first line, it will be moved to the beginning of the buffer.

n can be negative.

textIterForwardSearch

Search forward for a specific string.

textIterForwardSearch:: TextIter:: String:: [TextSearchFlags]:: Maybe TextIter:: IO (Maybe (TextIter,TextIter))
tistrflagslimit

If specified, the last character which is tested against that start of the search pattern will be limit.

TextSearchFlags may be empty.

Returns the start and end position of the string found.

textIterForwardSentenceEnd

Move TextIter forwards to the next sentence end.

textIterForwardSentenceEnd:: TextIter:: IO Bool
ti

Retuns True if the iterator has moved to a new sentence end.

textIterForwardSentenceEnds

Move TextIter forwards by n sentence ends.

textIterForwardSentenceEnds:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new sentence end.

textIterForwardToEnd

Moves TextIter to the end of the buffer.

textIterForwardToEnd:: TextIter:: IO ()
ti

textIterForwardToLineEnd

Moves TextIter to the end of the line.

textIterForwardToLineEnd:: TextIter:: IO Bool
ti

Returns True if TextIter moved to a new location which is not the buffer end iterator.

textIterForwardToTagToggle

Moves TextIter forward to the next change of a TextTag.

textIterForwardToTagToggle:: TextIter:: Maybe TextTag:: IO Bool
titt

If Nothing is supplied, any TextTag will be matched.

Returns True if there was a tag toggle after TextIter.

textIterForwardWordEnd

Move TextIter forwards to the next word end.

textIterForwardWordEnd:: TextIter:: IO Bool
ti

Retuns True if the iterator has moved to a new word end.

textIterForwardWordEnds

Move TextIter forwards by n word ends.

textIterForwardWordEnds:: TextIter:: Int:: IO Bool
tin

Retuns True if the iterator is pointing to a new word end.

no type info on symbol textIterGetAttributes

textIterGetBuffer

Return the TextBuffer this iterator is associated with.

textIterGetBuffer:: TextIter:: IO TextBuffer
ti

textIterGetChar

Return the character at this iterator.

textIterGetChar:: TextIter:: IO (Maybe Char)
ti

textIterGetCharsInLine

Return number of characters in this line.

textIterGetCharsInLine:: TextIter:: IO Int
ti

The return value includes delimiters.

textIterGetLine

Extract the line of the buffer.

textIterGetLine:: TextIter:: IO Int
ti

textIterGetLineOffset

Extract the offset relative to the beginning of the line.

textIterGetLineOffset:: TextIter:: IO Int
ti

textIterGetOffset

Extract the offset relative to the beginning of the buffer.

textIterGetOffset:: TextIter:: IO Int
ti

textIterGetPixbuf

Get the Pixbuf under the iterator.

textIterGetPixbuf:: TextIter:: IO (Maybe Pixbuf)
it

textIterGetSlice

Return the text in a given range.

textIterGetSlice:: TextIter:: TextIter:: IO String
endstart

Pictures (and other objects) are represented by 0xFFFC.

textIterGetText

Return the text in a given range.

textIterGetText:: TextIter:: TextIter:: IO String
startend

Pictures (and other objects) are stripped form the output.

textIterGetVisibleLineOffset

Extract the offset relative to the beginning of the line skipping invisible parts of the line.

textIterGetVisibleLineOffset:: TextIter:: IO Int
ti

textIterGetVisibleSlice

Return the visible text in a given range.

textIterGetVisibleSlice:: TextIter:: TextIter:: IO String
startend

Pictures (and other objects) are represented by 0xFFFC.

textIterGetVisibleText

Return the visible text in a given range.

textIterGetVisibleText:: TextIter:: TextIter:: IO String
startend

Pictures (and other objects) are stripped form the output.

textIterHasTag

Check if TextIter is within a range tagged with tag.

textIterHasTag:: TextIter:: TextTag:: IO Bool
titt

textIterInsideSentence

Determine if TextIter is inside a sentence.

textIterInsideSentence:: TextIter:: IO Bool
ti

textIterInsideWord

Determine if TextIter is inside a word.

textIterInsideWord:: TextIter:: IO Bool
ti

textIterIsCursorPosition

Determine if TextIter is at a cursor position.

textIterIsCursorPosition:: TextIter:: IO Bool
ti

textIterIsEnd

Determine if TextIter is at the end of the buffer.

textIterIsEnd:: TextIter:: IO Bool
ti

textIterIsStart

Determine if TextIter is at the beginning of the buffer.

textIterIsStart:: TextIter:: IO Bool
ti

textIterSetLine

Set TextIter to a line within the buffer.

textIterSetLine:: TextIter:: Int:: IO ()
tin

textIterSetLineOffset

Set TextIter to an offset within the line.

textIterSetLineOffset:: TextIter:: Int:: IO ()
tin

textIterSetOffset

Set TextIter to an offset within the buffer.

textIterSetOffset:: TextIter:: Int:: IO ()
tin

textIterSetVisibleLineOffset

Set TextIter to an visible character within the line.

textIterSetVisibleLineOffset:: TextIter:: Int:: IO ()
tin

textIterStartsLine

Determine if TextIter begins a new line.

textIterStartsLine:: TextIter:: IO Bool
ti

textIterStartsSentence

Determine if TextIter starts a sentence.

textIterStartsSentence:: TextIter:: IO Bool
ti

textIterStartsWord

Determine if TextIter begins a new natural-language word.

textIterStartsWord:: TextIter:: IO Bool
ti

textIterTogglesTag

Query if the TextIter is at the beginning or the end of a TextTag.

textIterTogglesTag:: TextIter:: TextTag:: IO Bool
titt