{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.Hook
(
Hook(..) ,
newZeroHook ,
#if defined(ENABLE_OVERLOADING)
ResolveHookMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
HookCompareIdsMethodInfo ,
#endif
hookCompareIds ,
hookDestroy ,
hookDestroyLink ,
hookFree ,
hookInsertBefore ,
hookPrepend ,
hookUnref ,
clearHookData ,
getHookData ,
#if defined(ENABLE_OVERLOADING)
hook_data ,
#endif
setHookData ,
clearHookDestroy ,
getHookDestroy ,
#if defined(ENABLE_OVERLOADING)
hook_destroy ,
#endif
setHookDestroy ,
getHookFlags ,
#if defined(ENABLE_OVERLOADING)
hook_flags ,
#endif
setHookFlags ,
clearHookFunc ,
getHookFunc ,
#if defined(ENABLE_OVERLOADING)
hook_func ,
#endif
setHookFunc ,
getHookHookId ,
#if defined(ENABLE_OVERLOADING)
hook_hookId ,
#endif
setHookHookId ,
clearHookNext ,
getHookNext ,
#if defined(ENABLE_OVERLOADING)
hook_next ,
#endif
setHookNext ,
clearHookPrev ,
getHookPrev ,
#if defined(ENABLE_OVERLOADING)
hook_prev ,
#endif
setHookPrev ,
getHookRefCount ,
#if defined(ENABLE_OVERLOADING)
hook_refCount ,
#endif
setHookRefCount ,
) 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.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.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 {-# SOURCE #-} qualified GI.GLib.Structs.HookList as GLib.HookList
newtype Hook = Hook (SP.ManagedPtr Hook)
deriving (Hook -> Hook -> Bool
(Hook -> Hook -> Bool) -> (Hook -> Hook -> Bool) -> Eq Hook
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Hook -> Hook -> Bool
$c/= :: Hook -> Hook -> Bool
== :: Hook -> Hook -> Bool
$c== :: Hook -> Hook -> Bool
Eq)
instance SP.ManagedPtrNewtype Hook where
toManagedPtr :: Hook -> ManagedPtr Hook
toManagedPtr (Hook ManagedPtr Hook
p) = ManagedPtr Hook
p
instance BoxedPtr Hook where
boxedPtrCopy :: Hook -> IO Hook
boxedPtrCopy = \Hook
p -> Hook -> (Ptr Hook -> IO Hook) -> IO Hook
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Hook
p (Int -> Ptr Hook -> IO (Ptr Hook)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
64 (Ptr Hook -> IO (Ptr Hook))
-> (Ptr Hook -> IO Hook) -> Ptr Hook -> IO Hook
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr Hook -> Hook) -> Ptr Hook -> IO Hook
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr Hook -> Hook
Hook)
boxedPtrFree :: Hook -> IO ()
boxedPtrFree = \Hook
x -> Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr Hook
x Ptr Hook -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr Hook where
boxedPtrCalloc :: IO (Ptr Hook)
boxedPtrCalloc = Int -> IO (Ptr Hook)
forall a. Int -> IO (Ptr a)
callocBytes Int
64
newZeroHook :: MonadIO m => m Hook
newZeroHook :: m Hook
newZeroHook = IO Hook -> m Hook
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hook -> m Hook) -> IO Hook -> m Hook
forall a b. (a -> b) -> a -> b
$ IO (Ptr Hook)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr Hook) -> (Ptr Hook -> IO Hook) -> IO Hook
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Hook -> Hook) -> Ptr Hook -> IO Hook
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Hook -> Hook
Hook
instance tag ~ 'AttrSet => Constructible Hook tag where
new :: (ManagedPtr Hook -> Hook) -> [AttrOp Hook tag] -> m Hook
new ManagedPtr Hook -> Hook
_ [AttrOp Hook tag]
attrs = do
Hook
o <- m Hook
forall (m :: * -> *). MonadIO m => m Hook
newZeroHook
Hook -> [AttrOp Hook 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Hook
o [AttrOp Hook tag]
[AttrOp Hook 'AttrSet]
attrs
Hook -> m Hook
forall (m :: * -> *) a. Monad m => a -> m a
return Hook
o
getHookData :: MonadIO m => Hook -> m (Ptr ())
getHookData :: Hook -> m (Ptr ())
getHookData Hook
s = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO (Ptr ())) -> IO (Ptr ())
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr Hook -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr ()
val <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr ())
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setHookData :: MonadIO m => Hook -> Ptr () -> m ()
setHookData :: Hook -> Ptr () -> m ()
setHookData Hook
s Ptr ()
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
val :: Ptr ())
clearHookData :: MonadIO m => Hook -> m ()
clearHookData :: Hook -> m ()
clearHookData Hook
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data HookDataFieldInfo
instance AttrInfo HookDataFieldInfo where
type AttrBaseTypeConstraint HookDataFieldInfo = (~) Hook
type AttrAllowedOps HookDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint HookDataFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint HookDataFieldInfo = (~)(Ptr ())
type AttrTransferType HookDataFieldInfo = (Ptr ())
type AttrGetType HookDataFieldInfo = Ptr ()
type AttrLabel HookDataFieldInfo = "data"
type AttrOrigin HookDataFieldInfo = Hook
attrGet = getHookData
attrSet = setHookData
attrConstruct = undefined
attrClear = clearHookData
attrTransfer _ v = do
return v
hook_data :: AttrLabelProxy "data"
hook_data = AttrLabelProxy
#endif
getHookNext :: MonadIO m => Hook -> m (Maybe Hook)
getHookNext :: Hook -> m (Maybe Hook)
getHookNext Hook
s = IO (Maybe Hook) -> m (Maybe Hook)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Hook) -> m (Maybe Hook))
-> IO (Maybe Hook) -> m (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook))
-> (Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr Hook
val <- Ptr (Ptr Hook) -> IO (Ptr Hook)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO (Ptr Hook)
Maybe Hook
result <- Ptr Hook -> (Ptr Hook -> IO Hook) -> IO (Maybe Hook)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr Hook
val ((Ptr Hook -> IO Hook) -> IO (Maybe Hook))
-> (Ptr Hook -> IO Hook) -> IO (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
val' -> do
Hook
val'' <- ((ManagedPtr Hook -> Hook) -> Ptr Hook -> IO Hook
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Hook -> Hook
Hook) Ptr Hook
val'
Hook -> IO Hook
forall (m :: * -> *) a. Monad m => a -> m a
return Hook
val''
Maybe Hook -> IO (Maybe Hook)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Hook
result
setHookNext :: MonadIO m => Hook -> Ptr Hook -> m ()
setHookNext :: Hook -> Ptr Hook -> m ()
setHookNext Hook
s Ptr Hook
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr Hook) -> Ptr Hook -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Ptr Hook
val :: Ptr Hook)
clearHookNext :: MonadIO m => Hook -> m ()
clearHookNext :: Hook -> m ()
clearHookNext Hook
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr Hook) -> Ptr Hook -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Ptr Hook
forall a. Ptr a
FP.nullPtr :: Ptr Hook)
#if defined(ENABLE_OVERLOADING)
data HookNextFieldInfo
instance AttrInfo HookNextFieldInfo where
type AttrBaseTypeConstraint HookNextFieldInfo = (~) Hook
type AttrAllowedOps HookNextFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint HookNextFieldInfo = (~) (Ptr Hook)
type AttrTransferTypeConstraint HookNextFieldInfo = (~)(Ptr Hook)
type AttrTransferType HookNextFieldInfo = (Ptr Hook)
type AttrGetType HookNextFieldInfo = Maybe Hook
type AttrLabel HookNextFieldInfo = "next"
type AttrOrigin HookNextFieldInfo = Hook
attrGet = getHookNext
attrSet = setHookNext
attrConstruct = undefined
attrClear = clearHookNext
attrTransfer _ v = do
return v
hook_next :: AttrLabelProxy "next"
hook_next = AttrLabelProxy
#endif
getHookPrev :: MonadIO m => Hook -> m (Maybe Hook)
getHookPrev :: Hook -> m (Maybe Hook)
getHookPrev Hook
s = IO (Maybe Hook) -> m (Maybe Hook)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Hook) -> m (Maybe Hook))
-> IO (Maybe Hook) -> m (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook))
-> (Ptr Hook -> IO (Maybe Hook)) -> IO (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr Hook
val <- Ptr (Ptr Hook) -> IO (Ptr Hook)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (Ptr Hook)
Maybe Hook
result <- Ptr Hook -> (Ptr Hook -> IO Hook) -> IO (Maybe Hook)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr Hook
val ((Ptr Hook -> IO Hook) -> IO (Maybe Hook))
-> (Ptr Hook -> IO Hook) -> IO (Maybe Hook)
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
val' -> do
Hook
val'' <- ((ManagedPtr Hook -> Hook) -> Ptr Hook -> IO Hook
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Hook -> Hook
Hook) Ptr Hook
val'
Hook -> IO Hook
forall (m :: * -> *) a. Monad m => a -> m a
return Hook
val''
Maybe Hook -> IO (Maybe Hook)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Hook
result
setHookPrev :: MonadIO m => Hook -> Ptr Hook -> m ()
setHookPrev :: Hook -> Ptr Hook -> m ()
setHookPrev Hook
s Ptr Hook
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr Hook) -> Ptr Hook -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr Hook
val :: Ptr Hook)
clearHookPrev :: MonadIO m => Hook -> m ()
clearHookPrev :: Hook -> m ()
clearHookPrev Hook
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr Hook) -> Ptr Hook -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr Hook)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr Hook
forall a. Ptr a
FP.nullPtr :: Ptr Hook)
#if defined(ENABLE_OVERLOADING)
data HookPrevFieldInfo
instance AttrInfo HookPrevFieldInfo where
type AttrBaseTypeConstraint HookPrevFieldInfo = (~) Hook
type AttrAllowedOps HookPrevFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint HookPrevFieldInfo = (~) (Ptr Hook)
type AttrTransferTypeConstraint HookPrevFieldInfo = (~)(Ptr Hook)
type AttrTransferType HookPrevFieldInfo = (Ptr Hook)
type AttrGetType HookPrevFieldInfo = Maybe Hook
type AttrLabel HookPrevFieldInfo = "prev"
type AttrOrigin HookPrevFieldInfo = Hook
attrGet = getHookPrev
attrSet = setHookPrev
attrConstruct = undefined
attrClear = clearHookPrev
attrTransfer _ v = do
return v
hook_prev :: AttrLabelProxy "prev"
hook_prev = AttrLabelProxy
#endif
getHookRefCount :: MonadIO m => Hook -> m Word32
getHookRefCount :: Hook -> m Word32
getHookRefCount Hook
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO Word32) -> IO Word32)
-> (Ptr Hook -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setHookRefCount :: MonadIO m => Hook -> Word32 -> m ()
setHookRefCount :: Hook -> Word32 -> m ()
setHookRefCount Hook
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data HookRefCountFieldInfo
instance AttrInfo HookRefCountFieldInfo where
type AttrBaseTypeConstraint HookRefCountFieldInfo = (~) Hook
type AttrAllowedOps HookRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint HookRefCountFieldInfo = (~) Word32
type AttrTransferTypeConstraint HookRefCountFieldInfo = (~)Word32
type AttrTransferType HookRefCountFieldInfo = Word32
type AttrGetType HookRefCountFieldInfo = Word32
type AttrLabel HookRefCountFieldInfo = "ref_count"
type AttrOrigin HookRefCountFieldInfo = Hook
attrGet = getHookRefCount
attrSet = setHookRefCount
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
hook_refCount :: AttrLabelProxy "refCount"
hook_refCount = AttrLabelProxy
#endif
getHookHookId :: MonadIO m => Hook -> m CULong
getHookHookId :: Hook -> m CULong
getHookHookId Hook
s = IO CULong -> m CULong
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO CULong) -> IO CULong
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO CULong) -> IO CULong)
-> (Ptr Hook -> IO CULong) -> IO CULong
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
CULong
val <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO CULong
CULong -> IO CULong
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
val
setHookHookId :: MonadIO m => Hook -> CULong -> m ()
setHookHookId :: Hook -> CULong -> m ()
setHookHookId Hook
s CULong
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr CULong -> CULong -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (CULong
val :: CULong)
#if defined(ENABLE_OVERLOADING)
data HookHookIdFieldInfo
instance AttrInfo HookHookIdFieldInfo where
type AttrBaseTypeConstraint HookHookIdFieldInfo = (~) Hook
type AttrAllowedOps HookHookIdFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint HookHookIdFieldInfo = (~) CULong
type AttrTransferTypeConstraint HookHookIdFieldInfo = (~)CULong
type AttrTransferType HookHookIdFieldInfo = CULong
type AttrGetType HookHookIdFieldInfo = CULong
type AttrLabel HookHookIdFieldInfo = "hook_id"
type AttrOrigin HookHookIdFieldInfo = Hook
attrGet = getHookHookId
attrSet = setHookHookId
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
hook_hookId :: AttrLabelProxy "hookId"
hook_hookId = AttrLabelProxy
#endif
getHookFlags :: MonadIO m => Hook -> m Word32
getHookFlags :: Hook -> m Word32
getHookFlags Hook
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO Word32) -> IO Word32)
-> (Ptr Hook -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setHookFlags :: MonadIO m => Hook -> Word32 -> m ()
setHookFlags :: Hook -> Word32 -> m ()
setHookFlags Hook
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data HookFlagsFieldInfo
instance AttrInfo HookFlagsFieldInfo where
type AttrBaseTypeConstraint HookFlagsFieldInfo = (~) Hook
type AttrAllowedOps HookFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint HookFlagsFieldInfo = (~) Word32
type AttrTransferTypeConstraint HookFlagsFieldInfo = (~)Word32
type AttrTransferType HookFlagsFieldInfo = Word32
type AttrGetType HookFlagsFieldInfo = Word32
type AttrLabel HookFlagsFieldInfo = "flags"
type AttrOrigin HookFlagsFieldInfo = Hook
attrGet = getHookFlags
attrSet = setHookFlags
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
hook_flags :: AttrLabelProxy "flags"
hook_flags = AttrLabelProxy
#endif
getHookFunc :: MonadIO m => Hook -> m (Ptr ())
getHookFunc :: Hook -> m (Ptr ())
getHookFunc Hook
s = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO (Ptr ())) -> IO (Ptr ())
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr Hook -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr ()
val <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) :: IO (Ptr ())
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setHookFunc :: MonadIO m => Hook -> Ptr () -> m ()
setHookFunc :: Hook -> Ptr () -> m ()
setHookFunc Hook
s Ptr ()
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) (Ptr ()
val :: Ptr ())
clearHookFunc :: MonadIO m => Hook -> m ()
clearHookFunc :: Hook -> m ()
clearHookFunc Hook
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) (Ptr ()
forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data HookFuncFieldInfo
instance AttrInfo HookFuncFieldInfo where
type AttrBaseTypeConstraint HookFuncFieldInfo = (~) Hook
type AttrAllowedOps HookFuncFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint HookFuncFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint HookFuncFieldInfo = (~)(Ptr ())
type AttrTransferType HookFuncFieldInfo = (Ptr ())
type AttrGetType HookFuncFieldInfo = Ptr ()
type AttrLabel HookFuncFieldInfo = "func"
type AttrOrigin HookFuncFieldInfo = Hook
attrGet = getHookFunc
attrSet = setHookFunc
attrConstruct = undefined
attrClear = clearHookFunc
attrTransfer _ v = do
return v
hook_func :: AttrLabelProxy "func"
hook_func = AttrLabelProxy
#endif
getHookDestroy :: MonadIO m => Hook -> m (Maybe GLib.Callbacks.DestroyNotify)
getHookDestroy :: Hook -> m (Maybe (Ptr () -> IO ()))
getHookDestroy Hook
s = IO (Maybe (Ptr () -> IO ())) -> m (Maybe (Ptr () -> IO ()))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe (Ptr () -> IO ())) -> m (Maybe (Ptr () -> IO ())))
-> IO (Maybe (Ptr () -> IO ())) -> m (Maybe (Ptr () -> IO ()))
forall a b. (a -> b) -> a -> b
$ Hook
-> (Ptr Hook -> IO (Maybe (Ptr () -> IO ())))
-> IO (Maybe (Ptr () -> IO ()))
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO (Maybe (Ptr () -> IO ())))
-> IO (Maybe (Ptr () -> IO ())))
-> (Ptr Hook -> IO (Maybe (Ptr () -> IO ())))
-> IO (Maybe (Ptr () -> IO ()))
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
FunPtr (Ptr () -> IO ())
val <- Ptr (FunPtr (Ptr () -> IO ())) -> IO (FunPtr (Ptr () -> IO ()))
forall a. Storable a => Ptr a -> IO a
peek (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (FunPtr (Ptr () -> IO ()))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) :: IO (FunPtr GLib.Callbacks.C_DestroyNotify)
Maybe (Ptr () -> IO ())
result <- FunPtr (Ptr () -> IO ())
-> (FunPtr (Ptr () -> IO ()) -> IO (Ptr () -> IO ()))
-> IO (Maybe (Ptr () -> IO ()))
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr (Ptr () -> IO ())
val ((FunPtr (Ptr () -> IO ()) -> IO (Ptr () -> IO ()))
-> IO (Maybe (Ptr () -> IO ())))
-> (FunPtr (Ptr () -> IO ()) -> IO (Ptr () -> IO ()))
-> IO (Maybe (Ptr () -> IO ()))
forall a b. (a -> b) -> a -> b
$ \FunPtr (Ptr () -> IO ())
val' -> do
let val'' :: Ptr () -> IO ()
val'' = FunPtr (Ptr () -> IO ()) -> Ptr () -> IO ()
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr (Ptr () -> IO ()) -> Ptr () -> m ()
GLib.Callbacks.dynamic_DestroyNotify FunPtr (Ptr () -> IO ())
val'
(Ptr () -> IO ()) -> IO (Ptr () -> IO ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr () -> IO ()
val''
Maybe (Ptr () -> IO ()) -> IO (Maybe (Ptr () -> IO ()))
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe (Ptr () -> IO ())
result
setHookDestroy :: MonadIO m => Hook -> FunPtr GLib.Callbacks.C_DestroyNotify -> m ()
setHookDestroy :: Hook -> FunPtr (Ptr () -> IO ()) -> m ()
setHookDestroy Hook
s FunPtr (Ptr () -> IO ())
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (FunPtr (Ptr () -> IO ())) -> FunPtr (Ptr () -> IO ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (FunPtr (Ptr () -> IO ()))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) (FunPtr (Ptr () -> IO ())
val :: FunPtr GLib.Callbacks.C_DestroyNotify)
clearHookDestroy :: MonadIO m => Hook -> m ()
clearHookDestroy :: Hook -> m ()
clearHookDestroy Hook
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Hook -> (Ptr Hook -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Hook
s ((Ptr Hook -> IO ()) -> IO ()) -> (Ptr Hook -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Hook
ptr -> do
Ptr (FunPtr (Ptr () -> IO ())) -> FunPtr (Ptr () -> IO ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Hook
ptr Ptr Hook -> Int -> Ptr (FunPtr (Ptr () -> IO ()))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) (FunPtr (Ptr () -> IO ())
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_DestroyNotify)
#if defined(ENABLE_OVERLOADING)
data HookDestroyFieldInfo
instance AttrInfo HookDestroyFieldInfo where
type AttrBaseTypeConstraint HookDestroyFieldInfo = (~) Hook
type AttrAllowedOps HookDestroyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint HookDestroyFieldInfo = (~) (FunPtr GLib.Callbacks.C_DestroyNotify)
type AttrTransferTypeConstraint HookDestroyFieldInfo = (~)GLib.Callbacks.DestroyNotify
type AttrTransferType HookDestroyFieldInfo = (FunPtr GLib.Callbacks.C_DestroyNotify)
type AttrGetType HookDestroyFieldInfo = Maybe GLib.Callbacks.DestroyNotify
type AttrLabel HookDestroyFieldInfo = "destroy"
type AttrOrigin HookDestroyFieldInfo = Hook
attrGet = getHookDestroy
attrSet = setHookDestroy
attrConstruct = undefined
attrClear = clearHookDestroy
attrTransfer _ v = do
GLib.Callbacks.mk_DestroyNotify (GLib.Callbacks.wrap_DestroyNotify Nothing v)
hook_destroy :: AttrLabelProxy "destroy"
hook_destroy = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Hook
type instance O.AttributeList Hook = HookAttributeList
type HookAttributeList = ('[ '("data", HookDataFieldInfo), '("next", HookNextFieldInfo), '("prev", HookPrevFieldInfo), '("refCount", HookRefCountFieldInfo), '("hookId", HookHookIdFieldInfo), '("flags", HookFlagsFieldInfo), '("func", HookFuncFieldInfo), '("destroy", HookDestroyFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_hook_compare_ids" g_hook_compare_ids ::
Ptr Hook ->
Ptr Hook ->
IO Int32
hookCompareIds ::
(B.CallStack.HasCallStack, MonadIO m) =>
Hook
-> Hook
-> m Int32
hookCompareIds :: Hook -> Hook -> m Int32
hookCompareIds Hook
newHook Hook
sibling = 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 Hook
newHook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
newHook
Ptr Hook
sibling' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
sibling
Int32
result <- Ptr Hook -> Ptr Hook -> IO Int32
g_hook_compare_ids Ptr Hook
newHook' Ptr Hook
sibling'
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
newHook
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
sibling
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data HookCompareIdsMethodInfo
instance (signature ~ (Hook -> m Int32), MonadIO m) => O.MethodInfo HookCompareIdsMethodInfo Hook signature where
overloadedMethod = hookCompareIds
#endif
foreign import ccall "g_hook_destroy" g_hook_destroy ::
Ptr GLib.HookList.HookList ->
CULong ->
IO CInt
hookDestroy ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> CULong
-> m Bool
hookDestroy :: HookList -> CULong -> m Bool
hookDestroy HookList
hookList CULong
hookId = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
CInt
result <- Ptr HookList -> CULong -> IO CInt
g_hook_destroy Ptr HookList
hookList' CULong
hookId
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_hook_destroy_link" g_hook_destroy_link ::
Ptr GLib.HookList.HookList ->
Ptr Hook ->
IO ()
hookDestroyLink ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> Hook
-> m ()
hookDestroyLink :: HookList -> Hook -> m ()
hookDestroyLink HookList
hookList Hook
hook = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
Ptr Hook
hook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
hook
Ptr HookList -> Ptr Hook -> IO ()
g_hook_destroy_link Ptr HookList
hookList' Ptr Hook
hook'
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
hook
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_hook_free" g_hook_free ::
Ptr GLib.HookList.HookList ->
Ptr Hook ->
IO ()
hookFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> Hook
-> m ()
hookFree :: HookList -> Hook -> m ()
hookFree HookList
hookList Hook
hook = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
Ptr Hook
hook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
hook
Ptr HookList -> Ptr Hook -> IO ()
g_hook_free Ptr HookList
hookList' Ptr Hook
hook'
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
hook
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_hook_insert_before" g_hook_insert_before ::
Ptr GLib.HookList.HookList ->
Ptr Hook ->
Ptr Hook ->
IO ()
hookInsertBefore ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> Maybe (Hook)
-> Hook
-> m ()
hookInsertBefore :: HookList -> Maybe Hook -> Hook -> m ()
hookInsertBefore HookList
hookList Maybe Hook
sibling Hook
hook = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
Ptr Hook
maybeSibling <- case Maybe Hook
sibling of
Maybe Hook
Nothing -> Ptr Hook -> IO (Ptr Hook)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Hook
forall a. Ptr a
nullPtr
Just Hook
jSibling -> do
Ptr Hook
jSibling' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
jSibling
Ptr Hook -> IO (Ptr Hook)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Hook
jSibling'
Ptr Hook
hook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
hook
Ptr HookList -> Ptr Hook -> Ptr Hook -> IO ()
g_hook_insert_before Ptr HookList
hookList' Ptr Hook
maybeSibling Ptr Hook
hook'
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Maybe Hook -> (Hook -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Hook
sibling Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
hook
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_hook_prepend" g_hook_prepend ::
Ptr GLib.HookList.HookList ->
Ptr Hook ->
IO ()
hookPrepend ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> Hook
-> m ()
hookPrepend :: HookList -> Hook -> m ()
hookPrepend HookList
hookList Hook
hook = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
Ptr Hook
hook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
hook
Ptr HookList -> Ptr Hook -> IO ()
g_hook_prepend Ptr HookList
hookList' Ptr Hook
hook'
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
hook
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_hook_unref" g_hook_unref ::
Ptr GLib.HookList.HookList ->
Ptr Hook ->
IO ()
hookUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.HookList.HookList
-> Hook
-> m ()
hookUnref :: HookList -> Hook -> m ()
hookUnref HookList
hookList Hook
hook = 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 HookList
hookList' <- HookList -> IO (Ptr HookList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HookList
hookList
Ptr Hook
hook' <- Hook -> IO (Ptr Hook)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hook
hook
Ptr HookList -> Ptr Hook -> IO ()
g_hook_unref Ptr HookList
hookList' Ptr Hook
hook'
HookList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HookList
hookList
Hook -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hook
hook
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveHookMethod (t :: Symbol) (o :: *) :: * where
ResolveHookMethod "compareIds" o = HookCompareIdsMethodInfo
ResolveHookMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveHookMethod t Hook, O.MethodInfo info Hook p) => OL.IsLabel t (Hook -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif