{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Information about a method on an D-Bus interface.
-- 
-- /Since: 2.26/

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gio.Structs.DBusMethodInfo
    ( 

-- * Exported types
    DBusMethodInfo(..)                      ,
    newZeroDBusMethodInfo                   ,
    noDBusMethodInfo                        ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveDBusMethodInfoMethod             ,
#endif


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    DBusMethodInfoRefMethodInfo             ,
#endif
    dBusMethodInfoRef                       ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    DBusMethodInfoUnrefMethodInfo           ,
#endif
    dBusMethodInfoUnref                     ,




 -- * Properties
-- ** annotations #attr:annotations#
-- | A pointer to a 'P.Nothing'-terminated array of pointers to t'GI.Gio.Structs.DBusAnnotationInfo.DBusAnnotationInfo' structures or 'P.Nothing' if there are no annotations.

    clearDBusMethodInfoAnnotations          ,
#if defined(ENABLE_OVERLOADING)
    dBusMethodInfo_annotations              ,
#endif
    getDBusMethodInfoAnnotations            ,
    setDBusMethodInfoAnnotations            ,


-- ** inArgs #attr:inArgs#
-- | A pointer to a 'P.Nothing'-terminated array of pointers to t'GI.Gio.Structs.DBusArgInfo.DBusArgInfo' structures or 'P.Nothing' if there are no in arguments.

    clearDBusMethodInfoInArgs               ,
#if defined(ENABLE_OVERLOADING)
    dBusMethodInfo_inArgs                   ,
#endif
    getDBusMethodInfoInArgs                 ,
    setDBusMethodInfoInArgs                 ,


-- ** name #attr:name#
-- | The name of the D-Bus method, e.g. /@requestName@/.

    clearDBusMethodInfoName                 ,
#if defined(ENABLE_OVERLOADING)
    dBusMethodInfo_name                     ,
#endif
    getDBusMethodInfoName                   ,
    setDBusMethodInfoName                   ,


-- ** outArgs #attr:outArgs#
-- | A pointer to a 'P.Nothing'-terminated array of pointers to t'GI.Gio.Structs.DBusArgInfo.DBusArgInfo' structures or 'P.Nothing' if there are no out arguments.

    clearDBusMethodInfoOutArgs              ,
#if defined(ENABLE_OVERLOADING)
    dBusMethodInfo_outArgs                  ,
#endif
    getDBusMethodInfoOutArgs                ,
    setDBusMethodInfoOutArgs                ,


-- ** refCount #attr:refCount#
-- | The reference count or -1 if statically allocated.

#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.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.GI.Base.Signals as B.Signals
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

-- | Memory-managed wrapper type.
newtype DBusMethodInfo = DBusMethodInfo (ManagedPtr DBusMethodInfo)
    deriving (DBusMethodInfo -> DBusMethodInfo -> Bool
(DBusMethodInfo -> DBusMethodInfo -> Bool)
-> (DBusMethodInfo -> DBusMethodInfo -> Bool) -> Eq DBusMethodInfo
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)
foreign import ccall "g_dbus_method_info_get_type" c_g_dbus_method_info_get_type :: 
    IO GType

instance BoxedObject DBusMethodInfo where
    boxedType :: DBusMethodInfo -> IO GType
boxedType _ = IO GType
c_g_dbus_method_info_get_type

-- | Convert 'DBusMethodInfo' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue DBusMethodInfo where
    toGValue :: DBusMethodInfo -> IO GValue
toGValue o :: DBusMethodInfo
o = do
        GType
gtype <- IO GType
c_g_dbus_method_info_get_type
        DBusMethodInfo -> (Ptr DBusMethodInfo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusMethodInfo
o (GType
-> (GValue -> Ptr DBusMethodInfo -> IO ())
-> Ptr DBusMethodInfo
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DBusMethodInfo -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO DBusMethodInfo
fromGValue gv :: GValue
gv = do
        Ptr DBusMethodInfo
ptr <- GValue -> IO (Ptr DBusMethodInfo)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr DBusMethodInfo)
        (ManagedPtr DBusMethodInfo -> DBusMethodInfo)
-> Ptr DBusMethodInfo -> IO DBusMethodInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo Ptr DBusMethodInfo
ptr
        
    

-- | Construct a `DBusMethodInfo` struct initialized to zero.
newZeroDBusMethodInfo :: MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo :: m DBusMethodInfo
newZeroDBusMethodInfo = IO DBusMethodInfo -> m DBusMethodInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusMethodInfo -> m DBusMethodInfo)
-> IO DBusMethodInfo -> m DBusMethodInfo
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr DBusMethodInfo)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 40 IO (Ptr DBusMethodInfo)
-> (Ptr DBusMethodInfo -> IO DBusMethodInfo) -> IO DBusMethodInfo
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr DBusMethodInfo -> DBusMethodInfo)
-> Ptr DBusMethodInfo -> IO DBusMethodInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo

instance tag ~ 'AttrSet => Constructible DBusMethodInfo tag where
    new :: (ManagedPtr DBusMethodInfo -> DBusMethodInfo)
-> [AttrOp DBusMethodInfo tag] -> m DBusMethodInfo
new _ attrs :: [AttrOp DBusMethodInfo tag]
attrs = do
        DBusMethodInfo
o <- m DBusMethodInfo
forall (m :: * -> *). MonadIO m => m DBusMethodInfo
newZeroDBusMethodInfo
        DBusMethodInfo -> [AttrOp DBusMethodInfo 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set DBusMethodInfo
o [AttrOp DBusMethodInfo tag]
[AttrOp DBusMethodInfo 'AttrSet]
attrs
        DBusMethodInfo -> m DBusMethodInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DBusMethodInfo
o


-- | A convenience alias for `Nothing` :: `Maybe` `DBusMethodInfo`.
noDBusMethodInfo :: Maybe DBusMethodInfo
noDBusMethodInfo :: Maybe DBusMethodInfo
noDBusMethodInfo = Maybe DBusMethodInfo
forall a. Maybe a
Nothing

-- | Get the value of the “@ref_count@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusMethodInfo #refCount
-- @
getDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> m Int32
getDBusMethodInfoRefCount :: DBusMethodInfo -> m Int32
getDBusMethodInfoRefCount s :: DBusMethodInfo
s = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO Int32) -> IO Int32)
-> (Ptr DBusMethodInfo -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO Int32
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val

-- | Set the value of the “@ref_count@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusMethodInfo [ #refCount 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusMethodInfoRefCount :: MonadIO m => DBusMethodInfo -> Int32 -> m ()
setDBusMethodInfoRefCount :: DBusMethodInfo -> Int32 -> m ()
setDBusMethodInfoRefCount s :: DBusMethodInfo
s val :: Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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

dBusMethodInfo_refCount :: AttrLabelProxy "refCount"
dBusMethodInfo_refCount = AttrLabelProxy

#endif


-- | Get the value of the “@name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusMethodInfo #name
-- @
getDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m (Maybe T.Text)
getDBusMethodInfoName :: DBusMethodInfo -> m (Maybe Text)
getDBusMethodInfoName s :: DBusMethodInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo
-> (Ptr DBusMethodInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr DBusMethodInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) :: IO CString
    Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
        Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result

-- | Set the value of the “@name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusMethodInfo [ #name 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> CString -> m ()
setDBusMethodInfoName :: DBusMethodInfo -> CString -> m ()
setDBusMethodInfoName s :: DBusMethodInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
val :: CString)

-- | Set the value of the “@name@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #name
-- @
clearDBusMethodInfoName :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoName :: DBusMethodInfo -> m ()
clearDBusMethodInfoName s :: DBusMethodInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
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

dBusMethodInfo_name :: AttrLabelProxy "name"
dBusMethodInfo_name = AttrLabelProxy

#endif


-- | Get the value of the “@in_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusMethodInfo #inArgs
-- @
getDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoInArgs :: DBusMethodInfo -> m (Maybe [DBusArgInfo])
getDBusMethodInfoInArgs s :: DBusMethodInfo
s = IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
 -> IO (Maybe [DBusArgInfo]))
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr DBusArgInfo)
val <- Ptr (Ptr (Ptr DBusArgInfo)) -> IO (Ptr (Ptr DBusArgInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) :: IO (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
    Maybe [DBusArgInfo]
result <- Ptr (Ptr DBusArgInfo)
-> (Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
-> IO (Maybe [DBusArgInfo])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusArgInfo)
val ((Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
 -> IO (Maybe [DBusArgInfo]))
-> (Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
-> IO (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr (Ptr DBusArgInfo)
val' -> do
        [Ptr DBusArgInfo]
val'' <- Ptr (Ptr DBusArgInfo) -> IO [Ptr DBusArgInfo]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusArgInfo)
val'
        [DBusArgInfo]
val''' <- (Ptr DBusArgInfo -> IO DBusArgInfo)
-> [Ptr DBusArgInfo] -> IO [DBusArgInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr DBusArgInfo -> DBusArgInfo)
-> Ptr DBusArgInfo -> IO DBusArgInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusArgInfo -> DBusArgInfo
Gio.DBusArgInfo.DBusArgInfo) [Ptr DBusArgInfo]
val''
        [DBusArgInfo] -> IO [DBusArgInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusArgInfo]
val'''
    Maybe [DBusArgInfo] -> IO (Maybe [DBusArgInfo])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusArgInfo]
result

-- | Set the value of the “@in_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusMethodInfo [ #inArgs 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoInArgs :: DBusMethodInfo -> Ptr (Ptr DBusArgInfo) -> m ()
setDBusMethodInfoInArgs s :: DBusMethodInfo
s val :: Ptr (Ptr DBusArgInfo)
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (Ptr (Ptr DBusArgInfo)
val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))

-- | Set the value of the “@in_args@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #inArgs
-- @
clearDBusMethodInfoInArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoInArgs :: DBusMethodInfo -> m ()
clearDBusMethodInfoInArgs s :: DBusMethodInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (Ptr (Ptr DBusArgInfo)
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

dBusMethodInfo_inArgs :: AttrLabelProxy "inArgs"
dBusMethodInfo_inArgs = AttrLabelProxy

#endif


-- | Get the value of the “@out_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusMethodInfo #outArgs
-- @
getDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusMethodInfoOutArgs :: DBusMethodInfo -> m (Maybe [DBusArgInfo])
getDBusMethodInfoOutArgs s :: DBusMethodInfo
s = IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo]) -> m (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
 -> IO (Maybe [DBusArgInfo]))
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr DBusArgInfo)
val <- Ptr (Ptr (Ptr DBusArgInfo)) -> IO (Ptr (Ptr DBusArgInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) :: IO (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
    Maybe [DBusArgInfo]
result <- Ptr (Ptr DBusArgInfo)
-> (Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
-> IO (Maybe [DBusArgInfo])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusArgInfo)
val ((Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
 -> IO (Maybe [DBusArgInfo]))
-> (Ptr (Ptr DBusArgInfo) -> IO [DBusArgInfo])
-> IO (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr (Ptr DBusArgInfo)
val' -> do
        [Ptr DBusArgInfo]
val'' <- Ptr (Ptr DBusArgInfo) -> IO [Ptr DBusArgInfo]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusArgInfo)
val'
        [DBusArgInfo]
val''' <- (Ptr DBusArgInfo -> IO DBusArgInfo)
-> [Ptr DBusArgInfo] -> IO [DBusArgInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr DBusArgInfo -> DBusArgInfo)
-> Ptr DBusArgInfo -> IO DBusArgInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusArgInfo -> DBusArgInfo
Gio.DBusArgInfo.DBusArgInfo) [Ptr DBusArgInfo]
val''
        [DBusArgInfo] -> IO [DBusArgInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusArgInfo]
val'''
    Maybe [DBusArgInfo] -> IO (Maybe [DBusArgInfo])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusArgInfo]
result

-- | Set the value of the “@out_args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusMethodInfo [ #outArgs 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusMethodInfoOutArgs :: DBusMethodInfo -> Ptr (Ptr DBusArgInfo) -> m ()
setDBusMethodInfoOutArgs s :: DBusMethodInfo
s val :: Ptr (Ptr DBusArgInfo)
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (Ptr (Ptr DBusArgInfo)
val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))

-- | Set the value of the “@out_args@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #outArgs
-- @
clearDBusMethodInfoOutArgs :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoOutArgs :: DBusMethodInfo -> m ()
clearDBusMethodInfoOutArgs s :: DBusMethodInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (Ptr (Ptr DBusArgInfo)
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

dBusMethodInfo_outArgs :: AttrLabelProxy "outArgs"
dBusMethodInfo_outArgs = AttrLabelProxy

#endif


-- | Get the value of the “@annotations@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusMethodInfo #annotations
-- @
getDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusMethodInfoAnnotations :: DBusMethodInfo -> m (Maybe [DBusAnnotationInfo])
getDBusMethodInfoAnnotations s :: DBusMethodInfo
s = IO (Maybe [DBusAnnotationInfo]) -> m (Maybe [DBusAnnotationInfo])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [DBusAnnotationInfo]) -> m (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
-> m (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO (Maybe [DBusAnnotationInfo]))
 -> IO (Maybe [DBusAnnotationInfo]))
-> (Ptr DBusMethodInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr DBusAnnotationInfo)
val <- Ptr (Ptr (Ptr DBusAnnotationInfo))
-> IO (Ptr (Ptr DBusAnnotationInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) :: IO (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
    Maybe [DBusAnnotationInfo]
result <- Ptr (Ptr DBusAnnotationInfo)
-> (Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
-> IO (Maybe [DBusAnnotationInfo])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusAnnotationInfo)
val ((Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
 -> IO (Maybe [DBusAnnotationInfo]))
-> (Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
-> IO (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr (Ptr DBusAnnotationInfo)
val' -> do
        [Ptr DBusAnnotationInfo]
val'' <- Ptr (Ptr DBusAnnotationInfo) -> IO [Ptr DBusAnnotationInfo]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusAnnotationInfo)
val'
        [DBusAnnotationInfo]
val''' <- (Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo)
-> [Ptr DBusAnnotationInfo] -> IO [DBusAnnotationInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
Gio.DBusAnnotationInfo.DBusAnnotationInfo) [Ptr DBusAnnotationInfo]
val''
        [DBusAnnotationInfo] -> IO [DBusAnnotationInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusAnnotationInfo]
val'''
    Maybe [DBusAnnotationInfo] -> IO (Maybe [DBusAnnotationInfo])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusAnnotationInfo]
result

-- | Set the value of the “@annotations@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusMethodInfo [ #annotations 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusMethodInfoAnnotations :: DBusMethodInfo -> Ptr (Ptr DBusAnnotationInfo) -> m ()
setDBusMethodInfoAnnotations s :: DBusMethodInfo
s val :: Ptr (Ptr DBusAnnotationInfo)
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) (Ptr (Ptr DBusAnnotationInfo)
val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))

-- | Set the value of the “@annotations@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #annotations
-- @
clearDBusMethodInfoAnnotations :: MonadIO m => DBusMethodInfo -> m ()
clearDBusMethodInfoAnnotations :: DBusMethodInfo -> m ()
clearDBusMethodInfoAnnotations s :: DBusMethodInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusMethodInfo -> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusMethodInfo
s ((Ptr DBusMethodInfo -> IO ()) -> IO ())
-> (Ptr DBusMethodInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusMethodInfo
ptr -> do
    Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusMethodInfo
ptr Ptr DBusMethodInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) (Ptr (Ptr DBusAnnotationInfo)
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

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, *)])
#endif

-- method DBusMethodInfo::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "DBusMethodInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDBusMethodInfo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gio" , name = "DBusMethodInfo" })
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_method_info_ref" g_dbus_method_info_ref :: 
    Ptr DBusMethodInfo ->                   -- info : TInterface (Name {namespace = "Gio", name = "DBusMethodInfo"})
    IO (Ptr DBusMethodInfo)

-- | If /@info@/ is statically allocated does nothing. Otherwise increases
-- the reference count.
-- 
-- /Since: 2.26/
dBusMethodInfoRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DBusMethodInfo
    -- ^ /@info@/: A t'GI.Gio.Structs.DBusMethodInfo.DBusMethodInfo'
    -> m DBusMethodInfo
    -- ^ __Returns:__ The same /@info@/.
dBusMethodInfoRef :: DBusMethodInfo -> m DBusMethodInfo
dBusMethodInfoRef info :: DBusMethodInfo
info = IO DBusMethodInfo -> m DBusMethodInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusMethodInfo -> m DBusMethodInfo)
-> IO DBusMethodInfo -> m DBusMethodInfo
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusMethodInfo
info' <- DBusMethodInfo -> IO (Ptr DBusMethodInfo)
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'
    Text -> Ptr DBusMethodInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusMethodInfoRef" Ptr DBusMethodInfo
