    -- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
    -- Edit the ORIGINAL .chs file instead!

    {-# LANGUAGE GADTs #-}

    {-# LINE 1 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}
    {-# LANGUAGE MagicHash #-}

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

    {-# LINE 3 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}
    {-# LANGUAGE OverloadedStrings #-}

    {-# LINE 4 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}
    {-# OPTIONS_HADDOCK hide #-}
    {-# OPTIONS_GHC -fno-warn-unused-binds #-}
    -- -*-haskell-*-
    --  GIMP Toolkit (GTK) CustomStore TreeModel
    --
    --  Author : Duncan Coutts
    --
    --  Created: 31 March 2006
    --
    --  Copyright (C) 2006-2007 Duncan Coutts, 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

    -- |
    -- Maintainer  : gtk2hs-users@lists.sourceforge.net
    -- Stability   : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Common types and classes for the ModelView modules.
    --
    module Graphics.UI.Gtk.ModelView.Types (
      TypedTreeModel(..),
      TypedTreeModelClass,
      toTypedTreeModel,
      unsafeTreeModelToGeneric,

      TypedTreeModelSort(..),
      unsafeTreeModelSortToGeneric,
      TypedTreeModelFilter(..),
      unsafeTreeModelFilterToGeneric,

      -- TreeIter
      TreeIter(..),
      receiveTreeIter,
      peekTreeIter,
      treeIterSetStamp,

      -- TreePath
      TreePath,
      NativeTreePath(..),
      newTreePath,
      withTreePath,
      maybeWithTreePath,
      peekTreePath,
      fromTreePath,
      stringToTreePath,

      -- Columns
      ColumnAccess(..),
      ColumnId(..),

      -- Storing the model in a ComboBox
      comboQuark,
      ) where

    import GHC.Exts (unsafeCoerce#)

    import System.Glib.FFI
    import System.Glib.UTFString
    import System.Glib.GValue         (GValue)
    import System.Glib.GObject        (Quark, quarkFromString)
    import Graphics.UI.Gtk.Types        (TreeModel, TreeModelSort, TreeModelFilter,
                                       Pixbuf)
    import Data.Char ( isDigit )
    import Control.Monad ( liftM )

    {-# LINE 81 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}

    newtype TypedTreeModel row = TypedTreeModel (ForeignPtr (TypedTreeModel row))

    class TypedTreeModelClass model where
      dummy :: model a -> a
      dummy model a
    _ = [Char] -> a
    forall a. HasCallStack => [Char] -> a
    error [Char]
    "not used"
      -- this is to get the right kind for model :: * -> *
      -- TODO: when haddock is fixed we can use an explicit kind annotation

    toTypedTreeModel :: TypedTreeModelClass model => model row -> TypedTreeModel row
    toTypedTreeModel :: forall (model :: * -> *) row.
    TypedTreeModelClass model =>
    model row -> TypedTreeModel row
    toTypedTreeModel = model row -> TypedTreeModel row
    forall a b. a -> b
    unsafeCoerce#

    unsafeTreeModelToGeneric :: TreeModel -> model row
    unsafeTreeModelToGeneric :: forall (model :: * -> *) row. TreeModel -> model row
    unsafeTreeModelToGeneric = TreeModel -> model row
    forall a b. a -> b
    unsafeCoerce#

    instance TypedTreeModelClass TypedTreeModel

    newtype TypedTreeModelSort row = TypedTreeModelSort (ForeignPtr (TypedTreeModelSort row))

    unsafeTreeModelSortToGeneric :: TreeModelSort -> TypedTreeModelSort row
    unsafeTreeModelSortToGeneric :: forall row. TreeModelSort -> TypedTreeModelSort row
    unsafeTreeModelSortToGeneric = TreeModelSort -> TypedTreeModelSort row
    forall a b. a -> b
    unsafeCoerce#

    instance TypedTreeModelClass TypedTreeModelSort

    newtype TypedTreeModelFilter row = TypedTreeModelFilter (ForeignPtr (TypedTreeModelFilter row))

    unsafeTreeModelFilterToGeneric :: TreeModelFilter -> TypedTreeModelFilter row
    unsafeTreeModelFilterToGeneric :: forall row. TreeModelFilter -> TypedTreeModelFilter row
    unsafeTreeModelFilterToGeneric = TreeModelFilter -> TypedTreeModelFilter row
    forall a b. a -> b
    unsafeCoerce#

    instance TypedTreeModelClass TypedTreeModelFilter

    -- | Tree Iterator: a pointer to an entry in a
    -- 'Graphics.UI.Gtk.ModelView.TreeModel'. The constructor of this structure is
    -- public for the sake of creating custom tree models. The first value is a
    -- time stamp that is handled by the functions that interface with Gtk. The
    -- time stamps are used to print warnings if programmers use an iter to a
    -- model that has changed meanwhile. The other three fields are used by the
    -- custom model implementation to implement an indexing scheme. The precise
    -- use of the three words is therefore implementation specific. See also
    -- 'TreePath'.
    --
    data TreeIter = TreeIter {-# UNPACK #-} !CInt !Word32 !Word32 !Word32
                  deriving Int -> TreeIter -> ShowS
    [TreeIter] -> ShowS
    TreeIter -> [Char]
    (Int -> TreeIter -> ShowS)
    -> (TreeIter -> [Char]) -> ([TreeIter] -> ShowS) -> Show TreeIter
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TreeIter -> ShowS
    showsPrec :: Int -> TreeIter -> ShowS
    $cshow :: TreeIter -> [Char]
    show :: TreeIter -> [Char]
    $cshowList :: [TreeIter] -> ShowS
    showList :: [TreeIter] -> ShowS
    Show

    type TreeIterPtr = Ptr (TreeIter)
    {-# LINE 126 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}

    instance Storable TreeIter where
      sizeOf :: TreeIter -> Int
    sizeOf TreeIter
    _ = Int
    32
    {-# LINE 129 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}
      alignment _ = alignment (undefined :: CInt)
      peek :: Ptr TreeIter -> IO TreeIter
    peek Ptr TreeIter
    ptr = do
        stamp      <- (\Ptr TreeIter
    ptr -> do {Ptr TreeIter -> Int -> IO CInt
    forall b. Ptr b -> Int -> IO CInt
    forall a b. Storable a => Ptr b -> Int -> IO a
    peekByteOff Ptr TreeIter
    ptr Int
    0 ::IO CInt}) Ptr TreeIter
    ptr
        user_data  <- (\Ptr TreeIter
    ptr -> do {Ptr TreeIter -> Int -> IO (Ptr ())
    forall b. Ptr b -> Int -> IO (Ptr ())
    forall a b. Storable a => Ptr b -> Int -> IO a
    peekByteOff Ptr TreeIter
    ptr Int
    8 ::IO (Ptr ())}) ptr
        user_data2 <- (\Ptr TreeIter
    ptr -> do {Ptr TreeIter -> Int -> IO (Ptr ())
    forall b. Ptr b -> Int -> IO (Ptr ())
    forall a b. Storable a => Ptr b -> Int -> IO a
    peekByteOff Ptr TreeIter
    ptr Int
    16 ::IO (Ptr ())}) ptr
        user_data3 <- (\Ptr TreeIter
    ptr -> do {Ptr TreeIter -> Int -> IO (Ptr ())
    forall b. Ptr b -> Int -> IO (Ptr ())
    forall a b. Storable a => Ptr b -> Int -> IO a
    peekByteOff Ptr TreeIter
    ptr Int
    24 ::IO (Ptr ())}) ptr
        return (TreeIter stamp (ptrToWord user_data)
                               (ptrToWord user_data2)
                               (ptrToWord user_data3))

        where ptrToWord :: Ptr a -> Word32
              ptrToWord :: forall a. Ptr a -> Word32
    ptrToWord Ptr a
    ptr = Int -> Word32
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Ptr a
    ptr Ptr a -> Ptr (ZonkAny 0) -> Int
    forall a b. Ptr a -> Ptr b -> Int
    `minusPtr` Ptr (ZonkAny 0)
    forall a. Ptr a
    nullPtr)

      poke :: Ptr TreeIter -> TreeIter -> IO ()
    poke Ptr TreeIter
    ptr (TreeIter CInt
    stamp Word32
    user_data Word32
    user_data2 Word32
    user_data3) = do
        (\Ptr TreeIter
    ptr CInt
    val -> do {Ptr TreeIter -> Int -> CInt -> IO ()
    forall b. Ptr b -> Int -> CInt -> IO ()
    forall a b. Storable a => Ptr b -> Int -> a -> IO ()
    pokeByteOff Ptr TreeIter
    ptr Int
    0 (CInt
    val::CInt)}) Ptr TreeIter
    ptr CInt
    stamp
        (\Ptr TreeIter
    ptr Ptr ()
    val -> do {Ptr TreeIter -> Int -> Ptr () -> IO ()
    forall b. Ptr b -> Int -> Ptr () -> IO ()
    forall a b. Storable a => Ptr b -> Int -> a -> IO ()
    pokeByteOff Ptr TreeIter
    ptr Int
    8 (Ptr ()
    val::(Ptr ()))}) Ptr TreeIter
    ptr (Word32 -> Ptr ()
    forall a. Word32 -> Ptr a
    wordToPtr Word32
    user_data)
        (\Ptr TreeIter
    ptr Ptr ()
    val -> do {Ptr TreeIter -> Int -> Ptr () -> IO ()
    forall b. Ptr b -> Int -> Ptr () -> IO ()
    forall a b. Storable a => Ptr b -> Int -> a -> IO ()
    pokeByteOff Ptr TreeIter
    ptr Int
    16 (Ptr ()
    val::(Ptr ()))}) Ptr TreeIter
    ptr (Word32 -> Ptr ()
    forall a. Word32 -> Ptr a
    wordToPtr Word32
    user_data2)
        (\Ptr TreeIter
    ptr Ptr ()
    val -> do {Ptr TreeIter -> Int -> Ptr () -> IO ()
    forall b. Ptr b -> Int -> Ptr () -> IO ()
    forall a b. Storable a => Ptr b -> Int -> a -> IO ()
    pokeByteOff Ptr TreeIter
    ptr Int
    24 (Ptr ()
    val::(Ptr ()))}) Ptr TreeIter
    ptr (Word32 -> Ptr ()
    forall a. Word32 -> Ptr a
    wordToPtr Word32
    user_data3)

        where wordToPtr :: Word32 -> Ptr a
              wordToPtr :: forall a. Word32 -> Ptr a
    wordToPtr Word32
    word = Ptr (ZonkAny 1)
    forall a. Ptr a
    nullPtr Ptr (ZonkAny 1) -> Int -> Ptr a
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Word32 -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word32
    word

    -- Pass a pointer to a structure large enough to hold a GtkTreeIter
    -- structure. If the function returns true, read the tree iter and
    -- return it.
    receiveTreeIter :: (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter :: (Ptr TreeIter -> IO CInt) -> IO (Maybe TreeIter)
    receiveTreeIter Ptr TreeIter -> IO CInt
    body =
      (Ptr TreeIter -> IO (Maybe TreeIter)) -> IO (Maybe TreeIter)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr TreeIter -> IO (Maybe TreeIter)) -> IO (Maybe TreeIter))
    -> (Ptr TreeIter -> IO (Maybe TreeIter)) -> IO (Maybe TreeIter)
    forall a b. (a -> b) -> a -> b
    $ \Ptr TreeIter
    iterPtr -> do
      result <- Ptr TreeIter -> IO CInt
    body Ptr TreeIter
    iterPtr
      if toBool result
        then liftM Just (peek iterPtr)
        else return Nothing

    -- Note that this function does throw an error if the pointer is NULL rather
    -- than returning some random tree iterator.
    peekTreeIter :: Ptr TreeIter -> IO TreeIter
    peekTreeIter :: Ptr TreeIter -> IO TreeIter
    peekTreeIter Ptr TreeIter
    ptr
      | Ptr TreeIter
    ptrPtr TreeIter -> Ptr TreeIter -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Ptr TreeIter
    forall a. Ptr a
    nullPtr = [Char] -> IO TreeIter
    forall a. [Char] -> IO a
    forall (m :: * -> *) a. MonadFail m => [Char] -> m a
    fail [Char]
    "peekTreeIter: ptr is NULL, tree iterator is invalid"
      | Bool
    otherwise = Ptr TreeIter -> IO TreeIter
    forall a. Storable a => Ptr a -> IO a
    peek Ptr TreeIter
    ptr

    -- update the stamp of a tree iter
    treeIterSetStamp :: TreeIter -> CInt -> TreeIter
    treeIterSetStamp :: TreeIter -> CInt -> TreeIter
    treeIterSetStamp (TreeIter CInt
    _ Word32
    a Word32
    b Word32
    c) CInt
    s = (CInt -> Word32 -> Word32 -> Word32 -> TreeIter
    TreeIter CInt
    s Word32
    a Word32
    b Word32
    c)

    -- | TreePath : a list of indices to specify a subtree or node in a
    -- 'Graphics.UI.Gtk.ModelView.TreeModel.TreeModel'. The node that correspond
    -- to a given 'TreePath' might change if nodes are removed or added and a
    -- 'TreePath' may refer to a different or even non-existent node after a
    -- modification of the model. In contrast, a 'TreeIter' is a more compact
    -- representation of a 'TreePath' which becomes invalid after each
    -- modification of the underlying model. An intelligent index that is adjusted
    -- with each update of the model to point to the same node (whenever possible)
    -- is 'Graphics.UI.Gtk.ModelView.TreeRowReference.TreeRowReference'.
    --
    type TreePath = [Int]

    newtype NativeTreePath = NativeTreePath (Ptr (NativeTreePath))
    {-# LINE 186 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}

    nativeTreePathFree :: NativeTreePath -> IO ()
    nativeTreePathFree :: NativeTreePath -> IO ()
    nativeTreePathFree =
      (\(NativeTreePath Ptr NativeTreePath
    arg1) -> Ptr NativeTreePath -> IO ()
    gtk_tree_path_free Ptr NativeTreePath
    arg1)
    {-# LINE 190 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}

    newTreePath :: TreePath -> IO NativeTreePath
    newTreePath :: TreePath -> IO NativeTreePath
    newTreePath TreePath
    path = do
      nativePath <- (Ptr NativeTreePath -> NativeTreePath)
    -> IO (Ptr NativeTreePath) -> IO NativeTreePath
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Ptr NativeTreePath -> NativeTreePath
    NativeTreePath IO (Ptr NativeTreePath)
    gtk_tree_path_new
    {-# LINE 194 "./Graphics/UI/Gtk/ModelView/Types.chs" #-}
      mapM_ ((\(NativeTreePath arg1) arg2 -> gtk_tree_path_append_index arg1 arg2) nativePath . fromIntegral) path
      return nativePath

    withTreePath :: TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath :: forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    withTreePath TreePath
    tp NativeTreePath -> IO a
    act = do
      nativePath <- TreePath -> IO NativeTreePath
    newTreePath TreePath
    tp
      res <- act nativePath
      nativeTreePathFree nativePath
      return res

    maybeWithTreePath :: Maybe TreePath -> (NativeTreePath -> IO a) -> IO a
    maybeWithTreePath :: forall a. Maybe TreePath -> (NativeTreePath -> IO a) -> IO a
    maybeWithTreePath Maybe TreePath
    mbTp NativeTreePath -> IO a
    act = IO a -> (TreePath -> IO a) -> Maybe TreePath -> IO a
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (NativeTreePath -> IO a
    act (Ptr NativeTreePath -> NativeTreePath
    NativeTreePath Ptr NativeTreePath
    forall a. Ptr a
    nullPtr)) (TreePath -> (NativeTreePath -> IO a) -> IO a
    forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
    `withTreePath` NativeTreePath -> IO a
    act) Maybe TreePath
    mbTp

    nativeTreePathGetIndices :: NativeTreePath -> IO [Int]
    nativeTreePathGetIndices :: NativeTreePath -> IO TreePath
    nativeTreePathGetIndices NativeTreePath
    tp = do
      depth <- (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
    $ (\(NativeTreePath Ptr NativeTreePath
    arg1) -> Ptr NativeTreePath -> IO CInt
    gtk_tree_path_get_depth Ptr NativeTreePath
    arg1) NativeTreePath
    tp
      arrayPtr <- (\(NativeTreePath Ptr NativeTreePath
    arg1) -> Ptr NativeTreePath -> IO (Ptr CInt)
    gtk_tree_path_get_indices Ptr NativeTreePath
    arg1) tp
      if (depth==0 || arrayPtr==nullPtr)
        then return []
        else liftM (map fromIntegral) $ peekArray depth arrayPtr

    -- | Convert the given pointer to a tree path.
    peekTreePath :: Ptr NativeTreePath -> IO TreePath
    peekTreePath :: Ptr NativeTreePath -> IO TreePath
    peekTreePath Ptr NativeTreePath
    tpPtr | Ptr NativeTreePath
    tpPtrPtr NativeTreePath -> Ptr NativeTreePath -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Ptr NativeTreePath
    forall a. Ptr a
    nullPtr = TreePath -> IO TreePath
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return []
                       | Bool
    otherwise =
      NativeTreePath -> IO TreePath
    nativeTreePathGetIndices (Ptr NativeTreePath -> NativeTreePath
    NativeTreePath Ptr NativeTreePath
    tpPtr)

    -- | Convert the given pointer to a tree path. Frees the pointer.
    fromTreePath :: Ptr NativeTreePath -> IO TreePath
    fromTreePath :: Ptr NativeTreePath -> IO TreePath
    fromTreePath Ptr NativeTreePath
    tpPtr | Ptr NativeTreePath
    tpPtrPtr NativeTreePath -> Ptr NativeTreePath -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Ptr NativeTreePath
    forall a. Ptr a
    nullPtr = TreePath -> IO TreePath
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return []
                       | Bool
    otherwise = do
      path <- NativeTreePath -> IO TreePath
    nativeTreePathGetIndices (Ptr NativeTreePath -> NativeTreePath
    NativeTreePath Ptr NativeTreePath
    tpPtr)
      nativeTreePathFree (NativeTreePath tpPtr)
      return path

    -- | Convert a comma or colon separated string into a 'TreePath'. Any
    -- non-digit characters are assumed to separate indices, thus, the function
    -- always is always successful.
    stringToTreePath :: DefaultGlibString -> TreePath
    stringToTreePath :: DefaultGlibString -> TreePath
    stringToTreePath = [Char] -> TreePath
    forall {a}. Num a => [Char] -> [a]
    stringToTreePath' ([Char] -> TreePath)
    -> (DefaultGlibString -> [Char]) -> DefaultGlibString -> TreePath
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . DefaultGlibString -> [Char]
    glibToString
      where
      stringToTreePath' :: [Char] -> [a]
    stringToTreePath' [Char]
    "" = []
      stringToTreePath' [Char]
    path = a -> [Char] -> [a]
    getNum a
    0 ((Char -> Bool) -> ShowS
    forall a. (a -> Bool) -> [a] -> [a]
    dropWhile (Bool -> Bool
    not (Bool -> Bool) -> (Char -> Bool) -> Char -> Bool
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> Bool
    isDigit) [Char]
    path)
      getNum :: a -> [Char] -> [a]
    getNum a
    acc (Char
    '0':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acc) [Char]
    xs
      getNum a
    acc (Char
    '1':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    1) [Char]
    xs
      getNum a
    acc (Char
    '2':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    2) [Char]
    xs
      getNum a
    acc (Char
    '3':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    3) [Char]
    xs
      getNum a
    acc (Char
    '4':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    4) [Char]
    xs
      getNum a
    acc (Char
    '5':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    5) [Char]
    xs
      getNum a
    acc (Char
    '6':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    6) [Char]
    xs
      getNum a
    acc (Char
    '7':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    7) [Char]
    xs
      getNum a
    acc (Char
    '8':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    8) [Char]
    xs
      getNum a
    acc (Char
    '9':[Char]
    xs) = a -> [Char] -> [a]
    getNum (a
    10a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    acca -> a -> a
    forall a. Num a => a -> a -> a
    +a
    9) [Char]
    xs
      getNum a
    acc [Char]
    xs = a
    acca -> [a] -> [a]
    forall a. a -> [a] -> [a]
    :[Char] -> [a]
    stringToTreePath' ((Char -> Bool) -> ShowS
    forall a. (a -> Bool) -> [a] -> [a]
    dropWhile (Bool -> Bool
    not (Bool -> Bool) -> (Char -> Bool) -> Char -> Bool
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> Bool
    isDigit) [Char]
    xs)

    -- | Accessing a row for a specific value. Used for 'ColumnMap'.
    data ColumnAccess row where
      CAInvalid :: ColumnAccess row
      CAInt     :: (row -> Int) -> ColumnAccess row
      CABool    :: (row -> Bool) -> ColumnAccess row
      CAString  :: GlibString string => (row -> string) -> ColumnAccess row
      CAPixbuf  :: (row -> Pixbuf) -> ColumnAccess row

    -- | The type of a tree column.
    data ColumnId row ty
      = ColumnId (GValue -> IO ty) ((row -> ty) -> ColumnAccess row) Int

    -- it shouldn't matter if the following function is actually inlined
    {-# NOINLINE comboQuark #-}
    comboQuark :: Quark
    comboQuark :: Quark
    comboQuark =
      IO Quark -> Quark
    forall a. IO a -> a
    unsafePerformIO (IO Quark -> Quark) -> IO Quark -> Quark
    forall a b. (a -> b) -> a -> b
    $ DefaultGlibString -> IO Quark
    forall string. GlibString string => string -> IO Quark
    quarkFromString (DefaultGlibString
    "comboBoxHaskellStringModelQuark"::DefaultGlibString)

    foreign import ccall unsafe "gtk_tree_path_free"
      gtk_tree_path_free :: ((Ptr NativeTreePath) -> (IO ()))

    foreign import ccall unsafe "gtk_tree_path_new"
      gtk_tree_path_new :: (IO (Ptr NativeTreePath))

    foreign import ccall unsafe "gtk_tree_path_append_index"
      gtk_tree_path_append_index :: ((Ptr NativeTreePath) -> (CInt -> (IO ())))

    foreign import ccall unsafe "gtk_tree_path_get_depth"
      gtk_tree_path_get_depth :: ((Ptr NativeTreePath) -> (IO CInt))

    foreign import ccall unsafe "gtk_tree_path_get_indices"
      gtk_tree_path_get_indices :: ((Ptr NativeTreePath) -> (IO (Ptr CInt)))