{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GObject.Structs.ClosureNotifyData
(
ClosureNotifyData(..) ,
newZeroClosureNotifyData ,
#if defined(ENABLE_OVERLOADING)
ResolveClosureNotifyDataMethod ,
#endif
clearClosureNotifyDataData ,
#if defined(ENABLE_OVERLOADING)
closureNotifyData_data ,
#endif
getClosureNotifyDataData ,
setClosureNotifyDataData ,
clearClosureNotifyDataNotify ,
#if defined(ENABLE_OVERLOADING)
closureNotifyData_notify ,
#endif
getClosureNotifyDataNotify ,
setClosureNotifyDataNotify ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GObject.Callbacks as GObject.Callbacks
newtype ClosureNotifyData = ClosureNotifyData (SP.ManagedPtr ClosureNotifyData)
deriving (ClosureNotifyData -> ClosureNotifyData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClosureNotifyData -> ClosureNotifyData -> Bool
$c/= :: ClosureNotifyData -> ClosureNotifyData -> Bool
== :: ClosureNotifyData -> ClosureNotifyData -> Bool
$c== :: ClosureNotifyData -> ClosureNotifyData -> Bool
Eq)
instance SP.ManagedPtrNewtype ClosureNotifyData where
toManagedPtr :: ClosureNotifyData -> ManagedPtr ClosureNotifyData
toManagedPtr (ClosureNotifyData ManagedPtr ClosureNotifyData
p) = ManagedPtr ClosureNotifyData
p
instance BoxedPtr ClosureNotifyData where
boxedPtrCopy :: ClosureNotifyData -> IO ClosureNotifyData
boxedPtrCopy = \ClosureNotifyData
p -> forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ClosureNotifyData
p (forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
8 forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr ClosureNotifyData -> ClosureNotifyData
ClosureNotifyData)
boxedPtrFree :: ClosureNotifyData -> IO ()
boxedPtrFree = \ClosureNotifyData
x -> forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr ClosureNotifyData
x forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr ClosureNotifyData where
boxedPtrCalloc :: IO (Ptr ClosureNotifyData)
boxedPtrCalloc = forall a. Int -> IO (Ptr a)
callocBytes Int
8
newZeroClosureNotifyData :: MonadIO m => m ClosureNotifyData
newZeroClosureNotifyData :: forall (m :: * -> *). MonadIO m => m ClosureNotifyData
newZeroClosureNotifyData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr ClosureNotifyData -> ClosureNotifyData
ClosureNotifyData
instance tag ~ 'AttrSet => Constructible ClosureNotifyData tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr ClosureNotifyData -> ClosureNotifyData)
-> [AttrOp ClosureNotifyData tag] -> m ClosureNotifyData
new ManagedPtr ClosureNotifyData -> ClosureNotifyData
_ [AttrOp ClosureNotifyData tag]
attrs = do
ClosureNotifyData
o <- forall (m :: * -> *). MonadIO m => m ClosureNotifyData
newZeroClosureNotifyData
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set ClosureNotifyData
o [AttrOp ClosureNotifyData tag]
attrs
forall (m :: * -> *) a. Monad m => a -> m a
return ClosureNotifyData
o
getClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> m (Ptr ())
getClosureNotifyDataData :: forall (m :: * -> *). MonadIO m => ClosureNotifyData -> m (Ptr ())
getClosureNotifyDataData ClosureNotifyData
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
Ptr ()
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> Ptr () -> m ()
setClosureNotifyDataData :: forall (m :: * -> *).
MonadIO m =>
ClosureNotifyData -> Ptr () -> m ()
setClosureNotifyDataData ClosureNotifyData
s Ptr ()
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
val :: Ptr ())
clearClosureNotifyDataData :: MonadIO m => ClosureNotifyData -> m ()
clearClosureNotifyDataData :: forall (m :: * -> *). MonadIO m => ClosureNotifyData -> m ()
clearClosureNotifyDataData ClosureNotifyData
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data ClosureNotifyDataDataFieldInfo
instance AttrInfo ClosureNotifyDataDataFieldInfo where
type AttrBaseTypeConstraint ClosureNotifyDataDataFieldInfo = (~) ClosureNotifyData
type AttrAllowedOps ClosureNotifyDataDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ClosureNotifyDataDataFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint ClosureNotifyDataDataFieldInfo = (~)(Ptr ())
type AttrTransferType ClosureNotifyDataDataFieldInfo = (Ptr ())
type AttrGetType ClosureNotifyDataDataFieldInfo = Ptr ()
type AttrLabel ClosureNotifyDataDataFieldInfo = "data"
type AttrOrigin ClosureNotifyDataDataFieldInfo = ClosureNotifyData
attrGet = getClosureNotifyDataData
attrSet = setClosureNotifyDataData
attrConstruct = undefined
attrClear = clearClosureNotifyDataData
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Structs.ClosureNotifyData.data"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Structs-ClosureNotifyData.html#g:attr:data"
})
closureNotifyData_data :: AttrLabelProxy "data"
closureNotifyData_data = AttrLabelProxy
#endif
getClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> m (Maybe GObject.Callbacks.ClosureNotify)
getClosureNotifyDataNotify :: forall (m :: * -> *).
MonadIO m =>
ClosureNotifyData -> m (Maybe ClosureNotify)
getClosureNotifyDataNotify ClosureNotifyData
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
FunPtr C_ClosureNotify
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) :: IO (FunPtr GObject.Callbacks.C_ClosureNotify)
Maybe ClosureNotify
result <- forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_ClosureNotify
val forall a b. (a -> b) -> a -> b
$ \FunPtr C_ClosureNotify
val' -> do
let val'' :: ClosureNotify
val'' = forall (m :: * -> *) a.
(HasCallStack, MonadIO m) =>
FunPtr C_ClosureNotify -> Ptr () -> GClosure a -> m ()
GObject.Callbacks.dynamic_ClosureNotify FunPtr C_ClosureNotify
val'
forall (m :: * -> *) a. Monad m => a -> m a
return ClosureNotify
val''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ClosureNotify
result
setClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> FunPtr GObject.Callbacks.C_ClosureNotify -> m ()
setClosureNotifyDataNotify :: forall (m :: * -> *).
MonadIO m =>
ClosureNotifyData -> FunPtr C_ClosureNotify -> m ()
setClosureNotifyDataNotify ClosureNotifyData
s FunPtr C_ClosureNotify
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) (FunPtr C_ClosureNotify
val :: FunPtr GObject.Callbacks.C_ClosureNotify)
clearClosureNotifyDataNotify :: MonadIO m => ClosureNotifyData -> m ()
clearClosureNotifyDataNotify :: forall (m :: * -> *). MonadIO m => ClosureNotifyData -> m ()
clearClosureNotifyDataNotify ClosureNotifyData
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr ClosureNotifyData
s forall a b. (a -> b) -> a -> b
$ \Ptr ClosureNotifyData
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ClosureNotifyData
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) (forall a. FunPtr a
FP.nullFunPtr :: FunPtr GObject.Callbacks.C_ClosureNotify)
#if defined(ENABLE_OVERLOADING)
data ClosureNotifyDataNotifyFieldInfo
instance AttrInfo ClosureNotifyDataNotifyFieldInfo where
type AttrBaseTypeConstraint ClosureNotifyDataNotifyFieldInfo = (~) ClosureNotifyData
type AttrAllowedOps ClosureNotifyDataNotifyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ClosureNotifyDataNotifyFieldInfo = (~) (FunPtr GObject.Callbacks.C_ClosureNotify)
type AttrTransferTypeConstraint ClosureNotifyDataNotifyFieldInfo = (~)GObject.Callbacks.ClosureNotify
type AttrTransferType ClosureNotifyDataNotifyFieldInfo = (FunPtr GObject.Callbacks.C_ClosureNotify)
type AttrGetType ClosureNotifyDataNotifyFieldInfo = Maybe GObject.Callbacks.ClosureNotify
type AttrLabel ClosureNotifyDataNotifyFieldInfo = "notify"
type AttrOrigin ClosureNotifyDataNotifyFieldInfo = ClosureNotifyData
attrGet = getClosureNotifyDataNotify
attrSet = setClosureNotifyDataNotify
attrConstruct = undefined
attrClear = clearClosureNotifyDataNotify
attrTransfer _ v = do
GObject.Callbacks.mk_ClosureNotify (GObject.Callbacks.wrap_ClosureNotify Nothing v)
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Structs.ClosureNotifyData.notify"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Structs-ClosureNotifyData.html#g:attr:notify"
})
closureNotifyData_notify :: AttrLabelProxy "notify"
closureNotifyData_notify = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ClosureNotifyData
type instance O.AttributeList ClosureNotifyData = ClosureNotifyDataAttributeList
type ClosureNotifyDataAttributeList = ('[ '("data", ClosureNotifyDataDataFieldInfo), '("notify", ClosureNotifyDataNotifyFieldInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveClosureNotifyDataMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveClosureNotifyDataMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveClosureNotifyDataMethod t ClosureNotifyData, O.OverloadedMethod info ClosureNotifyData p) => OL.IsLabel t (ClosureNotifyData -> 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 ~ ResolveClosureNotifyDataMethod t ClosureNotifyData, O.OverloadedMethod info ClosureNotifyData p, R.HasField t ClosureNotifyData p) => R.HasField t ClosureNotifyData p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveClosureNotifyDataMethod t ClosureNotifyData, O.OverloadedMethodInfo info ClosureNotifyData) => OL.IsLabel t (O.MethodProxy info ClosureNotifyData) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif