{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Structs.DBusMethodInfo
(
DBusMethodInfo(..) ,
newZeroDBusMethodInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusMethodInfoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusMethodInfoRefMethodInfo ,
#endif
dBusMethodInfoRef ,
#if defined(ENABLE_OVERLOADING)
DBusMethodInfoUnrefMethodInfo ,
#endif
dBusMethodInfoUnref ,
clearDBusMethodInfoAnnotations ,
#if defined(ENABLE_OVERLOADING)
dBusMethodInfo_annotations ,
#endif
getDBusMethodInfoAnnotations ,
setDBusMethodInfoAnnotations ,
clearDBusMethodInfoInArgs ,
#if defined(ENABLE_OVERLOADING)
dBusMethodInfo_inArgs ,
#endif
getDBusMethodInfoInArgs ,
setDBusMethodInfoInArgs ,
clearDBusMethodInfoName ,
#if defined(ENABLE_OVERLOADING)
dBusMethodInfo_name ,
#endif
getDBusMethodInfoName ,
setDBusMethodInfoName ,
clearDBusMethodInfoOutArgs ,
#if defined(ENABLE_OVERLOADING)
dBusMethodInfo_outArgs ,
#endif
getDBusMethodInfoOutArgs ,
setDBusMethodInfoOutArgs ,
#if defined(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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusAnnotationInfo as Gio.DBusAnnotationInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusArgInfo as Gio.DBusArgInfo
newtype DBusMethodInfo = DBusMethodInfo (SP.ManagedPtr DBusMethodInfo)
deriving (DBusMethodInfo -> DBusMethodInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusMethodInfo -> DBusMethodInfo -> Bool
$c/= :: DBusMethodInfo -> DBusMethodInfo -> Bool
== :: DBusMethodInfo -> DBusMethodInfo -> Bool
$c== :: DBusMethodInfo -> DBusMethodInfo -> Bool
Eq)
instance SP.ManagedPtrNewtype DBusMethodInfo where
toManagedPtr :: DBusMethodInfo -> ManagedPtr DBusMethodInfo
toManagedPtr (DBusMethodInfo ManagedPtr DBusMethodInfo
p) = ManagedPtr DBusMethodInfo
p
foreign import ccall "g_dbus_method_info_get_type" c_g_dbus_method_info_get_type ::
IO GType
type instance O.ParentTypes DBusMethodInfo = '[]
instance O.HasParentTypes DBusMethodInfo
instance B.Types.TypedObject DBusMethodInfo where
glibType :: IO GType
glibType = IO GType
c_g_dbus_method_info_get_type
instance B.Types.GBoxed DBusMethodInfo
instance B.GValue.IsGValue (Maybe DBusMethodInfo) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_dbus_method_info_get_type
gvalueSet_ :: Ptr GValue -> Maybe DBusMethodInfo -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DBusMethodInfo
P.Nothing = forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr DBusMethodInfo)
gvalueSet_ Ptr GValue
gv (P.Just DBusMethodInfo
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusMethodInfo
obj (forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DBusMethodInfo)
gvalueGet_ Ptr GValue
gv = do
Ptr DBusMethodInfo
ptr <- forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr DBusMethodInfo)
if Ptr DBusMethodInfo
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo Ptr DBusMethodInfo
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
newZeroDBusMethodInfo :: MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo :: forall (m :: * -> *). MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
40 forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo
instance tag ~ 'AttrSet => Constructible DBusMethodInfo tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr DBusMethodInfo -> DBusMethodInfo)
-> [AttrOp DBusMethodInfo tag] -> m DBusMethodInfo
new ManagedPtr DBusMethodInfo -> DBusMethodInfo
_ [AttrOp DBusMethodInfo tag]
attrs = do
DBusMethodInfo
o <- forall (m :: * -> *). MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set DBusMethodInfo
o [AttrOp DBusMethodInfo tag]
attrs
forall (m :: * -> *) a. Monad m => a -> m a
return DBusMethodInfo
o
getDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> m Int32
getDBusMethodInfoRefCount :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m Int32
getDBusMethodInfoRefCount DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
Int32
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> Int32 -> m ()
setDBusMethodInfoRefCount :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> Int32 -> m ()
setDBusMethodInfoRefCount DBusMethodInfo
s Int32
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoRefCountFieldInfo
instance AttrInfo DBusMethodInfoRefCountFieldInfo where
type AttrBaseTypeConstraint DBusMethodInfoRefCountFieldInfo = (~) DBusMethodInfo
type AttrAllowedOps DBusMethodInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusMethodInfoRefCountFieldInfo = (~) Int32
type AttrTransferTypeConstraint DBusMethodInfoRefCountFieldInfo = (~)Int32
type AttrTransferType DBusMethodInfoRefCountFieldInfo = Int32
type AttrGetType DBusMethodInfoRefCountFieldInfo = Int32
type AttrLabel DBusMethodInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusMethodInfoRefCountFieldInfo = DBusMethodInfo
attrGet = getDBusMethodInfoRefCount
attrSet = setDBusMethodInfoRefCount
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.refCount"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#g:attr:refCount"
})
dBusMethodInfo_refCount :: AttrLabelProxy "refCount"
dBusMethodInfo_refCount = AttrLabelProxy
#endif
getDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m (Maybe T.Text)
getDBusMethodInfoName :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m (Maybe Text)
getDBusMethodInfoName DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
CString
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO CString
Maybe Text
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
cstringToText CString
val'
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> CString -> m ()
setDBusMethodInfoName :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> CString -> m ()
setDBusMethodInfoName DBusMethodInfo
s CString
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
val :: CString)
clearDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoName :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoName DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoNameFieldInfo
instance AttrInfo DBusMethodInfoNameFieldInfo where
type AttrBaseTypeConstraint DBusMethodInfoNameFieldInfo = (~) DBusMethodInfo
type AttrAllowedOps DBusMethodInfoNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoNameFieldInfo = (~) CString
type AttrTransferTypeConstraint DBusMethodInfoNameFieldInfo = (~)CString
type AttrTransferType DBusMethodInfoNameFieldInfo = CString
type AttrGetType DBusMethodInfoNameFieldInfo = Maybe T.Text
type AttrLabel DBusMethodInfoNameFieldInfo = "name"
type AttrOrigin DBusMethodInfoNameFieldInfo = DBusMethodInfo
attrGet = getDBusMethodInfoName
attrSet = setDBusMethodInfoName
attrConstruct = undefined
attrClear = clearDBusMethodInfoName
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#g:attr:name"
})
dBusMethodInfo_name :: AttrLabelProxy "name"
dBusMethodInfo_name = AttrLabelProxy
#endif
getDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoInArgs :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> m (Maybe [DBusArgInfo])
getDBusMethodInfoInArgs DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
Ptr (Ptr DBusArgInfo)
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
Maybe [DBusArgInfo]
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusArgInfo)
val forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr DBusArgInfo)
val' -> do
[Ptr DBusArgInfo]
val'' <- forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusArgInfo)
val'
[DBusArgInfo]
val''' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusArgInfo -> DBusArgInfo
Gio.DBusArgInfo.DBusArgInfo) [Ptr DBusArgInfo]
val''
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusArgInfo]
val'''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusArgInfo]
result
setDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoInArgs :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> Ptr (Ptr DBusArgInfo) -> m ()
setDBusMethodInfoInArgs DBusMethodInfo
s Ptr (Ptr DBusArgInfo)
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr (Ptr DBusArgInfo)
val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
clearDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoInArgs :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoInArgs DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (forall a. Ptr a
FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoInArgsFieldInfo
instance AttrInfo DBusMethodInfoInArgsFieldInfo where
type AttrBaseTypeConstraint DBusMethodInfoInArgsFieldInfo = (~) DBusMethodInfo
type AttrAllowedOps DBusMethodInfoInArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoInArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrTransferTypeConstraint DBusMethodInfoInArgsFieldInfo = (~)(Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrTransferType DBusMethodInfoInArgsFieldInfo = (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrGetType DBusMethodInfoInArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
type AttrLabel DBusMethodInfoInArgsFieldInfo = "in_args"
type AttrOrigin DBusMethodInfoInArgsFieldInfo = DBusMethodInfo
attrGet = getDBusMethodInfoInArgs
attrSet = setDBusMethodInfoInArgs
attrConstruct = undefined
attrClear = clearDBusMethodInfoInArgs
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.inArgs"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#g:attr:inArgs"
})
dBusMethodInfo_inArgs :: AttrLabelProxy "inArgs"
dBusMethodInfo_inArgs = AttrLabelProxy
#endif
getDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoOutArgs :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> m (Maybe [DBusArgInfo])
getDBusMethodInfoOutArgs DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
Ptr (Ptr DBusArgInfo)
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
Maybe [DBusArgInfo]
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusArgInfo)
val forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr DBusArgInfo)
val' -> do
[Ptr DBusArgInfo]
val'' <- forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusArgInfo)
val'
[DBusArgInfo]
val''' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusArgInfo -> DBusArgInfo
Gio.DBusArgInfo.DBusArgInfo) [Ptr DBusArgInfo]
val''
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusArgInfo]
val'''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusArgInfo]
result
setDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoOutArgs :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> Ptr (Ptr DBusArgInfo) -> m ()
setDBusMethodInfoOutArgs DBusMethodInfo
s Ptr (Ptr DBusArgInfo)
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr (Ptr DBusArgInfo)
val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
clearDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoOutArgs :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoOutArgs DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (forall a. Ptr a
FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoOutArgsFieldInfo
instance AttrInfo DBusMethodInfoOutArgsFieldInfo where
type AttrBaseTypeConstraint DBusMethodInfoOutArgsFieldInfo = (~) DBusMethodInfo
type AttrAllowedOps DBusMethodInfoOutArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoOutArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrTransferTypeConstraint DBusMethodInfoOutArgsFieldInfo = (~)(Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrTransferType DBusMethodInfoOutArgsFieldInfo = (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
type AttrGetType DBusMethodInfoOutArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
type AttrLabel DBusMethodInfoOutArgsFieldInfo = "out_args"
type AttrOrigin DBusMethodInfoOutArgsFieldInfo = DBusMethodInfo
attrGet = getDBusMethodInfoOutArgs
attrSet = setDBusMethodInfoOutArgs
attrConstruct = undefined
attrClear = clearDBusMethodInfoOutArgs
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.outArgs"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#g:attr:outArgs"
})
dBusMethodInfo_outArgs :: AttrLabelProxy "outArgs"
dBusMethodInfo_outArgs = AttrLabelProxy
#endif
getDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusMethodInfoAnnotations :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> m (Maybe [DBusAnnotationInfo])
getDBusMethodInfoAnnotations DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
Ptr (Ptr DBusAnnotationInfo)
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
Maybe [DBusAnnotationInfo]
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusAnnotationInfo)
val forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr DBusAnnotationInfo)
val' -> do
[Ptr DBusAnnotationInfo]
val'' <- forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusAnnotationInfo)
val'
[DBusAnnotationInfo]
val''' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
Gio.DBusAnnotationInfo.DBusAnnotationInfo) [Ptr DBusAnnotationInfo]
val''
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusAnnotationInfo]
val'''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusAnnotationInfo]
result
setDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusMethodInfoAnnotations :: forall (m :: * -> *).
MonadIO m =>
DBusMethodInfo -> Ptr (Ptr DBusAnnotationInfo) -> m ()
setDBusMethodInfoAnnotations DBusMethodInfo
s Ptr (Ptr DBusAnnotationInfo)
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (Ptr (Ptr DBusAnnotationInfo)
val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
clearDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoAnnotations :: forall (m :: * -> *). MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoAnnotations DBusMethodInfo
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s forall a b. (a -> b) -> a -> b
$ \Ptr DBusMethodInfo
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (forall a. Ptr a
FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoAnnotationsFieldInfo
instance AttrInfo DBusMethodInfoAnnotationsFieldInfo where
type AttrBaseTypeConstraint DBusMethodInfoAnnotationsFieldInfo = (~) DBusMethodInfo
type AttrAllowedOps DBusMethodInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusMethodInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrTransferTypeConstraint DBusMethodInfoAnnotationsFieldInfo = (~)(Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrTransferType DBusMethodInfoAnnotationsFieldInfo = (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrGetType DBusMethodInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
type AttrLabel DBusMethodInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusMethodInfoAnnotationsFieldInfo = DBusMethodInfo
attrGet = getDBusMethodInfoAnnotations
attrSet = setDBusMethodInfoAnnotations
attrConstruct = undefined
attrClear = clearDBusMethodInfoAnnotations
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.annotations"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#g:attr:annotations"
})
dBusMethodInfo_annotations :: AttrLabelProxy "annotations"
dBusMethodInfo_annotations = AttrLabelProxy
#endif
#if defined(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, DK.Type)])
#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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DBusMethodInfo -> m DBusMethodInfo
dBusMethodInfoRef DBusMethodInfo
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusMethodInfo
info' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusMethodInfo
info
Ptr DBusMethodInfo
result <- Ptr DBusMethodInfo -> IO (Ptr DBusMethodInfo)
g_dbus_method_info_ref Ptr DBusMethodInfo
info'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusMethodInfoRef" Ptr DBusMethodInfo
result
DBusMethodInfo
result' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo) Ptr DBusMethodInfo
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusMethodInfo
info
forall (m :: * -> *) a. Monad m => a -> m a
return DBusMethodInfo
result'
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoRefMethodInfo
instance (signature ~ (m DBusMethodInfo), MonadIO m) => O.OverloadedMethod DBusMethodInfoRefMethodInfo DBusMethodInfo signature where
overloadedMethod = dBusMethodInfoRef
instance O.OverloadedMethodInfo DBusMethodInfoRefMethodInfo DBusMethodInfo where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.dBusMethodInfoRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#v: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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DBusMethodInfo -> m ()
dBusMethodInfoUnref DBusMethodInfo
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusMethodInfo
info' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusMethodInfo
info
Ptr DBusMethodInfo -> IO ()
g_dbus_method_info_unref Ptr DBusMethodInfo
info'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusMethodInfo
info
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod DBusMethodInfoUnrefMethodInfo DBusMethodInfo signature where
overloadedMethod = dBusMethodInfoUnref
instance O.OverloadedMethodInfo DBusMethodInfoUnrefMethodInfo DBusMethodInfo where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.DBusMethodInfo.dBusMethodInfoUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Structs-DBusMethodInfo.html#v:dBusMethodInfoUnref"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusMethodInfoMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDBusMethodInfoMethod "ref" o = DBusMethodInfoRefMethodInfo
ResolveDBusMethodInfoMethod "unref" o = DBusMethodInfoUnrefMethodInfo
ResolveDBusMethodInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusMethodInfoMethod t DBusMethodInfo, O.OverloadedMethod info DBusMethodInfo p) => OL.IsLabel t (DBusMethodInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDBusMethodInfoMethod t DBusMethodInfo, O.OverloadedMethod info DBusMethodInfo p, R.HasField t DBusMethodInfo p) => R.HasField t DBusMethodInfo p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDBusMethodInfoMethod t DBusMethodInfo, O.OverloadedMethodInfo info DBusMethodInfo) => OL.IsLabel t (O.MethodProxy info DBusMethodInfo) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif