{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.MultiSelection
(
MultiSelection(..) ,
IsMultiSelection ,
toMultiSelection ,
#if defined(ENABLE_OVERLOADING)
ResolveMultiSelectionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MultiSelectionGetModelMethodInfo ,
#endif
multiSelectionGetModel ,
multiSelectionNew ,
#if defined(ENABLE_OVERLOADING)
MultiSelectionSetModelMethodInfo ,
#endif
multiSelectionSetModel ,
#if defined(ENABLE_OVERLOADING)
MultiSelectionModelPropertyInfo ,
#endif
clearMultiSelectionModel ,
constructMultiSelectionModel ,
getMultiSelectionModel ,
#if defined(ENABLE_OVERLOADING)
multiSelectionModel ,
#endif
setMultiSelectionModel ,
) 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.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.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 qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.SelectionModel as Gtk.SelectionModel
newtype MultiSelection = MultiSelection (SP.ManagedPtr MultiSelection)
deriving (MultiSelection -> MultiSelection -> Bool
(MultiSelection -> MultiSelection -> Bool)
-> (MultiSelection -> MultiSelection -> Bool) -> Eq MultiSelection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiSelection -> MultiSelection -> Bool
$c/= :: MultiSelection -> MultiSelection -> Bool
== :: MultiSelection -> MultiSelection -> Bool
$c== :: MultiSelection -> MultiSelection -> Bool
Eq)
instance SP.ManagedPtrNewtype MultiSelection where
toManagedPtr :: MultiSelection -> ManagedPtr MultiSelection
toManagedPtr (MultiSelection ManagedPtr MultiSelection
p) = ManagedPtr MultiSelection
p
foreign import ccall "gtk_multi_selection_get_type"
c_gtk_multi_selection_get_type :: IO B.Types.GType
instance B.Types.TypedObject MultiSelection where
glibType :: IO GType
glibType = IO GType
c_gtk_multi_selection_get_type
instance B.Types.GObject MultiSelection
class (SP.GObject o, O.IsDescendantOf MultiSelection o) => IsMultiSelection o
instance (SP.GObject o, O.IsDescendantOf MultiSelection o) => IsMultiSelection o
instance O.HasParentTypes MultiSelection
type instance O.ParentTypes MultiSelection = '[GObject.Object.Object, Gio.ListModel.ListModel, Gtk.SelectionModel.SelectionModel]
toMultiSelection :: (MIO.MonadIO m, IsMultiSelection o) => o -> m MultiSelection
toMultiSelection :: forall (m :: * -> *) o.
(MonadIO m, IsMultiSelection o) =>
o -> m MultiSelection
toMultiSelection = IO MultiSelection -> m MultiSelection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO MultiSelection -> m MultiSelection)
-> (o -> IO MultiSelection) -> o -> m MultiSelection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MultiSelection -> MultiSelection)
-> o -> IO MultiSelection
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr MultiSelection -> MultiSelection
MultiSelection
instance B.GValue.IsGValue (Maybe MultiSelection) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_multi_selection_get_type
gvalueSet_ :: Ptr GValue -> Maybe MultiSelection -> IO ()
gvalueSet_ Ptr GValue
gv Maybe MultiSelection
P.Nothing = Ptr GValue -> Ptr MultiSelection -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr MultiSelection
forall a. Ptr a
FP.nullPtr :: FP.Ptr MultiSelection)
gvalueSet_ Ptr GValue
gv (P.Just MultiSelection
obj) = MultiSelection -> (Ptr MultiSelection -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MultiSelection
obj (Ptr GValue -> Ptr MultiSelection -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe MultiSelection)
gvalueGet_ Ptr GValue
gv = do
Ptr MultiSelection
ptr <- Ptr GValue -> IO (Ptr MultiSelection)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr MultiSelection)
if Ptr MultiSelection
ptr Ptr MultiSelection -> Ptr MultiSelection -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr MultiSelection
forall a. Ptr a
FP.nullPtr
then MultiSelection -> Maybe MultiSelection
forall a. a -> Maybe a
P.Just (MultiSelection -> Maybe MultiSelection)
-> IO MultiSelection -> IO (Maybe MultiSelection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr MultiSelection -> MultiSelection)
-> Ptr MultiSelection -> IO MultiSelection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MultiSelection -> MultiSelection
MultiSelection Ptr MultiSelection
ptr
else Maybe MultiSelection -> IO (Maybe MultiSelection)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MultiSelection
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMultiSelectionMethod (t :: Symbol) (o :: *) :: * where
ResolveMultiSelectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMultiSelectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMultiSelectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMultiSelectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMultiSelectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMultiSelectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMultiSelectionMethod "isSelected" o = Gtk.SelectionModel.SelectionModelIsSelectedMethodInfo
ResolveMultiSelectionMethod "itemsChanged" o = Gio.ListModel.ListModelItemsChangedMethodInfo
ResolveMultiSelectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMultiSelectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMultiSelectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMultiSelectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMultiSelectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMultiSelectionMethod "selectAll" o = Gtk.SelectionModel.SelectionModelSelectAllMethodInfo
ResolveMultiSelectionMethod "selectItem" o = Gtk.SelectionModel.SelectionModelSelectItemMethodInfo
ResolveMultiSelectionMethod "selectRange" o = Gtk.SelectionModel.SelectionModelSelectRangeMethodInfo
ResolveMultiSelectionMethod "selectionChanged" o = Gtk.SelectionModel.SelectionModelSelectionChangedMethodInfo
ResolveMultiSelectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMultiSelectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMultiSelectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMultiSelectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMultiSelectionMethod "unselectAll" o = Gtk.SelectionModel.SelectionModelUnselectAllMethodInfo
ResolveMultiSelectionMethod "unselectItem" o = Gtk.SelectionModel.SelectionModelUnselectItemMethodInfo
ResolveMultiSelectionMethod "unselectRange" o = Gtk.SelectionModel.SelectionModelUnselectRangeMethodInfo
ResolveMultiSelectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMultiSelectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMultiSelectionMethod "getItem" o = Gio.ListModel.ListModelGetItemMethodInfo
ResolveMultiSelectionMethod "getItemType" o = Gio.ListModel.ListModelGetItemTypeMethodInfo
ResolveMultiSelectionMethod "getModel" o = MultiSelectionGetModelMethodInfo
ResolveMultiSelectionMethod "getNItems" o = Gio.ListModel.ListModelGetNItemsMethodInfo
ResolveMultiSelectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMultiSelectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMultiSelectionMethod "getSelection" o = Gtk.SelectionModel.SelectionModelGetSelectionMethodInfo
ResolveMultiSelectionMethod "getSelectionInRange" o = Gtk.SelectionModel.SelectionModelGetSelectionInRangeMethodInfo
ResolveMultiSelectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMultiSelectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMultiSelectionMethod "setModel" o = MultiSelectionSetModelMethodInfo
ResolveMultiSelectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMultiSelectionMethod "setSelection" o = Gtk.SelectionModel.SelectionModelSetSelectionMethodInfo
ResolveMultiSelectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMultiSelectionMethod t MultiSelection, O.OverloadedMethod info MultiSelection p) => OL.IsLabel t (MultiSelection -> 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 ~ ResolveMultiSelectionMethod t MultiSelection, O.OverloadedMethod info MultiSelection p, R.HasField t MultiSelection p) => R.HasField t MultiSelection p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMultiSelectionMethod t MultiSelection, O.OverloadedMethodInfo info MultiSelection) => OL.IsLabel t (O.MethodProxy info MultiSelection) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getMultiSelectionModel :: (MonadIO m, IsMultiSelection o) => o -> m Gio.ListModel.ListModel
getMultiSelectionModel :: forall (m :: * -> *) o.
(MonadIO m, IsMultiSelection o) =>
o -> m ListModel
getMultiSelectionModel o
obj = IO ListModel -> m ListModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ListModel -> m ListModel) -> IO ListModel -> m ListModel
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe ListModel) -> IO ListModel
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getMultiSelectionModel" (IO (Maybe ListModel) -> IO ListModel)
-> IO (Maybe ListModel) -> IO ListModel
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ListModel -> ListModel)
-> IO (Maybe ListModel)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"model" ManagedPtr ListModel -> ListModel
Gio.ListModel.ListModel
setMultiSelectionModel :: (MonadIO m, IsMultiSelection o, Gio.ListModel.IsListModel a) => o -> a -> m ()
setMultiSelectionModel :: forall (m :: * -> *) o a.
(MonadIO m, IsMultiSelection o, IsListModel a) =>
o -> a -> m ()
setMultiSelectionModel o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"model" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructMultiSelectionModel :: (IsMultiSelection o, MIO.MonadIO m, Gio.ListModel.IsListModel a) => a -> m (GValueConstruct o)
constructMultiSelectionModel :: forall o (m :: * -> *) a.
(IsMultiSelection o, MonadIO m, IsListModel a) =>
a -> m (GValueConstruct o)
constructMultiSelectionModel a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"model" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearMultiSelectionModel :: (MonadIO m, IsMultiSelection o) => o -> m ()
clearMultiSelectionModel :: forall (m :: * -> *) o.
(MonadIO m, IsMultiSelection o) =>
o -> m ()
clearMultiSelectionModel o
obj = 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 -> Maybe ListModel -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"model" (Maybe ListModel
forall a. Maybe a
Nothing :: Maybe Gio.ListModel.ListModel)
#if defined(ENABLE_OVERLOADING)
data MultiSelectionModelPropertyInfo
instance AttrInfo MultiSelectionModelPropertyInfo where
type AttrAllowedOps MultiSelectionModelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint MultiSelectionModelPropertyInfo = IsMultiSelection
type AttrSetTypeConstraint MultiSelectionModelPropertyInfo = Gio.ListModel.IsListModel
type AttrTransferTypeConstraint MultiSelectionModelPropertyInfo = Gio.ListModel.IsListModel
type AttrTransferType MultiSelectionModelPropertyInfo = Gio.ListModel.ListModel
type AttrGetType MultiSelectionModelPropertyInfo = Gio.ListModel.ListModel
type AttrLabel MultiSelectionModelPropertyInfo = "model"
type AttrOrigin MultiSelectionModelPropertyInfo = MultiSelection
attrGet = getMultiSelectionModel
attrSet = setMultiSelectionModel
attrTransfer _ v = do
unsafeCastTo Gio.ListModel.ListModel v
attrConstruct = constructMultiSelectionModel
attrClear = clearMultiSelectionModel
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.MultiSelection.model"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-MultiSelection.html#g:attr:model"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MultiSelection
type instance O.AttributeList MultiSelection = MultiSelectionAttributeList
type MultiSelectionAttributeList = ('[ '("model", MultiSelectionModelPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
multiSelectionModel :: AttrLabelProxy "model"
multiSelectionModel = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MultiSelection = MultiSelectionSignalList
type MultiSelectionSignalList = ('[ '("itemsChanged", Gio.ListModel.ListModelItemsChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("selectionChanged", Gtk.SelectionModel.SelectionModelSelectionChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_multi_selection_new" gtk_multi_selection_new ::
Ptr Gio.ListModel.ListModel ->
IO (Ptr MultiSelection)
multiSelectionNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.ListModel.IsListModel a) =>
Maybe (a)
-> m MultiSelection
multiSelectionNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsListModel a) =>
Maybe a -> m MultiSelection
multiSelectionNew Maybe a
model = IO MultiSelection -> m MultiSelection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MultiSelection -> m MultiSelection)
-> IO MultiSelection -> m MultiSelection
forall a b. (a -> b) -> a -> b
$ do
Ptr ListModel
maybeModel <- case Maybe a
model of
Maybe a
Nothing -> Ptr ListModel -> IO (Ptr ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ListModel
forall a. Ptr a
nullPtr
Just a
jModel -> do
Ptr ListModel
jModel' <- a -> IO (Ptr ListModel)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject a
jModel
Ptr ListModel -> IO (Ptr ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ListModel
jModel'
Ptr MultiSelection
result <- Ptr ListModel -> IO (Ptr MultiSelection)
gtk_multi_selection_new Ptr ListModel
maybeModel
Text -> Ptr MultiSelection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"multiSelectionNew" Ptr MultiSelection
result
MultiSelection
result' <- ((ManagedPtr MultiSelection -> MultiSelection)
-> Ptr MultiSelection -> IO MultiSelection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MultiSelection -> MultiSelection
MultiSelection) Ptr MultiSelection
result
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
model a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
MultiSelection -> IO MultiSelection
forall (m :: * -> *) a. Monad m => a -> m a
return MultiSelection
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_multi_selection_get_model" gtk_multi_selection_get_model ::
Ptr MultiSelection ->
IO (Ptr Gio.ListModel.ListModel)
multiSelectionGetModel ::
(B.CallStack.HasCallStack, MonadIO m, IsMultiSelection a) =>
a
-> m Gio.ListModel.ListModel
multiSelectionGetModel :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMultiSelection a) =>
a -> m ListModel
multiSelectionGetModel a
self = IO ListModel -> m ListModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ListModel -> m ListModel) -> IO ListModel -> m ListModel
forall a b. (a -> b) -> a -> b
$ do
Ptr MultiSelection
self' <- a -> IO (Ptr MultiSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr ListModel
result <- Ptr MultiSelection -> IO (Ptr ListModel)
gtk_multi_selection_get_model Ptr MultiSelection
self'
Text -> Ptr ListModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"multiSelectionGetModel" Ptr ListModel
result
ListModel
result' <- ((ManagedPtr ListModel -> ListModel)
-> Ptr ListModel -> IO ListModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ListModel -> ListModel
Gio.ListModel.ListModel) Ptr ListModel
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
ListModel -> IO ListModel
forall (m :: * -> *) a. Monad m => a -> m a
return ListModel
result'
#if defined(ENABLE_OVERLOADING)
data MultiSelectionGetModelMethodInfo
instance (signature ~ (m Gio.ListModel.ListModel), MonadIO m, IsMultiSelection a) => O.OverloadedMethod MultiSelectionGetModelMethodInfo a signature where
overloadedMethod = multiSelectionGetModel
instance O.OverloadedMethodInfo MultiSelectionGetModelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.MultiSelection.multiSelectionGetModel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-MultiSelection.html#v:multiSelectionGetModel"
})
#endif
foreign import ccall "gtk_multi_selection_set_model" gtk_multi_selection_set_model ::
Ptr MultiSelection ->
Ptr Gio.ListModel.ListModel ->
IO ()
multiSelectionSetModel ::
(B.CallStack.HasCallStack, MonadIO m, IsMultiSelection a, Gio.ListModel.IsListModel b) =>
a
-> Maybe (b)
-> m ()
multiSelectionSetModel :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMultiSelection a, IsListModel b) =>
a -> Maybe b -> m ()
multiSelectionSetModel a
self Maybe b
model = 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 MultiSelection
self' <- a -> IO (Ptr MultiSelection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr ListModel
maybeModel <- case Maybe b
model of
Maybe b
Nothing -> Ptr ListModel -> IO (Ptr ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ListModel
forall a. Ptr a
nullPtr
Just b
jModel -> do
Ptr ListModel
jModel' <- b -> IO (Ptr ListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jModel
Ptr ListModel -> IO (Ptr ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ListModel
jModel'
Ptr MultiSelection -> Ptr ListModel -> IO ()
gtk_multi_selection_set_model Ptr MultiSelection
self' Ptr ListModel
maybeModel
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
model b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MultiSelectionSetModelMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsMultiSelection a, Gio.ListModel.IsListModel b) => O.OverloadedMethod MultiSelectionSetModelMethodInfo a signature where
overloadedMethod = multiSelectionSetModel
instance O.OverloadedMethodInfo MultiSelectionSetModelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.MultiSelection.multiSelectionSetModel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-MultiSelection.html#v:multiSelectionSetModel"
})
#endif