{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.BindingSignal
(
BindingSignal(..) ,
newZeroBindingSignal ,
noBindingSignal ,
#if defined(ENABLE_OVERLOADING)
ResolveBindingSignalMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingSignal_nArgs ,
#endif
getBindingSignalNArgs ,
setBindingSignalNArgs ,
#if defined(ENABLE_OVERLOADING)
bindingSignal_next ,
#endif
clearBindingSignalNext ,
getBindingSignalNext ,
setBindingSignalNext ,
#if defined(ENABLE_OVERLOADING)
bindingSignal_signalName ,
#endif
clearBindingSignalSignalName ,
getBindingSignalSignalName ,
setBindingSignalSignalName ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
newtype BindingSignal = BindingSignal (ManagedPtr BindingSignal)
deriving (BindingSignal -> BindingSignal -> Bool
(BindingSignal -> BindingSignal -> Bool)
-> (BindingSignal -> BindingSignal -> Bool) -> Eq BindingSignal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BindingSignal -> BindingSignal -> Bool
$c/= :: BindingSignal -> BindingSignal -> Bool
== :: BindingSignal -> BindingSignal -> Bool
$c== :: BindingSignal -> BindingSignal -> Bool
Eq)
instance WrappedPtr BindingSignal where
wrappedPtrCalloc :: IO (Ptr BindingSignal)
wrappedPtrCalloc = Int -> IO (Ptr BindingSignal)
forall a. Int -> IO (Ptr a)
callocBytes 32
wrappedPtrCopy :: BindingSignal -> IO BindingSignal
wrappedPtrCopy = \p :: BindingSignal
p -> BindingSignal
-> (Ptr BindingSignal -> IO BindingSignal) -> IO BindingSignal
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
p (Int -> Ptr BindingSignal -> IO (Ptr BindingSignal)
forall a. WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes 32 (Ptr BindingSignal -> IO (Ptr BindingSignal))
-> (Ptr BindingSignal -> IO BindingSignal)
-> Ptr BindingSignal
-> IO BindingSignal
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr BindingSignal -> BindingSignal)
-> Ptr BindingSignal -> IO BindingSignal
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr BindingSignal -> BindingSignal
BindingSignal)
wrappedPtrFree :: Maybe (GDestroyNotify BindingSignal)
wrappedPtrFree = GDestroyNotify BindingSignal
-> Maybe (GDestroyNotify BindingSignal)
forall a. a -> Maybe a
Just GDestroyNotify BindingSignal
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free
newZeroBindingSignal :: MonadIO m => m BindingSignal
newZeroBindingSignal :: m BindingSignal
newZeroBindingSignal = IO BindingSignal -> m BindingSignal
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BindingSignal -> m BindingSignal)
-> IO BindingSignal -> m BindingSignal
forall a b. (a -> b) -> a -> b
$ IO (Ptr BindingSignal)
forall a. WrappedPtr a => IO (Ptr a)
wrappedPtrCalloc IO (Ptr BindingSignal)
-> (Ptr BindingSignal -> IO BindingSignal) -> IO BindingSignal
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr BindingSignal -> BindingSignal)
-> Ptr BindingSignal -> IO BindingSignal
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr BindingSignal -> BindingSignal
BindingSignal
instance tag ~ 'AttrSet => Constructible BindingSignal tag where
new :: (ManagedPtr BindingSignal -> BindingSignal)
-> [AttrOp BindingSignal tag] -> m BindingSignal
new _ attrs :: [AttrOp BindingSignal tag]
attrs = do
BindingSignal
o <- m BindingSignal
forall (m :: * -> *). MonadIO m => m BindingSignal
newZeroBindingSignal
BindingSignal -> [AttrOp BindingSignal 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set BindingSignal
o [AttrOp BindingSignal tag]
[AttrOp BindingSignal 'AttrSet]
attrs
BindingSignal -> m BindingSignal
forall (m :: * -> *) a. Monad m => a -> m a
return BindingSignal
o
noBindingSignal :: Maybe BindingSignal
noBindingSignal :: Maybe BindingSignal
noBindingSignal = Maybe BindingSignal
forall a. Maybe a
Nothing
getBindingSignalNext :: MonadIO m => BindingSignal -> m (Maybe BindingSignal)
getBindingSignalNext :: BindingSignal -> m (Maybe BindingSignal)
getBindingSignalNext s :: BindingSignal
s = IO (Maybe BindingSignal) -> m (Maybe BindingSignal)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe BindingSignal) -> m (Maybe BindingSignal))
-> IO (Maybe BindingSignal) -> m (Maybe BindingSignal)
forall a b. (a -> b) -> a -> b
$ BindingSignal
-> (Ptr BindingSignal -> IO (Maybe BindingSignal))
-> IO (Maybe BindingSignal)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO (Maybe BindingSignal))
-> IO (Maybe BindingSignal))
-> (Ptr BindingSignal -> IO (Maybe BindingSignal))
-> IO (Maybe BindingSignal)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr BindingSignal
val <- Ptr (Ptr BindingSignal) -> IO (Ptr BindingSignal)
forall a. Storable a => Ptr a -> IO a
peek (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr (Ptr BindingSignal)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO (Ptr BindingSignal)
Maybe BindingSignal
result <- Ptr BindingSignal
-> (Ptr BindingSignal -> IO BindingSignal)
-> IO (Maybe BindingSignal)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr BindingSignal
val ((Ptr BindingSignal -> IO BindingSignal)
-> IO (Maybe BindingSignal))
-> (Ptr BindingSignal -> IO BindingSignal)
-> IO (Maybe BindingSignal)
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr BindingSignal
val' -> do
BindingSignal
val'' <- ((ManagedPtr BindingSignal -> BindingSignal)
-> Ptr BindingSignal -> IO BindingSignal
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr BindingSignal -> BindingSignal
BindingSignal) Ptr BindingSignal
val'
BindingSignal -> IO BindingSignal
forall (m :: * -> *) a. Monad m => a -> m a
return BindingSignal
val''
Maybe BindingSignal -> IO (Maybe BindingSignal)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe BindingSignal
result
setBindingSignalNext :: MonadIO m => BindingSignal -> Ptr BindingSignal -> m ()
setBindingSignalNext :: BindingSignal -> Ptr BindingSignal -> m ()
setBindingSignalNext s :: BindingSignal
s val :: Ptr BindingSignal
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO ()) -> IO ())
-> (Ptr BindingSignal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr (Ptr BindingSignal) -> Ptr BindingSignal -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr (Ptr BindingSignal)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Ptr BindingSignal
val :: Ptr BindingSignal)
clearBindingSignalNext :: MonadIO m => BindingSignal -> m ()
clearBindingSignalNext :: BindingSignal -> m ()
clearBindingSignalNext s :: BindingSignal
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO ()) -> IO ())
-> (Ptr BindingSignal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr (Ptr BindingSignal) -> Ptr BindingSignal -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr (Ptr BindingSignal)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Ptr BindingSignal
forall a. Ptr a
FP.nullPtr :: Ptr BindingSignal)
#if defined(ENABLE_OVERLOADING)
data BindingSignalNextFieldInfo
instance AttrInfo BindingSignalNextFieldInfo where
type AttrBaseTypeConstraint BindingSignalNextFieldInfo = (~) BindingSignal
type AttrAllowedOps BindingSignalNextFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSignalNextFieldInfo = (~) (Ptr BindingSignal)
type AttrTransferTypeConstraint BindingSignalNextFieldInfo = (~)(Ptr BindingSignal)
type AttrTransferType BindingSignalNextFieldInfo = (Ptr BindingSignal)
type AttrGetType BindingSignalNextFieldInfo = Maybe BindingSignal
type AttrLabel BindingSignalNextFieldInfo = "next"
type AttrOrigin BindingSignalNextFieldInfo = BindingSignal
attrGet = getBindingSignalNext
attrSet = setBindingSignalNext
attrConstruct = undefined
attrClear = clearBindingSignalNext
attrTransfer _ v = do
return v
bindingSignal_next :: AttrLabelProxy "next"
bindingSignal_next = AttrLabelProxy
#endif
getBindingSignalSignalName :: MonadIO m => BindingSignal -> m (Maybe T.Text)
getBindingSignalSignalName :: BindingSignal -> m (Maybe Text)
getBindingSignalSignalName s :: BindingSignal
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ BindingSignal
-> (Ptr BindingSignal -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr BindingSignal -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setBindingSignalSignalName :: MonadIO m => BindingSignal -> CString -> m ()
setBindingSignalSignalName :: BindingSignal -> CString -> m ()
setBindingSignalSignalName s :: BindingSignal
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO ()) -> IO ())
-> (Ptr BindingSignal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
val :: CString)
clearBindingSignalSignalName :: MonadIO m => BindingSignal -> m ()
clearBindingSignalSignalName :: BindingSignal -> m ()
clearBindingSignalSignalName s :: BindingSignal
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO ()) -> IO ())
-> (Ptr BindingSignal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data BindingSignalSignalNameFieldInfo
instance AttrInfo BindingSignalSignalNameFieldInfo where
type AttrBaseTypeConstraint BindingSignalSignalNameFieldInfo = (~) BindingSignal
type AttrAllowedOps BindingSignalSignalNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSignalSignalNameFieldInfo = (~) CString
type AttrTransferTypeConstraint BindingSignalSignalNameFieldInfo = (~)CString
type AttrTransferType BindingSignalSignalNameFieldInfo = CString
type AttrGetType BindingSignalSignalNameFieldInfo = Maybe T.Text
type AttrLabel BindingSignalSignalNameFieldInfo = "signal_name"
type AttrOrigin BindingSignalSignalNameFieldInfo = BindingSignal
attrGet = getBindingSignalSignalName
attrSet = setBindingSignalSignalName
attrConstruct = undefined
attrClear = clearBindingSignalSignalName
attrTransfer _ v = do
return v
bindingSignal_signalName :: AttrLabelProxy "signalName"
bindingSignal_signalName = AttrLabelProxy
#endif
getBindingSignalNArgs :: MonadIO m => BindingSignal -> m Word32
getBindingSignalNArgs :: BindingSignal -> m Word32
getBindingSignalNArgs s :: BindingSignal
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
$ BindingSignal -> (Ptr BindingSignal -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO Word32) -> IO Word32)
-> (Ptr BindingSignal -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setBindingSignalNArgs :: MonadIO m => BindingSignal -> Word32 -> m ()
setBindingSignalNArgs :: BindingSignal -> Word32 -> m ()
setBindingSignalNArgs s :: BindingSignal
s val :: 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
$ BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BindingSignal
s ((Ptr BindingSignal -> IO ()) -> IO ())
-> (Ptr BindingSignal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr BindingSignal
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindingSignal
ptr Ptr BindingSignal -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data BindingSignalNArgsFieldInfo
instance AttrInfo BindingSignalNArgsFieldInfo where
type AttrBaseTypeConstraint BindingSignalNArgsFieldInfo = (~) BindingSignal
type AttrAllowedOps BindingSignalNArgsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint BindingSignalNArgsFieldInfo = (~) Word32
type AttrTransferTypeConstraint BindingSignalNArgsFieldInfo = (~)Word32
type AttrTransferType BindingSignalNArgsFieldInfo = Word32
type AttrGetType BindingSignalNArgsFieldInfo = Word32
type AttrLabel BindingSignalNArgsFieldInfo = "n_args"
type AttrOrigin BindingSignalNArgsFieldInfo = BindingSignal
attrGet = getBindingSignalNArgs
attrSet = setBindingSignalNArgs
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
bindingSignal_nArgs :: AttrLabelProxy "nArgs"
bindingSignal_nArgs = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BindingSignal
type instance O.AttributeList BindingSignal = BindingSignalAttributeList
type BindingSignalAttributeList = ('[ '("next", BindingSignalNextFieldInfo), '("signalName", BindingSignalSignalNameFieldInfo), '("nArgs", BindingSignalNArgsFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveBindingSignalMethod (t :: Symbol) (o :: *) :: * where
ResolveBindingSignalMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBindingSignalMethod t BindingSignal, O.MethodInfo info BindingSignal p) => OL.IsLabel t (BindingSignal -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif