#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusNodeInfo
(
DBusNodeInfo(..) ,
newZeroDBusNodeInfo ,
noDBusNodeInfo ,
#if ENABLE_OVERLOADING
DBusNodeInfoGenerateXmlMethodInfo ,
#endif
dBusNodeInfoGenerateXml ,
#if ENABLE_OVERLOADING
DBusNodeInfoLookupInterfaceMethodInfo ,
#endif
dBusNodeInfoLookupInterface ,
dBusNodeInfoNewForXml ,
#if ENABLE_OVERLOADING
DBusNodeInfoRefMethodInfo ,
#endif
dBusNodeInfoRef ,
#if ENABLE_OVERLOADING
DBusNodeInfoUnrefMethodInfo ,
#endif
dBusNodeInfoUnref ,
clearDBusNodeInfoAnnotations ,
#if ENABLE_OVERLOADING
dBusNodeInfo_annotations ,
#endif
getDBusNodeInfoAnnotations ,
setDBusNodeInfoAnnotations ,
clearDBusNodeInfoInterfaces ,
#if ENABLE_OVERLOADING
dBusNodeInfo_interfaces ,
#endif
getDBusNodeInfoInterfaces ,
setDBusNodeInfoInterfaces ,
clearDBusNodeInfoNodes ,
#if ENABLE_OVERLOADING
dBusNodeInfo_nodes ,
#endif
getDBusNodeInfoNodes ,
setDBusNodeInfoNodes ,
clearDBusNodeInfoPath ,
#if ENABLE_OVERLOADING
dBusNodeInfo_path ,
#endif
getDBusNodeInfoPath ,
setDBusNodeInfoPath ,
#if ENABLE_OVERLOADING
dBusNodeInfo_refCount ,
#endif
getDBusNodeInfoRefCount ,
setDBusNodeInfoRefCount ,
) 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 qualified GI.GLib.Structs.String as GLib.String
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusAnnotationInfo as Gio.DBusAnnotationInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceInfo as Gio.DBusInterfaceInfo
newtype DBusNodeInfo = DBusNodeInfo (ManagedPtr DBusNodeInfo)
foreign import ccall "g_dbus_node_info_get_type" c_g_dbus_node_info_get_type ::
IO GType
instance BoxedObject DBusNodeInfo where
boxedType _ = c_g_dbus_node_info_get_type
newZeroDBusNodeInfo :: MonadIO m => m DBusNodeInfo
newZeroDBusNodeInfo = liftIO $ callocBoxedBytes 40 >>= wrapBoxed DBusNodeInfo
instance tag ~ 'AttrSet => Constructible DBusNodeInfo tag where
new _ attrs = do
o <- newZeroDBusNodeInfo
GI.Attributes.set o attrs
return o
noDBusNodeInfo :: Maybe DBusNodeInfo
noDBusNodeInfo = Nothing
getDBusNodeInfoRefCount :: MonadIO m => DBusNodeInfo -> m Int32
getDBusNodeInfoRefCount s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
setDBusNodeInfoRefCount :: MonadIO m => DBusNodeInfo -> Int32 -> m ()
setDBusNodeInfoRefCount s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Int32)
#if ENABLE_OVERLOADING
data DBusNodeInfoRefCountFieldInfo
instance AttrInfo DBusNodeInfoRefCountFieldInfo where
type AttrAllowedOps DBusNodeInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusNodeInfoRefCountFieldInfo = (~) Int32
type AttrBaseTypeConstraint DBusNodeInfoRefCountFieldInfo = (~) DBusNodeInfo
type AttrGetType DBusNodeInfoRefCountFieldInfo = Int32
type AttrLabel DBusNodeInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusNodeInfoRefCountFieldInfo = DBusNodeInfo
attrGet _ = getDBusNodeInfoRefCount
attrSet _ = setDBusNodeInfoRefCount
attrConstruct = undefined
attrClear _ = undefined
dBusNodeInfo_refCount :: AttrLabelProxy "refCount"
dBusNodeInfo_refCount = AttrLabelProxy
#endif
getDBusNodeInfoPath :: MonadIO m => DBusNodeInfo -> m (Maybe T.Text)
getDBusNodeInfoPath 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
setDBusNodeInfoPath :: MonadIO m => DBusNodeInfo -> CString -> m ()
setDBusNodeInfoPath s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearDBusNodeInfoPath :: MonadIO m => DBusNodeInfo -> m ()
clearDBusNodeInfoPath s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data DBusNodeInfoPathFieldInfo
instance AttrInfo DBusNodeInfoPathFieldInfo where
type AttrAllowedOps DBusNodeInfoPathFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusNodeInfoPathFieldInfo = (~) CString
type AttrBaseTypeConstraint DBusNodeInfoPathFieldInfo = (~) DBusNodeInfo
type AttrGetType DBusNodeInfoPathFieldInfo = Maybe T.Text
type AttrLabel DBusNodeInfoPathFieldInfo = "path"
type AttrOrigin DBusNodeInfoPathFieldInfo = DBusNodeInfo
attrGet _ = getDBusNodeInfoPath
attrSet _ = setDBusNodeInfoPath
attrConstruct = undefined
attrClear _ = clearDBusNodeInfoPath
dBusNodeInfo_path :: AttrLabelProxy "path"
dBusNodeInfo_path = AttrLabelProxy
#endif
getDBusNodeInfoInterfaces :: MonadIO m => DBusNodeInfo -> m (Maybe [Gio.DBusInterfaceInfo.DBusInterfaceInfo])
getDBusNodeInfoInterfaces s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (Ptr (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo))
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedPtrArray val'
val''' <- mapM (newBoxed Gio.DBusInterfaceInfo.DBusInterfaceInfo) val''
return val'''
return result
setDBusNodeInfoInterfaces :: MonadIO m => DBusNodeInfo -> Ptr (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo) -> m ()
setDBusNodeInfoInterfaces s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Ptr (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo))
clearDBusNodeInfoInterfaces :: MonadIO m => DBusNodeInfo -> m ()
clearDBusNodeInfoInterfaces s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo))
#if ENABLE_OVERLOADING
data DBusNodeInfoInterfacesFieldInfo
instance AttrInfo DBusNodeInfoInterfacesFieldInfo where
type AttrAllowedOps DBusNodeInfoInterfacesFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusNodeInfoInterfacesFieldInfo = (~) (Ptr (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo))
type AttrBaseTypeConstraint DBusNodeInfoInterfacesFieldInfo = (~) DBusNodeInfo
type AttrGetType DBusNodeInfoInterfacesFieldInfo = Maybe [Gio.DBusInterfaceInfo.DBusInterfaceInfo]
type AttrLabel DBusNodeInfoInterfacesFieldInfo = "interfaces"
type AttrOrigin DBusNodeInfoInterfacesFieldInfo = DBusNodeInfo
attrGet _ = getDBusNodeInfoInterfaces
attrSet _ = setDBusNodeInfoInterfaces
attrConstruct = undefined
attrClear _ = clearDBusNodeInfoInterfaces
dBusNodeInfo_interfaces :: AttrLabelProxy "interfaces"
dBusNodeInfo_interfaces = AttrLabelProxy
#endif
getDBusNodeInfoNodes :: MonadIO m => DBusNodeInfo -> m (Maybe [DBusNodeInfo])
getDBusNodeInfoNodes s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr (Ptr DBusNodeInfo))
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedPtrArray val'
val''' <- mapM (newBoxed DBusNodeInfo) val''
return val'''
return result
setDBusNodeInfoNodes :: MonadIO m => DBusNodeInfo -> Ptr (Ptr DBusNodeInfo) -> m ()
setDBusNodeInfoNodes s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr (Ptr DBusNodeInfo))
clearDBusNodeInfoNodes :: MonadIO m => DBusNodeInfo -> m ()
clearDBusNodeInfoNodes s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr (Ptr DBusNodeInfo))
#if ENABLE_OVERLOADING
data DBusNodeInfoNodesFieldInfo
instance AttrInfo DBusNodeInfoNodesFieldInfo where
type AttrAllowedOps DBusNodeInfoNodesFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusNodeInfoNodesFieldInfo = (~) (Ptr (Ptr DBusNodeInfo))
type AttrBaseTypeConstraint DBusNodeInfoNodesFieldInfo = (~) DBusNodeInfo
type AttrGetType DBusNodeInfoNodesFieldInfo = Maybe [DBusNodeInfo]
type AttrLabel DBusNodeInfoNodesFieldInfo = "nodes"
type AttrOrigin DBusNodeInfoNodesFieldInfo = DBusNodeInfo
attrGet _ = getDBusNodeInfoNodes
attrSet _ = setDBusNodeInfoNodes
attrConstruct = undefined
attrClear _ = clearDBusNodeInfoNodes
dBusNodeInfo_nodes :: AttrLabelProxy "nodes"
dBusNodeInfo_nodes = AttrLabelProxy
#endif
getDBusNodeInfoAnnotations :: MonadIO m => DBusNodeInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusNodeInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: 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
setDBusNodeInfoAnnotations :: MonadIO m => DBusNodeInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusNodeInfoAnnotations s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
clearDBusNodeInfoAnnotations :: MonadIO m => DBusNodeInfo -> m ()
clearDBusNodeInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
#if ENABLE_OVERLOADING
data DBusNodeInfoAnnotationsFieldInfo
instance AttrInfo DBusNodeInfoAnnotationsFieldInfo where
type AttrAllowedOps DBusNodeInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusNodeInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrBaseTypeConstraint DBusNodeInfoAnnotationsFieldInfo = (~) DBusNodeInfo
type AttrGetType DBusNodeInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
type AttrLabel DBusNodeInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusNodeInfoAnnotationsFieldInfo = DBusNodeInfo
attrGet _ = getDBusNodeInfoAnnotations
attrSet _ = setDBusNodeInfoAnnotations
attrConstruct = undefined
attrClear _ = clearDBusNodeInfoAnnotations
dBusNodeInfo_annotations :: AttrLabelProxy "annotations"
dBusNodeInfo_annotations = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusNodeInfo
type instance O.AttributeList DBusNodeInfo = DBusNodeInfoAttributeList
type DBusNodeInfoAttributeList = ('[ '("refCount", DBusNodeInfoRefCountFieldInfo), '("path", DBusNodeInfoPathFieldInfo), '("interfaces", DBusNodeInfoInterfacesFieldInfo), '("nodes", DBusNodeInfoNodesFieldInfo), '("annotations", DBusNodeInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_node_info_new_for_xml" g_dbus_node_info_new_for_xml ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr DBusNodeInfo)
dBusNodeInfoNewForXml ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m DBusNodeInfo
dBusNodeInfoNewForXml xmlData = liftIO $ do
xmlData' <- textToCString xmlData
onException (do
result <- propagateGError $ g_dbus_node_info_new_for_xml xmlData'
checkUnexpectedReturnNULL "dBusNodeInfoNewForXml" result
result' <- (wrapBoxed DBusNodeInfo) result
freeMem xmlData'
return result'
) (do
freeMem xmlData'
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_dbus_node_info_generate_xml" g_dbus_node_info_generate_xml ::
Ptr DBusNodeInfo ->
Word32 ->
Ptr GLib.String.String ->
IO ()
dBusNodeInfoGenerateXml ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusNodeInfo
-> Word32
-> GLib.String.String
-> m ()
dBusNodeInfoGenerateXml info indent stringBuilder = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
stringBuilder' <- unsafeManagedPtrGetPtr stringBuilder
g_dbus_node_info_generate_xml info' indent stringBuilder'
touchManagedPtr info
touchManagedPtr stringBuilder
return ()
#if ENABLE_OVERLOADING
data DBusNodeInfoGenerateXmlMethodInfo
instance (signature ~ (Word32 -> GLib.String.String -> m ()), MonadIO m) => O.MethodInfo DBusNodeInfoGenerateXmlMethodInfo DBusNodeInfo signature where
overloadedMethod _ = dBusNodeInfoGenerateXml
#endif
foreign import ccall "g_dbus_node_info_lookup_interface" g_dbus_node_info_lookup_interface ::
Ptr DBusNodeInfo ->
CString ->
IO (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo)
dBusNodeInfoLookupInterface ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusNodeInfo
-> T.Text
-> m Gio.DBusInterfaceInfo.DBusInterfaceInfo
dBusNodeInfoLookupInterface info name = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
name' <- textToCString name
result <- g_dbus_node_info_lookup_interface info' name'
checkUnexpectedReturnNULL "dBusNodeInfoLookupInterface" result
result' <- (newBoxed Gio.DBusInterfaceInfo.DBusInterfaceInfo) result
touchManagedPtr info
freeMem name'
return result'
#if ENABLE_OVERLOADING
data DBusNodeInfoLookupInterfaceMethodInfo
instance (signature ~ (T.Text -> m Gio.DBusInterfaceInfo.DBusInterfaceInfo), MonadIO m) => O.MethodInfo DBusNodeInfoLookupInterfaceMethodInfo DBusNodeInfo signature where
overloadedMethod _ = dBusNodeInfoLookupInterface
#endif
foreign import ccall "g_dbus_node_info_ref" g_dbus_node_info_ref ::
Ptr DBusNodeInfo ->
IO (Ptr DBusNodeInfo)
dBusNodeInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusNodeInfo
-> m DBusNodeInfo
dBusNodeInfoRef info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- g_dbus_node_info_ref info'
checkUnexpectedReturnNULL "dBusNodeInfoRef" result
result' <- (wrapBoxed DBusNodeInfo) result
touchManagedPtr info
return result'
#if ENABLE_OVERLOADING
data DBusNodeInfoRefMethodInfo
instance (signature ~ (m DBusNodeInfo), MonadIO m) => O.MethodInfo DBusNodeInfoRefMethodInfo DBusNodeInfo signature where
overloadedMethod _ = dBusNodeInfoRef
#endif
foreign import ccall "g_dbus_node_info_unref" g_dbus_node_info_unref ::
Ptr DBusNodeInfo ->
IO ()
dBusNodeInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusNodeInfo
-> m ()
dBusNodeInfoUnref info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
g_dbus_node_info_unref info'
touchManagedPtr info
return ()
#if ENABLE_OVERLOADING
data DBusNodeInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusNodeInfoUnrefMethodInfo DBusNodeInfo signature where
overloadedMethod _ = dBusNodeInfoUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusNodeInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusNodeInfoMethod "generateXml" o = DBusNodeInfoGenerateXmlMethodInfo
ResolveDBusNodeInfoMethod "lookupInterface" o = DBusNodeInfoLookupInterfaceMethodInfo
ResolveDBusNodeInfoMethod "ref" o = DBusNodeInfoRefMethodInfo
ResolveDBusNodeInfoMethod "unref" o = DBusNodeInfoUnrefMethodInfo
ResolveDBusNodeInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusNodeInfoMethod t DBusNodeInfo, O.MethodInfo info DBusNodeInfo p) => OL.IsLabel t (DBusNodeInfo -> 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