{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.TreeStore
(
TreeStore(..) ,
IsTreeStore ,
toTreeStore ,
#if defined(ENABLE_OVERLOADING)
ResolveTreeStoreMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TreeStoreAppendMethodInfo ,
#endif
treeStoreAppend ,
#if defined(ENABLE_OVERLOADING)
TreeStoreClearMethodInfo ,
#endif
treeStoreClear ,
#if defined(ENABLE_OVERLOADING)
TreeStoreInsertMethodInfo ,
#endif
treeStoreInsert ,
#if defined(ENABLE_OVERLOADING)
TreeStoreInsertAfterMethodInfo ,
#endif
treeStoreInsertAfter ,
#if defined(ENABLE_OVERLOADING)
TreeStoreInsertBeforeMethodInfo ,
#endif
treeStoreInsertBefore ,
#if defined(ENABLE_OVERLOADING)
TreeStoreInsertWithValuesMethodInfo ,
#endif
treeStoreInsertWithValues ,
#if defined(ENABLE_OVERLOADING)
TreeStoreIsAncestorMethodInfo ,
#endif
treeStoreIsAncestor ,
#if defined(ENABLE_OVERLOADING)
TreeStoreIterDepthMethodInfo ,
#endif
treeStoreIterDepth ,
#if defined(ENABLE_OVERLOADING)
TreeStoreIterIsValidMethodInfo ,
#endif
treeStoreIterIsValid ,
#if defined(ENABLE_OVERLOADING)
TreeStoreMoveAfterMethodInfo ,
#endif
treeStoreMoveAfter ,
#if defined(ENABLE_OVERLOADING)
TreeStoreMoveBeforeMethodInfo ,
#endif
treeStoreMoveBefore ,
treeStoreNew ,
#if defined(ENABLE_OVERLOADING)
TreeStorePrependMethodInfo ,
#endif
treeStorePrepend ,
#if defined(ENABLE_OVERLOADING)
TreeStoreRemoveMethodInfo ,
#endif
treeStoreRemove ,
#if defined(ENABLE_OVERLOADING)
TreeStoreSetMethodInfo ,
#endif
treeStoreSet ,
#if defined(ENABLE_OVERLOADING)
TreeStoreSetColumnTypesMethodInfo ,
#endif
treeStoreSetColumnTypes ,
#if defined(ENABLE_OVERLOADING)
TreeStoreSetValueMethodInfo ,
#endif
treeStoreSetValue ,
#if defined(ENABLE_OVERLOADING)
TreeStoreSwapMethodInfo ,
#endif
treeStoreSwap ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeDragDest as Gtk.TreeDragDest
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeDragSource as Gtk.TreeDragSource
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeSortable as Gtk.TreeSortable
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreeIter as Gtk.TreeIter
newtype TreeStore = TreeStore (SP.ManagedPtr TreeStore)
deriving (TreeStore -> TreeStore -> Bool
(TreeStore -> TreeStore -> Bool)
-> (TreeStore -> TreeStore -> Bool) -> Eq TreeStore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TreeStore -> TreeStore -> Bool
== :: TreeStore -> TreeStore -> Bool
$c/= :: TreeStore -> TreeStore -> Bool
/= :: TreeStore -> TreeStore -> Bool
Eq)
instance SP.ManagedPtrNewtype TreeStore where
toManagedPtr :: TreeStore -> ManagedPtr TreeStore
toManagedPtr (TreeStore ManagedPtr TreeStore
p) = ManagedPtr TreeStore
p
foreign import ccall "gtk_tree_store_get_type"
c_gtk_tree_store_get_type :: IO B.Types.GType
instance B.Types.TypedObject TreeStore where
glibType :: IO GType
glibType = IO GType
c_gtk_tree_store_get_type
instance B.Types.GObject TreeStore
class (SP.GObject o, O.IsDescendantOf TreeStore o) => IsTreeStore o
instance (SP.GObject o, O.IsDescendantOf TreeStore o) => IsTreeStore o
instance O.HasParentTypes TreeStore
type instance O.ParentTypes TreeStore = '[GObject.Object.Object, Gtk.Buildable.Buildable, Gtk.TreeDragDest.TreeDragDest, Gtk.TreeDragSource.TreeDragSource, Gtk.TreeModel.TreeModel, Gtk.TreeSortable.TreeSortable]
toTreeStore :: (MIO.MonadIO m, IsTreeStore o) => o -> m TreeStore
toTreeStore :: forall (m :: * -> *) o.
(MonadIO m, IsTreeStore o) =>
o -> m TreeStore
toTreeStore = IO TreeStore -> m TreeStore
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO TreeStore -> m TreeStore)
-> (o -> IO TreeStore) -> o -> m TreeStore
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TreeStore -> TreeStore) -> o -> IO TreeStore
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr TreeStore -> TreeStore
TreeStore
instance B.GValue.IsGValue (Maybe TreeStore) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_tree_store_get_type
gvalueSet_ :: Ptr GValue -> Maybe TreeStore -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TreeStore
P.Nothing = Ptr GValue -> Ptr TreeStore -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr TreeStore
forall a. Ptr a
FP.nullPtr :: FP.Ptr TreeStore)
gvalueSet_ Ptr GValue
gv (P.Just TreeStore
obj) = TreeStore -> (Ptr TreeStore -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TreeStore
obj (Ptr GValue -> Ptr TreeStore -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TreeStore)
gvalueGet_ Ptr GValue
gv = do
Ptr TreeStore
ptr <- Ptr GValue -> IO (Ptr TreeStore)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr TreeStore)
if Ptr TreeStore
ptr Ptr TreeStore -> Ptr TreeStore -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr TreeStore
forall a. Ptr a
FP.nullPtr
then TreeStore -> Maybe TreeStore
forall a. a -> Maybe a
P.Just (TreeStore -> Maybe TreeStore)
-> IO TreeStore -> IO (Maybe TreeStore)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr TreeStore -> TreeStore)
-> Ptr TreeStore -> IO TreeStore
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr TreeStore -> TreeStore
TreeStore Ptr TreeStore
ptr
else Maybe TreeStore -> IO (Maybe TreeStore)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TreeStore
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTreeStoreMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveTreeStoreMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveTreeStoreMethod "append" o = TreeStoreAppendMethodInfo
ResolveTreeStoreMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTreeStoreMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTreeStoreMethod "clear" o = TreeStoreClearMethodInfo
ResolveTreeStoreMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveTreeStoreMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveTreeStoreMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveTreeStoreMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveTreeStoreMethod "dragDataDelete" o = Gtk.TreeDragSource.TreeDragSourceDragDataDeleteMethodInfo
ResolveTreeStoreMethod "dragDataGet" o = Gtk.TreeDragSource.TreeDragSourceDragDataGetMethodInfo
ResolveTreeStoreMethod "dragDataReceived" o = Gtk.TreeDragDest.TreeDragDestDragDataReceivedMethodInfo
ResolveTreeStoreMethod "filterNew" o = Gtk.TreeModel.TreeModelFilterNewMethodInfo
ResolveTreeStoreMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTreeStoreMethod "foreach" o = Gtk.TreeModel.TreeModelForeachMethodInfo
ResolveTreeStoreMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTreeStoreMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTreeStoreMethod "hasDefaultSortFunc" o = Gtk.TreeSortable.TreeSortableHasDefaultSortFuncMethodInfo
ResolveTreeStoreMethod "insert" o = TreeStoreInsertMethodInfo
ResolveTreeStoreMethod "insertAfter" o = TreeStoreInsertAfterMethodInfo
ResolveTreeStoreMethod "insertBefore" o = TreeStoreInsertBeforeMethodInfo
ResolveTreeStoreMethod "insertWithValues" o = TreeStoreInsertWithValuesMethodInfo
ResolveTreeStoreMethod "isAncestor" o = TreeStoreIsAncestorMethodInfo
ResolveTreeStoreMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTreeStoreMethod "iterChildren" o = Gtk.TreeModel.TreeModelIterChildrenMethodInfo
ResolveTreeStoreMethod "iterDepth" o = TreeStoreIterDepthMethodInfo
ResolveTreeStoreMethod "iterHasChild" o = Gtk.TreeModel.TreeModelIterHasChildMethodInfo
ResolveTreeStoreMethod "iterIsValid" o = TreeStoreIterIsValidMethodInfo
ResolveTreeStoreMethod "iterNChildren" o = Gtk.TreeModel.TreeModelIterNChildrenMethodInfo
ResolveTreeStoreMethod "iterNext" o = Gtk.TreeModel.TreeModelIterNextMethodInfo
ResolveTreeStoreMethod "iterNthChild" o = Gtk.TreeModel.TreeModelIterNthChildMethodInfo
ResolveTreeStoreMethod "iterParent" o = Gtk.TreeModel.TreeModelIterParentMethodInfo
ResolveTreeStoreMethod "iterPrevious" o = Gtk.TreeModel.TreeModelIterPreviousMethodInfo
ResolveTreeStoreMethod "moveAfter" o = TreeStoreMoveAfterMethodInfo
ResolveTreeStoreMethod "moveBefore" o = TreeStoreMoveBeforeMethodInfo
ResolveTreeStoreMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTreeStoreMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTreeStoreMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveTreeStoreMethod "prepend" o = TreeStorePrependMethodInfo
ResolveTreeStoreMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTreeStoreMethod "refNode" o = Gtk.TreeModel.TreeModelRefNodeMethodInfo
ResolveTreeStoreMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTreeStoreMethod "remove" o = TreeStoreRemoveMethodInfo
ResolveTreeStoreMethod "rowChanged" o = Gtk.TreeModel.TreeModelRowChangedMethodInfo
ResolveTreeStoreMethod "rowDeleted" o = Gtk.TreeModel.TreeModelRowDeletedMethodInfo
ResolveTreeStoreMethod "rowDraggable" o = Gtk.TreeDragSource.TreeDragSourceRowDraggableMethodInfo
ResolveTreeStoreMethod "rowDropPossible" o = Gtk.TreeDragDest.TreeDragDestRowDropPossibleMethodInfo
ResolveTreeStoreMethod "rowHasChildToggled" o = Gtk.TreeModel.TreeModelRowHasChildToggledMethodInfo
ResolveTreeStoreMethod "rowInserted" o = Gtk.TreeModel.TreeModelRowInsertedMethodInfo
ResolveTreeStoreMethod "rowsReordered" o = Gtk.TreeModel.TreeModelRowsReorderedMethodInfo
ResolveTreeStoreMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTreeStoreMethod "set" o = TreeStoreSetMethodInfo
ResolveTreeStoreMethod "sortColumnChanged" o = Gtk.TreeSortable.TreeSortableSortColumnChangedMethodInfo
ResolveTreeStoreMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTreeStoreMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTreeStoreMethod "swap" o = TreeStoreSwapMethodInfo
ResolveTreeStoreMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTreeStoreMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTreeStoreMethod "unrefNode" o = Gtk.TreeModel.TreeModelUnrefNodeMethodInfo
ResolveTreeStoreMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTreeStoreMethod "getColumnType" o = Gtk.TreeModel.TreeModelGetColumnTypeMethodInfo
ResolveTreeStoreMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTreeStoreMethod "getFlags" o = Gtk.TreeModel.TreeModelGetFlagsMethodInfo
ResolveTreeStoreMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveTreeStoreMethod "getIter" o = Gtk.TreeModel.TreeModelGetIterMethodInfo
ResolveTreeStoreMethod "getIterFirst" o = Gtk.TreeModel.TreeModelGetIterFirstMethodInfo
ResolveTreeStoreMethod "getIterFromString" o = Gtk.TreeModel.TreeModelGetIterFromStringMethodInfo
ResolveTreeStoreMethod "getNColumns" o = Gtk.TreeModel.TreeModelGetNColumnsMethodInfo
ResolveTreeStoreMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo
ResolveTreeStoreMethod "getPath" o = Gtk.TreeModel.TreeModelGetPathMethodInfo
ResolveTreeStoreMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTreeStoreMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTreeStoreMethod "getSortColumnId" o = Gtk.TreeSortable.TreeSortableGetSortColumnIdMethodInfo
ResolveTreeStoreMethod "getStringFromIter" o = Gtk.TreeModel.TreeModelGetStringFromIterMethodInfo
ResolveTreeStoreMethod "getValue" o = Gtk.TreeModel.TreeModelGetValueMethodInfo
ResolveTreeStoreMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveTreeStoreMethod "setColumnTypes" o = TreeStoreSetColumnTypesMethodInfo
ResolveTreeStoreMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTreeStoreMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTreeStoreMethod "setDefaultSortFunc" o = Gtk.TreeSortable.TreeSortableSetDefaultSortFuncMethodInfo
ResolveTreeStoreMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
ResolveTreeStoreMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTreeStoreMethod "setSortColumnId" o = Gtk.TreeSortable.TreeSortableSetSortColumnIdMethodInfo
ResolveTreeStoreMethod "setSortFunc" o = Gtk.TreeSortable.TreeSortableSetSortFuncMethodInfo
ResolveTreeStoreMethod "setValue" o = TreeStoreSetValueMethodInfo
ResolveTreeStoreMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeStoreMethod t TreeStore, O.OverloadedMethod info TreeStore p) => OL.IsLabel t (TreeStore -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveTreeStoreMethod t TreeStore, O.OverloadedMethod info TreeStore p, R.HasField t TreeStore p) => R.HasField t TreeStore p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTreeStoreMethod t TreeStore, O.OverloadedMethodInfo info TreeStore) => OL.IsLabel t (O.MethodProxy info TreeStore) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TreeStore
type instance O.AttributeList TreeStore = TreeStoreAttributeList
type TreeStoreAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TreeStore = TreeStoreSignalList
type TreeStoreSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("rowChanged", Gtk.TreeModel.TreeModelRowChangedSignalInfo), '("rowDeleted", Gtk.TreeModel.TreeModelRowDeletedSignalInfo), '("rowHasChildToggled", Gtk.TreeModel.TreeModelRowHasChildToggledSignalInfo), '("rowInserted", Gtk.TreeModel.TreeModelRowInsertedSignalInfo), '("sortColumnChanged", Gtk.TreeSortable.TreeSortableSortColumnChangedSignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_tree_store_newv" gtk_tree_store_newv ::
Int32 ->
Ptr CGType ->
IO (Ptr TreeStore)
treeStoreNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
[GType]
-> m TreeStore
treeStoreNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[GType] -> m TreeStore
treeStoreNew [GType]
types = IO TreeStore -> m TreeStore
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeStore -> m TreeStore) -> IO TreeStore -> m TreeStore
forall a b. (a -> b) -> a -> b
$ do
let nColumns :: Int32
nColumns = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [GType] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [GType]
types
Ptr CGType
types' <- ((GType -> CGType) -> [GType] -> IO (Ptr CGType)
forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapStorableArray GType -> CGType
gtypeToCGType) [GType]
types
Ptr TreeStore
result <- Int32 -> Ptr CGType -> IO (Ptr TreeStore)
gtk_tree_store_newv Int32
nColumns Ptr CGType
types'
Text -> Ptr TreeStore -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"treeStoreNew" Ptr TreeStore
result
TreeStore
result' <- ((ManagedPtr TreeStore -> TreeStore)
-> Ptr TreeStore -> IO TreeStore
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr TreeStore -> TreeStore
TreeStore) Ptr TreeStore
result
Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
types'
TreeStore -> IO TreeStore
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeStore
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_tree_store_append" gtk_tree_store_append ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreAppend ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> m (Gtk.TreeIter.TreeIter)
treeStoreAppend :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> m TreeIter
treeStoreAppend a
treeStore Maybe TreeIter
parent = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_append Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStoreAppendMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreAppendMethodInfo a signature where
overloadedMethod = treeStoreAppend
instance O.OverloadedMethodInfo TreeStoreAppendMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreAppend",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreAppend"
})
#endif
foreign import ccall "gtk_tree_store_clear" gtk_tree_store_clear ::
Ptr TreeStore ->
IO ()
treeStoreClear ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> m ()
treeStoreClear :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> m ()
treeStoreClear a
treeStore = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeStore -> IO ()
gtk_tree_store_clear Ptr TreeStore
treeStore'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreClearMethodInfo a signature where
overloadedMethod = treeStoreClear
instance O.OverloadedMethodInfo TreeStoreClearMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreClear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreClear"
})
#endif
foreign import ccall "gtk_tree_store_insert" gtk_tree_store_insert ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
Int32 ->
IO ()
treeStoreInsert ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> Int32
-> m (Gtk.TreeIter.TreeIter)
treeStoreInsert :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> Int32 -> m TreeIter
treeStoreInsert a
treeStore Maybe TreeIter
parent Int32
position = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> Int32 -> IO ()
gtk_tree_store_insert Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent Int32
position
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStoreInsertMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> Int32 -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreInsertMethodInfo a signature where
overloadedMethod = treeStoreInsert
instance O.OverloadedMethodInfo TreeStoreInsertMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreInsert",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreInsert"
})
#endif
foreign import ccall "gtk_tree_store_insert_after" gtk_tree_store_insert_after ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreInsertAfter ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> Maybe (Gtk.TreeIter.TreeIter)
-> m (Gtk.TreeIter.TreeIter)
treeStoreInsertAfter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> Maybe TreeIter -> m TreeIter
treeStoreInsertAfter a
treeStore Maybe TreeIter
parent Maybe TreeIter
sibling = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr TreeIter
maybeSibling <- case Maybe TreeIter
sibling of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jSibling -> do
Ptr TreeIter
jSibling' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jSibling
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jSibling'
Ptr TreeStore
-> Ptr TreeIter -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_insert_after Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent Ptr TreeIter
maybeSibling
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
sibling TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStoreInsertAfterMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> Maybe (Gtk.TreeIter.TreeIter) -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreInsertAfterMethodInfo a signature where
overloadedMethod = treeStoreInsertAfter
instance O.OverloadedMethodInfo TreeStoreInsertAfterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreInsertAfter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreInsertAfter"
})
#endif
foreign import ccall "gtk_tree_store_insert_before" gtk_tree_store_insert_before ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreInsertBefore ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> Maybe (Gtk.TreeIter.TreeIter)
-> m (Gtk.TreeIter.TreeIter)
treeStoreInsertBefore :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> Maybe TreeIter -> m TreeIter
treeStoreInsertBefore a
treeStore Maybe TreeIter
parent Maybe TreeIter
sibling = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr TreeIter
maybeSibling <- case Maybe TreeIter
sibling of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jSibling -> do
Ptr TreeIter
jSibling' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jSibling
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jSibling'
Ptr TreeStore
-> Ptr TreeIter -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_insert_before Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent Ptr TreeIter
maybeSibling
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
sibling TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStoreInsertBeforeMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> Maybe (Gtk.TreeIter.TreeIter) -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreInsertBeforeMethodInfo a signature where
overloadedMethod = treeStoreInsertBefore
instance O.OverloadedMethodInfo TreeStoreInsertBeforeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreInsertBefore",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreInsertBefore"
})
#endif
foreign import ccall "gtk_tree_store_insert_with_valuesv" gtk_tree_store_insert_with_valuesv ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
Int32 ->
Ptr Int32 ->
Ptr B.GValue.GValue ->
Int32 ->
IO ()
treeStoreInsertWithValues ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> Int32
-> [Int32]
-> [GValue]
-> m (Gtk.TreeIter.TreeIter)
treeStoreInsertWithValues :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> Int32 -> [Int32] -> [GValue] -> m TreeIter
treeStoreInsertWithValues a
treeStore Maybe TreeIter
parent Int32
position [Int32]
columns [GValue]
values = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
let nValues :: Int32
nValues = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [GValue] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [GValue]
values
let columns_expected_length_ :: Int32
columns_expected_length_ = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Int32] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Int32]
columns
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Int32
columns_expected_length_ Int32 -> Int32 -> Bool
forall a. Eq a => a -> a -> Bool
/= Int32
nValues) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
[Char] -> IO ()
forall a. HasCallStack => [Char] -> a
error [Char]
"Gtk.treeStoreInsertWithValues : length of 'columns' does not agree with that of 'values'."
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr Int32
columns' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
columns
Ptr GValue
values' <- [GValue] -> IO (Ptr GValue)
B.GValue.packGValueArray [GValue]
values
Ptr TreeStore
-> Ptr TreeIter
-> Ptr TreeIter
-> Int32
-> Ptr Int32
-> Ptr GValue
-> Int32
-> IO ()
gtk_tree_store_insert_with_valuesv Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent Int32
position Ptr Int32
columns' Ptr GValue
values' Int32
nValues
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(GValue -> IO ()) -> [GValue] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [GValue]
values
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
columns'
Ptr GValue -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr GValue
values'
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStoreInsertWithValuesMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> Int32 -> [Int32] -> [GValue] -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreInsertWithValuesMethodInfo a signature where
overloadedMethod = treeStoreInsertWithValues
instance O.OverloadedMethodInfo TreeStoreInsertWithValuesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreInsertWithValues",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreInsertWithValues"
})
#endif
foreign import ccall "gtk_tree_store_is_ancestor" gtk_tree_store_is_ancestor ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO CInt
treeStoreIsAncestor ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> Gtk.TreeIter.TreeIter
-> m Bool
treeStoreIsAncestor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> TreeIter -> m Bool
treeStoreIsAncestor a
treeStore TreeIter
iter TreeIter
descendant = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr TreeIter
descendant' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
descendant
CInt
result <- Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO CInt
gtk_tree_store_is_ancestor Ptr TreeStore
treeStore' Ptr TreeIter
iter' Ptr TreeIter
descendant'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
descendant
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeStoreIsAncestorMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> Gtk.TreeIter.TreeIter -> m Bool), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreIsAncestorMethodInfo a signature where
overloadedMethod = treeStoreIsAncestor
instance O.OverloadedMethodInfo TreeStoreIsAncestorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreIsAncestor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreIsAncestor"
})
#endif
foreign import ccall "gtk_tree_store_iter_depth" gtk_tree_store_iter_depth ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
IO Int32
treeStoreIterDepth ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> m Int32
treeStoreIterDepth :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> m Int32
treeStoreIterDepth a
treeStore TreeIter
iter = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Int32
result <- Ptr TreeStore -> Ptr TreeIter -> IO Int32
gtk_tree_store_iter_depth Ptr TreeStore
treeStore' Ptr TreeIter
iter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TreeStoreIterDepthMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m Int32), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreIterDepthMethodInfo a signature where
overloadedMethod = treeStoreIterDepth
instance O.OverloadedMethodInfo TreeStoreIterDepthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreIterDepth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreIterDepth"
})
#endif
foreign import ccall "gtk_tree_store_iter_is_valid" gtk_tree_store_iter_is_valid ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
IO CInt
treeStoreIterIsValid ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> m Bool
treeStoreIterIsValid :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> m Bool
treeStoreIterIsValid a
treeStore TreeIter
iter = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
CInt
result <- Ptr TreeStore -> Ptr TreeIter -> IO CInt
gtk_tree_store_iter_is_valid Ptr TreeStore
treeStore' Ptr TreeIter
iter'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeStoreIterIsValidMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m Bool), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreIterIsValidMethodInfo a signature where
overloadedMethod = treeStoreIterIsValid
instance O.OverloadedMethodInfo TreeStoreIterIsValidMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreIterIsValid",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreIterIsValid"
})
#endif
foreign import ccall "gtk_tree_store_move_after" gtk_tree_store_move_after ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreMoveAfter ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> Maybe (Gtk.TreeIter.TreeIter)
-> m ()
treeStoreMoveAfter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> Maybe TreeIter -> m ()
treeStoreMoveAfter a
treeStore TreeIter
iter Maybe TreeIter
position = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr TreeIter
maybePosition <- case Maybe TreeIter
position of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jPosition -> do
Ptr TreeIter
jPosition' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jPosition
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jPosition'
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_move_after Ptr TreeStore
treeStore' Ptr TreeIter
iter' Ptr TreeIter
maybePosition
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
position TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreMoveAfterMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> Maybe (Gtk.TreeIter.TreeIter) -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreMoveAfterMethodInfo a signature where
overloadedMethod = treeStoreMoveAfter
instance O.OverloadedMethodInfo TreeStoreMoveAfterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreMoveAfter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreMoveAfter"
})
#endif
foreign import ccall "gtk_tree_store_move_before" gtk_tree_store_move_before ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreMoveBefore ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> Maybe (Gtk.TreeIter.TreeIter)
-> m ()
treeStoreMoveBefore :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> Maybe TreeIter -> m ()
treeStoreMoveBefore a
treeStore TreeIter
iter Maybe TreeIter
position = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr TreeIter
maybePosition <- case Maybe TreeIter
position of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jPosition -> do
Ptr TreeIter
jPosition' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jPosition
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jPosition'
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_move_before Ptr TreeStore
treeStore' Ptr TreeIter
iter' Ptr TreeIter
maybePosition
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
position TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreMoveBeforeMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> Maybe (Gtk.TreeIter.TreeIter) -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreMoveBeforeMethodInfo a signature where
overloadedMethod = treeStoreMoveBefore
instance O.OverloadedMethodInfo TreeStoreMoveBeforeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreMoveBefore",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreMoveBefore"
})
#endif
foreign import ccall "gtk_tree_store_prepend" gtk_tree_store_prepend ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStorePrepend ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Maybe (Gtk.TreeIter.TreeIter)
-> m (Gtk.TreeIter.TreeIter)
treeStorePrepend :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> Maybe TreeIter -> m TreeIter
treeStorePrepend a
treeStore Maybe TreeIter
parent = IO TreeIter -> m TreeIter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeIter -> m TreeIter) -> IO TreeIter -> m TreeIter
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gtk.TreeIter.TreeIter)
Ptr TreeIter
maybeParent <- case Maybe TreeIter
parent of
Maybe TreeIter
Nothing -> Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
forall a. Ptr a
nullPtr
Just TreeIter
jParent -> do
Ptr TreeIter
jParent' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
jParent
Ptr TreeIter -> IO (Ptr TreeIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeIter
jParent'
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_prepend Ptr TreeStore
treeStore' Ptr TreeIter
iter Ptr TreeIter
maybeParent
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreeIter -> TreeIter
Gtk.TreeIter.TreeIter) Ptr TreeIter
iter
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Maybe TreeIter -> (TreeIter -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TreeIter
parent TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
TreeIter -> IO TreeIter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TreeIter
iter'
#if defined(ENABLE_OVERLOADING)
data TreeStorePrependMethodInfo
instance (signature ~ (Maybe (Gtk.TreeIter.TreeIter) -> m (Gtk.TreeIter.TreeIter)), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStorePrependMethodInfo a signature where
overloadedMethod = treeStorePrepend
instance O.OverloadedMethodInfo TreeStorePrependMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStorePrepend",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStorePrepend"
})
#endif
foreign import ccall "gtk_tree_store_remove" gtk_tree_store_remove ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
IO CInt
treeStoreRemove ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> m Bool
treeStoreRemove :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> m Bool
treeStoreRemove a
treeStore TreeIter
iter = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
CInt
result <- Ptr TreeStore -> Ptr TreeIter -> IO CInt
gtk_tree_store_remove Ptr TreeStore
treeStore' Ptr TreeIter
iter'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeStoreRemoveMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m Bool), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreRemoveMethodInfo a signature where
overloadedMethod = treeStoreRemove
instance O.OverloadedMethodInfo TreeStoreRemoveMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreRemove",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreRemove"
})
#endif
foreign import ccall "gtk_tree_store_set_column_types" gtk_tree_store_set_column_types ::
Ptr TreeStore ->
Int32 ->
Ptr CGType ->
IO ()
treeStoreSetColumnTypes ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> [GType]
-> m ()
treeStoreSetColumnTypes :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> [GType] -> m ()
treeStoreSetColumnTypes a
treeStore [GType]
types = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let nColumns :: Int32
nColumns = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [GType] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [GType]
types
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr CGType
types' <- ((GType -> CGType) -> [GType] -> IO (Ptr CGType)
forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapStorableArray GType -> CGType
gtypeToCGType) [GType]
types
Ptr TreeStore -> Int32 -> Ptr CGType -> IO ()
gtk_tree_store_set_column_types Ptr TreeStore
treeStore' Int32
nColumns Ptr CGType
types'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
types'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreSetColumnTypesMethodInfo
instance (signature ~ ([GType] -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreSetColumnTypesMethodInfo a signature where
overloadedMethod = treeStoreSetColumnTypes
instance O.OverloadedMethodInfo TreeStoreSetColumnTypesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreSetColumnTypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreSetColumnTypes"
})
#endif
foreign import ccall "gtk_tree_store_set_value" gtk_tree_store_set_value ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Int32 ->
Ptr GValue ->
IO ()
treeStoreSetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> Int32
-> GValue
-> m ()
treeStoreSetValue :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> Int32 -> GValue -> m ()
treeStoreSetValue a
treeStore TreeIter
iter Int32
column GValue
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
Ptr TreeStore -> Ptr TreeIter -> Int32 -> Ptr GValue -> IO ()
gtk_tree_store_set_value Ptr TreeStore
treeStore' Ptr TreeIter
iter' Int32
column Ptr GValue
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreSetValueMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> Int32 -> GValue -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreSetValueMethodInfo a signature where
overloadedMethod = treeStoreSetValue
instance O.OverloadedMethodInfo TreeStoreSetValueMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreSetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreSetValue"
})
#endif
foreign import ccall "gtk_tree_store_set_valuesv" gtk_tree_store_set_valuesv ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Int32 ->
Ptr B.GValue.GValue ->
Int32 ->
IO ()
treeStoreSet ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> [Int32]
-> [GValue]
-> m ()
treeStoreSet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> [Int32] -> [GValue] -> m ()
treeStoreSet a
treeStore TreeIter
iter [Int32]
columns [GValue]
values = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let nValues :: Int32
nValues = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [GValue] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [GValue]
values
let columns_expected_length_ :: Int32
columns_expected_length_ = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Int32] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Int32]
columns
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Int32
columns_expected_length_ Int32 -> Int32 -> Bool
forall a. Eq a => a -> a -> Bool
/= Int32
nValues) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
[Char] -> IO ()
forall a. HasCallStack => [Char] -> a
error [Char]
"Gtk.treeStoreSet : length of 'columns' does not agree with that of 'values'."
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr Int32
columns' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
columns
Ptr GValue
values' <- [GValue] -> IO (Ptr GValue)
B.GValue.packGValueArray [GValue]
values
Ptr TreeStore
-> Ptr TreeIter -> Ptr Int32 -> Ptr GValue -> Int32 -> IO ()
gtk_tree_store_set_valuesv Ptr TreeStore
treeStore' Ptr TreeIter
iter' Ptr Int32
columns' Ptr GValue
values' Int32
nValues
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
(GValue -> IO ()) -> [GValue] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [GValue]
values
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
columns'
Ptr GValue -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr GValue
values'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreSetMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> [Int32] -> [GValue] -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreSetMethodInfo a signature where
overloadedMethod = treeStoreSet
instance O.OverloadedMethodInfo TreeStoreSetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreSet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreSet"
})
#endif
foreign import ccall "gtk_tree_store_swap" gtk_tree_store_swap ::
Ptr TreeStore ->
Ptr Gtk.TreeIter.TreeIter ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeStoreSwap ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeStore a) =>
a
-> Gtk.TreeIter.TreeIter
-> Gtk.TreeIter.TreeIter
-> m ()
treeStoreSwap :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTreeStore a) =>
a -> TreeIter -> TreeIter -> m ()
treeStoreSwap a
treeStore TreeIter
a TreeIter
b = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeStore
treeStore' <- a -> IO (Ptr TreeStore)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeStore
Ptr TreeIter
a' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
a
Ptr TreeIter
b' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
b
Ptr TreeStore -> Ptr TreeIter -> Ptr TreeIter -> IO ()
gtk_tree_store_swap Ptr TreeStore
treeStore' Ptr TreeIter
a' Ptr TreeIter
b'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeStore
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
a
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
b
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeStoreSwapMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> Gtk.TreeIter.TreeIter -> m ()), MonadIO m, IsTreeStore a) => O.OverloadedMethod TreeStoreSwapMethodInfo a signature where
overloadedMethod = treeStoreSwap
instance O.OverloadedMethodInfo TreeStoreSwapMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.TreeStore.treeStoreSwap",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-TreeStore.html#v:treeStoreSwap"
})
#endif