{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.FilterListModel
(
FilterListModel(..) ,
IsFilterListModel ,
toFilterListModel ,
noFilterListModel ,
#if defined(ENABLE_OVERLOADING)
ResolveFilterListModelMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FilterListModelGetModelMethodInfo ,
#endif
filterListModelGetModel ,
#if defined(ENABLE_OVERLOADING)
FilterListModelHasFilterMethodInfo ,
#endif
filterListModelHasFilter ,
filterListModelNew ,
filterListModelNewForType ,
#if defined(ENABLE_OVERLOADING)
FilterListModelRefilterMethodInfo ,
#endif
filterListModelRefilter ,
#if defined(ENABLE_OVERLOADING)
FilterListModelSetFilterFuncMethodInfo ,
#endif
filterListModelSetFilterFunc ,
#if defined(ENABLE_OVERLOADING)
FilterListModelSetModelMethodInfo ,
#endif
filterListModelSetModel ,
#if defined(ENABLE_OVERLOADING)
FilterListModelHasFilterPropertyInfo ,
#endif
getFilterListModelHasFilter ,
#if defined(ENABLE_OVERLOADING)
FilterListModelItemTypePropertyInfo ,
#endif
constructFilterListModelItemType ,
#if defined(ENABLE_OVERLOADING)
filterListModelItemType ,
#endif
getFilterListModelItemType ,
#if defined(ENABLE_OVERLOADING)
FilterListModelModelPropertyInfo ,
#endif
constructFilterListModelModel ,
#if defined(ENABLE_OVERLOADING)
filterListModelModel ,
#endif
getFilterListModelModel ,
) 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.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
newtype FilterListModel = FilterListModel (ManagedPtr FilterListModel)
deriving (FilterListModel -> FilterListModel -> Bool
(FilterListModel -> FilterListModel -> Bool)
-> (FilterListModel -> FilterListModel -> Bool)
-> Eq FilterListModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilterListModel -> FilterListModel -> Bool
$c/= :: FilterListModel -> FilterListModel -> Bool
== :: FilterListModel -> FilterListModel -> Bool
$c== :: FilterListModel -> FilterListModel -> Bool
Eq)
foreign import ccall "gtk_filter_list_model_get_type"
c_gtk_filter_list_model_get_type :: IO GType
instance GObject FilterListModel where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_filter_list_model_get_type
instance B.GValue.IsGValue FilterListModel where
toGValue :: FilterListModel -> IO GValue
toGValue o :: FilterListModel
o = do
GType
gtype <- IO GType
c_gtk_filter_list_model_get_type
FilterListModel -> (Ptr FilterListModel -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FilterListModel
o (GType
-> (GValue -> Ptr FilterListModel -> IO ())
-> Ptr FilterListModel
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr FilterListModel -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO FilterListModel
fromGValue gv :: GValue
gv = do
Ptr FilterListModel
ptr <- GValue -> IO (Ptr FilterListModel)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr FilterListModel)
(ManagedPtr FilterListModel -> FilterListModel)
-> Ptr FilterListModel -> IO FilterListModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr FilterListModel -> FilterListModel
FilterListModel Ptr FilterListModel
ptr
class (GObject o, O.IsDescendantOf FilterListModel o) => IsFilterListModel o
instance (GObject o, O.IsDescendantOf FilterListModel o) => IsFilterListModel o
instance O.HasParentTypes FilterListModel
type instance O.ParentTypes FilterListModel = '[GObject.Object.Object, Gio.ListModel.ListModel]
toFilterListModel :: (MonadIO m, IsFilterListModel o) => o -> m FilterListModel
toFilterListModel :: o -> m FilterListModel
toFilterListModel = IO FilterListModel -> m FilterListModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilterListModel -> m FilterListModel)
-> (o -> IO FilterListModel) -> o -> m FilterListModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FilterListModel -> FilterListModel)
-> o -> IO FilterListModel
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr FilterListModel -> FilterListModel
FilterListModel
noFilterListModel :: Maybe FilterListModel
noFilterListModel :: Maybe FilterListModel
noFilterListModel = Maybe FilterListModel
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFilterListModelMethod (t :: Symbol) (o :: *) :: * where
ResolveFilterListModelMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFilterListModelMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFilterListModelMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFilterListModelMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFilterListModelMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFilterListModelMethod "hasFilter" o = FilterListModelHasFilterMethodInfo
ResolveFilterListModelMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFilterListModelMethod "itemsChanged" o = Gio.ListModel.ListModelItemsChangedMethodInfo
ResolveFilterListModelMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFilterListModelMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFilterListModelMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFilterListModelMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFilterListModelMethod "refilter" o = FilterListModelRefilterMethodInfo
ResolveFilterListModelMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFilterListModelMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFilterListModelMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFilterListModelMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFilterListModelMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFilterListModelMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFilterListModelMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFilterListModelMethod "getItem" o = Gio.ListModel.ListModelGetItemMethodInfo
ResolveFilterListModelMethod "getItemType" o = Gio.ListModel.ListModelGetItemTypeMethodInfo
ResolveFilterListModelMethod "getModel" o = FilterListModelGetModelMethodInfo
ResolveFilterListModelMethod "getNItems" o = Gio.ListModel.ListModelGetNItemsMethodInfo
ResolveFilterListModelMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFilterListModelMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFilterListModelMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFilterListModelMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFilterListModelMethod "setFilterFunc" o = FilterListModelSetFilterFuncMethodInfo
ResolveFilterListModelMethod "setModel" o = FilterListModelSetModelMethodInfo
ResolveFilterListModelMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFilterListModelMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFilterListModelMethod t FilterListModel, O.MethodInfo info FilterListModel p) => OL.IsLabel t (FilterListModel -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getFilterListModelHasFilter :: (MonadIO m, IsFilterListModel o) => o -> m Bool
getFilterListModelHasFilter :: o -> m Bool
getFilterListModelHasFilter obj :: o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "has-filter"
#if defined(ENABLE_OVERLOADING)
data FilterListModelHasFilterPropertyInfo
instance AttrInfo FilterListModelHasFilterPropertyInfo where
type AttrAllowedOps FilterListModelHasFilterPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint FilterListModelHasFilterPropertyInfo = IsFilterListModel
type AttrSetTypeConstraint FilterListModelHasFilterPropertyInfo = (~) ()
type AttrTransferTypeConstraint FilterListModelHasFilterPropertyInfo = (~) ()
type AttrTransferType FilterListModelHasFilterPropertyInfo = ()
type AttrGetType FilterListModelHasFilterPropertyInfo = Bool
type AttrLabel FilterListModelHasFilterPropertyInfo = "has-filter"
type AttrOrigin FilterListModelHasFilterPropertyInfo = FilterListModel
attrGet = getFilterListModelHasFilter
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getFilterListModelItemType :: (MonadIO m, IsFilterListModel o) => o -> m GType
getFilterListModelItemType :: o -> m GType
getFilterListModelItemType obj :: o
obj = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO GType
forall a. GObject a => a -> String -> IO GType
B.Properties.getObjectPropertyGType o
obj "item-type"
constructFilterListModelItemType :: (IsFilterListModel o) => GType -> IO (GValueConstruct o)
constructFilterListModelItemType :: GType -> IO (GValueConstruct o)
constructFilterListModelItemType val :: GType
val = String -> GType -> IO (GValueConstruct o)
forall o. String -> GType -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyGType "item-type" GType
val
#if defined(ENABLE_OVERLOADING)
data FilterListModelItemTypePropertyInfo
instance AttrInfo FilterListModelItemTypePropertyInfo where
type AttrAllowedOps FilterListModelItemTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint FilterListModelItemTypePropertyInfo = IsFilterListModel
type AttrSetTypeConstraint FilterListModelItemTypePropertyInfo = (~) GType
type AttrTransferTypeConstraint FilterListModelItemTypePropertyInfo = (~) GType
type AttrTransferType FilterListModelItemTypePropertyInfo = GType
type AttrGetType FilterListModelItemTypePropertyInfo = GType
type AttrLabel FilterListModelItemTypePropertyInfo = "item-type"
type AttrOrigin FilterListModelItemTypePropertyInfo = FilterListModel
attrGet = getFilterListModelItemType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructFilterListModelItemType
attrClear = undefined
#endif
getFilterListModelModel :: (MonadIO m, IsFilterListModel o) => o -> m (Maybe Gio.ListModel.ListModel)
getFilterListModelModel :: o -> m (Maybe ListModel)
getFilterListModelModel obj :: o
obj = IO (Maybe ListModel) -> m (Maybe ListModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ListModel) -> m (Maybe ListModel))
-> IO (Maybe ListModel) -> m (Maybe 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 "model" ManagedPtr ListModel -> ListModel
Gio.ListModel.ListModel
constructFilterListModelModel :: (IsFilterListModel o, Gio.ListModel.IsListModel a) => a -> IO (GValueConstruct o)
constructFilterListModelModel :: a -> IO (GValueConstruct o)
constructFilterListModelModel val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "model" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data FilterListModelModelPropertyInfo
instance AttrInfo FilterListModelModelPropertyInfo where
type AttrAllowedOps FilterListModelModelPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FilterListModelModelPropertyInfo = IsFilterListModel
type AttrSetTypeConstraint FilterListModelModelPropertyInfo = Gio.ListModel.IsListModel
type AttrTransferTypeConstraint FilterListModelModelPropertyInfo = Gio.ListModel.IsListModel
type AttrTransferType FilterListModelModelPropertyInfo = Gio.ListModel.ListModel
type AttrGetType FilterListModelModelPropertyInfo = (Maybe Gio.ListModel.ListModel)
type AttrLabel FilterListModelModelPropertyInfo = "model"
type AttrOrigin FilterListModelModelPropertyInfo = FilterListModel
attrGet = getFilterListModelModel
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.ListModel.ListModel v
attrConstruct = constructFilterListModelModel
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FilterListModel
type instance O.AttributeList FilterListModel = FilterListModelAttributeList
type FilterListModelAttributeList = ('[ '("hasFilter", FilterListModelHasFilterPropertyInfo), '("itemType", FilterListModelItemTypePropertyInfo), '("model", FilterListModelModelPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
filterListModelItemType :: AttrLabelProxy "itemType"
filterListModelItemType = AttrLabelProxy
filterListModelModel :: AttrLabelProxy "model"
filterListModelModel = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FilterListModel = FilterListModelSignalList
type FilterListModelSignalList = ('[ '("itemsChanged", Gio.ListModel.ListModelItemsChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_filter_list_model_new" gtk_filter_list_model_new ::
Ptr Gio.ListModel.ListModel ->
FunPtr Gtk.Callbacks.C_FilterListModelFilterFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO (Ptr FilterListModel)
filterListModelNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.ListModel.IsListModel a) =>
a
-> Maybe (Gtk.Callbacks.FilterListModelFilterFunc)
-> m FilterListModel
filterListModelNew :: a -> Maybe FilterListModelFilterFunc -> m FilterListModel
filterListModelNew model :: a
model filterFunc :: Maybe FilterListModelFilterFunc
filterFunc = IO FilterListModel -> m FilterListModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilterListModel -> m FilterListModel)
-> IO FilterListModel -> m FilterListModel
forall a b. (a -> b) -> a -> b
$ do
Ptr ListModel
model' <- a -> IO (Ptr ListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
model
FunPtr C_FilterListModelFilterFunc
maybeFilterFunc <- case Maybe FilterListModelFilterFunc
filterFunc of
Nothing -> FunPtr C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_FilterListModelFilterFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jFilterFunc :: FilterListModelFilterFunc
jFilterFunc -> do
FunPtr C_FilterListModelFilterFunc
jFilterFunc' <- C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
Gtk.Callbacks.mk_FilterListModelFilterFunc (Maybe (Ptr (FunPtr C_FilterListModelFilterFunc))
-> FilterListModelFilterFunc_WithClosures
-> C_FilterListModelFilterFunc
Gtk.Callbacks.wrap_FilterListModelFilterFunc Maybe (Ptr (FunPtr C_FilterListModelFilterFunc))
forall a. Maybe a
Nothing (FilterListModelFilterFunc -> FilterListModelFilterFunc_WithClosures
Gtk.Callbacks.drop_closures_FilterListModelFilterFunc FilterListModelFilterFunc
jFilterFunc))
FunPtr C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_FilterListModelFilterFunc
jFilterFunc'
let userData :: Ptr ()
userData = FunPtr C_FilterListModelFilterFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FilterListModelFilterFunc
maybeFilterFunc
let userDestroy :: FunPtr (Ptr a -> IO ())
userDestroy = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
Ptr FilterListModel
result <- Ptr ListModel
-> FunPtr C_FilterListModelFilterFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO (Ptr FilterListModel)
gtk_filter_list_model_new Ptr ListModel
model' FunPtr C_FilterListModelFilterFunc
maybeFilterFunc Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
userDestroy
Text -> Ptr FilterListModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "filterListModelNew" Ptr FilterListModel
result
FilterListModel
result' <- ((ManagedPtr FilterListModel -> FilterListModel)
-> Ptr FilterListModel -> IO FilterListModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FilterListModel -> FilterListModel
FilterListModel) Ptr FilterListModel
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
model
FilterListModel -> IO FilterListModel
forall (m :: * -> *) a. Monad m => a -> m a
return FilterListModel
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_filter_list_model_new_for_type" gtk_filter_list_model_new_for_type ::
CGType ->
IO (Ptr FilterListModel)
filterListModelNewForType ::
(B.CallStack.HasCallStack, MonadIO m) =>
GType
-> m FilterListModel
filterListModelNewForType :: GType -> m FilterListModel
filterListModelNewForType itemType :: GType
itemType = IO FilterListModel -> m FilterListModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilterListModel -> m FilterListModel)
-> IO FilterListModel -> m FilterListModel
forall a b. (a -> b) -> a -> b
$ do
let itemType' :: CGType
itemType' = GType -> CGType
gtypeToCGType GType
itemType
Ptr FilterListModel
result <- CGType -> IO (Ptr FilterListModel)
gtk_filter_list_model_new_for_type CGType
itemType'
Text -> Ptr FilterListModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "filterListModelNewForType" Ptr FilterListModel
result
FilterListModel
result' <- ((ManagedPtr FilterListModel -> FilterListModel)
-> Ptr FilterListModel -> IO FilterListModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FilterListModel -> FilterListModel
FilterListModel) Ptr FilterListModel
result
FilterListModel -> IO FilterListModel
forall (m :: * -> *) a. Monad m => a -> m a
return FilterListModel
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_filter_list_model_get_model" gtk_filter_list_model_get_model ::
Ptr FilterListModel ->
IO (Ptr Gio.ListModel.ListModel)
filterListModelGetModel ::
(B.CallStack.HasCallStack, MonadIO m, IsFilterListModel a) =>
a
-> m (Maybe Gio.ListModel.ListModel)
filterListModelGetModel :: a -> m (Maybe ListModel)
filterListModelGetModel self :: a
self = IO (Maybe ListModel) -> m (Maybe ListModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ListModel) -> m (Maybe ListModel))
-> IO (Maybe ListModel) -> m (Maybe ListModel)
forall a b. (a -> b) -> a -> b
$ do
Ptr FilterListModel
self' <- a -> IO (Ptr FilterListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr ListModel
result <- Ptr FilterListModel -> IO (Ptr ListModel)
gtk_filter_list_model_get_model Ptr FilterListModel
self'
Maybe ListModel
maybeResult <- Ptr ListModel
-> (Ptr ListModel -> IO ListModel) -> IO (Maybe ListModel)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr ListModel
result ((Ptr ListModel -> IO ListModel) -> IO (Maybe ListModel))
-> (Ptr ListModel -> IO ListModel) -> IO (Maybe ListModel)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr ListModel
result' -> do
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'
ListModel -> IO ListModel
forall (m :: * -> *) a. Monad m => a -> m a
return ListModel
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe ListModel -> IO (Maybe ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ListModel
maybeResult
#if defined(ENABLE_OVERLOADING)
data FilterListModelGetModelMethodInfo
instance (signature ~ (m (Maybe Gio.ListModel.ListModel)), MonadIO m, IsFilterListModel a) => O.MethodInfo FilterListModelGetModelMethodInfo a signature where
overloadedMethod = filterListModelGetModel
#endif
foreign import ccall "gtk_filter_list_model_has_filter" gtk_filter_list_model_has_filter ::
Ptr FilterListModel ->
IO CInt
filterListModelHasFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsFilterListModel a) =>
a
-> m Bool
filterListModelHasFilter :: a -> m Bool
filterListModelHasFilter self :: a
self = 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 FilterListModel
self' <- a -> IO (Ptr FilterListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CInt
result <- Ptr FilterListModel -> IO CInt
gtk_filter_list_model_has_filter Ptr FilterListModel
self'
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
self
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FilterListModelHasFilterMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFilterListModel a) => O.MethodInfo FilterListModelHasFilterMethodInfo a signature where
overloadedMethod = filterListModelHasFilter
#endif
foreign import ccall "gtk_filter_list_model_refilter" gtk_filter_list_model_refilter ::
Ptr FilterListModel ->
IO ()
filterListModelRefilter ::
(B.CallStack.HasCallStack, MonadIO m, IsFilterListModel a) =>
a
-> m ()
filterListModelRefilter :: a -> m ()
filterListModelRefilter self :: a
self = 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 FilterListModel
self' <- a -> IO (Ptr FilterListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr FilterListModel -> IO ()
gtk_filter_list_model_refilter Ptr FilterListModel
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FilterListModelRefilterMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFilterListModel a) => O.MethodInfo FilterListModelRefilterMethodInfo a signature where
overloadedMethod = filterListModelRefilter
#endif
foreign import ccall "gtk_filter_list_model_set_filter_func" gtk_filter_list_model_set_filter_func ::
Ptr FilterListModel ->
FunPtr Gtk.Callbacks.C_FilterListModelFilterFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
filterListModelSetFilterFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsFilterListModel a) =>
a
-> Maybe (Gtk.Callbacks.FilterListModelFilterFunc)
-> m ()
filterListModelSetFilterFunc :: a -> Maybe FilterListModelFilterFunc -> m ()
filterListModelSetFilterFunc self :: a
self filterFunc :: Maybe FilterListModelFilterFunc
filterFunc = 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 FilterListModel
self' <- a -> IO (Ptr FilterListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
FunPtr C_FilterListModelFilterFunc
maybeFilterFunc <- case Maybe FilterListModelFilterFunc
filterFunc of
Nothing -> FunPtr C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_FilterListModelFilterFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jFilterFunc :: FilterListModelFilterFunc
jFilterFunc -> do
FunPtr C_FilterListModelFilterFunc
jFilterFunc' <- C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
Gtk.Callbacks.mk_FilterListModelFilterFunc (Maybe (Ptr (FunPtr C_FilterListModelFilterFunc))
-> FilterListModelFilterFunc_WithClosures
-> C_FilterListModelFilterFunc
Gtk.Callbacks.wrap_FilterListModelFilterFunc Maybe (Ptr (FunPtr C_FilterListModelFilterFunc))
forall a. Maybe a
Nothing (FilterListModelFilterFunc -> FilterListModelFilterFunc_WithClosures
Gtk.Callbacks.drop_closures_FilterListModelFilterFunc FilterListModelFilterFunc
jFilterFunc))
FunPtr C_FilterListModelFilterFunc
-> IO (FunPtr C_FilterListModelFilterFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_FilterListModelFilterFunc
jFilterFunc'
let userData :: Ptr ()
userData = FunPtr C_FilterListModelFilterFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FilterListModelFilterFunc
maybeFilterFunc
let userDestroy :: FunPtr (Ptr a -> IO ())
userDestroy = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
Ptr FilterListModel
-> FunPtr C_FilterListModelFilterFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gtk_filter_list_model_set_filter_func Ptr FilterListModel
self' FunPtr C_FilterListModelFilterFunc
maybeFilterFunc Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
userDestroy
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FilterListModelSetFilterFuncMethodInfo
instance (signature ~ (Maybe (Gtk.Callbacks.FilterListModelFilterFunc) -> m ()), MonadIO m, IsFilterListModel a) => O.MethodInfo FilterListModelSetFilterFuncMethodInfo a signature where
overloadedMethod = filterListModelSetFilterFunc
#endif
foreign import ccall "gtk_filter_list_model_set_model" gtk_filter_list_model_set_model ::
Ptr FilterListModel ->
Ptr Gio.ListModel.ListModel ->
IO ()
filterListModelSetModel ::
(B.CallStack.HasCallStack, MonadIO m, IsFilterListModel a, Gio.ListModel.IsListModel b) =>
a
-> Maybe (b)
-> m ()
filterListModelSetModel :: a -> Maybe b -> m ()
filterListModelSetModel self :: a
self model :: 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 FilterListModel
self' <- a -> IO (Ptr FilterListModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr ListModel
maybeModel <- case Maybe b
model of
Nothing -> Ptr ListModel -> IO (Ptr ListModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ListModel
forall a. Ptr a
nullPtr
Just jModel :: 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 FilterListModel -> Ptr ListModel -> IO ()
gtk_filter_list_model_set_model Ptr FilterListModel
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 FilterListModelSetModelMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFilterListModel a, Gio.ListModel.IsListModel b) => O.MethodInfo FilterListModelSetModelMethodInfo a signature where
overloadedMethod = filterListModelSetModel
#endif