{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.TreeSelection
(
TreeSelection(..) ,
IsTreeSelection ,
toTreeSelection ,
noTreeSelection ,
#if defined(ENABLE_OVERLOADING)
ResolveTreeSelectionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TreeSelectionCountSelectedRowsMethodInfo,
#endif
treeSelectionCountSelectedRows ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionGetModeMethodInfo ,
#endif
treeSelectionGetMode ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionGetSelectedMethodInfo ,
#endif
treeSelectionGetSelected ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionGetSelectedRowsMethodInfo ,
#endif
treeSelectionGetSelectedRows ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionGetTreeViewMethodInfo ,
#endif
treeSelectionGetTreeView ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionIterIsSelectedMethodInfo ,
#endif
treeSelectionIterIsSelected ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionPathIsSelectedMethodInfo ,
#endif
treeSelectionPathIsSelected ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSelectAllMethodInfo ,
#endif
treeSelectionSelectAll ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSelectIterMethodInfo ,
#endif
treeSelectionSelectIter ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSelectPathMethodInfo ,
#endif
treeSelectionSelectPath ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSelectRangeMethodInfo ,
#endif
treeSelectionSelectRange ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSelectedForeachMethodInfo ,
#endif
treeSelectionSelectedForeach ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSetModeMethodInfo ,
#endif
treeSelectionSetMode ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionSetSelectFunctionMethodInfo,
#endif
treeSelectionSetSelectFunction ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionUnselectAllMethodInfo ,
#endif
treeSelectionUnselectAll ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionUnselectIterMethodInfo ,
#endif
treeSelectionUnselectIter ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionUnselectPathMethodInfo ,
#endif
treeSelectionUnselectPath ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionUnselectRangeMethodInfo ,
#endif
treeSelectionUnselectRange ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionModePropertyInfo ,
#endif
constructTreeSelectionMode ,
getTreeSelectionMode ,
setTreeSelectionMode ,
#if defined(ENABLE_OVERLOADING)
treeSelectionMode ,
#endif
C_TreeSelectionChangedCallback ,
TreeSelectionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
TreeSelectionChangedSignalInfo ,
#endif
afterTreeSelectionChanged ,
genClosure_TreeSelectionChanged ,
mk_TreeSelectionChangedCallback ,
noTreeSelectionChangedCallback ,
onTreeSelectionChanged ,
wrap_TreeSelectionChangedCallback ,
) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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 Data.Text as T
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 GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel
import {-# SOURCE #-} qualified GI.Gtk.Objects.TreeView as Gtk.TreeView
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreeIter as Gtk.TreeIter
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreePath as Gtk.TreePath
newtype TreeSelection = TreeSelection (ManagedPtr TreeSelection)
deriving (TreeSelection -> TreeSelection -> Bool
(TreeSelection -> TreeSelection -> Bool)
-> (TreeSelection -> TreeSelection -> Bool) -> Eq TreeSelection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TreeSelection -> TreeSelection -> Bool
$c/= :: TreeSelection -> TreeSelection -> Bool
== :: TreeSelection -> TreeSelection -> Bool
$c== :: TreeSelection -> TreeSelection -> Bool
Eq)
foreign import ccall "gtk_tree_selection_get_type"
c_gtk_tree_selection_get_type :: IO GType
instance GObject TreeSelection where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_tree_selection_get_type
instance B.GValue.IsGValue TreeSelection where
toGValue :: TreeSelection -> IO GValue
toGValue o :: TreeSelection
o = do
GType
gtype <- IO GType
c_gtk_tree_selection_get_type
TreeSelection -> (Ptr TreeSelection -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TreeSelection
o (GType
-> (GValue -> Ptr TreeSelection -> IO ())
-> Ptr TreeSelection
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr TreeSelection -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO TreeSelection
fromGValue gv :: GValue
gv = do
Ptr TreeSelection
ptr <- GValue -> IO (Ptr TreeSelection)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr TreeSelection)
(ManagedPtr TreeSelection -> TreeSelection)
-> Ptr TreeSelection -> IO TreeSelection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr TreeSelection -> TreeSelection
TreeSelection Ptr TreeSelection
ptr
class (GObject o, O.IsDescendantOf TreeSelection o) => IsTreeSelection o
instance (GObject o, O.IsDescendantOf TreeSelection o) => IsTreeSelection o
instance O.HasParentTypes TreeSelection
type instance O.ParentTypes TreeSelection = '[GObject.Object.Object]
toTreeSelection :: (MonadIO m, IsTreeSelection o) => o -> m TreeSelection
toTreeSelection :: o -> m TreeSelection
toTreeSelection = IO TreeSelection -> m TreeSelection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeSelection -> m TreeSelection)
-> (o -> IO TreeSelection) -> o -> m TreeSelection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TreeSelection -> TreeSelection)
-> o -> IO TreeSelection
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr TreeSelection -> TreeSelection
TreeSelection
noTreeSelection :: Maybe TreeSelection
noTreeSelection :: Maybe TreeSelection
noTreeSelection = Maybe TreeSelection
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTreeSelectionMethod (t :: Symbol) (o :: *) :: * where
ResolveTreeSelectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTreeSelectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTreeSelectionMethod "countSelectedRows" o = TreeSelectionCountSelectedRowsMethodInfo
ResolveTreeSelectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTreeSelectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTreeSelectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTreeSelectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTreeSelectionMethod "iterIsSelected" o = TreeSelectionIterIsSelectedMethodInfo
ResolveTreeSelectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTreeSelectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTreeSelectionMethod "pathIsSelected" o = TreeSelectionPathIsSelectedMethodInfo
ResolveTreeSelectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTreeSelectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTreeSelectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTreeSelectionMethod "selectAll" o = TreeSelectionSelectAllMethodInfo
ResolveTreeSelectionMethod "selectIter" o = TreeSelectionSelectIterMethodInfo
ResolveTreeSelectionMethod "selectPath" o = TreeSelectionSelectPathMethodInfo
ResolveTreeSelectionMethod "selectRange" o = TreeSelectionSelectRangeMethodInfo
ResolveTreeSelectionMethod "selectedForeach" o = TreeSelectionSelectedForeachMethodInfo
ResolveTreeSelectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTreeSelectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTreeSelectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTreeSelectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTreeSelectionMethod "unselectAll" o = TreeSelectionUnselectAllMethodInfo
ResolveTreeSelectionMethod "unselectIter" o = TreeSelectionUnselectIterMethodInfo
ResolveTreeSelectionMethod "unselectPath" o = TreeSelectionUnselectPathMethodInfo
ResolveTreeSelectionMethod "unselectRange" o = TreeSelectionUnselectRangeMethodInfo
ResolveTreeSelectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTreeSelectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTreeSelectionMethod "getMode" o = TreeSelectionGetModeMethodInfo
ResolveTreeSelectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTreeSelectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTreeSelectionMethod "getSelected" o = TreeSelectionGetSelectedMethodInfo
ResolveTreeSelectionMethod "getSelectedRows" o = TreeSelectionGetSelectedRowsMethodInfo
ResolveTreeSelectionMethod "getTreeView" o = TreeSelectionGetTreeViewMethodInfo
ResolveTreeSelectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTreeSelectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTreeSelectionMethod "setMode" o = TreeSelectionSetModeMethodInfo
ResolveTreeSelectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTreeSelectionMethod "setSelectFunction" o = TreeSelectionSetSelectFunctionMethodInfo
ResolveTreeSelectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeSelectionMethod t TreeSelection, O.MethodInfo info TreeSelection p) => OL.IsLabel t (TreeSelection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type TreeSelectionChangedCallback =
IO ()
noTreeSelectionChangedCallback :: Maybe TreeSelectionChangedCallback
noTreeSelectionChangedCallback :: Maybe (IO ())
noTreeSelectionChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_TreeSelectionChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TreeSelectionChangedCallback :: C_TreeSelectionChangedCallback -> IO (FunPtr C_TreeSelectionChangedCallback)
genClosure_TreeSelectionChanged :: MonadIO m => TreeSelectionChangedCallback -> m (GClosure C_TreeSelectionChangedCallback)
genClosure_TreeSelectionChanged :: IO () -> m (GClosure C_TreeSelectionChangedCallback)
genClosure_TreeSelectionChanged cb :: IO ()
cb = IO (GClosure C_TreeSelectionChangedCallback)
-> m (GClosure C_TreeSelectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TreeSelectionChangedCallback)
-> m (GClosure C_TreeSelectionChangedCallback))
-> IO (GClosure C_TreeSelectionChangedCallback)
-> m (GClosure C_TreeSelectionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSelectionChangedCallback
cb' = IO () -> C_TreeSelectionChangedCallback
wrap_TreeSelectionChangedCallback IO ()
cb
C_TreeSelectionChangedCallback
-> IO (FunPtr C_TreeSelectionChangedCallback)
mk_TreeSelectionChangedCallback C_TreeSelectionChangedCallback
cb' IO (FunPtr C_TreeSelectionChangedCallback)
-> (FunPtr C_TreeSelectionChangedCallback
-> IO (GClosure C_TreeSelectionChangedCallback))
-> IO (GClosure C_TreeSelectionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TreeSelectionChangedCallback
-> IO (GClosure C_TreeSelectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TreeSelectionChangedCallback ::
TreeSelectionChangedCallback ->
C_TreeSelectionChangedCallback
wrap_TreeSelectionChangedCallback :: IO () -> C_TreeSelectionChangedCallback
wrap_TreeSelectionChangedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onTreeSelectionChanged :: (IsTreeSelection a, MonadIO m) => a -> TreeSelectionChangedCallback -> m SignalHandlerId
onTreeSelectionChanged :: a -> IO () -> m SignalHandlerId
onTreeSelectionChanged obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSelectionChangedCallback
cb' = IO () -> C_TreeSelectionChangedCallback
wrap_TreeSelectionChangedCallback IO ()
cb
FunPtr C_TreeSelectionChangedCallback
cb'' <- C_TreeSelectionChangedCallback
-> IO (FunPtr C_TreeSelectionChangedCallback)
mk_TreeSelectionChangedCallback C_TreeSelectionChangedCallback
cb'
a
-> Text
-> FunPtr C_TreeSelectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_TreeSelectionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterTreeSelectionChanged :: (IsTreeSelection a, MonadIO m) => a -> TreeSelectionChangedCallback -> m SignalHandlerId
afterTreeSelectionChanged :: a -> IO () -> m SignalHandlerId
afterTreeSelectionChanged obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSelectionChangedCallback
cb' = IO () -> C_TreeSelectionChangedCallback
wrap_TreeSelectionChangedCallback IO ()
cb
FunPtr C_TreeSelectionChangedCallback
cb'' <- C_TreeSelectionChangedCallback
-> IO (FunPtr C_TreeSelectionChangedCallback)
mk_TreeSelectionChangedCallback C_TreeSelectionChangedCallback
cb'
a
-> Text
-> FunPtr C_TreeSelectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_TreeSelectionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data TreeSelectionChangedSignalInfo
instance SignalInfo TreeSelectionChangedSignalInfo where
type HaskellCallbackType TreeSelectionChangedSignalInfo = TreeSelectionChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TreeSelectionChangedCallback cb
cb'' <- mk_TreeSelectionChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
getTreeSelectionMode :: (MonadIO m, IsTreeSelection o) => o -> m Gtk.Enums.SelectionMode
getTreeSelectionMode :: o -> m SelectionMode
getTreeSelectionMode obj :: o
obj = IO SelectionMode -> m SelectionMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SelectionMode -> m SelectionMode)
-> IO SelectionMode -> m SelectionMode
forall a b. (a -> b) -> a -> b
$ o -> String -> IO SelectionMode
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "mode"
setTreeSelectionMode :: (MonadIO m, IsTreeSelection o) => o -> Gtk.Enums.SelectionMode -> m ()
setTreeSelectionMode :: o -> SelectionMode -> m ()
setTreeSelectionMode obj :: o
obj val :: SelectionMode
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> SelectionMode -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj "mode" SelectionMode
val
constructTreeSelectionMode :: (IsTreeSelection o) => Gtk.Enums.SelectionMode -> IO (GValueConstruct o)
constructTreeSelectionMode :: SelectionMode -> IO (GValueConstruct o)
constructTreeSelectionMode val :: SelectionMode
val = String -> SelectionMode -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum "mode" SelectionMode
val
#if defined(ENABLE_OVERLOADING)
data TreeSelectionModePropertyInfo
instance AttrInfo TreeSelectionModePropertyInfo where
type AttrAllowedOps TreeSelectionModePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint TreeSelectionModePropertyInfo = IsTreeSelection
type AttrSetTypeConstraint TreeSelectionModePropertyInfo = (~) Gtk.Enums.SelectionMode
type AttrTransferTypeConstraint TreeSelectionModePropertyInfo = (~) Gtk.Enums.SelectionMode
type AttrTransferType TreeSelectionModePropertyInfo = Gtk.Enums.SelectionMode
type AttrGetType TreeSelectionModePropertyInfo = Gtk.Enums.SelectionMode
type AttrLabel TreeSelectionModePropertyInfo = "mode"
type AttrOrigin TreeSelectionModePropertyInfo = TreeSelection
attrGet = getTreeSelectionMode
attrSet = setTreeSelectionMode
attrTransfer _ v = do
return v
attrConstruct = constructTreeSelectionMode
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TreeSelection
type instance O.AttributeList TreeSelection = TreeSelectionAttributeList
type TreeSelectionAttributeList = ('[ '("mode", TreeSelectionModePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
treeSelectionMode :: AttrLabelProxy "mode"
treeSelectionMode = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TreeSelection = TreeSelectionSignalList
type TreeSelectionSignalList = ('[ '("changed", TreeSelectionChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_tree_selection_count_selected_rows" gtk_tree_selection_count_selected_rows ::
Ptr TreeSelection ->
IO Int32
treeSelectionCountSelectedRows ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m Int32
treeSelectionCountSelectedRows :: a -> m Int32
treeSelectionCountSelectedRows selection :: a
selection = IO Int32 -> m Int32
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 TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Int32
result <- Ptr TreeSelection -> IO Int32
gtk_tree_selection_count_selected_rows Ptr TreeSelection
selection'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TreeSelectionCountSelectedRowsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionCountSelectedRowsMethodInfo a signature where
overloadedMethod = treeSelectionCountSelectedRows
#endif
foreign import ccall "gtk_tree_selection_get_mode" gtk_tree_selection_get_mode ::
Ptr TreeSelection ->
IO CUInt
treeSelectionGetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m Gtk.Enums.SelectionMode
treeSelectionGetMode :: a -> m SelectionMode
treeSelectionGetMode selection :: a
selection = IO SelectionMode -> m SelectionMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SelectionMode -> m SelectionMode)
-> IO SelectionMode -> m SelectionMode
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
CUInt
result <- Ptr TreeSelection -> IO CUInt
gtk_tree_selection_get_mode Ptr TreeSelection
selection'
let result' :: SelectionMode
result' = (Int -> SelectionMode
forall a. Enum a => Int -> a
toEnum (Int -> SelectionMode) -> (CUInt -> Int) -> CUInt -> SelectionMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
SelectionMode -> IO SelectionMode
forall (m :: * -> *) a. Monad m => a -> m a
return SelectionMode
result'
#if defined(ENABLE_OVERLOADING)
data TreeSelectionGetModeMethodInfo
instance (signature ~ (m Gtk.Enums.SelectionMode), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionGetModeMethodInfo a signature where
overloadedMethod = treeSelectionGetMode
#endif
foreign import ccall "gtk_tree_selection_get_selected" gtk_tree_selection_get_selected ::
Ptr TreeSelection ->
Ptr (Ptr Gtk.TreeModel.TreeModel) ->
Ptr Gtk.TreeIter.TreeIter ->
IO CInt
treeSelectionGetSelected ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m ((Bool, Gtk.TreeModel.TreeModel, Gtk.TreeIter.TreeIter))
treeSelectionGetSelected :: a -> m (Bool, TreeModel, TreeIter)
treeSelectionGetSelected selection :: a
selection = IO (Bool, TreeModel, TreeIter) -> m (Bool, TreeModel, TreeIter)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TreeModel, TreeIter) -> m (Bool, TreeModel, TreeIter))
-> IO (Bool, TreeModel, TreeIter) -> m (Bool, TreeModel, TreeIter)
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr (Ptr TreeModel)
model <- IO (Ptr (Ptr TreeModel))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gtk.TreeModel.TreeModel))
Ptr TreeIter
iter <- Int -> IO (Ptr TreeIter)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 32 :: IO (Ptr Gtk.TreeIter.TreeIter)
CInt
result <- Ptr TreeSelection -> Ptr (Ptr TreeModel) -> Ptr TreeIter -> IO CInt
gtk_tree_selection_get_selected Ptr TreeSelection
selection' Ptr (Ptr TreeModel)
model Ptr TreeIter
iter
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Ptr TreeModel
model' <- Ptr (Ptr TreeModel) -> IO (Ptr TreeModel)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr TreeModel)
model
TreeModel
model'' <- ((ManagedPtr TreeModel -> TreeModel)
-> Ptr TreeModel -> IO TreeModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeModel -> TreeModel
Gtk.TreeModel.TreeModel) Ptr TreeModel
model'
TreeIter
iter' <- ((ManagedPtr TreeIter -> TreeIter) -> Ptr TreeIter -> IO TreeIter
forall a.
(HasCallStack, BoxedObject 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
selection
Ptr (Ptr TreeModel) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr TreeModel)
model
(Bool, TreeModel, TreeIter) -> IO (Bool, TreeModel, TreeIter)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TreeModel
model'', TreeIter
iter')
#if defined(ENABLE_OVERLOADING)
data TreeSelectionGetSelectedMethodInfo
instance (signature ~ (m ((Bool, Gtk.TreeModel.TreeModel, Gtk.TreeIter.TreeIter))), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionGetSelectedMethodInfo a signature where
overloadedMethod = treeSelectionGetSelected
#endif
foreign import ccall "gtk_tree_selection_get_selected_rows" gtk_tree_selection_get_selected_rows ::
Ptr TreeSelection ->
Ptr (Ptr Gtk.TreeModel.TreeModel) ->
IO (Ptr (GList (Ptr Gtk.TreePath.TreePath)))
treeSelectionGetSelectedRows ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m (([Gtk.TreePath.TreePath], Gtk.TreeModel.TreeModel))
treeSelectionGetSelectedRows :: a -> m ([TreePath], TreeModel)
treeSelectionGetSelectedRows selection :: a
selection = IO ([TreePath], TreeModel) -> m ([TreePath], TreeModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([TreePath], TreeModel) -> m ([TreePath], TreeModel))
-> IO ([TreePath], TreeModel) -> m ([TreePath], TreeModel)
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr (Ptr TreeModel)
model <- IO (Ptr (Ptr TreeModel))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gtk.TreeModel.TreeModel))
Ptr (GList (Ptr TreePath))
result <- Ptr TreeSelection
-> Ptr (Ptr TreeModel) -> IO (Ptr (GList (Ptr TreePath)))
gtk_tree_selection_get_selected_rows Ptr TreeSelection
selection' Ptr (Ptr TreeModel)
model
[Ptr TreePath]
result' <- Ptr (GList (Ptr TreePath)) -> IO [Ptr TreePath]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr TreePath))
result
[TreePath]
result'' <- (Ptr TreePath -> IO TreePath) -> [Ptr TreePath] -> IO [TreePath]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr TreePath -> TreePath) -> Ptr TreePath -> IO TreePath
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreePath -> TreePath
Gtk.TreePath.TreePath) [Ptr TreePath]
result'
Ptr (GList (Ptr TreePath)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr TreePath))
result
Ptr TreeModel
model' <- Ptr (Ptr TreeModel) -> IO (Ptr TreeModel)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr TreeModel)
model
TreeModel
model'' <- ((ManagedPtr TreeModel -> TreeModel)
-> Ptr TreeModel -> IO TreeModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeModel -> TreeModel
Gtk.TreeModel.TreeModel) Ptr TreeModel
model'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
Ptr (Ptr TreeModel) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr TreeModel)
model
([TreePath], TreeModel) -> IO ([TreePath], TreeModel)
forall (m :: * -> *) a. Monad m => a -> m a
return ([TreePath]
result'', TreeModel
model'')
#if defined(ENABLE_OVERLOADING)
data TreeSelectionGetSelectedRowsMethodInfo
instance (signature ~ (m (([Gtk.TreePath.TreePath], Gtk.TreeModel.TreeModel))), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionGetSelectedRowsMethodInfo a signature where
overloadedMethod = treeSelectionGetSelectedRows
#endif
foreign import ccall "gtk_tree_selection_get_tree_view" gtk_tree_selection_get_tree_view ::
Ptr TreeSelection ->
IO (Ptr Gtk.TreeView.TreeView)
treeSelectionGetTreeView ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m Gtk.TreeView.TreeView
treeSelectionGetTreeView :: a -> m TreeView
treeSelectionGetTreeView selection :: a
selection = IO TreeView -> m TreeView
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeView -> m TreeView) -> IO TreeView -> m TreeView
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeView
result <- Ptr TreeSelection -> IO (Ptr TreeView)
gtk_tree_selection_get_tree_view Ptr TreeSelection
selection'
Text -> Ptr TreeView -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "treeSelectionGetTreeView" Ptr TreeView
result
TreeView
result' <- ((ManagedPtr TreeView -> TreeView) -> Ptr TreeView -> IO TreeView
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeView -> TreeView
Gtk.TreeView.TreeView) Ptr TreeView
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreeView -> IO TreeView
forall (m :: * -> *) a. Monad m => a -> m a
return TreeView
result'
#if defined(ENABLE_OVERLOADING)
data TreeSelectionGetTreeViewMethodInfo
instance (signature ~ (m Gtk.TreeView.TreeView), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionGetTreeViewMethodInfo a signature where
overloadedMethod = treeSelectionGetTreeView
#endif
foreign import ccall "gtk_tree_selection_iter_is_selected" gtk_tree_selection_iter_is_selected ::
Ptr TreeSelection ->
Ptr Gtk.TreeIter.TreeIter ->
IO CInt
treeSelectionIterIsSelected ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreeIter.TreeIter
-> m Bool
treeSelectionIterIsSelected :: a -> TreeIter -> m Bool
treeSelectionIterIsSelected selection :: a
selection iter :: TreeIter
iter = IO Bool -> m Bool
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 TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
CInt
result <- Ptr TreeSelection -> Ptr TreeIter -> IO CInt
gtk_tree_selection_iter_is_selected Ptr TreeSelection
selection' Ptr TreeIter
iter'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeSelectionIterIsSelectedMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m Bool), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionIterIsSelectedMethodInfo a signature where
overloadedMethod = treeSelectionIterIsSelected
#endif
foreign import ccall "gtk_tree_selection_path_is_selected" gtk_tree_selection_path_is_selected ::
Ptr TreeSelection ->
Ptr Gtk.TreePath.TreePath ->
IO CInt
treeSelectionPathIsSelected ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreePath.TreePath
-> m Bool
treeSelectionPathIsSelected :: a -> TreePath -> m Bool
treeSelectionPathIsSelected selection :: a
selection path :: TreePath
path = IO Bool -> m Bool
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 TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreePath
path' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
path
CInt
result <- Ptr TreeSelection -> Ptr TreePath -> IO CInt
gtk_tree_selection_path_is_selected Ptr TreeSelection
selection' Ptr TreePath
path'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
path
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeSelectionPathIsSelectedMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> m Bool), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionPathIsSelectedMethodInfo a signature where
overloadedMethod = treeSelectionPathIsSelected
#endif
foreign import ccall "gtk_tree_selection_select_all" gtk_tree_selection_select_all ::
Ptr TreeSelection ->
IO ()
treeSelectionSelectAll ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m ()
treeSelectionSelectAll :: a -> m ()
treeSelectionSelectAll selection :: a
selection = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeSelection -> IO ()
gtk_tree_selection_select_all Ptr TreeSelection
selection'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSelectAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSelectAllMethodInfo a signature where
overloadedMethod = treeSelectionSelectAll
#endif
foreign import ccall "gtk_tree_selection_select_iter" gtk_tree_selection_select_iter ::
Ptr TreeSelection ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeSelectionSelectIter ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreeIter.TreeIter
-> m ()
treeSelectionSelectIter :: a -> TreeIter -> m ()
treeSelectionSelectIter selection :: a
selection iter :: TreeIter
iter = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr TreeSelection -> Ptr TreeIter -> IO ()
gtk_tree_selection_select_iter Ptr TreeSelection
selection' Ptr TreeIter
iter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSelectIterMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSelectIterMethodInfo a signature where
overloadedMethod = treeSelectionSelectIter
#endif
foreign import ccall "gtk_tree_selection_select_path" gtk_tree_selection_select_path ::
Ptr TreeSelection ->
Ptr Gtk.TreePath.TreePath ->
IO ()
treeSelectionSelectPath ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreePath.TreePath
-> m ()
treeSelectionSelectPath :: a -> TreePath -> m ()
treeSelectionSelectPath selection :: a
selection path :: TreePath
path = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreePath
path' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
path
Ptr TreeSelection -> Ptr TreePath -> IO ()
gtk_tree_selection_select_path Ptr TreeSelection
selection' Ptr TreePath
path'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
path
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSelectPathMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSelectPathMethodInfo a signature where
overloadedMethod = treeSelectionSelectPath
#endif
foreign import ccall "gtk_tree_selection_select_range" gtk_tree_selection_select_range ::
Ptr TreeSelection ->
Ptr Gtk.TreePath.TreePath ->
Ptr Gtk.TreePath.TreePath ->
IO ()
treeSelectionSelectRange ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreePath.TreePath
-> Gtk.TreePath.TreePath
-> m ()
treeSelectionSelectRange :: a -> TreePath -> TreePath -> m ()
treeSelectionSelectRange selection :: a
selection startPath :: TreePath
startPath endPath :: TreePath
endPath = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreePath
startPath' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
startPath
Ptr TreePath
endPath' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
endPath
Ptr TreeSelection -> Ptr TreePath -> Ptr TreePath -> IO ()
gtk_tree_selection_select_range Ptr TreeSelection
selection' Ptr TreePath
startPath' Ptr TreePath
endPath'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
startPath
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
endPath
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSelectRangeMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> Gtk.TreePath.TreePath -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSelectRangeMethodInfo a signature where
overloadedMethod = treeSelectionSelectRange
#endif
foreign import ccall "gtk_tree_selection_selected_foreach" gtk_tree_selection_selected_foreach ::
Ptr TreeSelection ->
FunPtr Gtk.Callbacks.C_TreeSelectionForeachFunc ->
Ptr () ->
IO ()
treeSelectionSelectedForeach ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.Callbacks.TreeSelectionForeachFunc
-> m ()
treeSelectionSelectedForeach :: a -> TreeSelectionForeachFunc -> m ()
treeSelectionSelectedForeach selection :: a
selection func :: TreeSelectionForeachFunc
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
FunPtr C_TreeSelectionForeachFunc
func' <- C_TreeSelectionForeachFunc
-> IO (FunPtr C_TreeSelectionForeachFunc)
Gtk.Callbacks.mk_TreeSelectionForeachFunc (Maybe (Ptr (FunPtr C_TreeSelectionForeachFunc))
-> TreeSelectionForeachFunc_WithClosures
-> C_TreeSelectionForeachFunc
Gtk.Callbacks.wrap_TreeSelectionForeachFunc Maybe (Ptr (FunPtr C_TreeSelectionForeachFunc))
forall a. Maybe a
Nothing (TreeSelectionForeachFunc -> TreeSelectionForeachFunc_WithClosures
Gtk.Callbacks.drop_closures_TreeSelectionForeachFunc TreeSelectionForeachFunc
func))
let data_ :: Ptr a
data_ = Ptr a
forall a. Ptr a
nullPtr
Ptr TreeSelection
-> FunPtr C_TreeSelectionForeachFunc -> Ptr () -> IO ()
gtk_tree_selection_selected_foreach Ptr TreeSelection
selection' FunPtr C_TreeSelectionForeachFunc
func' Ptr ()
forall a. Ptr a
data_
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_TreeSelectionForeachFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_TreeSelectionForeachFunc
func'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSelectedForeachMethodInfo
instance (signature ~ (Gtk.Callbacks.TreeSelectionForeachFunc -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSelectedForeachMethodInfo a signature where
overloadedMethod = treeSelectionSelectedForeach
#endif
foreign import ccall "gtk_tree_selection_set_mode" gtk_tree_selection_set_mode ::
Ptr TreeSelection ->
CUInt ->
IO ()
treeSelectionSetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.Enums.SelectionMode
-> m ()
treeSelectionSetMode :: a -> SelectionMode -> m ()
treeSelectionSetMode selection :: a
selection type_ :: SelectionMode
type_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SelectionMode -> Int) -> SelectionMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SelectionMode -> Int
forall a. Enum a => a -> Int
fromEnum) SelectionMode
type_
Ptr TreeSelection -> CUInt -> IO ()
gtk_tree_selection_set_mode Ptr TreeSelection
selection' CUInt
type_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSetModeMethodInfo
instance (signature ~ (Gtk.Enums.SelectionMode -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSetModeMethodInfo a signature where
overloadedMethod = treeSelectionSetMode
#endif
foreign import ccall "gtk_tree_selection_set_select_function" gtk_tree_selection_set_select_function ::
Ptr TreeSelection ->
FunPtr Gtk.Callbacks.C_TreeSelectionFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
treeSelectionSetSelectFunction ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Maybe (Gtk.Callbacks.TreeSelectionFunc)
-> m ()
treeSelectionSetSelectFunction :: a -> Maybe TreeSelectionFunc -> m ()
treeSelectionSetSelectFunction selection :: a
selection func :: Maybe TreeSelectionFunc
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
FunPtr C_TreeSelectionFunc
maybeFunc <- case Maybe TreeSelectionFunc
func of
Nothing -> FunPtr C_TreeSelectionFunc -> IO (FunPtr C_TreeSelectionFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_TreeSelectionFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jFunc :: TreeSelectionFunc
jFunc -> do
FunPtr C_TreeSelectionFunc
jFunc' <- C_TreeSelectionFunc -> IO (FunPtr C_TreeSelectionFunc)
Gtk.Callbacks.mk_TreeSelectionFunc (Maybe (Ptr (FunPtr C_TreeSelectionFunc))
-> TreeSelectionFunc_WithClosures -> C_TreeSelectionFunc
Gtk.Callbacks.wrap_TreeSelectionFunc Maybe (Ptr (FunPtr C_TreeSelectionFunc))
forall a. Maybe a
Nothing (TreeSelectionFunc -> TreeSelectionFunc_WithClosures
Gtk.Callbacks.drop_closures_TreeSelectionFunc TreeSelectionFunc
jFunc))
FunPtr C_TreeSelectionFunc -> IO (FunPtr C_TreeSelectionFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_TreeSelectionFunc
jFunc'
let data_ :: Ptr ()
data_ = FunPtr C_TreeSelectionFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_TreeSelectionFunc
maybeFunc
let destroy :: FunPtr (Ptr a -> IO ())
destroy = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
Ptr TreeSelection
-> FunPtr C_TreeSelectionFunc
-> Ptr ()
-> FunPtr (Ptr () -> IO ())
-> IO ()
gtk_tree_selection_set_select_function Ptr TreeSelection
selection' FunPtr C_TreeSelectionFunc
maybeFunc Ptr ()
data_ FunPtr (Ptr () -> IO ())
forall a. FunPtr (Ptr a -> IO ())
destroy
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionSetSelectFunctionMethodInfo
instance (signature ~ (Maybe (Gtk.Callbacks.TreeSelectionFunc) -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionSetSelectFunctionMethodInfo a signature where
overloadedMethod = treeSelectionSetSelectFunction
#endif
foreign import ccall "gtk_tree_selection_unselect_all" gtk_tree_selection_unselect_all ::
Ptr TreeSelection ->
IO ()
treeSelectionUnselectAll ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> m ()
treeSelectionUnselectAll :: a -> m ()
treeSelectionUnselectAll selection :: a
selection = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeSelection -> IO ()
gtk_tree_selection_unselect_all Ptr TreeSelection
selection'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionUnselectAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionUnselectAllMethodInfo a signature where
overloadedMethod = treeSelectionUnselectAll
#endif
foreign import ccall "gtk_tree_selection_unselect_iter" gtk_tree_selection_unselect_iter ::
Ptr TreeSelection ->
Ptr Gtk.TreeIter.TreeIter ->
IO ()
treeSelectionUnselectIter ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreeIter.TreeIter
-> m ()
treeSelectionUnselectIter :: a -> TreeIter -> m ()
treeSelectionUnselectIter selection :: a
selection iter :: TreeIter
iter = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreeIter
iter' <- TreeIter -> IO (Ptr TreeIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreeIter
iter
Ptr TreeSelection -> Ptr TreeIter -> IO ()
gtk_tree_selection_unselect_iter Ptr TreeSelection
selection' Ptr TreeIter
iter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreeIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreeIter
iter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionUnselectIterMethodInfo
instance (signature ~ (Gtk.TreeIter.TreeIter -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionUnselectIterMethodInfo a signature where
overloadedMethod = treeSelectionUnselectIter
#endif
foreign import ccall "gtk_tree_selection_unselect_path" gtk_tree_selection_unselect_path ::
Ptr TreeSelection ->
Ptr Gtk.TreePath.TreePath ->
IO ()
treeSelectionUnselectPath ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreePath.TreePath
-> m ()
treeSelectionUnselectPath :: a -> TreePath -> m ()
treeSelectionUnselectPath selection :: a
selection path :: TreePath
path = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreePath
path' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
path
Ptr TreeSelection -> Ptr TreePath -> IO ()
gtk_tree_selection_unselect_path Ptr TreeSelection
selection' Ptr TreePath
path'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
path
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionUnselectPathMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionUnselectPathMethodInfo a signature where
overloadedMethod = treeSelectionUnselectPath
#endif
foreign import ccall "gtk_tree_selection_unselect_range" gtk_tree_selection_unselect_range ::
Ptr TreeSelection ->
Ptr Gtk.TreePath.TreePath ->
Ptr Gtk.TreePath.TreePath ->
IO ()
treeSelectionUnselectRange ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSelection a) =>
a
-> Gtk.TreePath.TreePath
-> Gtk.TreePath.TreePath
-> m ()
treeSelectionUnselectRange :: a -> TreePath -> TreePath -> m ()
treeSelectionUnselectRange selection :: a
selection startPath :: TreePath
startPath endPath :: TreePath
endPath = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSelection
selection' <- a -> IO (Ptr TreeSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
selection
Ptr TreePath
startPath' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
startPath
Ptr TreePath
endPath' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
endPath
Ptr TreeSelection -> Ptr TreePath -> Ptr TreePath -> IO ()
gtk_tree_selection_unselect_range Ptr TreeSelection
selection' Ptr TreePath
startPath' Ptr TreePath
endPath'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
selection
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
startPath
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
endPath
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSelectionUnselectRangeMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> Gtk.TreePath.TreePath -> m ()), MonadIO m, IsTreeSelection a) => O.MethodInfo TreeSelectionUnselectRangeMethodInfo a signature where
overloadedMethod = treeSelectionUnselectRange
#endif