#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusSignalInfo
(
DBusSignalInfo(..) ,
newZeroDBusSignalInfo ,
noDBusSignalInfo ,
#if ENABLE_OVERLOADING
DBusSignalInfoRefMethodInfo ,
#endif
dBusSignalInfoRef ,
#if ENABLE_OVERLOADING
DBusSignalInfoUnrefMethodInfo ,
#endif
dBusSignalInfoUnref ,
clearDBusSignalInfoAnnotations ,
#if ENABLE_OVERLOADING
dBusSignalInfo_annotations ,
#endif
getDBusSignalInfoAnnotations ,
setDBusSignalInfoAnnotations ,
clearDBusSignalInfoArgs ,
#if ENABLE_OVERLOADING
dBusSignalInfo_args ,
#endif
getDBusSignalInfoArgs ,
setDBusSignalInfoArgs ,
clearDBusSignalInfoName ,
#if ENABLE_OVERLOADING
dBusSignalInfo_name ,
#endif
getDBusSignalInfoName ,
setDBusSignalInfoName ,
#if ENABLE_OVERLOADING
dBusSignalInfo_refCount ,
#endif
getDBusSignalInfoRefCount ,
setDBusSignalInfoRefCount ,
) 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.Gio.Structs.DBusAnnotationInfo as Gio.DBusAnnotationInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusArgInfo as Gio.DBusArgInfo
newtype DBusSignalInfo = DBusSignalInfo (ManagedPtr DBusSignalInfo)
foreign import ccall "g_dbus_signal_info_get_type" c_g_dbus_signal_info_get_type ::
IO GType
instance BoxedObject DBusSignalInfo where
boxedType _ = c_g_dbus_signal_info_get_type
newZeroDBusSignalInfo :: MonadIO m => m DBusSignalInfo
newZeroDBusSignalInfo = liftIO $ callocBoxedBytes 32 >>= wrapBoxed DBusSignalInfo
instance tag ~ 'AttrSet => Constructible DBusSignalInfo tag where
new _ attrs = do
o <- newZeroDBusSignalInfo
GI.Attributes.set o attrs
return o
noDBusSignalInfo :: Maybe DBusSignalInfo
noDBusSignalInfo = Nothing
getDBusSignalInfoRefCount :: MonadIO m => DBusSignalInfo -> m Int32
getDBusSignalInfoRefCount s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
setDBusSignalInfoRefCount :: MonadIO m => DBusSignalInfo -> Int32 -> m ()
setDBusSignalInfoRefCount s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Int32)
#if ENABLE_OVERLOADING
data DBusSignalInfoRefCountFieldInfo
instance AttrInfo DBusSignalInfoRefCountFieldInfo where
type AttrAllowedOps DBusSignalInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusSignalInfoRefCountFieldInfo = (~) Int32
type AttrBaseTypeConstraint DBusSignalInfoRefCountFieldInfo = (~) DBusSignalInfo
type AttrGetType DBusSignalInfoRefCountFieldInfo = Int32
type AttrLabel DBusSignalInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusSignalInfoRefCountFieldInfo = DBusSignalInfo
attrGet _ = getDBusSignalInfoRefCount
attrSet _ = setDBusSignalInfoRefCount
attrConstruct = undefined
attrClear _ = undefined
dBusSignalInfo_refCount :: AttrLabelProxy "refCount"
dBusSignalInfo_refCount = AttrLabelProxy
#endif
getDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> m (Maybe T.Text)
getDBusSignalInfoName 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
setDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> CString -> m ()
setDBusSignalInfoName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data DBusSignalInfoNameFieldInfo
instance AttrInfo DBusSignalInfoNameFieldInfo where
type AttrAllowedOps DBusSignalInfoNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusSignalInfoNameFieldInfo = (~) CString
type AttrBaseTypeConstraint DBusSignalInfoNameFieldInfo = (~) DBusSignalInfo
type AttrGetType DBusSignalInfoNameFieldInfo = Maybe T.Text
type AttrLabel DBusSignalInfoNameFieldInfo = "name"
type AttrOrigin DBusSignalInfoNameFieldInfo = DBusSignalInfo
attrGet _ = getDBusSignalInfoName
attrSet _ = setDBusSignalInfoName
attrConstruct = undefined
attrClear _ = clearDBusSignalInfoName
dBusSignalInfo_name :: AttrLabelProxy "name"
dBusSignalInfo_name = AttrLabelProxy
#endif
getDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusSignalInfoArgs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedPtrArray val'
val''' <- mapM (newBoxed Gio.DBusArgInfo.DBusArgInfo) val''
return val'''
return result
setDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusSignalInfoArgs s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
clearDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoArgs s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
#if ENABLE_OVERLOADING
data DBusSignalInfoArgsFieldInfo
instance AttrInfo DBusSignalInfoArgsFieldInfo where
type AttrAllowedOps DBusSignalInfoArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusSignalInfoArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrBaseTypeConstraint DBusSignalInfoArgsFieldInfo = (~) DBusSignalInfo
type AttrGetType DBusSignalInfoArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
type AttrLabel DBusSignalInfoArgsFieldInfo = "args"
type AttrOrigin DBusSignalInfoArgsFieldInfo = DBusSignalInfo
attrGet _ = getDBusSignalInfoArgs
attrSet _ = setDBusSignalInfoArgs
attrConstruct = undefined
attrClear _ = clearDBusSignalInfoArgs
dBusSignalInfo_args :: AttrLabelProxy "args"
dBusSignalInfo_args = AttrLabelProxy
#endif
getDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusSignalInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedPtrArray val'
val''' <- mapM (newBoxed Gio.DBusAnnotationInfo.DBusAnnotationInfo) val''
return val'''
return result
setDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusSignalInfoAnnotations s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
clearDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
#if ENABLE_OVERLOADING
data DBusSignalInfoAnnotationsFieldInfo
instance AttrInfo DBusSignalInfoAnnotationsFieldInfo where
type AttrAllowedOps DBusSignalInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusSignalInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrBaseTypeConstraint DBusSignalInfoAnnotationsFieldInfo = (~) DBusSignalInfo
type AttrGetType DBusSignalInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
type AttrLabel DBusSignalInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusSignalInfoAnnotationsFieldInfo = DBusSignalInfo
attrGet _ = getDBusSignalInfoAnnotations
attrSet _ = setDBusSignalInfoAnnotations
attrConstruct = undefined
attrClear _ = clearDBusSignalInfoAnnotations
dBusSignalInfo_annotations :: AttrLabelProxy "annotations"
dBusSignalInfo_annotations = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusSignalInfo
type instance O.AttributeList DBusSignalInfo = DBusSignalInfoAttributeList
type DBusSignalInfoAttributeList = ('[ '("refCount", DBusSignalInfoRefCountFieldInfo), '("name", DBusSignalInfoNameFieldInfo), '("args", DBusSignalInfoArgsFieldInfo), '("annotations", DBusSignalInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_signal_info_ref" g_dbus_signal_info_ref ::
Ptr DBusSignalInfo ->
IO (Ptr DBusSignalInfo)
dBusSignalInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusSignalInfo
-> m DBusSignalInfo
dBusSignalInfoRef info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- g_dbus_signal_info_ref info'
checkUnexpectedReturnNULL "dBusSignalInfoRef" result
result' <- (wrapBoxed DBusSignalInfo) result
touchManagedPtr info
return result'
#if ENABLE_OVERLOADING
data DBusSignalInfoRefMethodInfo
instance (signature ~ (m DBusSignalInfo), MonadIO m) => O.MethodInfo DBusSignalInfoRefMethodInfo DBusSignalInfo signature where
overloadedMethod _ = dBusSignalInfoRef
#endif
foreign import ccall "g_dbus_signal_info_unref" g_dbus_signal_info_unref ::
Ptr DBusSignalInfo ->
IO ()
dBusSignalInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusSignalInfo
-> m ()
dBusSignalInfoUnref info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
g_dbus_signal_info_unref info'
touchManagedPtr info
return ()
#if ENABLE_OVERLOADING
data DBusSignalInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusSignalInfoUnrefMethodInfo DBusSignalInfo signature where
overloadedMethod _ = dBusSignalInfoUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusSignalInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusSignalInfoMethod "ref" o = DBusSignalInfoRefMethodInfo
ResolveDBusSignalInfoMethod "unref" o = DBusSignalInfoUnrefMethodInfo
ResolveDBusSignalInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusSignalInfoMethod t DBusSignalInfo, O.MethodInfo info DBusSignalInfo p) => OL.IsLabel t (DBusSignalInfo -> 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