{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A GtkBindingSignal stores the necessary information to
-- activate a widget in response to a key press via a signal
-- emission.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gtk.Structs.BindingSignal
    ( 

-- * Exported types
    BindingSignal(..)                       ,
    newZeroBindingSignal                    ,


 -- * Methods

#if defined(ENABLE_OVERLOADING)
    ResolveBindingSignalMethod              ,
#endif



 -- * Properties


-- ** nArgs #attr:nArgs#
-- | number of arguments specified for the signal

#if defined(ENABLE_OVERLOADING)
    bindingSignal_nArgs                     ,
#endif
    getBindingSignalNArgs                   ,
    setBindingSignalNArgs                   ,


-- ** next #attr:next#
-- | implementation detail

#if defined(ENABLE_OVERLOADING)
    bindingSignal_next                      ,
#endif
    clearBindingSignalNext                  ,
    getBindingSignalNext                    ,
    setBindingSignalNext                    ,


-- ** signalName #attr:signalName#
-- | the action signal to be emitted

#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.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 qualified GHC.Records as R


-- | Memory-managed wrapper type.
newtype BindingSignal = BindingSignal (SP.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 SP.ManagedPtrNewtype BindingSignal where
    toManagedPtr :: BindingSignal -> ManagedPtr BindingSignal
toManagedPtr (BindingSignal ManagedPtr BindingSignal
p) = ManagedPtr BindingSignal
p

instance BoxedPtr BindingSignal where
    boxedPtrCopy :: BindingSignal -> IO BindingSignal
boxedPtrCopy = \BindingSignal
p -> BindingSignal
-> (Ptr BindingSignal -> IO BindingSignal) -> IO BindingSignal
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BindingSignal
p (Int -> Ptr BindingSignal -> IO (Ptr BindingSignal)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
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, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr BindingSignal -> BindingSignal
BindingSignal)
    boxedPtrFree :: BindingSignal -> IO ()
boxedPtrFree = \BindingSignal
x -> BindingSignal -> (Ptr BindingSignal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr BindingSignal
x Ptr BindingSignal -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr BindingSignal where
    boxedPtrCalloc :: IO (Ptr BindingSignal)
boxedPtrCalloc = Int -> IO (Ptr BindingSignal)
forall a. Int -> IO (Ptr a)
callocBytes Int
32


-- | Construct a `BindingSignal` struct initialized to zero.
newZeroBindingSignal :: MonadIO m => m BindingSignal
newZeroBindingSignal :: forall (m :: * -> *). MonadIO m => 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. CallocPtr a => IO (Ptr a)
boxedPtrCalloc 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, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr BindingSignal -> BindingSignal
BindingSignal

instance tag ~ 'AttrSet => Constructible BindingSignal tag where
    new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr BindingSignal -> BindingSignal)
-> [AttrOp BindingSignal tag] -> m BindingSignal
new ManagedPtr BindingSignal -> BindingSignal
_ [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


-- | Get the value of the “@next@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' bindingSignal #next
-- @
getBindingSignalNext :: MonadIO m => BindingSignal -> m (Maybe BindingSignal)
getBindingSignalNext :: forall (m :: * -> *).
MonadIO m =>
BindingSignal -> m (Maybe BindingSignal)
getBindingSignalNext 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 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` Int
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
$ \Ptr BindingSignal
val' -> do
        BindingSignal
val'' <- ((ManagedPtr BindingSignal -> BindingSignal)
-> Ptr BindingSignal -> IO BindingSignal
forall a.
(HasCallStack, BoxedPtr 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

-- | Set the value of the “@next@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' bindingSignal [ #next 'Data.GI.Base.Attributes.:=' value ]
-- @
setBindingSignalNext :: MonadIO m => BindingSignal -> Ptr BindingSignal -> m ()
setBindingSignalNext :: forall (m :: * -> *).
MonadIO m =>
BindingSignal -> Ptr BindingSignal -> m ()
setBindingSignalNext BindingSignal
s 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 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` Int
0) (Ptr BindingSignal
val :: Ptr BindingSignal)

-- | Set the value of the “@next@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #next
-- @
clearBindingSignalNext :: MonadIO m => BindingSignal -> m ()
clearBindingSignalNext :: forall (m :: * -> *). MonadIO m => BindingSignal -> m ()
clearBindingSignalNext 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 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` Int
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


-- | Get the value of the “@signal_name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' bindingSignal #signalName
-- @
getBindingSignalSignalName :: MonadIO m => BindingSignal -> m (Maybe T.Text)
getBindingSignalSignalName :: forall (m :: * -> *). MonadIO m => BindingSignal -> m (Maybe Text)
getBindingSignalSignalName 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 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` Int
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
$ \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

-- | Set the value of the “@signal_name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' bindingSignal [ #signalName 'Data.GI.Base.Attributes.:=' value ]
-- @
setBindingSignalSignalName :: MonadIO m => BindingSignal -> CString -> m ()
setBindingSignalSignalName :: forall (m :: * -> *). MonadIO m => BindingSignal -> CString -> m ()
setBindingSignalSignalName BindingSignal
s 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 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` Int
8) (CString
val :: CString)

-- | Set the value of the “@signal_name@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #signalName
-- @
clearBindingSignalSignalName :: MonadIO m => BindingSignal -> m ()
clearBindingSignalSignalName :: forall (m :: * -> *). MonadIO m => BindingSignal -> m ()
clearBindingSignalSignalName 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 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` Int
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


-- | Get the value of the “@n_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' bindingSignal #nArgs
-- @
getBindingSignalNArgs :: MonadIO m => BindingSignal -> m Word32
getBindingSignalNArgs :: forall (m :: * -> *). MonadIO m => BindingSignal -> m Word32
getBindingSignalNArgs 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 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` Int
16) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@n_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' bindingSignal [ #nArgs 'Data.GI.Base.Attributes.:=' value ]
-- @
setBindingSignalNArgs :: MonadIO m => BindingSignal -> Word32 -> m ()
setBindingSignalNArgs :: forall (m :: * -> *). MonadIO m => BindingSignal -> Word32 -> m ()
setBindingSignalNArgs BindingSignal
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
$ 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 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` Int
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


-- XXX Skipped attribute for "BindingSignal:args"
-- Not implemented: Don't know how to unpack C array of type TCArray False (-1) 2 (TInterface (Name {namespace = "Gtk", name = "BindingArg"}))

#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.OverloadedMethod 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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveBindingSignalMethod t BindingSignal, O.OverloadedMethod info BindingSignal p, R.HasField t BindingSignal p) => R.HasField t BindingSignal p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveBindingSignalMethod t BindingSignal, O.OverloadedMethodInfo info BindingSignal) => OL.IsLabel t (O.MethodProxy info BindingSignal) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif