{-# LINE 2 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
module Graphics.UI.Gtk.ModelView.TreeModelSort (
TreeModelSort,
TreeModelSortClass,
castToTreeModelSort, gTypeTreeModelSort,
toTreeModelSort,
TypedTreeModelSort,
treeModelSortNewWithModel,
treeModelSortGetModel,
treeModelSortConvertChildPathToPath,
treeModelSortConvertPathToChildPath,
treeModelSortConvertChildIterToIter,
treeModelSortConvertIterToChildIter,
treeModelSortResetDefaultSortFunc,
treeModelSortClearCache,
treeModelSortIterIsValid,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import Graphics.UI.Gtk.Types
{-# LINE 73 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
import Graphics.UI.Gtk.ModelView.TreeModel
{-# LINE 74 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
import Graphics.UI.Gtk.ModelView.Types
{-# LINE 75 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
{-# LINE 77 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
instance TreeModelClass (TypedTreeModelSort a)
instance TreeModelSortClass (TypedTreeModelSort a)
instance GObjectClass (TypedTreeModelSort a) where
toGObject :: TypedTreeModelSort a -> GObject
toGObject (TypedTreeModelSort ForeignPtr (TypedTreeModelSort a)
tm) = ForeignPtr GObject -> GObject
GObject (ForeignPtr (TypedTreeModelSort a) -> ForeignPtr GObject
forall a b. ForeignPtr a -> ForeignPtr b
castForeignPtr ForeignPtr (TypedTreeModelSort a)
tm)
unsafeCastGObject :: GObject -> TypedTreeModelSort a
unsafeCastGObject = ForeignPtr (TypedTreeModelSort a) -> TypedTreeModelSort a
forall row.
ForeignPtr (TypedTreeModelSort row) -> TypedTreeModelSort row
TypedTreeModelSort (ForeignPtr (TypedTreeModelSort a) -> TypedTreeModelSort a)
-> (GObject -> ForeignPtr (TypedTreeModelSort a))
-> GObject
-> TypedTreeModelSort a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ForeignPtr GObject -> ForeignPtr (TypedTreeModelSort a)
forall a b. ForeignPtr a -> ForeignPtr b
castForeignPtr (ForeignPtr GObject -> ForeignPtr (TypedTreeModelSort a))
-> (GObject -> ForeignPtr GObject)
-> GObject
-> ForeignPtr (TypedTreeModelSort a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GObject -> ForeignPtr GObject
unGObject
instance TreeSortableClass TreeModelSort
instance TreeSortableClass (TypedTreeModelSort row)
treeModelSortNewWithModel :: (TreeModelClass (childModel row),
TypedTreeModelClass childModel) =>
childModel row -> IO (TypedTreeModelSort row)
treeModelSortNewWithModel :: forall (childModel :: * -> *) row.
(TreeModelClass (childModel row),
TypedTreeModelClass childModel) =>
childModel row -> IO (TypedTreeModelSort row)
treeModelSortNewWithModel childModel row
childModel = (TreeModelSort -> TypedTreeModelSort row)
-> IO TreeModelSort -> IO (TypedTreeModelSort row)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM TreeModelSort -> TypedTreeModelSort row
forall row. TreeModelSort -> TypedTreeModelSort row
unsafeTreeModelSortToGeneric (IO TreeModelSort -> IO (TypedTreeModelSort row))
-> IO TreeModelSort -> IO (TypedTreeModelSort row)
forall a b. (a -> b) -> a -> b
$
(ForeignPtr TreeModelSort -> TreeModelSort,
FinalizerPtr TreeModelSort)
-> IO (Ptr TreeModelSort) -> IO TreeModelSort
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr TreeModelSort -> TreeModelSort,
FinalizerPtr TreeModelSort)
forall {a}.
(ForeignPtr TreeModelSort -> TreeModelSort, FinalizerPtr a)
mkTreeModelSort (IO (Ptr TreeModelSort) -> IO TreeModelSort)
-> IO (Ptr TreeModelSort) -> IO TreeModelSort
forall a b. (a -> b) -> a -> b
$
(Ptr TreeModel -> Ptr TreeModelSort)
-> IO (Ptr TreeModel) -> IO (Ptr TreeModelSort)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr TreeModel -> Ptr TreeModelSort
forall a b. Ptr a -> Ptr b
castPtr :: Ptr TreeModel -> Ptr TreeModelSort) (IO (Ptr TreeModel) -> IO (Ptr TreeModelSort))
-> IO (Ptr TreeModel) -> IO (Ptr TreeModelSort)
forall a b. (a -> b) -> a -> b
$
(\(TreeModel ForeignPtr TreeModel
arg1) -> ForeignPtr TreeModel
-> (Ptr TreeModel -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModel
arg1 ((Ptr TreeModel -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel))
-> (Ptr TreeModel -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModel
argPtr1 ->Ptr TreeModel -> IO (Ptr TreeModel)
gtk_tree_model_sort_new_with_model Ptr TreeModel
argPtr1)
{-# LINE 99 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModel childModel)
treeModelSortGetModel :: TreeModelSortClass self => self -> IO TreeModel
treeModelSortGetModel :: forall self. TreeModelSortClass self => self -> IO TreeModel
treeModelSortGetModel self
self =
(ForeignPtr TreeModel -> TreeModel, FinalizerPtr TreeModel)
-> IO (Ptr TreeModel) -> IO TreeModel
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr TreeModel -> TreeModel, FinalizerPtr TreeModel)
forall {a}. (ForeignPtr TreeModel -> TreeModel, FinalizerPtr a)
mkTreeModel (IO (Ptr TreeModel) -> IO TreeModel)
-> IO (Ptr TreeModel) -> IO TreeModel
forall a b. (a -> b) -> a -> b
$
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) -> ForeignPtr TreeModelSort
-> (Ptr TreeModelSort -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel))
-> (Ptr TreeModelSort -> IO (Ptr TreeModel)) -> IO (Ptr TreeModel)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> IO (Ptr TreeModel)
gtk_tree_model_sort_get_model Ptr TreeModelSort
argPtr1)
{-# LINE 110 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
treeModelSortConvertChildPathToPath :: TreeModelSortClass self => self
-> TreePath
-> IO TreePath
treeModelSortConvertChildPathToPath :: forall self.
TreeModelSortClass self =>
self -> TreePath -> IO TreePath
treeModelSortConvertChildPathToPath self
self [] = TreePath -> IO TreePath
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return []
treeModelSortConvertChildPathToPath self
self TreePath
childPath =
TreePath -> (NativeTreePath -> IO TreePath) -> IO TreePath
forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
withTreePath TreePath
childPath ((NativeTreePath -> IO TreePath) -> IO TreePath)
-> (NativeTreePath -> IO TreePath) -> IO TreePath
forall a b. (a -> b) -> a -> b
$ \NativeTreePath
childPath ->
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) (NativeTreePath Ptr NativeTreePath
arg2) -> ForeignPtr TreeModelSort
-> (Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath))
-> (Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> Ptr NativeTreePath -> IO (Ptr NativeTreePath)
gtk_tree_model_sort_convert_child_path_to_path Ptr TreeModelSort
argPtr1 Ptr NativeTreePath
arg2)
{-# LINE 124 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
NativeTreePath
childPath
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
treeModelSortConvertPathToChildPath :: TreeModelSortClass self => self
-> TreePath
-> IO TreePath
treeModelSortConvertPathToChildPath :: forall self.
TreeModelSortClass self =>
self -> TreePath -> IO TreePath
treeModelSortConvertPathToChildPath self
self [] = TreePath -> IO TreePath
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return []
treeModelSortConvertPathToChildPath self
self TreePath
sortedPath =
TreePath -> (NativeTreePath -> IO TreePath) -> IO TreePath
forall a. TreePath -> (NativeTreePath -> IO a) -> IO a
withTreePath TreePath
sortedPath ((NativeTreePath -> IO TreePath) -> IO TreePath)
-> (NativeTreePath -> IO TreePath) -> IO TreePath
forall a b. (a -> b) -> a -> b
$ \NativeTreePath
sortedPath ->
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) (NativeTreePath Ptr NativeTreePath
arg2) -> ForeignPtr TreeModelSort
-> (Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath))
-> (Ptr TreeModelSort -> IO (Ptr NativeTreePath))
-> IO (Ptr NativeTreePath)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> Ptr NativeTreePath -> IO (Ptr NativeTreePath)
gtk_tree_model_sort_convert_path_to_child_path Ptr TreeModelSort
argPtr1 Ptr NativeTreePath
arg2)
{-# LINE 140 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
NativeTreePath
sortedPath
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
treeModelSortConvertChildIterToIter :: TreeModelSortClass self => self
-> TreeIter
-> IO TreeIter
treeModelSortConvertChildIterToIter :: forall self.
TreeModelSortClass self =>
self -> TreeIter -> IO TreeIter
treeModelSortConvertChildIterToIter self
self TreeIter
childIter =
TreeIter -> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with TreeIter
childIter ((Ptr TreeIter -> IO TreeIter) -> IO TreeIter)
-> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. (a -> b) -> a -> b
$ \Ptr TreeIter
childIterPtr ->
(Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeIter -> IO TreeIter) -> IO TreeIter)
-> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. (a -> b) -> a -> b
$ \Ptr TreeIter
sortIterPtr -> do
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) Ptr TreeIter
arg2 Ptr TreeIter
arg3 -> ForeignPtr TreeModelSort
-> (Ptr TreeModelSort -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO CInt) -> IO CInt)
-> (Ptr TreeModelSort -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> Ptr TreeIter -> Ptr TreeIter -> IO CInt
gtk_tree_model_sort_convert_child_iter_to_iter Ptr TreeModelSort
argPtr1 Ptr TreeIter
arg2 Ptr TreeIter
arg3)
{-# LINE 154 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
Ptr TreeIter
sortIterPtr
Ptr TreeIter
childIterPtr
Ptr TreeIter -> IO TreeIter
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeIter
sortIterPtr
treeModelSortConvertIterToChildIter :: TreeModelSortClass self => self
-> TreeIter
-> IO TreeIter
treeModelSortConvertIterToChildIter :: forall self.
TreeModelSortClass self =>
self -> TreeIter -> IO TreeIter
treeModelSortConvertIterToChildIter self
self TreeIter
sortedIter =
TreeIter -> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with TreeIter
sortedIter ((Ptr TreeIter -> IO TreeIter) -> IO TreeIter)
-> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. (a -> b) -> a -> b
$ \Ptr TreeIter
sortedIterPtr ->
(Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeIter -> IO TreeIter) -> IO TreeIter)
-> (Ptr TreeIter -> IO TreeIter) -> IO TreeIter
forall a b. (a -> b) -> a -> b
$ \Ptr TreeIter
childIterPtr -> do
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) Ptr TreeIter
arg2 Ptr TreeIter
arg3 -> ForeignPtr TreeModelSort -> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO ()) -> IO ())
-> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_model_sort_convert_iter_to_child_iter Ptr TreeModelSort
argPtr1 Ptr TreeIter
arg2 Ptr TreeIter
arg3)
{-# LINE 169 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
Ptr TreeIter
childIterPtr
Ptr TreeIter
sortedIterPtr
Ptr TreeIter -> IO TreeIter
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeIter
childIterPtr
treeModelSortResetDefaultSortFunc :: TreeModelSortClass self => self -> IO ()
treeModelSortResetDefaultSortFunc :: forall self. TreeModelSortClass self => self -> IO ()
treeModelSortResetDefaultSortFunc self
self =
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) -> ForeignPtr TreeModelSort -> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO ()) -> IO ())
-> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> IO ()
gtk_tree_model_sort_reset_default_sort_func Ptr TreeModelSort
argPtr1)
{-# LINE 180 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
treeModelSortClearCache :: TreeModelSortClass self => self -> IO ()
treeModelSortClearCache :: forall self. TreeModelSortClass self => self -> IO ()
treeModelSortClearCache self
self =
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) -> ForeignPtr TreeModelSort -> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO ()) -> IO ())
-> (Ptr TreeModelSort -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> IO ()
gtk_tree_model_sort_clear_cache Ptr TreeModelSort
argPtr1)
{-# LINE 194 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
treeModelSortIterIsValid :: TreeModelSortClass self => self
-> TreeIter
-> IO Bool
treeModelSortIterIsValid :: forall self. TreeModelSortClass self => self -> TreeIter -> IO Bool
treeModelSortIterIsValid 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 ->
(\(TreeModelSort ForeignPtr TreeModelSort
arg1) Ptr TreeIter
arg2 -> ForeignPtr TreeModelSort
-> (Ptr TreeModelSort -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr TreeModelSort
arg1 ((Ptr TreeModelSort -> IO CInt) -> IO CInt)
-> (Ptr TreeModelSort -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModelSort
argPtr1 ->Ptr TreeModelSort -> Ptr TreeIter -> IO CInt
gtk_tree_model_sort_iter_is_valid Ptr TreeModelSort
argPtr1 Ptr TreeIter
arg2)
{-# LINE 212 "./Graphics/UI/Gtk/ModelView/TreeModelSort.chs" #-}
(toTreeModelSort self)
Ptr TreeIter
iterPtr
foreign import ccall safe "gtk_tree_model_sort_new_with_model"
gtk_tree_model_sort_new_with_model :: ((Ptr TreeModel) -> (IO (Ptr TreeModel)))
foreign import ccall safe "gtk_tree_model_sort_get_model"
gtk_tree_model_sort_get_model :: ((Ptr TreeModelSort) -> (IO (Ptr TreeModel)))
foreign import ccall safe "gtk_tree_model_sort_convert_child_path_to_path"
gtk_tree_model_sort_convert_child_path_to_path :: ((Ptr TreeModelSort) -> ((Ptr NativeTreePath) -> (IO (Ptr NativeTreePath))))
foreign import ccall safe "gtk_tree_model_sort_convert_path_to_child_path"
gtk_tree_model_sort_convert_path_to_child_path :: ((Ptr TreeModelSort) -> ((Ptr NativeTreePath) -> (IO (Ptr NativeTreePath))))
foreign import ccall safe "gtk_tree_model_sort_convert_child_iter_to_iter"
gtk_tree_model_sort_convert_child_iter_to_iter :: ((Ptr TreeModelSort) -> ((Ptr TreeIter) -> ((Ptr TreeIter) -> (IO CInt))))
foreign import ccall safe "gtk_tree_model_sort_convert_iter_to_child_iter"
gtk_tree_model_sort_convert_iter_to_child_iter :: ((Ptr TreeModelSort) -> ((Ptr TreeIter) -> ((Ptr TreeIter) -> (IO ()))))
foreign import ccall safe "gtk_tree_model_sort_reset_default_sort_func"
gtk_tree_model_sort_reset_default_sort_func :: ((Ptr TreeModelSort) -> (IO ()))
foreign import ccall safe "gtk_tree_model_sort_clear_cache"
gtk_tree_model_sort_clear_cache :: ((Ptr TreeModelSort) -> (IO ()))
foreign import ccall safe "gtk_tree_model_sort_iter_is_valid"
gtk_tree_model_sort_iter_is_valid :: ((Ptr TreeModelSort) -> ((Ptr TreeIter) -> (IO CInt)))