#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GObject.Structs.SignalQuery
(
SignalQuery(..) ,
newZeroSignalQuery ,
noSignalQuery ,
getSignalQueryItype ,
setSignalQueryItype ,
#if ENABLE_OVERLOADING
signalQuery_itype ,
#endif
getSignalQueryNParams ,
setSignalQueryNParams ,
#if ENABLE_OVERLOADING
signalQuery_nParams ,
#endif
getSignalQueryReturnType ,
setSignalQueryReturnType ,
#if ENABLE_OVERLOADING
signalQuery_returnType ,
#endif
getSignalQuerySignalFlags ,
setSignalQuerySignalFlags ,
#if ENABLE_OVERLOADING
signalQuery_signalFlags ,
#endif
getSignalQuerySignalId ,
setSignalQuerySignalId ,
#if ENABLE_OVERLOADING
signalQuery_signalId ,
#endif
clearSignalQuerySignalName ,
getSignalQuerySignalName ,
setSignalQuerySignalName ,
#if ENABLE_OVERLOADING
signalQuery_signalName ,
#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.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.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 SignalQuery = SignalQuery (ManagedPtr SignalQuery)
instance WrappedPtr SignalQuery where
wrappedPtrCalloc = callocBytes 56
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 56 >=> wrapPtr SignalQuery)
wrappedPtrFree = Just ptr_to_g_free
newZeroSignalQuery :: MonadIO m => m SignalQuery
newZeroSignalQuery = liftIO $ wrappedPtrCalloc >>= wrapPtr SignalQuery
instance tag ~ 'AttrSet => Constructible SignalQuery tag where
new _ attrs = do
o <- newZeroSignalQuery
GI.Attributes.set o attrs
return o
noSignalQuery :: Maybe SignalQuery
noSignalQuery = Nothing
getSignalQuerySignalId :: MonadIO m => SignalQuery -> m Word32
getSignalQuerySignalId s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Word32
return val
setSignalQuerySignalId :: MonadIO m => SignalQuery -> Word32 -> m ()
setSignalQuerySignalId s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Word32)
#if ENABLE_OVERLOADING
data SignalQuerySignalIdFieldInfo
instance AttrInfo SignalQuerySignalIdFieldInfo where
type AttrAllowedOps SignalQuerySignalIdFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalQuerySignalIdFieldInfo = (~) Word32
type AttrBaseTypeConstraint SignalQuerySignalIdFieldInfo = (~) SignalQuery
type AttrGetType SignalQuerySignalIdFieldInfo = Word32
type AttrLabel SignalQuerySignalIdFieldInfo = "signal_id"
type AttrOrigin SignalQuerySignalIdFieldInfo = SignalQuery
attrGet _ = getSignalQuerySignalId
attrSet _ = setSignalQuerySignalId
attrConstruct = undefined
attrClear _ = undefined
signalQuery_signalId :: AttrLabelProxy "signalId"
signalQuery_signalId = AttrLabelProxy
#endif
getSignalQuerySignalName :: MonadIO m => SignalQuery -> m (Maybe T.Text)
getSignalQuerySignalName 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
setSignalQuerySignalName :: MonadIO m => SignalQuery -> CString -> m ()
setSignalQuerySignalName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearSignalQuerySignalName :: MonadIO m => SignalQuery -> m ()
clearSignalQuerySignalName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data SignalQuerySignalNameFieldInfo
instance AttrInfo SignalQuerySignalNameFieldInfo where
type AttrAllowedOps SignalQuerySignalNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SignalQuerySignalNameFieldInfo = (~) CString
type AttrBaseTypeConstraint SignalQuerySignalNameFieldInfo = (~) SignalQuery
type AttrGetType SignalQuerySignalNameFieldInfo = Maybe T.Text
type AttrLabel SignalQuerySignalNameFieldInfo = "signal_name"
type AttrOrigin SignalQuerySignalNameFieldInfo = SignalQuery
attrGet _ = getSignalQuerySignalName
attrSet _ = setSignalQuerySignalName
attrConstruct = undefined
attrClear _ = clearSignalQuerySignalName
signalQuery_signalName :: AttrLabelProxy "signalName"
signalQuery_signalName = AttrLabelProxy
#endif
getSignalQueryItype :: MonadIO m => SignalQuery -> m GType
getSignalQueryItype s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CGType
let val' = GType val
return val'
setSignalQueryItype :: MonadIO m => SignalQuery -> GType -> m ()
setSignalQueryItype s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gtypeToCGType val
poke (ptr `plusPtr` 16) (val' :: CGType)
#if ENABLE_OVERLOADING
data SignalQueryItypeFieldInfo
instance AttrInfo SignalQueryItypeFieldInfo where
type AttrAllowedOps SignalQueryItypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalQueryItypeFieldInfo = (~) GType
type AttrBaseTypeConstraint SignalQueryItypeFieldInfo = (~) SignalQuery
type AttrGetType SignalQueryItypeFieldInfo = GType
type AttrLabel SignalQueryItypeFieldInfo = "itype"
type AttrOrigin SignalQueryItypeFieldInfo = SignalQuery
attrGet _ = getSignalQueryItype
attrSet _ = setSignalQueryItype
attrConstruct = undefined
attrClear _ = undefined
signalQuery_itype :: AttrLabelProxy "itype"
signalQuery_itype = AttrLabelProxy
#endif
getSignalQuerySignalFlags :: MonadIO m => SignalQuery -> m [GObject.Flags.SignalFlags]
getSignalQuerySignalFlags s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO CUInt
let val' = wordToGFlags val
return val'
setSignalQuerySignalFlags :: MonadIO m => SignalQuery -> [GObject.Flags.SignalFlags] -> m ()
setSignalQuerySignalFlags s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gflagsToWord val
poke (ptr `plusPtr` 24) (val' :: CUInt)
#if ENABLE_OVERLOADING
data SignalQuerySignalFlagsFieldInfo
instance AttrInfo SignalQuerySignalFlagsFieldInfo where
type AttrAllowedOps SignalQuerySignalFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalQuerySignalFlagsFieldInfo = (~) [GObject.Flags.SignalFlags]
type AttrBaseTypeConstraint SignalQuerySignalFlagsFieldInfo = (~) SignalQuery
type AttrGetType SignalQuerySignalFlagsFieldInfo = [GObject.Flags.SignalFlags]
type AttrLabel SignalQuerySignalFlagsFieldInfo = "signal_flags"
type AttrOrigin SignalQuerySignalFlagsFieldInfo = SignalQuery
attrGet _ = getSignalQuerySignalFlags
attrSet _ = setSignalQuerySignalFlags
attrConstruct = undefined
attrClear _ = undefined
signalQuery_signalFlags :: AttrLabelProxy "signalFlags"
signalQuery_signalFlags = AttrLabelProxy
#endif
getSignalQueryReturnType :: MonadIO m => SignalQuery -> m GType
getSignalQueryReturnType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CGType
let val' = GType val
return val'
setSignalQueryReturnType :: MonadIO m => SignalQuery -> GType -> m ()
setSignalQueryReturnType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gtypeToCGType val
poke (ptr `plusPtr` 32) (val' :: CGType)
#if ENABLE_OVERLOADING
data SignalQueryReturnTypeFieldInfo
instance AttrInfo SignalQueryReturnTypeFieldInfo where
type AttrAllowedOps SignalQueryReturnTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalQueryReturnTypeFieldInfo = (~) GType
type AttrBaseTypeConstraint SignalQueryReturnTypeFieldInfo = (~) SignalQuery
type AttrGetType SignalQueryReturnTypeFieldInfo = GType
type AttrLabel SignalQueryReturnTypeFieldInfo = "return_type"
type AttrOrigin SignalQueryReturnTypeFieldInfo = SignalQuery
attrGet _ = getSignalQueryReturnType
attrSet _ = setSignalQueryReturnType
attrConstruct = undefined
attrClear _ = undefined
signalQuery_returnType :: AttrLabelProxy "returnType"
signalQuery_returnType = AttrLabelProxy
#endif
getSignalQueryNParams :: MonadIO m => SignalQuery -> m Word32
getSignalQueryNParams s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO Word32
return val
setSignalQueryNParams :: MonadIO m => SignalQuery -> Word32 -> m ()
setSignalQueryNParams s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (val :: Word32)
#if ENABLE_OVERLOADING
data SignalQueryNParamsFieldInfo
instance AttrInfo SignalQueryNParamsFieldInfo where
type AttrAllowedOps SignalQueryNParamsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint SignalQueryNParamsFieldInfo = (~) Word32
type AttrBaseTypeConstraint SignalQueryNParamsFieldInfo = (~) SignalQuery
type AttrGetType SignalQueryNParamsFieldInfo = Word32
type AttrLabel SignalQueryNParamsFieldInfo = "n_params"
type AttrOrigin SignalQueryNParamsFieldInfo = SignalQuery
attrGet _ = getSignalQueryNParams
attrSet _ = setSignalQueryNParams
attrConstruct = undefined
attrClear _ = undefined
signalQuery_nParams :: AttrLabelProxy "nParams"
signalQuery_nParams = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SignalQuery
type instance O.AttributeList SignalQuery = SignalQueryAttributeList
type SignalQueryAttributeList = ('[ '("signalId", SignalQuerySignalIdFieldInfo), '("signalName", SignalQuerySignalNameFieldInfo), '("itype", SignalQueryItypeFieldInfo), '("signalFlags", SignalQuerySignalFlagsFieldInfo), '("returnType", SignalQueryReturnTypeFieldInfo), '("nParams", SignalQueryNParamsFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveSignalQueryMethod (t :: Symbol) (o :: *) :: * where
ResolveSignalQueryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSignalQueryMethod t SignalQuery, O.MethodInfo info SignalQuery p) => OL.IsLabel t (SignalQuery -> 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