result
    DBusMethodInfo
result' <- ((ManagedPtr DBusMethodInfo -> DBusMethodInfo)
-> Ptr DBusMethodInfo -> IO DBusMethodInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusMethodInfo -> DBusMethodInfo
DBusMethodInfo) Ptr DBusMethodInfo
result
    DBusMethodInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusMethodInfo
info
    DBusMethodInfo -> IO DBusMethodInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DBusMethodInfo
result'

#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoRefMethodInfo
instance (signature ~ (m DBusMethodInfo), MonadIO m) => O.MethodInfo DBusMethodInfoRefMethodInfo DBusMethodInfo signature where
    overloadedMethod = dBusMethodInfoRef

#endif

-- method DBusMethodInfo::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "DBusMethodInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDBusMethodInfo."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_method_info_unref" g_dbus_method_info_unref :: 
    Ptr DBusMethodInfo ->                   -- info : TInterface (Name {namespace = "Gio", name = "DBusMethodInfo"})
    IO ()

-- | If /@info@/ is statically allocated, does nothing. Otherwise decreases
-- the reference count of /@info@/. When its reference count drops to 0,
-- the memory used is freed.
-- 
-- /Since: 2.26/
dBusMethodInfoUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DBusMethodInfo
    -- ^ /@info@/: A t'GI.Gio.Structs.DBusMethodInfo.DBusMethodInfo'.
    -> m ()
dBusMethodInfoUnref :: DBusMethodInfo -> m ()
dBusMethodInfoUnref info :: DBusMethodInfo
info = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusMethodInfo
info' <- DBusMethodInfo -> IO (Ptr DBusMethodInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusMethodInfo
info
    Ptr DBusMethodInfo -> IO ()
g_dbus_method_info_unref Ptr DBusMethodInfo
info'
    DBusMethodInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusMethodInfo
info
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DBusMethodInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusMethodInfoUnrefMethodInfo DBusMethodInfo signature where
    overloadedMethod = dBusMethodInfoUnref

#endif

#if defined(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) => OL.IsLabel t (DBusMethodInfo -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif