{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GObject.Structs.SignalInvocationHint
(
SignalInvocationHint(..) ,
newZeroSignalInvocationHint ,
#if defined(ENABLE_OVERLOADING)
ResolveSignalInvocationHintMethod ,
#endif
getSignalInvocationHintDetail ,
setSignalInvocationHintDetail ,
#if defined(ENABLE_OVERLOADING)
signalInvocationHint_detail ,
#endif
getSignalInvocationHintRunType ,
setSignalInvocationHintRunType ,
#if defined(ENABLE_OVERLOADING)
signalInvocationHint_runType ,
#endif
getSignalInvocationHintSignalId ,
setSignalInvocationHintSignalId ,
#if defined(ENABLE_OVERLOADING)
signalInvocationHint_signalId ,
#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.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 {-# SOURCE #-} qualified GI.GObject.Flags as GObject.Flags
newtype SignalInvocationHint = SignalInvocationHint (SP.ManagedPtr SignalInvocationHint)
deriving (SignalInvocationHint -> SignalInvocationHint -> Bool
(SignalInvocationHint -> SignalInvocationHint -> Bool)
-> (SignalInvocationHint -> SignalInvocationHint -> Bool)
-> Eq SignalInvocationHint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignalInvocationHint -> SignalInvocationHint -> Bool
$c/= :: SignalInvocationHint -> SignalInvocationHint -> Bool
== :: SignalInvocationHint -> SignalInvocationHint -> Bool
$c== :: SignalInvocationHint -> SignalInvocationHint -> Bool
Eq)
instance SP.ManagedPtrNewtype SignalInvocationHint where
toManagedPtr :: SignalInvocationHint -> ManagedPtr SignalInvocationHint
toManagedPtr (SignalInvocationHint ManagedPtr SignalInvocationHint
p) = ManagedPtr SignalInvocationHint
p
instance BoxedPtr SignalInvocationHint where
boxedPtrCopy :: SignalInvocationHint -> IO SignalInvocationHint
boxedPtrCopy = \SignalInvocationHint
p -> SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO SignalInvocationHint)
-> IO SignalInvocationHint
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SignalInvocationHint
p (Int -> Ptr SignalInvocationHint -> IO (Ptr SignalInvocationHint)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
12 (Ptr SignalInvocationHint -> IO (Ptr SignalInvocationHint))
-> (Ptr SignalInvocationHint -> IO SignalInvocationHint)
-> Ptr SignalInvocationHint
-> IO SignalInvocationHint
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr SignalInvocationHint -> SignalInvocationHint)
-> Ptr SignalInvocationHint -> IO SignalInvocationHint
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr SignalInvocationHint -> SignalInvocationHint
SignalInvocationHint)
boxedPtrFree :: SignalInvocationHint -> IO ()
boxedPtrFree = \SignalInvocationHint
x -> SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr SignalInvocationHint
x Ptr SignalInvocationHint -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr SignalInvocationHint where
boxedPtrCalloc :: IO (Ptr SignalInvocationHint)
boxedPtrCalloc = Int -> IO (Ptr SignalInvocationHint)
forall a. Int -> IO (Ptr a)
callocBytes Int
12
newZeroSignalInvocationHint :: MonadIO m => m SignalInvocationHint
newZeroSignalInvocationHint :: m SignalInvocationHint
newZeroSignalInvocationHint = IO SignalInvocationHint -> m SignalInvocationHint
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalInvocationHint -> m SignalInvocationHint)
-> IO SignalInvocationHint -> m SignalInvocationHint
forall a b. (a -> b) -> a -> b
$ IO (Ptr SignalInvocationHint)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr SignalInvocationHint)
-> (Ptr SignalInvocationHint -> IO SignalInvocationHint)
-> IO SignalInvocationHint
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr SignalInvocationHint -> SignalInvocationHint)
-> Ptr SignalInvocationHint -> IO SignalInvocationHint
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr SignalInvocationHint -> SignalInvocationHint
SignalInvocationHint
instance tag ~ 'AttrSet => Constructible SignalInvocationHint tag where
new :: (ManagedPtr SignalInvocationHint -> SignalInvocationHint)
-> [AttrOp SignalInvocationHint tag] -> m SignalInvocationHint
new ManagedPtr SignalInvocationHint -> SignalInvocationHint
_ [AttrOp SignalInvocationHint tag]
attrs = do
SignalInvocationHint
o <- m SignalInvocationHint
forall (m :: * -> *). MonadIO m => m SignalInvocationHint
newZeroSignalInvocationHint
SignalInvocationHint
-> [AttrOp SignalInvocationHint 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set SignalInvocationHint
o [AttrOp SignalInvocationHint tag]
[AttrOp SignalInvocationHint 'AttrSet]
attrs
SignalInvocationHint -> m SignalInvocationHint
forall (m :: * -> *) a. Monad m => a -> m a
return SignalInvocationHint
o
getSignalInvocationHintSignalId :: MonadIO m => SignalInvocationHint -> m Word32
getSignalInvocationHintSignalId :: SignalInvocationHint -> m Word32
getSignalInvocationHintSignalId SignalInvocationHint
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
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO Word32) -> IO Word32)
-> (Ptr SignalInvocationHint -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setSignalInvocationHintSignalId :: MonadIO m => SignalInvocationHint -> Word32 -> m ()
setSignalInvocationHintSignalId :: SignalInvocationHint -> Word32 -> m ()
setSignalInvocationHintSignalId SignalInvocationHint
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
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO ()) -> IO ())
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data SignalInvocationHintSignalIdFieldInfo
instance AttrInfo SignalInvocationHintSignalIdFieldInfo where
type AttrBaseTypeConstraint SignalInvocationHintSignalIdFieldInfo = (~) SignalInvocationHint
type AttrAllowedOps SignalInvocationHintSignalIdFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalInvocationHintSignalIdFieldInfo = (~) Word32
type AttrTransferTypeConstraint SignalInvocationHintSignalIdFieldInfo = (~)Word32
type AttrTransferType SignalInvocationHintSignalIdFieldInfo = Word32
type AttrGetType SignalInvocationHintSignalIdFieldInfo = Word32
type AttrLabel SignalInvocationHintSignalIdFieldInfo = "signal_id"
type AttrOrigin SignalInvocationHintSignalIdFieldInfo = SignalInvocationHint
attrGet = getSignalInvocationHintSignalId
attrSet = setSignalInvocationHintSignalId
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
signalInvocationHint_signalId :: AttrLabelProxy "signalId"
signalInvocationHint_signalId = AttrLabelProxy
#endif
getSignalInvocationHintDetail :: MonadIO m => SignalInvocationHint -> m Word32
getSignalInvocationHintDetail :: SignalInvocationHint -> m Word32
getSignalInvocationHintDetail SignalInvocationHint
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
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO Word32) -> IO Word32)
-> (Ptr SignalInvocationHint -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setSignalInvocationHintDetail :: MonadIO m => SignalInvocationHint -> Word32 -> m ()
setSignalInvocationHintDetail :: SignalInvocationHint -> Word32 -> m ()
setSignalInvocationHintDetail SignalInvocationHint
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
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO ()) -> IO ())
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data SignalInvocationHintDetailFieldInfo
instance AttrInfo SignalInvocationHintDetailFieldInfo where
type AttrBaseTypeConstraint SignalInvocationHintDetailFieldInfo = (~) SignalInvocationHint
type AttrAllowedOps SignalInvocationHintDetailFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalInvocationHintDetailFieldInfo = (~) Word32
type AttrTransferTypeConstraint SignalInvocationHintDetailFieldInfo = (~)Word32
type AttrTransferType SignalInvocationHintDetailFieldInfo = Word32
type AttrGetType SignalInvocationHintDetailFieldInfo = Word32
type AttrLabel SignalInvocationHintDetailFieldInfo = "detail"
type AttrOrigin SignalInvocationHintDetailFieldInfo = SignalInvocationHint
attrGet = getSignalInvocationHintDetail
attrSet = setSignalInvocationHintDetail
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
signalInvocationHint_detail :: AttrLabelProxy "detail"
signalInvocationHint_detail = AttrLabelProxy
#endif
getSignalInvocationHintRunType :: MonadIO m => SignalInvocationHint -> m [GObject.Flags.SignalFlags]
getSignalInvocationHintRunType :: SignalInvocationHint -> m [SignalFlags]
getSignalInvocationHintRunType SignalInvocationHint
s = IO [SignalFlags] -> m [SignalFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SignalFlags] -> m [SignalFlags])
-> IO [SignalFlags] -> m [SignalFlags]
forall a b. (a -> b) -> a -> b
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO [SignalFlags])
-> IO [SignalFlags]
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO [SignalFlags])
-> IO [SignalFlags])
-> (Ptr SignalInvocationHint -> IO [SignalFlags])
-> IO [SignalFlags]
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO CUInt
let val' :: [SignalFlags]
val' = CUInt -> [SignalFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
val
[SignalFlags] -> IO [SignalFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [SignalFlags]
val'
setSignalInvocationHintRunType :: MonadIO m => SignalInvocationHint -> [GObject.Flags.SignalFlags] -> m ()
setSignalInvocationHintRunType :: SignalInvocationHint -> [SignalFlags] -> m ()
setSignalInvocationHintRunType SignalInvocationHint
s [SignalFlags]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ SignalInvocationHint
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr SignalInvocationHint
s ((Ptr SignalInvocationHint -> IO ()) -> IO ())
-> (Ptr SignalInvocationHint -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr SignalInvocationHint
ptr -> do
let val' :: CUInt
val' = [SignalFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SignalFlags]
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SignalInvocationHint
ptr Ptr SignalInvocationHint -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data SignalInvocationHintRunTypeFieldInfo
instance AttrInfo SignalInvocationHintRunTypeFieldInfo where
type AttrBaseTypeConstraint SignalInvocationHintRunTypeFieldInfo = (~) SignalInvocationHint
type AttrAllowedOps SignalInvocationHintRunTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalInvocationHintRunTypeFieldInfo = (~) [GObject.Flags.SignalFlags]
type AttrTransferTypeConstraint SignalInvocationHintRunTypeFieldInfo = (~)[GObject.Flags.SignalFlags]
type AttrTransferType SignalInvocationHintRunTypeFieldInfo = [GObject.Flags.SignalFlags]
type AttrGetType SignalInvocationHintRunTypeFieldInfo = [GObject.Flags.SignalFlags]
type AttrLabel SignalInvocationHintRunTypeFieldInfo = "run_type"
type AttrOrigin SignalInvocationHintRunTypeFieldInfo = SignalInvocationHint
attrGet = getSignalInvocationHintRunType
attrSet = setSignalInvocationHintRunType
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
signalInvocationHint_runType :: AttrLabelProxy "runType"
signalInvocationHint_runType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SignalInvocationHint
type instance O.AttributeList SignalInvocationHint = SignalInvocationHintAttributeList
type SignalInvocationHintAttributeList = ('[ '("signalId", SignalInvocationHintSignalIdFieldInfo), '("detail", SignalInvocationHintDetailFieldInfo), '("runType", SignalInvocationHintRunTypeFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveSignalInvocationHintMethod (t :: Symbol) (o :: *) :: * where
ResolveSignalInvocationHintMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSignalInvocationHintMethod t SignalInvocationHint, O.MethodInfo info SignalInvocationHint p) => OL.IsLabel t (SignalInvocationHint -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif