#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Structs.BindingSignal
(
BindingSignal(..) ,
newZeroBindingSignal ,
noBindingSignal ,
#if ENABLE_OVERLOADING
bindingSignal_nArgs ,
#endif
getBindingSignalNArgs ,
setBindingSignalNArgs ,
#if ENABLE_OVERLOADING
bindingSignal_next ,
#endif
clearBindingSignalNext ,
getBindingSignalNext ,
setBindingSignalNext ,
#if 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
newtype BindingSignal = BindingSignal (ManagedPtr BindingSignal)
instance WrappedPtr BindingSignal where
wrappedPtrCalloc = callocBytes 32
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 32 >=> wrapPtr BindingSignal)
wrappedPtrFree = Just ptr_to_g_free
newZeroBindingSignal :: MonadIO m => m BindingSignal
newZeroBindingSignal = liftIO $ wrappedPtrCalloc >>= wrapPtr BindingSignal
instance tag ~ 'AttrSet => Constructible BindingSignal tag where
new _ attrs = do
o <- newZeroBindingSignal
GI.Attributes.set o attrs
return o
noBindingSignal :: Maybe BindingSignal
noBindingSignal = Nothing
getBindingSignalNext :: MonadIO m => BindingSignal -> m (Maybe BindingSignal)
getBindingSignalNext s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr BindingSignal)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr BindingSignal) val'
return val''
return result
setBindingSignalNext :: MonadIO m => BindingSignal -> Ptr BindingSignal -> m ()
setBindingSignalNext s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr BindingSignal)
clearBindingSignalNext :: MonadIO m => BindingSignal -> m ()
clearBindingSignalNext s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr BindingSignal)
#if ENABLE_OVERLOADING
data BindingSignalNextFieldInfo
instance AttrInfo BindingSignalNextFieldInfo where
type AttrAllowedOps BindingSignalNextFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSignalNextFieldInfo = (~) (Ptr BindingSignal)
type AttrBaseTypeConstraint BindingSignalNextFieldInfo = (~) BindingSignal
type AttrGetType BindingSignalNextFieldInfo = Maybe BindingSignal
type AttrLabel BindingSignalNextFieldInfo = "next"
type AttrOrigin BindingSignalNextFieldInfo = BindingSignal
attrGet _ = getBindingSignalNext
attrSet _ = setBindingSignalNext
attrConstruct = undefined
attrClear _ = clearBindingSignalNext
bindingSignal_next :: AttrLabelProxy "next"
bindingSignal_next = AttrLabelProxy
#endif
getBindingSignalSignalName :: MonadIO m => BindingSignal -> m (Maybe T.Text)
getBindingSignalSignalName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setBindingSignalSignalName :: MonadIO m => BindingSignal -> CString -> m ()
setBindingSignalSignalName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearBindingSignalSignalName :: MonadIO m => BindingSignal -> m ()
clearBindingSignalSignalName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data BindingSignalSignalNameFieldInfo
instance AttrInfo BindingSignalSignalNameFieldInfo where
type AttrAllowedOps BindingSignalSignalNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSignalSignalNameFieldInfo = (~) CString
type AttrBaseTypeConstraint BindingSignalSignalNameFieldInfo = (~) BindingSignal
type AttrGetType BindingSignalSignalNameFieldInfo = Maybe T.Text
type AttrLabel BindingSignalSignalNameFieldInfo = "signal_name"
type AttrOrigin BindingSignalSignalNameFieldInfo = BindingSignal
attrGet _ = getBindingSignalSignalName
attrSet _ = setBindingSignalSignalName
attrConstruct = undefined
attrClear _ = clearBindingSignalSignalName
bindingSignal_signalName :: AttrLabelProxy "signalName"
bindingSignal_signalName = AttrLabelProxy
#endif
getBindingSignalNArgs :: MonadIO m => BindingSignal -> m Word32
getBindingSignalNArgs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Word32
return val
setBindingSignalNArgs :: MonadIO m => BindingSignal -> Word32 -> m ()
setBindingSignalNArgs s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Word32)
#if ENABLE_OVERLOADING
data BindingSignalNArgsFieldInfo
instance AttrInfo BindingSignalNArgsFieldInfo where
type AttrAllowedOps BindingSignalNArgsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint BindingSignalNArgsFieldInfo = (~) Word32
type AttrBaseTypeConstraint BindingSignalNArgsFieldInfo = (~) BindingSignal
type AttrGetType BindingSignalNArgsFieldInfo = Word32
type AttrLabel BindingSignalNArgsFieldInfo = "n_args"
type AttrOrigin BindingSignalNArgsFieldInfo = BindingSignal
attrGet _ = getBindingSignalNArgs
attrSet _ = setBindingSignalNArgs
attrConstruct = undefined
attrClear _ = undefined
bindingSignal_nArgs :: AttrLabelProxy "nArgs"
bindingSignal_nArgs = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList BindingSignal
type instance O.AttributeList BindingSignal = BindingSignalAttributeList
type BindingSignalAttributeList = ('[ '("next", BindingSignalNextFieldInfo), '("signalName", BindingSignalSignalNameFieldInfo), '("nArgs", BindingSignalNArgsFieldInfo)] :: [(Symbol, *)])
#endif
#if 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) => O.IsLabelProxy t (BindingSignal -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveBindingSignalMethod t BindingSignal, O.MethodInfo info BindingSignal p) => O.IsLabel t (BindingSignal -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif