    {-# LINE 2 "./Graphics/UI/Gtk/Multiline/Types.chs" #-}
    {-# OPTIONS_HADDOCK hide #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Multiline internal types
    --
    -- Author : Axel Simon
    --
    -- Created: 2 March 2006
    --
    -- Copyright (C) 2002-2006 Axel Simon
    --
    -- This library is free software; you can redistribute it and/or
    -- modify it under the terms of the GNU Lesser General Public
    -- License as published by the Free Software Foundation; either
    -- version 2.1 of the License, or (at your option) any later version.
    --
    -- This library is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -- Lesser General Public License for more details.
    --
    -- #hide
    module Graphics.UI.Gtk.Multiline.Types (

    -- * Types
      TextIter(TextIter),

    -- * Methods
      textIterCopy,
      mkTextIterCopy,
      makeEmptyTextIter
      ) where

    import System.Glib.FFI
    import Graphics.UI.Gtk.General.Structs (textIterSize)

    {-# LINE 38 "./Graphics/UI/Gtk/Multiline/Types.chs" #-}

    -- methods

    newtype TextIter = TextIter (ForeignPtr (TextIter))
    {-# LINE 42 "./Graphics/UI/Gtk/Multiline/Types.chs" #-}

    -- | Copy the iterator.
    --
    textIterCopy :: TextIter -> IO TextIter
    textIterCopy :: TextIter -> IO TextIter
    textIterCopy (TextIter ForeignPtr TextIter
    iter) = do
      iter' <- Int -> IO (ForeignPtr TextIter)
    forall a. Int -> IO (ForeignPtr a)
    mallocForeignPtrBytes Int
    textIterSize
      withForeignPtr iter' $ \Ptr TextIter
    iterPtr' ->
        ForeignPtr TextIter -> (Ptr TextIter -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TextIter
    iter ((Ptr TextIter -> IO ()) -> IO ())
    -> (Ptr TextIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TextIter
    iterPtr ->
          Ptr TextIter -> Ptr TextIter -> Int -> IO ()
    forall a. Ptr a -> Ptr a -> Int -> IO ()
    copyBytes Ptr TextIter
    iterPtr' Ptr TextIter
    iterPtr Int
    textIterSize
      return (TextIter iter')

    -- | Internal marshaling util
    --
    mkTextIterCopy :: Ptr TextIter -> IO TextIter
    mkTextIterCopy :: Ptr TextIter -> IO TextIter
    mkTextIterCopy Ptr TextIter
    iterPtr = do
      iter' <- Int -> IO (ForeignPtr TextIter)
    forall a. Int -> IO (ForeignPtr a)
    mallocForeignPtrBytes Int
    textIterSize
      withForeignPtr iter' $ \Ptr TextIter
    iterPtr' ->
        Ptr TextIter -> Ptr TextIter -> Int -> IO ()
    forall a. Ptr a -> Ptr a -> Int -> IO ()
    copyBytes Ptr TextIter
    iterPtr' Ptr TextIter
    iterPtr Int
    textIterSize
      return (TextIter iter')

    -- | Allocate memory to be filled with a TextIter.
    --
    makeEmptyTextIter :: IO TextIter
    makeEmptyTextIter :: IO TextIter
    makeEmptyTextIter = do
      iter <- Int -> IO (ForeignPtr TextIter)
    forall a. Int -> IO (ForeignPtr a)
    mallocForeignPtrBytes Int
    textIterSize
      return (TextIter iter)