{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.SourceFuncs
(
SourceFuncs(..) ,
newZeroSourceFuncs ,
#if defined(ENABLE_OVERLOADING)
ResolveSourceFuncsMethod ,
#endif
clearSourceFuncsCheck ,
getSourceFuncsCheck ,
setSourceFuncsCheck ,
#if defined(ENABLE_OVERLOADING)
sourceFuncs_check ,
#endif
clearSourceFuncsFinalize ,
getSourceFuncsFinalize ,
setSourceFuncsFinalize ,
#if defined(ENABLE_OVERLOADING)
sourceFuncs_finalize ,
#endif
clearSourceFuncsPrepare ,
getSourceFuncsPrepare ,
setSourceFuncsPrepare ,
#if defined(ENABLE_OVERLOADING)
sourceFuncs_prepare ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
#else
import qualified GI.GLib.Callbacks as GLib.Callbacks
#endif
newtype SourceFuncs = SourceFuncs (SP.ManagedPtr SourceFuncs)
deriving (SourceFuncs -> SourceFuncs -> Bool
(SourceFuncs -> SourceFuncs -> Bool)
-> (SourceFuncs -> SourceFuncs -> Bool) -> Eq SourceFuncs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SourceFuncs -> SourceFuncs -> Bool
== :: SourceFuncs -> SourceFuncs -> Bool
$c/= :: SourceFuncs -> SourceFuncs -> Bool
/= :: SourceFuncs -> SourceFuncs -> Bool
Eq)
instance SP.ManagedPtrNewtype SourceFuncs where
toManagedPtr :: SourceFuncs -> ManagedPtr SourceFuncs
toManagedPtr (SourceFuncs ManagedPtr SourceFuncs
p) = ManagedPtr SourceFuncs
p
instance BoxedPtr SourceFuncs where
boxedPtrCopy :: SourceFuncs -> IO SourceFuncs
boxedPtrCopy = \SourceFuncs
p -> SourceFuncs
-> (Ptr SourceFuncs -> IO SourceFuncs) -> IO SourceFuncs
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SourceFuncs
p (Int -> Ptr SourceFuncs -> IO (Ptr SourceFuncs)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
48 (Ptr SourceFuncs -> IO (Ptr SourceFuncs))
-> (Ptr SourceFuncs -> IO SourceFuncs)
-> Ptr SourceFuncs
-> IO SourceFuncs
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr SourceFuncs -> SourceFuncs)
-> Ptr SourceFuncs -> IO SourceFuncs
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr SourceFuncs -> SourceFuncs
SourceFuncs)
boxedPtrFree :: SourceFuncs -> IO ()
boxedPtrFree = \SourceFuncs
x -> SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr SourceFuncs
x Ptr SourceFuncs -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr SourceFuncs where
boxedPtrCalloc :: IO (Ptr SourceFuncs)
boxedPtrCalloc = Int -> IO (Ptr SourceFuncs)
forall a. Int -> IO (Ptr a)
callocBytes Int
48
newZeroSourceFuncs :: MonadIO m => m SourceFuncs
newZeroSourceFuncs :: forall (m :: * -> *). MonadIO m => m SourceFuncs
newZeroSourceFuncs = IO SourceFuncs -> m SourceFuncs
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SourceFuncs -> m SourceFuncs)
-> IO SourceFuncs -> m SourceFuncs
forall a b. (a -> b) -> a -> b
$ IO (Ptr SourceFuncs)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr SourceFuncs)
-> (Ptr SourceFuncs -> IO SourceFuncs) -> IO SourceFuncs
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr SourceFuncs -> SourceFuncs)
-> Ptr SourceFuncs -> IO SourceFuncs
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr SourceFuncs -> SourceFuncs
SourceFuncs
instance tag ~ 'AttrSet => Constructible SourceFuncs tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr SourceFuncs -> SourceFuncs)
-> [AttrOp SourceFuncs tag] -> m SourceFuncs
new ManagedPtr SourceFuncs -> SourceFuncs
_ [AttrOp SourceFuncs tag]
attrs = do
SourceFuncs
o <- m SourceFuncs
forall (m :: * -> *). MonadIO m => m SourceFuncs
newZeroSourceFuncs
SourceFuncs -> [AttrOp SourceFuncs 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set SourceFuncs
o [AttrOp SourceFuncs tag]
[AttrOp SourceFuncs 'AttrSet]
attrs
SourceFuncs -> m SourceFuncs
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return SourceFuncs
o
getSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m (Maybe GLib.Callbacks.SourceFuncsPrepareFunc)
getSourceFuncsPrepare :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> m (Maybe SourceFuncsPrepareFunc)
getSourceFuncsPrepare SourceFuncs
s = IO (Maybe SourceFuncsPrepareFunc)
-> m (Maybe SourceFuncsPrepareFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SourceFuncsPrepareFunc)
-> m (Maybe SourceFuncsPrepareFunc))
-> IO (Maybe SourceFuncsPrepareFunc)
-> m (Maybe SourceFuncsPrepareFunc)
forall a b. (a -> b) -> a -> b
$ SourceFuncs
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsPrepareFunc))
-> IO (Maybe SourceFuncsPrepareFunc)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO (Maybe SourceFuncsPrepareFunc))
-> IO (Maybe SourceFuncsPrepareFunc))
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsPrepareFunc))
-> IO (Maybe SourceFuncsPrepareFunc)
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
FunPtr C_SourceFuncsPrepareFunc
val <- Ptr (FunPtr C_SourceFuncsPrepareFunc)
-> IO (FunPtr C_SourceFuncsPrepareFunc)
forall a. Storable a => Ptr a -> IO a
peek (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsPrepareFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc)
Maybe SourceFuncsPrepareFunc
result <- FunPtr C_SourceFuncsPrepareFunc
-> (FunPtr C_SourceFuncsPrepareFunc -> IO SourceFuncsPrepareFunc)
-> IO (Maybe SourceFuncsPrepareFunc)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_SourceFuncsPrepareFunc
val ((FunPtr C_SourceFuncsPrepareFunc -> IO SourceFuncsPrepareFunc)
-> IO (Maybe SourceFuncsPrepareFunc))
-> (FunPtr C_SourceFuncsPrepareFunc -> IO SourceFuncsPrepareFunc)
-> IO (Maybe SourceFuncsPrepareFunc)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_SourceFuncsPrepareFunc
val' -> do
let val'' :: SourceFuncsPrepareFunc
val'' = FunPtr C_SourceFuncsPrepareFunc -> SourceFuncsPrepareFunc
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_SourceFuncsPrepareFunc -> Source -> m (Bool, Int32)
GLib.Callbacks.dynamic_SourceFuncsPrepareFunc FunPtr C_SourceFuncsPrepareFunc
val'
SourceFuncsPrepareFunc -> IO SourceFuncsPrepareFunc
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SourceFuncsPrepareFunc
val''
Maybe SourceFuncsPrepareFunc -> IO (Maybe SourceFuncsPrepareFunc)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SourceFuncsPrepareFunc
result
setSourceFuncsPrepare :: MonadIO m => SourceFuncs -> FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc -> m ()
setSourceFuncsPrepare :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> FunPtr C_SourceFuncsPrepareFunc -> m ()
setSourceFuncsPrepare SourceFuncs
s FunPtr C_SourceFuncsPrepareFunc
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsPrepareFunc)
-> FunPtr C_SourceFuncsPrepareFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsPrepareFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr C_SourceFuncsPrepareFunc
val :: FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc)
clearSourceFuncsPrepare :: MonadIO m => SourceFuncs -> m ()
clearSourceFuncsPrepare :: forall (m :: * -> *). MonadIO m => SourceFuncs -> m ()
clearSourceFuncsPrepare SourceFuncs
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsPrepareFunc)
-> FunPtr C_SourceFuncsPrepareFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsPrepareFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr C_SourceFuncsPrepareFunc
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc)
#if defined(ENABLE_OVERLOADING)
data SourceFuncsPrepareFieldInfo
instance AttrInfo SourceFuncsPrepareFieldInfo where
type AttrBaseTypeConstraint SourceFuncsPrepareFieldInfo = (~) SourceFuncs
type AttrAllowedOps SourceFuncsPrepareFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SourceFuncsPrepareFieldInfo = (~) (FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc)
type AttrTransferTypeConstraint SourceFuncsPrepareFieldInfo = (~)GLib.Callbacks.SourceFuncsPrepareFunc
type AttrTransferType SourceFuncsPrepareFieldInfo = (FunPtr GLib.Callbacks.C_SourceFuncsPrepareFunc)
type AttrGetType SourceFuncsPrepareFieldInfo = Maybe GLib.Callbacks.SourceFuncsPrepareFunc
type AttrLabel SourceFuncsPrepareFieldInfo = "prepare"
type AttrOrigin SourceFuncsPrepareFieldInfo = SourceFuncs
attrGet = getSourceFuncsPrepare
attrSet = setSourceFuncsPrepare
attrConstruct = undefined
attrClear = clearSourceFuncsPrepare
attrTransfer _ v = do
GLib.Callbacks.mk_SourceFuncsPrepareFunc (GLib.Callbacks.wrap_SourceFuncsPrepareFunc Nothing v)
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.SourceFuncs.prepare"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-SourceFuncs.html#g:attr:prepare"
})
sourceFuncs_prepare :: AttrLabelProxy "prepare"
sourceFuncs_prepare = AttrLabelProxy
#endif
getSourceFuncsCheck :: MonadIO m => SourceFuncs -> m (Maybe GLib.Callbacks.SourceFuncsCheckFunc)
getSourceFuncsCheck :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> m (Maybe SourceFuncsCheckFunc)
getSourceFuncsCheck SourceFuncs
s = IO (Maybe SourceFuncsCheckFunc) -> m (Maybe SourceFuncsCheckFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SourceFuncsCheckFunc) -> m (Maybe SourceFuncsCheckFunc))
-> IO (Maybe SourceFuncsCheckFunc)
-> m (Maybe SourceFuncsCheckFunc)
forall a b. (a -> b) -> a -> b
$ SourceFuncs
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsCheckFunc))
-> IO (Maybe SourceFuncsCheckFunc)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO (Maybe SourceFuncsCheckFunc))
-> IO (Maybe SourceFuncsCheckFunc))
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsCheckFunc))
-> IO (Maybe SourceFuncsCheckFunc)
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
FunPtr C_SourceFuncsCheckFunc
val <- Ptr (FunPtr C_SourceFuncsCheckFunc)
-> IO (FunPtr C_SourceFuncsCheckFunc)
forall a. Storable a => Ptr a -> IO a
peek (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsCheckFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO (FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc)
Maybe SourceFuncsCheckFunc
result <- FunPtr C_SourceFuncsCheckFunc
-> (FunPtr C_SourceFuncsCheckFunc -> IO SourceFuncsCheckFunc)
-> IO (Maybe SourceFuncsCheckFunc)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_SourceFuncsCheckFunc
val ((FunPtr C_SourceFuncsCheckFunc -> IO SourceFuncsCheckFunc)
-> IO (Maybe SourceFuncsCheckFunc))
-> (FunPtr C_SourceFuncsCheckFunc -> IO SourceFuncsCheckFunc)
-> IO (Maybe SourceFuncsCheckFunc)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_SourceFuncsCheckFunc
val' -> do
let val'' :: SourceFuncsCheckFunc
val'' = FunPtr C_SourceFuncsCheckFunc -> SourceFuncsCheckFunc
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_SourceFuncsCheckFunc -> Source -> m Bool
GLib.Callbacks.dynamic_SourceFuncsCheckFunc FunPtr C_SourceFuncsCheckFunc
val'
SourceFuncsCheckFunc -> IO SourceFuncsCheckFunc
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SourceFuncsCheckFunc
val''
Maybe SourceFuncsCheckFunc -> IO (Maybe SourceFuncsCheckFunc)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SourceFuncsCheckFunc
result
setSourceFuncsCheck :: MonadIO m => SourceFuncs -> FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc -> m ()
setSourceFuncsCheck :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> FunPtr C_SourceFuncsCheckFunc -> m ()
setSourceFuncsCheck SourceFuncs
s FunPtr C_SourceFuncsCheckFunc
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsCheckFunc)
-> FunPtr C_SourceFuncsCheckFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsCheckFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr C_SourceFuncsCheckFunc
val :: FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc)
clearSourceFuncsCheck :: MonadIO m => SourceFuncs -> m ()
clearSourceFuncsCheck :: forall (m :: * -> *). MonadIO m => SourceFuncs -> m ()
clearSourceFuncsCheck SourceFuncs
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsCheckFunc)
-> FunPtr C_SourceFuncsCheckFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsCheckFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr C_SourceFuncsCheckFunc
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc)
#if defined(ENABLE_OVERLOADING)
data SourceFuncsCheckFieldInfo
instance AttrInfo SourceFuncsCheckFieldInfo where
type AttrBaseTypeConstraint SourceFuncsCheckFieldInfo = (~) SourceFuncs
type AttrAllowedOps SourceFuncsCheckFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SourceFuncsCheckFieldInfo = (~) (FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc)
type AttrTransferTypeConstraint SourceFuncsCheckFieldInfo = (~)GLib.Callbacks.SourceFuncsCheckFunc
type AttrTransferType SourceFuncsCheckFieldInfo = (FunPtr GLib.Callbacks.C_SourceFuncsCheckFunc)
type AttrGetType SourceFuncsCheckFieldInfo = Maybe GLib.Callbacks.SourceFuncsCheckFunc
type AttrLabel SourceFuncsCheckFieldInfo = "check"
type AttrOrigin SourceFuncsCheckFieldInfo = SourceFuncs
attrGet = getSourceFuncsCheck
attrSet = setSourceFuncsCheck
attrConstruct = undefined
attrClear = clearSourceFuncsCheck
attrTransfer _ v = do
GLib.Callbacks.mk_SourceFuncsCheckFunc (GLib.Callbacks.wrap_SourceFuncsCheckFunc Nothing v)
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.SourceFuncs.check"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-SourceFuncs.html#g:attr:check"
})
sourceFuncs_check :: AttrLabelProxy "check"
sourceFuncs_check = AttrLabelProxy
#endif
getSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m (Maybe GLib.Callbacks.SourceFuncsFinalizeFunc)
getSourceFuncsFinalize :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> m (Maybe SourceFuncsFinalizeFunc)
getSourceFuncsFinalize SourceFuncs
s = IO (Maybe SourceFuncsFinalizeFunc)
-> m (Maybe SourceFuncsFinalizeFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SourceFuncsFinalizeFunc)
-> m (Maybe SourceFuncsFinalizeFunc))
-> IO (Maybe SourceFuncsFinalizeFunc)
-> m (Maybe SourceFuncsFinalizeFunc)
forall a b. (a -> b) -> a -> b
$ SourceFuncs
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsFinalizeFunc))
-> IO (Maybe SourceFuncsFinalizeFunc)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO (Maybe SourceFuncsFinalizeFunc))
-> IO (Maybe SourceFuncsFinalizeFunc))
-> (Ptr SourceFuncs -> IO (Maybe SourceFuncsFinalizeFunc))
-> IO (Maybe SourceFuncsFinalizeFunc)
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
FunPtr C_SourceFuncsFinalizeFunc
val <- Ptr (FunPtr C_SourceFuncsFinalizeFunc)
-> IO (FunPtr C_SourceFuncsFinalizeFunc)
forall a. Storable a => Ptr a -> IO a
peek (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsFinalizeFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc)
Maybe SourceFuncsFinalizeFunc
result <- FunPtr C_SourceFuncsFinalizeFunc
-> (FunPtr C_SourceFuncsFinalizeFunc -> IO SourceFuncsFinalizeFunc)
-> IO (Maybe SourceFuncsFinalizeFunc)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_SourceFuncsFinalizeFunc
val ((FunPtr C_SourceFuncsFinalizeFunc -> IO SourceFuncsFinalizeFunc)
-> IO (Maybe SourceFuncsFinalizeFunc))
-> (FunPtr C_SourceFuncsFinalizeFunc -> IO SourceFuncsFinalizeFunc)
-> IO (Maybe SourceFuncsFinalizeFunc)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_SourceFuncsFinalizeFunc
val' -> do
let val'' :: SourceFuncsFinalizeFunc
val'' = FunPtr C_SourceFuncsFinalizeFunc -> SourceFuncsFinalizeFunc
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_SourceFuncsFinalizeFunc -> Source -> m ()
GLib.Callbacks.dynamic_SourceFuncsFinalizeFunc FunPtr C_SourceFuncsFinalizeFunc
val'
SourceFuncsFinalizeFunc -> IO SourceFuncsFinalizeFunc
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SourceFuncsFinalizeFunc
val''
Maybe SourceFuncsFinalizeFunc -> IO (Maybe SourceFuncsFinalizeFunc)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SourceFuncsFinalizeFunc
result
setSourceFuncsFinalize :: MonadIO m => SourceFuncs -> FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc -> m ()
setSourceFuncsFinalize :: forall (m :: * -> *).
MonadIO m =>
SourceFuncs -> FunPtr C_SourceFuncsFinalizeFunc -> m ()
setSourceFuncsFinalize SourceFuncs
s FunPtr C_SourceFuncsFinalizeFunc
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsFinalizeFunc)
-> FunPtr C_SourceFuncsFinalizeFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsFinalizeFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr C_SourceFuncsFinalizeFunc
val :: FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc)
clearSourceFuncsFinalize :: MonadIO m => SourceFuncs -> m ()
clearSourceFuncsFinalize :: forall (m :: * -> *). MonadIO m => SourceFuncs -> m ()
clearSourceFuncsFinalize SourceFuncs
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SourceFuncs -> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SourceFuncs
s ((Ptr SourceFuncs -> IO ()) -> IO ())
-> (Ptr SourceFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SourceFuncs
ptr -> do
Ptr (FunPtr C_SourceFuncsFinalizeFunc)
-> FunPtr C_SourceFuncsFinalizeFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SourceFuncs
ptr Ptr SourceFuncs -> Int -> Ptr (FunPtr C_SourceFuncsFinalizeFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr C_SourceFuncsFinalizeFunc
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc)
#if defined(ENABLE_OVERLOADING)
data SourceFuncsFinalizeFieldInfo
instance AttrInfo SourceFuncsFinalizeFieldInfo where
type AttrBaseTypeConstraint SourceFuncsFinalizeFieldInfo = (~) SourceFuncs
type AttrAllowedOps SourceFuncsFinalizeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SourceFuncsFinalizeFieldInfo = (~) (FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc)
type AttrTransferTypeConstraint SourceFuncsFinalizeFieldInfo = (~)GLib.Callbacks.SourceFuncsFinalizeFunc
type AttrTransferType SourceFuncsFinalizeFieldInfo = (FunPtr GLib.Callbacks.C_SourceFuncsFinalizeFunc)
type AttrGetType SourceFuncsFinalizeFieldInfo = Maybe GLib.Callbacks.SourceFuncsFinalizeFunc
type AttrLabel SourceFuncsFinalizeFieldInfo = "finalize"
type AttrOrigin SourceFuncsFinalizeFieldInfo = SourceFuncs
attrGet = getSourceFuncsFinalize
attrSet = setSourceFuncsFinalize
attrConstruct = undefined
attrClear = clearSourceFuncsFinalize
attrTransfer _ v = do
GLib.Callbacks.mk_SourceFuncsFinalizeFunc (GLib.Callbacks.wrap_SourceFuncsFinalizeFunc Nothing v)
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.SourceFuncs.finalize"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-SourceFuncs.html#g:attr:finalize"
})
sourceFuncs_finalize :: AttrLabelProxy "finalize"
sourceFuncs_finalize = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SourceFuncs
type instance O.AttributeList SourceFuncs = SourceFuncsAttributeList
type SourceFuncsAttributeList = ('[ '("prepare", SourceFuncsPrepareFieldInfo), '("check", SourceFuncsCheckFieldInfo), '("finalize", SourceFuncsFinalizeFieldInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveSourceFuncsMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSourceFuncsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSourceFuncsMethod t SourceFuncs, O.OverloadedMethod info SourceFuncs p) => OL.IsLabel t (SourceFuncs -> 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 ~ ResolveSourceFuncsMethod t SourceFuncs, O.OverloadedMethod info SourceFuncs p, R.HasField t SourceFuncs p) => R.HasField t SourceFuncs p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSourceFuncsMethod t SourceFuncs, O.OverloadedMethodInfo info SourceFuncs) => OL.IsLabel t (O.MethodProxy info SourceFuncs) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif