#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusMethodInfo
(
DBusMethodInfo(..) ,
newZeroDBusMethodInfo ,
noDBusMethodInfo ,
#if ENABLE_OVERLOADING
DBusMethodInfoRefMethodInfo ,
#endif
dBusMethodInfoRef ,
#if ENABLE_OVERLOADING
DBusMethodInfoUnrefMethodInfo ,
#endif
dBusMethodInfoUnref ,
clearDBusMethodInfoAnnotations ,
#if ENABLE_OVERLOADING
dBusMethodInfo_annotations ,
#endif
getDBusMethodInfoAnnotations ,
setDBusMethodInfoAnnotations ,
clearDBusMethodInfoInArgs ,
#if ENABLE_OVERLOADING
dBusMethodInfo_inArgs ,
#endif
getDBusMethodInfoInArgs ,
setDBusMethodInfoInArgs ,
clearDBusMethodInfoName ,
#if ENABLE_OVERLOADING
dBusMethodInfo_name ,
#endif
getDBusMethodInfoName ,
setDBusMethodInfoName ,
clearDBusMethodInfoOutArgs ,
#if ENABLE_OVERLOADING
dBusMethodInfo_outArgs ,
#endif
getDBusMethodInfoOutArgs ,
setDBusMethodInfoOutArgs ,
#if ENABLE_OVERLOADING
dBusMethodInfo_refCount ,
#endif
getDBusMethodInfoRefCount ,
setDBusMethodInfoRefCount ,
) 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
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusAnnotationInfo as Gio.DBusAnnotationInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusArgInfo as Gio.DBusArgInfo
newtype DBusMethodInfo = DBusMethodInfo (ManagedPtr DBusMethodInfo)
foreign import ccall "g_dbus_method_info_get_type" c_g_dbus_method_info_get_type ::
IO GType
instance BoxedObject DBusMethodInfo where
boxedType _ = c_g_dbus_method_info_get_type
newZeroDBusMethodInfo :: MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo = liftIO $ callocBoxedBytes 40 >>= wrapBoxed DBusMethodInfo
instance tag ~ 'AttrSet => Constructible DBusMethodInfo tag where
new _ attrs = do
o <- newZeroDBusMethodInfo
GI.Attributes.set o attrs
return o
noDBusMethodInfo :: Maybe DBusMethodInfo
noDBusMethodInfo = Nothing
getDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> m Int32
getDBusMethodInfoRefCount s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
setDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> Int32 -> m ()
setDBusMethodInfoRefCount s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Int32)
#if ENABLE_OVERLOADING
data DBusMethodInfoRefCountFieldInfo
instance AttrInfo DBusMethodInfoRefCountFieldInfo where
type AttrAllowedOps DBusMethodInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusMethodInfoRefCountFieldInfo = (~) Int32
type AttrBaseTypeConstraint DBusMethodInfoRefCountFieldInfo = (~) DBusMethodInfo
type AttrGetType DBusMethodInfoRefCountFieldInfo = Int32
type AttrLabel DBusMethodInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusMethodInfoRefCountFieldInfo = DBusMethodInfo
attrGet _ = getDBusMethodInfoRefCount
attrSet _ = setDBusMethodInfoRefCount
attrConstruct = undefined
attrClear _ = undefined
dBusMethodInfo_refCount :: AttrLabelProxy "refCount"
dBusMethodInfo_refCount = AttrLabelProxy
#endif
getDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m (Maybe T.Text)
getDBusMethodInfoName 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
setDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> CString -> m ()
setDBusMethodInfoName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data DBusMethodInfoNameFieldInfo
instance AttrInfo DBusMethodInfoNameFieldInfo where
type AttrAllowedOps DBusMethodInfoNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoNameFieldInfo = (~) CString
type AttrBaseTypeConstraint DBusMethodInfoNameFieldInfo = (~) DBusMethodInfo
type AttrGetType DBusMethodInfoNameFieldInfo = Maybe T.Text
type AttrLabel DBusMethodInfoNameFieldInfo = "name"
type AttrOrigin DBusMethodInfoNameFieldInfo = DBusMethodInfo
attrGet _ = getDBusMethodInfoName
attrSet _ = setDBusMethodInfoName
attrConstruct = undefined
attrClear _ = clearDBusMethodInfoName
dBusMethodInfo_name :: AttrLabelProxy "name"
dBusMethodInfo_name = AttrLabelProxy
#endif
getDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoInArgs 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
setDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoInArgs s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
clearDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoInArgs s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
#if ENABLE_OVERLOADING
data DBusMethodInfoInArgsFieldInfo
instance AttrInfo DBusMethodInfoInArgsFieldInfo where
type AttrAllowedOps DBusMethodInfoInArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoInArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrBaseTypeConstraint DBusMethodInfoInArgsFieldInfo = (~) DBusMethodInfo
type AttrGetType DBusMethodInfoInArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
type AttrLabel DBusMethodInfoInArgsFieldInfo = "in_args"
type AttrOrigin DBusMethodInfoInArgsFieldInfo = DBusMethodInfo
attrGet _ = getDBusMethodInfoInArgs
attrSet _ = setDBusMethodInfoInArgs
attrConstruct = undefined
attrClear _ = clearDBusMethodInfoInArgs
dBusMethodInfo_inArgs :: AttrLabelProxy "inArgs"
dBusMethodInfo_inArgs = AttrLabelProxy
#endif
getDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoOutArgs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: 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
setDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoOutArgs s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
clearDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoOutArgs s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
#if ENABLE_OVERLOADING
data DBusMethodInfoOutArgsFieldInfo
instance AttrInfo DBusMethodInfoOutArgsFieldInfo where
type AttrAllowedOps DBusMethodInfoOutArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoOutArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrBaseTypeConstraint DBusMethodInfoOutArgsFieldInfo = (~) DBusMethodInfo
type AttrGetType DBusMethodInfoOutArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
type AttrLabel DBusMethodInfoOutArgsFieldInfo = "out_args"
type AttrOrigin DBusMethodInfoOutArgsFieldInfo = DBusMethodInfo
attrGet _ = getDBusMethodInfoOutArgs
attrSet _ = setDBusMethodInfoOutArgs
attrConstruct = undefined
attrClear _ = clearDBusMethodInfoOutArgs
dBusMethodInfo_outArgs :: AttrLabelProxy "outArgs"
dBusMethodInfo_outArgs = AttrLabelProxy
#endif
getDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusMethodInfoAnnotations 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
setDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusMethodInfoAnnotations s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
clearDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
#if ENABLE_OVERLOADING
data DBusMethodInfoAnnotationsFieldInfo
instance AttrInfo DBusMethodInfoAnnotationsFieldInfo where
type AttrAllowedOps DBusMethodInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrBaseTypeConstraint DBusMethodInfoAnnotationsFieldInfo = (~) DBusMethodInfo
type AttrGetType DBusMethodInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
type AttrLabel DBusMethodInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusMethodInfoAnnotationsFieldInfo = DBusMethodInfo
attrGet _ = getDBusMethodInfoAnnotations
attrSet _ = setDBusMethodInfoAnnotations
attrConstruct = undefined
attrClear _ = clearDBusMethodInfoAnnotations
dBusMethodInfo_annotations :: AttrLabelProxy "annotations"
dBusMethodInfo_annotations = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusMethodInfo
type instance O.AttributeList DBusMethodInfo = DBusMethodInfoAttributeList
type DBusMethodInfoAttributeList = ('[ '("refCount", DBusMethodInfoRefCountFieldInfo), '("name", DBusMethodInfoNameFieldInfo), '("inArgs", DBusMethodInfoInArgsFieldInfo), '("outArgs", DBusMethodInfoOutArgsFieldInfo), '("annotations", DBusMethodInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_method_info_ref" g_dbus_method_info_ref ::
Ptr DBusMethodInfo ->
IO (Ptr DBusMethodInfo)
dBusMethodInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusMethodInfo
-> m DBusMethodInfo
dBusMethodInfoRef info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- g_dbus_method_info_ref info'
checkUnexpectedReturnNULL "dBusMethodInfoRef" result
result' <- (wrapBoxed DBusMethodInfo) result
touchManagedPtr info
return result'
#if ENABLE_OVERLOADING
data DBusMethodInfoRefMethodInfo
instance (signature ~ (m DBusMethodInfo), MonadIO m) => O.MethodInfo DBusMethodInfoRefMethodInfo DBusMethodInfo signature where
overloadedMethod _ = dBusMethodInfoRef
#endif
foreign import ccall "g_dbus_method_info_unref" g_dbus_method_info_unref ::
Ptr DBusMethodInfo ->
IO ()
dBusMethodInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusMethodInfo
-> m ()
dBusMethodInfoUnref info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
g_dbus_method_info_unref info'
touchManagedPtr info
return ()
#if ENABLE_OVERLOADING
data DBusMethodInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusMethodInfoUnrefMethodInfo DBusMethodInfo signature where
overloadedMethod _ = dBusMethodInfoUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusMethodInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusMethodInfoMethod "ref" o = DBusMethodInfoRefMethodInfo
ResolveDBusMethodInfoMethod "unref" o = DBusMethodInfoUnrefMethodInfo
ResolveDBusMethodInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusMethodInfoMethod t DBusMethodInfo, O.MethodInfo info DBusMethodInfo p) => O.IsLabelProxy t (DBusMethodInfo -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDBusMethodInfoMethod t DBusMethodInfo, O.MethodInfo info DBusMethodInfo p) => O.IsLabel t (DBusMethodInfo -> 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