    {-# LINE 2 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
    {-# LANGUAGE Rank2Types #-}

    {-# LINE 3 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) TreeModel
    --
    -- Author : Axel Simon
    --
    -- Created: 8 May 2001
    --
    -- Copyright (C) 1999-2007 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.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- The tree interface used by 'TreeView'.
    --
    module Graphics.UI.Gtk.ModelView.TreeModel (
    -- * Detail
    --
    -- | The 'TreeModel' interface defines a generic storage object for use by the
    -- 'TreeView' and similar widgets. Specifically, the functions in defined here
    -- are used by Gtk's widgets to access the stored data. Thus, rather than
    -- calling these functions, an application programmer has to implement them.
    -- While the module "Graphics.UI.Gtk.ModelView.CustomStore" provides the
    -- necessary functions to implement the 'TreeMode' interface, it is often
    -- sufficient to use the wo implementations that come with Gtk2Hs, namely are
    -- 'ListStore' and 'TreeStore'.
    --
    -- The model is represented as a hierarchical tree of values. It is important
    -- to note that this interface only provides a way of examining a model and
    -- observing changes. The implementation of each individual model decides how
    -- and if changes are made.
    --
    -- Two generic models are provided that implement the 'TreeModel' interface:
    -- the 'TreeStore' and the 'ListStore'. To use these, the developer simply
    -- inserts data into these models as necessary. These models provide the data
    -- structure as well as the 'TreeModel' interface. In fact, they implement
    -- other interfaces, making drag and drop and storing data trivial.
    --
    -- A 'TreeModel' stores records of the same type. Each record is referred to
    -- as row, just like in a relational database. Defining how the information of
    -- a row is displayed can be done in two ways: If the widget displays data
    -- using 'Graphics.UI.Gtk.ModelView.CellRenderer.CellRenderer' or one of its
    -- derivatives, it is possible to state how a row is mapped to the attributes
    -- of a renderer using the
    -- 'Graphics.UI.Gtk.ModelView.CellLayout.cellLayoutSetAttributes' function.
    -- Some widgets do not use
    -- 'Graphics.UI.Gtk.ModelView.CellRenderer.CellRenderer's to display their
    -- data. In this case an extraction function can be defined that maps a row to
    -- one of a few basic types (like 'String's or 'Int's). This extraction
    -- function is associated with a 'ColumnId' using
    -- 'Graphics.UI.Gtk.ModelView.CustomStore.treeModelSetColumn'. The latter can
    -- be set in the widget for the property that should be set. The widget then
    -- uses the function 'treeModelGetValue' and the 'ColumnId' to extract the
    -- value from the model. As the name suggests, using 'ColumnId's creates a
    -- view of the data as if each row were divided into a well-defined set of
    -- columns, again, like a relational database.
    --
    -- Models are accessed on a node level of granularity. There are two index
    -- types used to reference a particular node in a model. They are the
    -- 'TreePath' and the 'TreeIter'. Most of the interface consists of operations
    -- on a 'TreeIter'.
    --
    -- A path is essentially a potential node. It is a location on a model that
    -- may or may not actually correspond to a node on a specific model. A
    -- 'TreePath' is in fact a synonym for a list of 'Int's and hence are easy to
    -- manipulate. Each number refers to the offset at that level. Thus, the path
    -- @[0]@ refers to the root node and the path @[2,4]@ refers to the fifth
    -- child of the third node.
    --
    -- By contrast, a 'TreeIter' is a reference to a specific node on a specific
    -- model. It is an abstract data type filled in by the model. One can convert
    -- a path to an iterator by calling 'treeModelGetIter'. These iterators are
    -- the primary way of accessing a model and are similar to the iterators used
    -- by 'TextBuffer'. The model interface defines a set of operations using them
    -- for navigating the model. Iterators are expected to always be valid for as
    -- long as the model is unchanged (and doesn't emit a signal).
    --

    -- * Class Hierarchy
    -- |
    -- @
    -- | GInterface
    -- | +----TreeModel
    -- | +--------TypedTreeModel
    -- @

    -- * Types
      TreeModel,
      TreeModelClass,
      castToTreeModel, gTypeTreeModel,
      toTreeModel,

      TypedTreeModel,
      TypedTreeModelClass,
      toTypedTreeModel,

      TreeIter(..),
      TreePath,

      ColumnId,

    -- * Constructors
      makeColumnIdInt,
      makeColumnIdBool,
      makeColumnIdString,
      makeColumnIdPixbuf,
      invalidColumnId,

    -- * Methods
      columnIdToNumber,
      stringToTreePath,
      treeModelGetFlags,
      treeModelGetIter,
      treeModelGetIterFromString,
      treeModelGetIterFirst,
      treeModelGetPath,
      treeModelGetValue,
      treeModelIterNext,
      treeModelIterChildren,
      treeModelIterHasChild,
      treeModelIterNChildren,
      treeModelIterNthChild,
      treeModelIterParent,
      treeModelForeach,

      treeModelGetStringFromIter,

      treeModelRefNode,
      treeModelUnrefNode,
      treeModelRowChanged,
      treeModelRowInserted,
      treeModelRowHasChildToggled,
      treeModelRowDeleted,
      treeModelRowsReordered,

    -- * Signals
      rowChanged,
      rowInserted,
      rowHasChildToggled,
      rowDeleted,
      rowsReordered,

      ) where

    import Control.Monad (liftM)

    import System.Glib.FFI
    import System.Glib.Flags (toFlags)
    import System.Glib.UTFString
    import Graphics.UI.Gtk.Signals
    {-# LINE 164 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
    import Graphics.UI.Gtk.Types
    {-# LINE 165 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
    import System.Glib.GValue (GValue(GValue), allocaGValue)
    import Graphics.UI.Gtk.ModelView.CustomStore (TreeModelFlags(..))
    import Graphics.UI.Gtk.ModelView.Types (TypedTreeModel,
                                                 TypedTreeModelClass,
                                                 toTypedTreeModel,
                                                 TreeIter(..),
                                                 receiveTreeIter,
                                                 peekTreeIter,
                                                 TreePath,
                                                 NativeTreePath(..),
                                                 withTreePath,
                                                 fromTreePath,
                                                 peekTreePath,
                                                 stringToTreePath,
                                                 ColumnId(..),
                                                 ColumnAccess(..))
    import System.Glib.GValueTypes ( valueGetInt, valueGetBool,
                                         valueGetString, valueGetGObject )

    {-# LINE 184 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}

    --------------------
    -- Constructors

    -- | Create a 'ColumnId' to extract an integer.
    makeColumnIdInt :: Int -> ColumnId row Int
    makeColumnIdInt :: forall row. Int -> ColumnId row Int
    makeColumnIdInt = (GValue -> IO Int)
    -> ((row -> Int) -> ColumnAccess row) -> Int -> ColumnId row Int
    forall row ty.
    (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    ColumnId GValue -> IO Int
    valueGetInt (row -> Int) -> ColumnAccess row
    forall row. (row -> Int) -> ColumnAccess row
    CAInt

    -- | Create a 'ColumnId' to extract an Boolean.
    makeColumnIdBool :: Int -> ColumnId row Bool
    makeColumnIdBool :: forall row. Int -> ColumnId row Bool
    makeColumnIdBool = (GValue -> IO Bool)
    -> ((row -> Bool) -> ColumnAccess row) -> Int -> ColumnId row Bool
    forall row ty.
    (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    ColumnId GValue -> IO Bool
    valueGetBool (row -> Bool) -> ColumnAccess row
    forall row. (row -> Bool) -> ColumnAccess row
    CABool

    -- | Create a 'ColumnId' to extract an string.
    makeColumnIdString :: GlibString string => Int -> ColumnId row string
    makeColumnIdString :: forall string row. GlibString string => Int -> ColumnId row string
    makeColumnIdString = (GValue -> IO string)
    -> ((row -> string) -> ColumnAccess row)
    -> Int
    -> ColumnId row string
    forall row ty.
    (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    ColumnId GValue -> IO string
    forall string. GlibString string => GValue -> IO string
    valueGetString (row -> string) -> ColumnAccess row
    forall string row.
    GlibString string =>
    (row -> string) -> ColumnAccess row
    CAString

    -- | Create a 'ColumnId' to extract an 'Pixbuf'.
    makeColumnIdPixbuf :: Int -> ColumnId row Pixbuf
    makeColumnIdPixbuf :: forall row. Int -> ColumnId row Pixbuf
    makeColumnIdPixbuf = (GValue -> IO Pixbuf)
    -> ((row -> Pixbuf) -> ColumnAccess row)
    -> Int
    -> ColumnId row Pixbuf
    forall row ty.
    (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    ColumnId GValue -> IO Pixbuf
    forall gobj. GObjectClass gobj => GValue -> IO gobj
    valueGetGObject (row -> Pixbuf) -> ColumnAccess row
    forall row. (row -> Pixbuf) -> ColumnAccess row
    CAPixbuf

    -- | Convert a 'ColumnId' to a bare number.
    columnIdToNumber :: ColumnId row ty -> Int
    columnIdToNumber :: forall row ty. ColumnId row ty -> Int
    columnIdToNumber (ColumnId GValue -> IO ty
    _ (row -> ty) -> ColumnAccess row
    _ Int
    i) = Int
    i

    -- | The invalid 'ColumnId'. Widgets use this value if no column id has
    -- been set.
    invalidColumnId :: ColumnId row ty
    invalidColumnId :: forall row ty. ColumnId row ty
    invalidColumnId = (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    forall row ty.
    (GValue -> IO ty)
    -> ((row -> ty) -> ColumnAccess row) -> Int -> ColumnId row ty
    ColumnId ([Char] -> GValue -> IO ty
    forall a. HasCallStack => [Char] -> a
    error [Char]
    "invalidColumnId: no GValue extractor")
      ([Char] -> (row -> ty) -> ColumnAccess row
    forall a. HasCallStack => [Char] -> a
    error [Char]
    "invalidColumnId: no access type") (-Int
    1)

    instance Eq (ColumnId row ty) where
      (ColumnId GValue -> IO ty
    _ (row -> ty) -> ColumnAccess row
    _ Int
    i1) == :: ColumnId row ty -> ColumnId row ty -> Bool
    == (ColumnId GValue -> IO ty
    _ (row -> ty) -> ColumnAccess row
    _ Int
    i2) = Int
    i1Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Int
    i2

    instance Show (ColumnId row ty) where
      show :: ColumnId row ty -> [Char]
    show (ColumnId GValue -> IO ty
    _ (row -> ty) -> ColumnAccess row
    _ Int
    i) = Int -> [Char]
    forall a. Show a => a -> [Char]
    show Int
    i

    --------------------
    -- Methods

    -- %hash d:35ea
    -- | Returns a set of flags supported by this interface.
    --
    -- The flags supported should not
    -- change during the lifecycle of the tree_model.
    --
    treeModelGetFlags :: TreeModelClass self => self -> IO [TreeModelFlags]
    treeModelGetFlags :: forall self. TreeModelClass self => self -> IO [TreeModelFlags]
    treeModelGetFlags self
    self =
      (CInt -> [TreeModelFlags]) -> IO CInt -> IO [TreeModelFlags]
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Int -> [TreeModelFlags]
    forall a. Flags a => Int -> [a]
    toFlags (Int -> [TreeModelFlags])
    -> (CInt -> Int) -> CInt -> [TreeModelFlags]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral) (IO CInt -> IO [TreeModelFlags]) -> IO CInt -> IO [TreeModelFlags]
    forall a b. (a -> b) -> a -> b
    $
      (\(TreeModel ForeignPtr TreeModel
    arg1) -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> IO CInt
    gtk_tree_model_get_flags Ptr TreeModel
    argPtr1)
    {-# LINE 235 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)

    -- %hash c:35a1 d:49a2
    -- | Turn a 'String' into a 'TreeIter'.
    --
    -- * Returns @Nothing@ if the string is not a colon separated list of numbers
    -- that references a valid node.
    --
    treeModelGetIterFromString :: (TreeModelClass self, GlibString string) => self
     -> string -- ^ @pathString@ - A string representation of a 'TreePath'.
     -> IO (Maybe TreeIter)
    treeModelGetIterFromString :: forall self string.
    (TreeModelClass self, GlibString string) =>
    self -> string -> IO (Maybe TreeIter)
    treeModelGetIterFromString self
    self string
    pathString =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      string -> (CString -> IO CInt) -> IO CInt
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    pathString ((CString -> IO CInt) -> IO CInt)
    -> (CString -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \CString
    pathStringPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 CString
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> CString -> IO CInt
    gtk_tree_model_get_iter_from_string Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 CString
    arg3)
    {-# LINE 250 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        CString
    pathStringPtr

    -- %hash c:4cd2 d:ad96
    -- | Turn a 'TreePath' into a 'TreeIter'.
    --
    -- Returns @Nothing@ if the given 'TreePath' was invalid. The empty list
    -- is always invalid. The root node of a tree can be accessed by passing
    -- @[0]@ as @path@.
    --
    treeModelGetIter :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - The 'TreePath'.
     -> IO (Maybe TreeIter)
    treeModelGetIter :: forall self.
    TreeModelClass self =>
    self -> TreePath -> IO (Maybe TreeIter)
    treeModelGetIter self
    _ [] = Maybe TreeIter -> IO (Maybe TreeIter)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Maybe TreeIter
    forall a. Maybe a
    Nothing
    treeModelGetIter self
    self TreePath
    path =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      TreePath -> (NativeTreePath -> IO CInt) -> IO CInt
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    path ((NativeTreePath -> IO CInt) -> IO CInt)
    -> (NativeTreePath -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \NativeTreePath
    path ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 (NativeTreePath Ptr NativeTreePath
    arg3) -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> Ptr NativeTreePath -> IO CInt
    gtk_tree_model_get_iter Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 Ptr NativeTreePath
    arg3)
    {-# LINE 269 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        NativeTreePath
    path

    -- %hash c:103f d:8041
    -- | Retrieves an 'TreeIter' to the first entry.
    --
    -- Returns @Nothing@ if the table is empty.
    --
    treeModelGetIterFirst :: TreeModelClass self => self
     -> IO (Maybe TreeIter)
    treeModelGetIterFirst :: forall self. TreeModelClass self => self -> IO (Maybe TreeIter)
    treeModelGetIterFirst self
    self =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO CInt
    gtk_tree_model_get_iter_first Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 283 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr

    -- %hash c:ec20 d:d43e
    -- | Turn an abstract 'TreeIter' into a 'TreePath'.
    --
    -- In case the given 'TreeIter' was invalid, an empty list is returned.
    --
    treeModelGetPath :: TreeModelClass self => self
     -> TreeIter -> IO TreePath
    treeModelGetPath :: forall self. TreeModelClass self => self -> TreeIter -> IO TreePath
    treeModelGetPath self
    self TreeIter
    iter =
      TreeIter -> (Ptr TreeIter -> IO TreePath) -> IO TreePath
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO TreePath) -> IO TreePath)
    -> (Ptr TreeIter -> IO TreePath) -> IO TreePath
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel
    -> (Ptr TreeModel -> IO (Ptr NativeTreePath))
    -> IO (Ptr NativeTreePath)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO (Ptr NativeTreePath))
     -> IO (Ptr NativeTreePath))
    -> (Ptr TreeModel -> IO (Ptr NativeTreePath))
    -> IO (Ptr NativeTreePath)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO (Ptr NativeTreePath)
    gtk_tree_model_get_path Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 296 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
      IO (Ptr NativeTreePath)
    -> (Ptr NativeTreePath -> IO TreePath) -> IO TreePath
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr NativeTreePath -> IO TreePath
    fromTreePath

    -- | Read the value of at a specific column and 'TreeIter'.
    --
    treeModelGetValue :: TreeModelClass self => self
     -> TreeIter
     -> ColumnId row ty -- ^ @column@ - The column to lookup the value at.
     -> IO ty
    treeModelGetValue :: forall self row ty.
    TreeModelClass self =>
    self -> TreeIter -> ColumnId row ty -> IO ty
    treeModelGetValue self
    self TreeIter
    iter (ColumnId GValue -> IO ty
    getter (row -> ty) -> ColumnAccess row
    _ Int
    colId) =
      (GValue -> IO ty) -> IO ty
    forall b. (GValue -> IO b) -> IO b
    allocaGValue ((GValue -> IO ty) -> IO ty) -> (GValue -> IO ty) -> IO ty
    forall a b. (a -> b) -> a -> b
    $ \GValue
    gVal ->
      TreeIter -> (Ptr TreeIter -> IO ty) -> IO ty
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ty) -> IO ty)
    -> (Ptr TreeIter -> IO ty) -> IO ty
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr -> do
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 CInt
    arg3 (GValue Ptr GValue
    arg4) -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> CInt -> Ptr GValue -> IO ()
    gtk_tree_model_get_value Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 CInt
    arg3 Ptr GValue
    arg4)
    {-# LINE 310 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    colId)
        GValue
    gVal
      GValue -> IO ty
    getter GValue
    gVal

    -- %hash c:5c12 d:d7db
    -- | Retrieve an iterator to the node following it at the current level. If
    -- there is no next node, @Nothing@ is returned.
    --
    treeModelIterNext :: TreeModelClass self => self -> TreeIter -> IO (Maybe TreeIter)
    treeModelIterNext :: forall self.
    TreeModelClass self =>
    self -> TreeIter -> IO (Maybe TreeIter)
    treeModelIterNext self
    self TreeIter
    iter =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr -> do
      Ptr TreeIter -> TreeIter -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke Ptr TreeIter
    iterPtr TreeIter
    iter
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO CInt
    gtk_tree_model_iter_next Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 325 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr

    -- %hash c:7eba d:27e8
    -- | Retrieve an iterator to the first child of @parent@. If @parent@ has no
    -- children, @Nothing@.
    --
    treeModelIterChildren :: TreeModelClass self => self
     -> TreeIter -- ^ @parent@ - a pointer to the parent
     -> IO (Maybe TreeIter)
    treeModelIterChildren :: forall self.
    TreeModelClass self =>
    self -> TreeIter -> IO (Maybe TreeIter)
    treeModelIterChildren self
    self TreeIter
    parent =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    parent ((Ptr TreeIter -> IO CInt) -> IO CInt)
    -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    parentPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 Ptr TreeIter
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> Ptr TreeIter -> IO CInt
    gtk_tree_model_iter_children Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 Ptr TreeIter
    arg3)
    {-# LINE 339 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        Ptr TreeIter
    parentPtr

    -- %hash c:dcc3
    -- | Returns @True@ if @iter@ has children, @False@ otherwise.
    --
    treeModelIterHasChild :: TreeModelClass self => self
     -> TreeIter -- ^ @iter@ - The 'TreeIter' to test for children.
     -> IO Bool -- ^ returns @True@ if @iter@ has children.
    treeModelIterHasChild :: forall self. TreeModelClass self => self -> TreeIter -> IO Bool
    treeModelIterHasChild self
    self TreeIter
    iter =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO CInt) -> IO CInt)
    -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO CInt
    gtk_tree_model_iter_has_child Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 353 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr

    -- %hash c:eed
    -- | Returns the number of children that @iter@ has. As a special case, if
    -- @iter@ is @Nothing@, then the number of toplevel nodes is returned.
    --
    treeModelIterNChildren :: TreeModelClass self => self
     -> Maybe TreeIter -- ^ @iter@ - The 'TreeIter', or @Nothing@.
     -> IO Int -- ^ returns The number of children of @iter@.
    treeModelIterNChildren :: forall self.
    TreeModelClass self =>
    self -> Maybe TreeIter -> IO Int
    treeModelIterNChildren self
    self Maybe TreeIter
    iter =
      (CInt -> Int) -> IO CInt -> IO Int
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
    forall a b. (a -> b) -> a -> b
    $
      (TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt)
    -> Maybe TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe TreeIter
    iter ((Ptr TreeIter -> IO CInt) -> IO CInt)
    -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO CInt
    gtk_tree_model_iter_n_children Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 367 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr

    -- %hash c:6950 d:6f4d
    -- | Retrieve the @n@th child of @parent@, counting from zero. If @n@ is too
    -- big or @parent@ has no children, @Nothing@ is returned. If @Nothing@ is
    -- specified for the @parent@ argument, the function will return the @n@th
    -- root node.
    --
    treeModelIterNthChild :: TreeModelClass self => self
     -> Maybe TreeIter -- ^ @parent@ - The 'TreeIter' to get the child from, or
                       -- @Nothing@.
     -> Int -- ^ @n@ - Then index of the desired child.
     -> IO (Maybe TreeIter)
    treeModelIterNthChild :: forall self.
    TreeModelClass self =>
    self -> Maybe TreeIter -> Int -> IO (Maybe TreeIter)
    treeModelIterNthChild self
    self Maybe TreeIter
    parent Int
    n =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      (TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt)
    -> Maybe TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe TreeIter
    parent ((Ptr TreeIter -> IO CInt) -> IO CInt)
    -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    parentPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 Ptr TreeIter
    arg3 CInt
    arg4 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> Ptr TreeIter -> CInt -> IO CInt
    gtk_tree_model_iter_nth_child Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 Ptr TreeIter
    arg3 CInt
    arg4)
    {-# LINE 385 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        Ptr TreeIter
    parentPtr
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    n)

    -- %hash c:8f01 d:70ff
    -- | Retrieve the parent of this iterator.
    --
    treeModelIterParent :: TreeModelClass self => self
     -> TreeIter
     -> IO (Maybe TreeIter)
    treeModelIterParent :: forall self.
    TreeModelClass self =>
    self -> TreeIter -> IO (Maybe TreeIter)
    treeModelIterParent self
    self TreeIter
    child =
      (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter ((Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr ->
      TreeIter -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    child ((Ptr TreeIter -> IO CInt) -> IO CInt)
    -> (Ptr TreeIter -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    childPtr ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 Ptr TreeIter
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CInt) -> IO CInt)
    -> (Ptr TreeModel -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> Ptr TreeIter -> IO CInt
    gtk_tree_model_iter_parent Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2 Ptr TreeIter
    arg3)
    {-# LINE 400 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iterPtr
        Ptr TreeIter
    childPtr

    -- %hash c:154f d:a6d
    -- | Maps a function over each node in model in a depth-first fashion. If it
    -- returns @True@, then the tree ceases to be walked, and 'treeModelForeach'
    -- returns.
    --
    treeModelForeach :: TreeModelClass self => self -> (TreeIter -> IO Bool) -> IO ()
    treeModelForeach :: forall self.
    TreeModelClass self =>
    self -> (TreeIter -> IO Bool) -> IO ()
    treeModelForeach self
    self TreeIter -> IO Bool
    fun = do
      fPtr <- (Ptr TreeModel
     -> Ptr NativeTreePath -> Ptr TreeIter -> Ptr () -> IO CInt)
    -> IO TreeModelForeachFunc
    mkTreeModelForeachFunc (\Ptr TreeModel
    _ Ptr NativeTreePath
    _ Ptr TreeIter
    iterPtr Ptr ()
    _ -> do
        -- make a deep copy of the iterator. This makes it possible to store this
        -- iterator in Haskell land somewhere. The TreeModel parameter is not
        -- passed to the function due to performance reasons. But since it is
        -- a constant this does not matter.
        iter <- Ptr TreeIter -> IO TreeIter
    forall a. Storable a => Ptr a -> IO a
    peek Ptr TreeIter
    iterPtr
        liftM (fromIntegral.fromBool) $ fun iter
        )
      (\(TreeModel ForeignPtr TreeModel
    arg1) TreeModelForeachFunc
    arg2 Ptr ()
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> TreeModelForeachFunc -> Ptr () -> IO ()
    gtk_tree_model_foreach Ptr TreeModel
    argPtr1 TreeModelForeachFunc
    arg2 Ptr ()
    arg3)
    {-# LINE 420 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        fPtr
        nullPtr
      freeHaskellFunPtr fPtr

    type TreeModelForeachFunc = FunPtr (((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> ((Ptr ()) -> (IO CInt))))))
    {-# LINE 426 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}

    foreign import ccall "wrapper" mkTreeModelForeachFunc ::
      (Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> Ptr () -> IO CInt) ->
      IO TreeModelForeachFunc

    -- %hash c:f04a d:94fd
    -- | Generates a string representation of the iter. This string is a \':\'
    -- separated list of numbers. For example, \"4:10:0:3\" would be an acceptable
    -- return value for this string.
    --
    -- * Available since Gtk+ version 2.2
    --
    treeModelGetStringFromIter :: (TreeModelClass self, GlibString string) => self
     -> TreeIter -- ^ @iter@ - An 'TreeIter'.
     -> IO string -- ^ the returned string representation
    treeModelGetStringFromIter :: forall self string.
    (TreeModelClass self, GlibString string) =>
    self -> TreeIter -> IO string
    treeModelGetStringFromIter self
    self TreeIter
    iter = TreeIter -> (Ptr TreeIter -> IO string) -> IO string
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO string) -> IO string)
    -> (Ptr TreeIter -> IO string) -> IO string
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO CString) -> IO CString
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO CString) -> IO CString)
    -> (Ptr TreeModel -> IO CString) -> IO CString
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO CString
    gtk_tree_model_get_string_from_iter Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 444 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iter
      IO CString -> (CString -> IO string) -> IO string
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= CString -> IO string
    forall s. GlibString s => CString -> IO s
    readUTFString

    -- %hash c:228e d:304e
    -- | Lets the tree ref the node. This is an optional method for models to
    -- implement. To be more specific, models may ignore this call as it exists
    -- primarily for performance reasons.
    --
    -- This function is primarily meant as a way for views to let caching model
    -- know when nodes are being displayed (and hence, whether or not to cache that
    -- node.) For example, a file-system based model would not want to keep the
    -- entire file-hierarchy in memory, just the sections that are currently being
    -- displayed by every current view.
    --
    -- A model should be expected to be able to get an iter independent of its
    -- reffed state.
    --
    treeModelRefNode :: TreeModelClass self => self
     -> TreeIter -- ^ @iter@ - The 'TreeIter'.
     -> IO ()
    treeModelRefNode :: forall self. TreeModelClass self => self -> TreeIter -> IO ()
    treeModelRefNode self
    self TreeIter
    iter = TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO ()
    gtk_tree_model_ref_node Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 468 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iter

    -- %hash c:f5d7 d:22a6
    -- | Lets the tree unref the node. This is an optional method for models to
    -- implement. To be more specific, models may ignore this call as it exists
    -- primarily for performance reasons.
    --
    -- For more information on what this means, see 'treeModelRefNode'. Please
    -- note that nodes that are deleted are not unreffed.
    --
    treeModelUnrefNode :: TreeModelClass self => self
     -> TreeIter -- ^ @iter@ - The 'TreeIter'.
     -> IO ()
    treeModelUnrefNode :: forall self. TreeModelClass self => self -> TreeIter -> IO ()
    treeModelUnrefNode self
    self TreeIter
    iter = TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) Ptr TreeIter
    arg2 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr TreeIter -> IO ()
    gtk_tree_model_unref_node Ptr TreeModel
    argPtr1 Ptr TreeIter
    arg2)
    {-# LINE 484 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        Ptr TreeIter
    iter

    -- %hash c:8d25 d:a7c9
    -- | Emits the 'rowChanged' signal on the model.
    --
    -- * This function is only necessary to implement a custom tree model. When
    -- using 'Graphics.UI.Gtk.ModelView.ListStore' or
    -- 'Graphics.UI.Gtk.ModelView.TreeStore', this function is called
    -- automatically.
    --
    treeModelRowChanged :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - A 'TreePath' pointing to the changed row
     -> TreeIter -- ^ @iter@ - A valid 'TreeIter' pointing to the changed row
     -> IO ()
    treeModelRowChanged :: forall self.
    TreeModelClass self =>
    self -> TreePath -> TreeIter -> IO ()
    treeModelRowChanged self
    self TreePath
    path TreeIter
    iter =
      TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      TreePath -> (NativeTreePath -> IO ()) -> IO ()
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    path ((NativeTreePath -> IO ()) -> IO ())
    -> (NativeTreePath -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \NativeTreePath
    path ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) (NativeTreePath Ptr NativeTreePath
    arg2) Ptr TreeIter
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> IO ()
    gtk_tree_model_row_changed Ptr TreeModel
    argPtr1 Ptr NativeTreePath
    arg2 Ptr TreeIter
    arg3)
    {-# LINE 503 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        NativeTreePath
    path
        Ptr TreeIter
    iter

    -- %hash c:f809 d:57af
    -- | Emits the 'rowInserted' signal on the model.
    --
    -- * This function is only necessary to implement a custom tree model. When
    -- using 'Graphics.UI.Gtk.ModelView.ListStore' or
    -- 'Graphics.UI.Gtk.ModelView.TreeStore', this function is called
    -- automatically.
    --
    treeModelRowInserted :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - A 'TreePath' pointing to the inserted row
     -> TreeIter -- ^ @iter@ - A valid 'TreeIter' pointing to the inserted row
     -> IO ()
    treeModelRowInserted :: forall self.
    TreeModelClass self =>
    self -> TreePath -> TreeIter -> IO ()
    treeModelRowInserted self
    self TreePath
    path TreeIter
    iter =
      TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      TreePath -> (NativeTreePath -> IO ()) -> IO ()
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    path ((NativeTreePath -> IO ()) -> IO ())
    -> (NativeTreePath -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \NativeTreePath
    path ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) (NativeTreePath Ptr NativeTreePath
    arg2) Ptr TreeIter
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> IO ()
    gtk_tree_model_row_inserted Ptr TreeModel
    argPtr1 Ptr NativeTreePath
    arg2 Ptr TreeIter
    arg3)
    {-# LINE 523 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        NativeTreePath
    path
        Ptr TreeIter
    iter

    -- %hash c:e917 d:6534
    -- | Emits the 'rowHasChildToggled' signal on the model. This should be
    -- called by models after the child state of a node changes.
    --
    -- * This function is only necessary to implement a custom tree model. When
    -- using 'Graphics.UI.Gtk.ModelView.ListStore' or
    -- 'Graphics.UI.Gtk.ModelView.TreeStore', this function is called
    -- automatically.
    --
    treeModelRowHasChildToggled :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - A 'TreePath' pointing to the changed row
     -> TreeIter -- ^ @iter@ - A valid 'TreeIter' pointing to the changed row
     -> IO ()
    treeModelRowHasChildToggled :: forall self.
    TreeModelClass self =>
    self -> TreePath -> TreeIter -> IO ()
    treeModelRowHasChildToggled self
    self TreePath
    path TreeIter
    iter =
      TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
      TreePath -> (NativeTreePath -> IO ()) -> IO ()
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    path ((NativeTreePath -> IO ()) -> IO ())
    -> (NativeTreePath -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \NativeTreePath
    path ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) (NativeTreePath Ptr NativeTreePath
    arg2) Ptr TreeIter
    arg3 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> IO ()
    gtk_tree_model_row_has_child_toggled Ptr TreeModel
    argPtr1 Ptr NativeTreePath
    arg2 Ptr TreeIter
    arg3)
    {-# LINE 544 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        NativeTreePath
    path
        Ptr TreeIter
    iter

    -- %hash c:c0a2 d:7ca6
    -- | Emits the 'rowDeleted' signal on the model. This should be called by
    -- models after a row has been removed. The location pointed to by @path@
    -- should be the location that the row previously was at. It may not be a
    -- valid location anymore.
    --
    -- * This function is only necessary to implement a custom tree model. When
    -- using 'Graphics.UI.Gtk.ModelView.ListStore' or
    -- 'Graphics.UI.Gtk.ModelView.TreeStore', this function is called
    -- automatically.
    --
    treeModelRowDeleted :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - A 'TreePath' pointing to the previous location of
                 -- the deleted row.
     -> IO ()
    treeModelRowDeleted :: forall self. TreeModelClass self => self -> TreePath -> IO ()
    treeModelRowDeleted self
    self TreePath
    path =
      TreePath -> (NativeTreePath -> IO ()) -> IO ()
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    path ((NativeTreePath -> IO ()) -> IO ())
    -> (NativeTreePath -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \NativeTreePath
    path ->
      (\(TreeModel ForeignPtr TreeModel
    arg1) (NativeTreePath Ptr NativeTreePath
    arg2) -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel -> Ptr NativeTreePath -> IO ()
    gtk_tree_model_row_deleted Ptr TreeModel
    argPtr1 Ptr NativeTreePath
    arg2)
    {-# LINE 566 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
        (toTreeModel self)
        NativeTreePath
    path

    -- %hash c:f0f3 d:a8c5
    -- | Emits the 'rowsReordered' signal on the model. This should be called by
    -- models when their rows have been reordered. The length of @newOrder@ must
    -- be equal to the value returned by @treeModelIterNChildren self iter@.
    --
    -- * This function is only necessary to implement a custom tree model. When
    -- using 'Graphics.UI.Gtk.ModelView.ListStore' or
    -- 'Graphics.UI.Gtk.ModelView.TreeStore', this function is called
    -- automatically.
    --
    treeModelRowsReordered :: TreeModelClass self => self
     -> TreePath -- ^ @path@ - A 'TreePath' pointing to the tree node whose
                 -- children have been reordered
     -> Maybe TreeIter -- ^ @iter@ - A valid 'TreeIter' pointing to the node whose
                       -- children have been reordered, or @Nothing@ if
                       -- @path@ is @[]@.
     -> [Int] -- ^ @newOrder@ - a list of integers giving the previous position
                -- of each node at this hierarchy level.

     -> IO ()
    treeModelRowsReordered :: forall self.
    TreeModelClass self =>
    self -> TreePath -> Maybe TreeIter -> TreePath -> IO ()
    treeModelRowsReordered self
    self TreePath
    path Maybe TreeIter
    iter TreePath
    array = do
      n <- self -> Maybe TreeIter -> IO Int
    forall self.
    TreeModelClass self =>
    self -> Maybe TreeIter -> IO Int
    treeModelIterNChildren self
    self Maybe TreeIter
    iter
      let l = TreePath -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length TreePath
    array
      if n/=l then error ("treeModelRowsReordered: passed-in array is of size "
                          ++show l++" but there are "++show n++
                          " children at path "++show path) else
        withTreePath path $ \NativeTreePath
    path ->
        (TreeIter -> (Ptr TreeIter -> IO ()) -> IO ())
    -> Maybe TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith TreeIter -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe TreeIter
    iter ((Ptr TreeIter -> IO ()) -> IO ())
    -> (Ptr TreeIter -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iter ->
        [CInt] -> (Ptr CInt -> IO ()) -> IO ()
    forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
    withArray ((Int -> CInt) -> TreePath -> [CInt]
    forall a b. (a -> b) -> [a] -> [b]
    map Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral TreePath
    array) ((Ptr CInt -> IO ()) -> IO ()) -> (Ptr CInt -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    newOrderPtr ->
        (\(TreeModel ForeignPtr TreeModel
    arg1) (NativeTreePath Ptr NativeTreePath
    arg2) Ptr TreeIter
    arg3 Ptr CInt
    arg4 -> ForeignPtr TreeModel -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr TreeModel
    arg1 ((Ptr TreeModel -> IO ()) -> IO ())
    -> (Ptr TreeModel -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeModel
    argPtr1 ->Ptr TreeModel
    -> Ptr NativeTreePath -> Ptr TreeIter -> Ptr CInt -> IO ()
    gtk_tree_model_rows_reordered Ptr TreeModel
    argPtr1 Ptr NativeTreePath
    arg2 Ptr TreeIter
    arg3 Ptr CInt
    arg4)
    {-# LINE 599 "./Graphics/UI/Gtk/ModelView/TreeModel.chs" #-}
          (toTreeModel self)
          NativeTreePath
    path
          Ptr TreeIter
    iter
          Ptr CInt
    newOrderPtr

    --------------------
    -- Signals

    -- %hash c:50c7 d:8da5
    -- | This signal is emitted when a row in the model has changed.
    --
    rowChanged :: TreeModelClass self => Signal self (TreePath -> TreeIter -> IO ())
    rowChanged :: forall self.
    TreeModelClass self =>
    Signal self (TreePath -> TreeIter -> IO ())
    rowChanged = (Bool
     -> self -> (TreePath -> TreeIter -> IO ()) -> IO (ConnectId self))
    -> Signal self (TreePath -> TreeIter -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal ([Char]
    -> (Ptr NativeTreePath -> IO TreePath)
    -> (Ptr TreeIter -> IO TreeIter)
    -> Bool
    -> self
    -> (TreePath -> TreeIter -> IO ())
    -> IO (ConnectId self)
    forall obj a' a b' b.
    GObjectClass obj =>
    [Char]
    -> (Ptr a' -> IO a)
    -> (Ptr b' -> IO b)
    -> Bool
    -> obj
    -> (a -> b -> IO ())
    -> IO (ConnectId obj)
    connect_BOXED_BOXED__NONE [Char]
    "row-changed" Ptr NativeTreePath -> IO TreePath
    peekTreePath Ptr TreeIter -> IO TreeIter
    peekTreeIter)

    -- %hash c:f31a d:3c6b
    -- | This signal is emitted when a new row has been inserted in the model.
    --
    --
    rowInserted :: TreeModelClass self => Signal self (TreePath -> TreeIter -> IO ())
    rowInserted :: forall self.
    TreeModelClass self =>
    Signal self (TreePath -> TreeIter -> IO ())
    rowInserted = (Bool
     -> self -> (TreePath -> TreeIter -> IO ()) -> IO (ConnectId self))
    -> Signal self (TreePath -> TreeIter -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal ([Char]
    -> (Ptr NativeTreePath -> IO TreePath)
    -> (Ptr TreeIter -> IO TreeIter)
    -> Bool
    -> self
    -> (TreePath -> TreeIter -> IO ())
    -> IO (ConnectId self)
    forall obj a' a b' b.
    GObjectClass obj =>
    [Char]
    -> (Ptr a' -> IO a)
    -> (Ptr b' -> IO b)
    -> Bool
    -> obj
    -> (a -> b -> IO ())
    -> IO (ConnectId obj)
    connect_BOXED_BOXED__NONE [Char]
    "row-inserted" Ptr NativeTreePath -> IO TreePath
    peekTreePath Ptr TreeIter -> IO TreeIter
    peekTreeIter)

    -- %hash c:7279 d:5ef
    -- | This signal is emitted when a row has gotten the first child row or lost
    -- its last child row.
    --
    rowHasChildToggled :: TreeModelClass self => Signal self (TreePath -> TreeIter -> IO ())
    rowHasChildToggled :: forall self.
    TreeModelClass self =>
    Signal self (TreePath -> TreeIter -> IO ())
    rowHasChildToggled = (Bool
     -> self -> (TreePath -> TreeIter -> IO ()) -> IO (ConnectId self))
    -> Signal self (TreePath -> TreeIter -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal ([Char]
    -> (Ptr NativeTreePath -> IO TreePath)
    -> (Ptr TreeIter -> IO TreeIter)
    -> Bool
    -> self
    -> (TreePath -> TreeIter -> IO ())
    -> IO (ConnectId self)
    forall obj a' a b' b.
    GObjectClass obj =>
    [Char]
    -> (Ptr a' -> IO a)
    -> (Ptr b' -> IO b)
    -> Bool
    -> obj
    -> (a -> b -> IO ())
    -> IO (ConnectId obj)
    connect_BOXED_BOXED__NONE [Char]
    "row-has-child-toggled" Ptr NativeTreePath -> IO TreePath
    peekTreePath Ptr TreeIter -> IO TreeIter
    peekTreeIter)

    -- %hash c:f669 d:367f
    -- | This signal is emitted when a row has been deleted.
    --
    -- Note that no iterator is passed to the signal handler, since the row is
    -- already deleted.
    --
    -- Implementations of 'TreeModel' must emit row-deleted /before/ removing the
    -- node from its internal data structures. This is because models and views
    -- which access and monitor this model might have references on the node which
    -- need to be released in the 'rowDeleted' handler.
    --
    rowDeleted :: TreeModelClass self => Signal self (TreePath -> IO ())
    rowDeleted :: forall self. TreeModelClass self => Signal self (TreePath -> IO ())
    rowDeleted = (Bool -> self -> (TreePath -> IO ()) -> IO (ConnectId self))
    -> Signal self (TreePath -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal ([Char]
    -> (Ptr NativeTreePath -> IO TreePath)
    -> Bool
    -> self
    -> (TreePath -> IO ())
    -> IO (ConnectId self)
    forall obj a' a.
    GObjectClass obj =>
    [Char]
    -> (Ptr a' -> IO a)
    -> Bool
    -> obj
    -> (a -> IO ())
    -> IO (ConnectId obj)
    connect_BOXED__NONE [Char]
    "row-deleted" Ptr NativeTreePath -> IO TreePath
    peekTreePath)

    -- %hash c:46dd d:b2e5
    -- | This signal is emitted when the children of a node in the 'TreeModel'
    -- have been reordered. See 'treeModelRowsReordered' for more information
    -- about the parameters that this signal carries.
    --
    -- Note that this signal is /not/ emitted when rows are reordered by DND,
    -- since this is implemented by removing and then reinserting the row.
    --
    rowsReordered :: TreeModelClass self =>
                     Signal self (TreePath -> Maybe TreeIter -> [Int] -> IO ())
    rowsReordered :: forall self.
    TreeModelClass self =>
    Signal self (TreePath -> Maybe TreeIter -> TreePath -> IO ())
    rowsReordered = (Bool
     -> self
     -> (TreePath -> Maybe TreeIter -> TreePath -> IO ())
     -> IO (ConnectId self))
    -> Signal self (TreePath -> Maybe TreeIter -> TreePath -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal ((Bool
      -> self
      -> (TreePath -> Maybe TreeIter -> TreePath -> IO ())
      -> IO (ConnectId self))
     -> Signal self (TreePath -> Maybe TreeIter -> TreePath -> IO ()))
    -> (Bool
        -> self
        -> (TreePath -> Maybe TreeIter -> TreePath -> IO ())
        -> IO (ConnectId self))
    -> Signal self (TreePath -> Maybe TreeIter -> TreePath -> IO ())
    forall a b. (a -> b) -> a -> b
    $ \Bool
    after self
    model TreePath -> Maybe TreeIter -> TreePath -> IO ()
    user ->
      [Char]
    -> (Ptr NativeTreePath -> IO TreePath)
    -> (Ptr TreeIter -> IO (Maybe TreeIter))
    -> Bool
    -> self
    -> (TreePath -> Maybe TreeIter -> Ptr CInt -> IO ())
    -> IO (ConnectId self)
    forall obj a' a b' b c.
    GObjectClass obj =>
    [Char]
    -> (Ptr a' -> IO a)
    -> (Ptr b' -> IO b)
    -> Bool
    -> obj
    -> (a -> b -> Ptr c -> IO ())
    -> IO (ConnectId obj)
    connect_BOXED_BOXED_PTR__NONE [Char]
    "rows-reordered" Ptr NativeTreePath -> IO TreePath
    peekTreePath
        ((Ptr TreeIter -> IO TreeIter)
    -> Ptr TreeIter -> IO (Maybe TreeIter)
    forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
    maybePeek Ptr TreeIter -> IO TreeIter
    peekTreeIter) Bool
    after self
    model ((TreePath -> Maybe TreeIter -> Ptr CInt -> IO ())
     -> IO (ConnectId self))
    -> (TreePath -> Maybe TreeIter -> Ptr CInt -> IO ())
    -> IO (ConnectId self)
    forall a b. (a -> b) -> a -> b
    $ \TreePath
    path Maybe TreeIter
    iter Ptr CInt
    arrayPtr -> do
          n <- self -> Maybe TreeIter -> IO Int
    forall self.
    TreeModelClass self =>
    self -> Maybe TreeIter -> IO Int
    treeModelIterNChildren self
    model Maybe TreeIter
    iter
          -- hopefully the model is never buggy, otherwise this can segfault
          newOrder <- peekArray n arrayPtr
          user path iter (map fromIntegral (newOrder :: [(CInt)]))

    foreign import ccall safe "gtk_tree_model_get_flags"
      gtk_tree_model_get_flags :: ((Ptr TreeModel) -> (IO CInt))

    foreign import ccall safe "gtk_tree_model_get_iter_from_string"
      gtk_tree_model_get_iter_from_string :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> ((Ptr CChar) -> (IO CInt))))

    foreign import ccall safe "gtk_tree_model_get_iter"
      gtk_tree_model_get_iter :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> ((Ptr NativeTreePath) -> (IO CInt))))

    foreign import ccall safe "gtk_tree_model_get_iter_first"
      gtk_tree_model_get_iter_first :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO CInt)))

    foreign import ccall safe "gtk_tree_model_get_path"
      gtk_tree_model_get_path :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO (Ptr NativeTreePath))))

    foreign import ccall safe "gtk_tree_model_get_value"
      gtk_tree_model_get_value :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (CInt -> ((Ptr GValue) -> (IO ())))))

    foreign import ccall safe "gtk_tree_model_iter_next"
      gtk_tree_model_iter_next :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO CInt)))

    foreign import ccall safe "gtk_tree_model_iter_children"
      gtk_tree_model_iter_children :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> ((Ptr TreeIter) -> (IO CInt))))

    foreign import ccall safe "gtk_tree_model_iter_has_child"
      gtk_tree_model_iter_has_child :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO CInt)))

    foreign import ccall safe "gtk_tree_model_iter_n_children"
      gtk_tree_model_iter_n_children :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO CInt)))

    foreign import ccall safe "gtk_tree_model_iter_nth_child"
      gtk_tree_model_iter_nth_child :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> ((Ptr TreeIter) -> (CInt -> (IO CInt)))))

    foreign import ccall safe "gtk_tree_model_iter_parent"
      gtk_tree_model_iter_parent :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> ((Ptr TreeIter) -> (IO CInt))))

    foreign import ccall safe "gtk_tree_model_foreach"
      gtk_tree_model_foreach :: ((Ptr TreeModel) -> ((FunPtr ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> ((Ptr ()) -> (IO CInt)))))) -> ((Ptr ()) -> (IO ()))))

    foreign import ccall safe "gtk_tree_model_get_string_from_iter"
      gtk_tree_model_get_string_from_iter :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO (Ptr CChar))))

    foreign import ccall safe "gtk_tree_model_ref_node"
      gtk_tree_model_ref_node :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO ())))

    foreign import ccall safe "gtk_tree_model_unref_node"
      gtk_tree_model_unref_node :: ((Ptr TreeModel) -> ((Ptr TreeIter) -> (IO ())))

    foreign import ccall safe "gtk_tree_model_row_changed"
      gtk_tree_model_row_changed :: ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> (IO ()))))

    foreign import ccall safe "gtk_tree_model_row_inserted"
      gtk_tree_model_row_inserted :: ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> (IO ()))))

    foreign import ccall safe "gtk_tree_model_row_has_child_toggled"
      gtk_tree_model_row_has_child_toggled :: ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> (IO ()))))

    foreign import ccall safe "gtk_tree_model_row_deleted"
      gtk_tree_model_row_deleted :: ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> (IO ())))

    foreign import ccall safe "gtk_tree_model_rows_reordered"
      gtk_tree_model_rows_reordered :: ((Ptr TreeModel) -> ((Ptr NativeTreePath) -> ((Ptr TreeIter) -> ((Ptr CInt) -> (IO ())))))