module Graphics.UI.Gtk.Multiline.TextIter (
TextIter,
TextSearchFlags(..),
textIterCopy,
textIterGetBuffer,
textIterGetOffset,
textIterGetLine,
textIterGetLineOffset,
textIterGetVisibleLineOffset,
textIterGetChar,
textIterGetSlice,
textIterGetText,
textIterGetVisibleSlice,
textIterGetVisibleText,
textIterGetPixbuf,
textIterGetChildAnchor,
textIterGetMarks,
textIterGetToggledTags,
textIterBeginsTag,
textIterEndsTag,
textIterTogglesTag,
textIterHasTag,
textIterGetTags,
textIterEditable,
textIterCanInsert,
textIterStartsWord,
textIterEndsWord,
textIterInsideWord,
textIterStartsLine,
textIterEndsLine,
textIterStartsSentence,
textIterEndsSentence,
textIterInsideSentence,
textIterIsCursorPosition,
textIterGetCharsInLine,
textIterGetAttributes,
textIterGetLanguage,
textIterIsEnd,
textIterIsStart,
textIterForwardChar,
textIterBackwardChar,
textIterForwardChars,
textIterBackwardChars,
textIterForwardLine,
textIterBackwardLine,
textIterForwardLines,
textIterBackwardLines,
textIterForwardWordEnds,
textIterBackwardWordStarts,
textIterForwardWordEnd,
textIterBackwardWordStart,
textIterForwardCursorPosition,
textIterBackwardCursorPosition,
textIterForwardCursorPositions,
textIterBackwardCursorPositions,
textIterForwardSentenceEnds,
textIterBackwardSentenceStarts,
textIterForwardSentenceEnd,
textIterBackwardSentenceStart,
textIterSetOffset,
textIterSetLine,
textIterSetLineOffset,
textIterSetVisibleLineOffset,
textIterForwardToEnd,
textIterForwardToLineEnd,
textIterForwardToTagToggle,
textIterBackwardToTagToggle,
textIterForwardFindChar,
textIterBackwardFindChar,
textIterForwardSearch,
textIterBackwardSearch,
textIterEqual,
textIterCompare,
textIterInRange,
textIterOrder,
textIterForwardVisibleLine,
textIterBackwardVisibleLine,
textIterForwardVisibleLines,
textIterBackwardVisibleLines,
textIterForwardVisibleWordEnds,
textIterBackwardVisibleWordStarts,
textIterForwardVisibleWordEnd,
textIterBackwardVisibleWordStart,
textIterForwardVisibleCursorPosition,
textIterBackwardVisibleCursorPosition,
textIterForwardVisibleCursorPositions,
textIterBackwardVisibleCursorPositions,
textIterVisibleLineOffset,
textIterOffset,
textIterLineOffset,
textIterLine,
) where
import Control.Monad (liftM)
import Data.Maybe (fromMaybe)
import Data.Char (chr)
import System.Glib.FFI
import System.Glib.Flags (fromFlags)
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.GList
import Graphics.UI.Gtk.Types
import Graphics.UI.Gtk.General.Enums (TextSearchFlags(..))
import Graphics.UI.Gtk.Multiline.Types
import Graphics.UI.Gtk.Multiline.TextTag
import Graphics.Rendering.Pango.BasicTypes
textIterGetBuffer :: TextIter -> IO TextBuffer
textIterGetBuffer ti = makeNewGObject mkTextBuffer $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_buffer argPtr1) ti
textIterGetOffset :: TextIter -> IO Int
textIterGetOffset ti = liftM fromIntegral $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_offset argPtr1) ti
textIterGetLine :: TextIter -> IO Int
textIterGetLine ti = liftM fromIntegral $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_line argPtr1) ti
textIterGetLineOffset :: TextIter -> IO Int
textIterGetLineOffset ti = liftM fromIntegral $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_line_offset argPtr1) ti
textIterGetVisibleLineOffset :: TextIter -> IO Int
textIterGetVisibleLineOffset ti = liftM fromIntegral $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_visible_line_offset argPtr1) ti
textIterGetChar :: TextIter -> IO (Maybe Char)
textIterGetChar ti = do
res <- liftM fromIntegral $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_char argPtr1) ti
return $ if res==0 then Nothing else Just (chr res)
textIterGetSlice :: GlibString string => TextIter -> TextIter -> IO string
textIterGetSlice end start = do
cStr <- (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_get_slice argPtr1 argPtr2) start end
str <- peekUTFString cStr
g_free (castPtr cStr)
return str
textIterGetText :: GlibString string => TextIter -> TextIter -> IO string
textIterGetText start end = do
cStr <- (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_get_text argPtr1 argPtr2) start end
str <- peekUTFString cStr
g_free (castPtr cStr)
return str
textIterGetVisibleSlice :: GlibString string => TextIter -> TextIter -> IO string
textIterGetVisibleSlice start end = do
cStr <- (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_get_visible_slice argPtr1 argPtr2) start end
str <- peekUTFString cStr
g_free (castPtr cStr)
return str
textIterGetVisibleText :: GlibString string => TextIter -> TextIter -> IO string
textIterGetVisibleText start end = do
cStr <- (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_get_visible_text argPtr1 argPtr2) start end
str <- peekUTFString cStr
g_free (castPtr cStr)
return str
textIterGetPixbuf :: TextIter -> IO (Maybe Pixbuf)
textIterGetPixbuf it = do
pbPtr <- (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_pixbuf argPtr1) it
if pbPtr==nullPtr then return Nothing else liftM Just $
makeNewGObject mkPixbuf (return pbPtr)
textIterGetChildAnchor :: TextIter -> IO (Maybe TextChildAnchor)
textIterGetChildAnchor it = do
tcaPtr <- (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_child_anchor argPtr1) it
if tcaPtr == nullPtr then return Nothing else liftM Just $
makeNewGObject mkTextChildAnchor (return tcaPtr)
textIterGetMarks :: TextIter
-> IO [TextMark]
textIterGetMarks self =
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_marks argPtr1)
self
>>= fromGSList
>>= mapM (\tm -> makeNewGObject mkTextMark (return tm))
textIterGetToggledTags :: TextIter
-> Bool
-> IO [TextTag]
textIterGetToggledTags self toggledOn =
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_toggled_tags argPtr1 arg2)
self
(fromBool toggledOn)
>>= fromGSList
>>= mapM (\tt -> makeNewGObject mkTextTag (return tt))
textIterBeginsTag :: TextIter -> Maybe TextTag -> IO Bool
textIterBeginsTag ti (Just tt) = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_begins_tag argPtr1 argPtr2) ti tt
textIterBeginsTag ti Nothing = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_begins_tag argPtr1 argPtr2) ti (TextTag nullForeignPtr)
textIterEndsTag :: TextIter -> Maybe TextTag -> IO Bool
textIterEndsTag ti (Just tt) = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_ends_tag argPtr1 argPtr2) ti tt
textIterEndsTag ti Nothing = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_ends_tag argPtr1 argPtr2) ti (TextTag nullForeignPtr)
textIterTogglesTag :: TextIter -> Maybe TextTag -> IO Bool
textIterTogglesTag ti (Just tt) = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_toggles_tag argPtr1 argPtr2) ti tt
textIterTogglesTag ti Nothing = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_toggles_tag argPtr1 argPtr2) ti (TextTag nullForeignPtr)
textIterHasTag :: TextIter -> Maybe TextTag -> IO Bool
textIterHasTag ti (Just tt) = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_has_tag argPtr1 argPtr2) ti tt
textIterHasTag ti Nothing = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_has_tag argPtr1 argPtr2) ti (TextTag nullForeignPtr)
textIterGetTags :: TextIter
-> IO [TextTag]
textIterGetTags self =
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_tags argPtr1)
self
>>= fromGSList
>>= mapM (\tt -> makeNewGObject mkTextTag (return tt))
textIterEditable :: TextIter -> Bool -> IO Bool
textIterEditable ti def = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_editable argPtr1 arg2) ti (fromBool def)
textIterCanInsert :: TextIter -> Bool -> IO Bool
textIterCanInsert ti def = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_can_insert argPtr1 arg2) ti (fromBool def)
textIterStartsWord :: TextIter -> IO Bool
textIterStartsWord ti = liftM toBool $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_starts_word argPtr1) ti
textIterEndsWord :: TextIter -> IO Bool
textIterEndsWord ti = liftM toBool $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_ends_word argPtr1) ti
textIterInsideWord :: TextIter -> IO Bool
textIterInsideWord ti = liftM toBool $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_inside_word argPtr1) ti
textIterStartsLine :: TextIter -> IO Bool
textIterStartsLine ti = liftM toBool $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_starts_line argPtr1) ti
textIterEndsLine :: TextIter -> IO Bool
textIterEndsLine ti = liftM toBool $ (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_ends_line argPtr1) ti
textIterStartsSentence :: TextIter -> IO Bool
textIterStartsSentence ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_starts_sentence argPtr1) ti
textIterEndsSentence :: TextIter -> IO Bool
textIterEndsSentence ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_ends_sentence argPtr1) ti
textIterInsideSentence :: TextIter -> IO Bool
textIterInsideSentence ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_inside_sentence argPtr1) ti
textIterIsCursorPosition :: TextIter -> IO Bool
textIterIsCursorPosition ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_is_cursor_position argPtr1) ti
textIterGetCharsInLine :: TextIter -> IO Int
textIterGetCharsInLine ti = liftM fromIntegral $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_chars_in_line argPtr1) ti
textIterGetAttributes :: TextIter -> TextAttributes -> IO Bool
textIterGetAttributes ti ta = liftM toBool $
(\(TextIter arg1) (TextAttributes arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_get_attributes argPtr1 argPtr2) ti ta
textIterGetLanguage :: TextIter -> IO Language
textIterGetLanguage ti = liftM Language $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_get_language argPtr1) ti
textIterIsEnd :: TextIter -> IO Bool
textIterIsEnd ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_is_end argPtr1) ti
textIterIsStart :: TextIter -> IO Bool
textIterIsStart ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_is_start argPtr1) ti
textIterForwardChar :: TextIter -> IO Bool
textIterForwardChar ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_char argPtr1) ti
textIterBackwardChar :: TextIter -> IO Bool
textIterBackwardChar ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_char argPtr1) ti
textIterForwardChars :: TextIter -> Int -> IO Bool
textIterForwardChars ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_chars argPtr1 arg2) ti (fromIntegral n)
textIterBackwardChars :: TextIter -> Int -> IO Bool
textIterBackwardChars ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_chars argPtr1 arg2) ti (fromIntegral n)
textIterForwardLine :: TextIter -> IO Bool
textIterForwardLine ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_line argPtr1) ti
textIterBackwardLine :: TextIter -> IO Bool
textIterBackwardLine ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_line argPtr1) ti
textIterForwardLines :: TextIter -> Int -> IO Bool
textIterForwardLines ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_lines argPtr1 arg2) ti (fromIntegral n)
textIterBackwardLines :: TextIter -> Int -> IO Bool
textIterBackwardLines ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_lines argPtr1 arg2) ti (fromIntegral n)
textIterForwardWordEnds :: TextIter -> Int -> IO Bool
textIterForwardWordEnds ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_word_ends argPtr1 arg2) ti (fromIntegral n)
textIterBackwardWordStarts :: TextIter -> Int -> IO Bool
textIterBackwardWordStarts ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_word_starts argPtr1 arg2) ti (fromIntegral n)
textIterForwardWordEnd :: TextIter -> IO Bool
textIterForwardWordEnd ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_word_end argPtr1) ti
textIterBackwardWordStart :: TextIter -> IO Bool
textIterBackwardWordStart ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_word_start argPtr1) ti
textIterForwardCursorPosition :: TextIter -> IO Bool
textIterForwardCursorPosition ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_cursor_position argPtr1) ti
textIterBackwardCursorPosition :: TextIter -> IO Bool
textIterBackwardCursorPosition ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_cursor_position argPtr1) ti
textIterForwardCursorPositions :: TextIter -> Int -> IO Bool
textIterForwardCursorPositions ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_cursor_positions argPtr1 arg2) ti (fromIntegral n)
textIterBackwardCursorPositions :: TextIter -> Int -> IO Bool
textIterBackwardCursorPositions ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_cursor_positions argPtr1 arg2) ti (fromIntegral n)
textIterForwardSentenceEnds :: TextIter -> Int -> IO Bool
textIterForwardSentenceEnds ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_sentence_ends argPtr1 arg2) ti (fromIntegral n)
textIterBackwardSentenceStarts :: TextIter -> Int -> IO Bool
textIterBackwardSentenceStarts ti n = liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_sentence_starts argPtr1 arg2) ti (fromIntegral n)
textIterForwardSentenceEnd :: TextIter -> IO Bool
textIterForwardSentenceEnd ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_sentence_end argPtr1) ti
textIterBackwardSentenceStart :: TextIter -> IO Bool
textIterBackwardSentenceStart ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_sentence_start argPtr1) ti
textIterSetOffset :: TextIter -> Int -> IO ()
textIterSetOffset ti n =
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_set_offset argPtr1 arg2) ti (fromIntegral n)
textIterSetLine :: TextIter -> Int -> IO ()
textIterSetLine ti n =
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_set_line argPtr1 arg2) ti (fromIntegral n)
textIterSetLineOffset :: TextIter -> Int -> IO ()
textIterSetLineOffset ti n =
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_set_line_offset argPtr1 arg2) ti (fromIntegral n)
textIterSetVisibleLineOffset :: TextIter -> Int -> IO ()
textIterSetVisibleLineOffset ti n =
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_set_visible_line_offset argPtr1 arg2) ti (fromIntegral n)
textIterForwardToEnd :: TextIter -> IO ()
textIterForwardToEnd ti = (\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_to_end argPtr1) ti
textIterForwardToLineEnd :: TextIter -> IO Bool
textIterForwardToLineEnd ti = liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_to_line_end argPtr1) ti
textIterForwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool
textIterForwardToTagToggle ti tt = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_forward_to_tag_toggle argPtr1 argPtr2) ti
(fromMaybe (TextTag nullForeignPtr) tt)
textIterBackwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool
textIterBackwardToTagToggle ti tt = liftM toBool $
(\(TextIter arg1) (TextTag arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_backward_to_tag_toggle argPtr1 argPtr2) ti
(fromMaybe (TextTag nullForeignPtr) tt)
type TextCharPredicate = FunPtr ((CUInt -> ((Ptr ()) -> (IO CInt))))
foreign import ccall "wrapper" mkTextCharPredicate ::
((CUInt) -> Ptr () -> IO (CInt)) -> IO TextCharPredicate
textIterForwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter ->
IO Bool
textIterForwardFindChar ti pred limit = do
fPtr <- mkTextCharPredicate (\c _ -> return $ fromBool $ pred (chr (fromIntegral c)))
res <- liftM toBool $ (\(TextIter arg1) arg2 arg3 (TextIter arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->gtk_text_iter_forward_find_char argPtr1 arg2 arg3 argPtr4)
ti fPtr nullPtr (fromMaybe (TextIter nullForeignPtr) limit)
freeHaskellFunPtr fPtr
return res
textIterBackwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter ->
IO Bool
textIterBackwardFindChar ti pred limit = do
fPtr <- mkTextCharPredicate (\c _ -> return $ fromBool $ pred (chr (fromIntegral c)))
res <- liftM toBool $ (\(TextIter arg1) arg2 arg3 (TextIter arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->gtk_text_iter_backward_find_char argPtr1 arg2 arg3 argPtr4)
ti fPtr nullPtr (fromMaybe (TextIter nullForeignPtr) limit)
freeHaskellFunPtr fPtr
return res
textIterForwardSearch :: GlibString string => TextIter -> string -> [TextSearchFlags] ->
Maybe TextIter -> IO (Maybe (TextIter, TextIter))
textIterForwardSearch ti str flags limit = do
start <- makeEmptyTextIter
end <- makeEmptyTextIter
found <- liftM toBool $ withUTFString str $ \cStr ->
(\(TextIter arg1) arg2 arg3 (TextIter arg4) (TextIter arg5) (TextIter arg6) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->withForeignPtr arg5 $ \argPtr5 ->withForeignPtr arg6 $ \argPtr6 ->gtk_text_iter_forward_search argPtr1 arg2 arg3 argPtr4 argPtr5 argPtr6) ti cStr
((fromIntegral.fromFlags) flags) start end
(fromMaybe (TextIter nullForeignPtr) limit)
return $ if found then Just (start,end) else Nothing
textIterBackwardSearch :: GlibString string => TextIter -> string -> [TextSearchFlags] ->
Maybe TextIter -> IO (Maybe (TextIter, TextIter))
textIterBackwardSearch ti str flags limit = do
start <- makeEmptyTextIter
end <- makeEmptyTextIter
found <- liftM toBool $ withUTFString str $ \cStr ->
(\(TextIter arg1) arg2 arg3 (TextIter arg4) (TextIter arg5) (TextIter arg6) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->withForeignPtr arg5 $ \argPtr5 ->withForeignPtr arg6 $ \argPtr6 ->gtk_text_iter_backward_search argPtr1 arg2 arg3 argPtr4 argPtr5 argPtr6) ti cStr
((fromIntegral.fromFlags) flags) start end
(fromMaybe (TextIter nullForeignPtr) limit)
return $ if found then Just (start,end) else Nothing
textIterForwardVisibleLine :: TextIter
-> IO Bool
textIterForwardVisibleLine self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_line argPtr1)
self
textIterBackwardVisibleLine :: TextIter
-> IO Bool
textIterBackwardVisibleLine self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_line argPtr1)
self
textIterForwardVisibleLines :: TextIter
-> Int
-> IO Bool
textIterForwardVisibleLines self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_lines argPtr1 arg2)
self
(fromIntegral count)
textIterBackwardVisibleLines :: TextIter
-> Int
-> IO Bool
textIterBackwardVisibleLines self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_lines argPtr1 arg2)
self
(fromIntegral count)
textIterForwardVisibleWordEnds :: TextIter
-> Int
-> IO Bool
textIterForwardVisibleWordEnds self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_word_ends argPtr1 arg2)
self
(fromIntegral count)
textIterBackwardVisibleWordStarts :: TextIter
-> Int
-> IO Bool
textIterBackwardVisibleWordStarts self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_word_starts argPtr1 arg2)
self
(fromIntegral count)
textIterForwardVisibleWordEnd :: TextIter
-> IO Bool
textIterForwardVisibleWordEnd self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_word_end argPtr1)
self
textIterBackwardVisibleWordStart :: TextIter
-> IO Bool
textIterBackwardVisibleWordStart self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_word_start argPtr1)
self
textIterForwardVisibleCursorPosition :: TextIter
-> IO Bool
textIterForwardVisibleCursorPosition self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_cursor_position argPtr1)
self
textIterBackwardVisibleCursorPosition :: TextIter
-> IO Bool
textIterBackwardVisibleCursorPosition self =
liftM toBool $
(\(TextIter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_cursor_position argPtr1)
self
textIterForwardVisibleCursorPositions :: TextIter
-> Int
-> IO Bool
textIterForwardVisibleCursorPositions self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_forward_visible_cursor_positions argPtr1 arg2)
self
(fromIntegral count)
textIterBackwardVisibleCursorPositions :: TextIter
-> Int
-> IO Bool
textIterBackwardVisibleCursorPositions self count =
liftM toBool $
(\(TextIter arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_text_iter_backward_visible_cursor_positions argPtr1 arg2)
self
(fromIntegral count)
textIterEqual :: TextIter -> TextIter -> IO Bool
textIterEqual ti2 ti1 = liftM toBool $ (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_equal argPtr1 argPtr2) ti1 ti2
textIterCompare :: TextIter -> TextIter -> IO Ordering
textIterCompare ti2 ti1 = do
res <- (\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_compare argPtr1 argPtr2) ti1 ti2
return $ case res of
(1) -> LT
0 -> EQ
1 -> GT
textIterInRange :: TextIter
-> TextIter
-> TextIter
-> IO Bool
textIterInRange ti start end = liftM toBool $
(\(TextIter arg1) (TextIter arg2) (TextIter arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_text_iter_in_range argPtr1 argPtr2 argPtr3) ti start end
textIterOrder :: TextIter -> TextIter -> IO ()
textIterOrder first second =
(\(TextIter arg1) (TextIter arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_text_iter_order argPtr1 argPtr2) first second
textIterVisibleLineOffset :: Attr TextIter Int
textIterVisibleLineOffset = newAttr
textIterGetVisibleLineOffset
textIterSetVisibleLineOffset
textIterOffset :: Attr TextIter Int
textIterOffset = newAttr
textIterGetOffset
textIterSetOffset
textIterLineOffset :: Attr TextIter Int
textIterLineOffset = newAttr
textIterGetLineOffset
textIterSetLineOffset
textIterLine :: Attr TextIter Int
textIterLine = newAttr
textIterGetLine
textIterSetLine
foreign import ccall unsafe "gtk_text_iter_get_buffer"
gtk_text_iter_get_buffer :: ((Ptr TextIter) -> (IO (Ptr TextBuffer)))
foreign import ccall unsafe "gtk_text_iter_get_offset"
gtk_text_iter_get_offset :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_line"
gtk_text_iter_get_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_line_offset"
gtk_text_iter_get_line_offset :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_visible_line_offset"
gtk_text_iter_get_visible_line_offset :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_char"
gtk_text_iter_get_char :: ((Ptr TextIter) -> (IO CUInt))
foreign import ccall safe "gtk_text_iter_get_slice"
gtk_text_iter_get_slice :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO (Ptr CChar))))
foreign import ccall unsafe "g_free"
g_free :: ((Ptr ()) -> (IO ()))
foreign import ccall safe "gtk_text_iter_get_text"
gtk_text_iter_get_text :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO (Ptr CChar))))
foreign import ccall safe "gtk_text_iter_get_visible_slice"
gtk_text_iter_get_visible_slice :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO (Ptr CChar))))
foreign import ccall safe "gtk_text_iter_get_visible_text"
gtk_text_iter_get_visible_text :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO (Ptr CChar))))
foreign import ccall unsafe "gtk_text_iter_get_pixbuf"
gtk_text_iter_get_pixbuf :: ((Ptr TextIter) -> (IO (Ptr Pixbuf)))
foreign import ccall unsafe "gtk_text_iter_get_child_anchor"
gtk_text_iter_get_child_anchor :: ((Ptr TextIter) -> (IO (Ptr TextChildAnchor)))
foreign import ccall safe "gtk_text_iter_get_marks"
gtk_text_iter_get_marks :: ((Ptr TextIter) -> (IO (Ptr ())))
foreign import ccall safe "gtk_text_iter_get_toggled_tags"
gtk_text_iter_get_toggled_tags :: ((Ptr TextIter) -> (CInt -> (IO (Ptr ()))))
foreign import ccall unsafe "gtk_text_iter_begins_tag"
gtk_text_iter_begins_tag :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_ends_tag"
gtk_text_iter_ends_tag :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_toggles_tag"
gtk_text_iter_toggles_tag :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_has_tag"
gtk_text_iter_has_tag :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_get_tags"
gtk_text_iter_get_tags :: ((Ptr TextIter) -> (IO (Ptr ())))
foreign import ccall unsafe "gtk_text_iter_editable"
gtk_text_iter_editable :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_can_insert"
gtk_text_iter_can_insert :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_starts_word"
gtk_text_iter_starts_word :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_ends_word"
gtk_text_iter_ends_word :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_inside_word"
gtk_text_iter_inside_word :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_starts_line"
gtk_text_iter_starts_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_ends_line"
gtk_text_iter_ends_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_starts_sentence"
gtk_text_iter_starts_sentence :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_ends_sentence"
gtk_text_iter_ends_sentence :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_inside_sentence"
gtk_text_iter_inside_sentence :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_is_cursor_position"
gtk_text_iter_is_cursor_position :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_chars_in_line"
gtk_text_iter_get_chars_in_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_get_attributes"
gtk_text_iter_get_attributes :: ((Ptr TextIter) -> ((Ptr TextAttributes) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_get_language"
gtk_text_iter_get_language :: ((Ptr TextIter) -> (IO (Ptr Language)))
foreign import ccall unsafe "gtk_text_iter_is_end"
gtk_text_iter_is_end :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_is_start"
gtk_text_iter_is_start :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_char"
gtk_text_iter_forward_char :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_backward_char"
gtk_text_iter_backward_char :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_chars"
gtk_text_iter_forward_chars :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_chars"
gtk_text_iter_backward_chars :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_forward_line"
gtk_text_iter_forward_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_backward_line"
gtk_text_iter_backward_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_lines"
gtk_text_iter_forward_lines :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_lines"
gtk_text_iter_backward_lines :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_forward_word_ends"
gtk_text_iter_forward_word_ends :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_word_starts"
gtk_text_iter_backward_word_starts :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_forward_word_end"
gtk_text_iter_forward_word_end :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_backward_word_start"
gtk_text_iter_backward_word_start :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_cursor_position"
gtk_text_iter_forward_cursor_position :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_backward_cursor_position"
gtk_text_iter_backward_cursor_position :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_cursor_positions"
gtk_text_iter_forward_cursor_positions :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_cursor_positions"
gtk_text_iter_backward_cursor_positions :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_forward_sentence_ends"
gtk_text_iter_forward_sentence_ends :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_sentence_starts"
gtk_text_iter_backward_sentence_starts :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_forward_sentence_end"
gtk_text_iter_forward_sentence_end :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_backward_sentence_start"
gtk_text_iter_backward_sentence_start :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_set_offset"
gtk_text_iter_set_offset :: ((Ptr TextIter) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_text_iter_set_line"
gtk_text_iter_set_line :: ((Ptr TextIter) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_text_iter_set_line_offset"
gtk_text_iter_set_line_offset :: ((Ptr TextIter) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_text_iter_set_visible_line_offset"
gtk_text_iter_set_visible_line_offset :: ((Ptr TextIter) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_text_iter_forward_to_end"
gtk_text_iter_forward_to_end :: ((Ptr TextIter) -> (IO ()))
foreign import ccall unsafe "gtk_text_iter_forward_to_line_end"
gtk_text_iter_forward_to_line_end :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall unsafe "gtk_text_iter_forward_to_tag_toggle"
gtk_text_iter_forward_to_tag_toggle :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_backward_to_tag_toggle"
gtk_text_iter_backward_to_tag_toggle :: ((Ptr TextIter) -> ((Ptr TextTag) -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_forward_find_char"
gtk_text_iter_forward_find_char :: ((Ptr TextIter) -> ((FunPtr (CUInt -> ((Ptr ()) -> (IO CInt)))) -> ((Ptr ()) -> ((Ptr TextIter) -> (IO CInt)))))
foreign import ccall safe "gtk_text_iter_backward_find_char"
gtk_text_iter_backward_find_char :: ((Ptr TextIter) -> ((FunPtr (CUInt -> ((Ptr ()) -> (IO CInt)))) -> ((Ptr ()) -> ((Ptr TextIter) -> (IO CInt)))))
foreign import ccall unsafe "gtk_text_iter_forward_search"
gtk_text_iter_forward_search :: ((Ptr TextIter) -> ((Ptr CChar) -> (CInt -> ((Ptr TextIter) -> ((Ptr TextIter) -> ((Ptr TextIter) -> (IO CInt)))))))
foreign import ccall unsafe "gtk_text_iter_backward_search"
gtk_text_iter_backward_search :: ((Ptr TextIter) -> ((Ptr CChar) -> (CInt -> ((Ptr TextIter) -> ((Ptr TextIter) -> ((Ptr TextIter) -> (IO CInt)))))))
foreign import ccall safe "gtk_text_iter_forward_visible_line"
gtk_text_iter_forward_visible_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_backward_visible_line"
gtk_text_iter_backward_visible_line :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_forward_visible_lines"
gtk_text_iter_forward_visible_lines :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_backward_visible_lines"
gtk_text_iter_backward_visible_lines :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_forward_visible_word_ends"
gtk_text_iter_forward_visible_word_ends :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_backward_visible_word_starts"
gtk_text_iter_backward_visible_word_starts :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_forward_visible_word_end"
gtk_text_iter_forward_visible_word_end :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_backward_visible_word_start"
gtk_text_iter_backward_visible_word_start :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_forward_visible_cursor_position"
gtk_text_iter_forward_visible_cursor_position :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_backward_visible_cursor_position"
gtk_text_iter_backward_visible_cursor_position :: ((Ptr TextIter) -> (IO CInt))
foreign import ccall safe "gtk_text_iter_forward_visible_cursor_positions"
gtk_text_iter_forward_visible_cursor_positions :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall safe "gtk_text_iter_backward_visible_cursor_positions"
gtk_text_iter_backward_visible_cursor_positions :: ((Ptr TextIter) -> (CInt -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_equal"
gtk_text_iter_equal :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_compare"
gtk_text_iter_compare :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO CInt)))
foreign import ccall unsafe "gtk_text_iter_in_range"
gtk_text_iter_in_range :: ((Ptr TextIter) -> ((Ptr TextIter) -> ((Ptr TextIter) -> (IO CInt))))
foreign import ccall safe "gtk_text_iter_order"
gtk_text_iter_order :: ((Ptr TextIter) -> ((Ptr TextIter) -> (IO ())))