{-# 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 signal on a 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.DBusSignalInfo
    ( 

-- * Exported types
    DBusSignalInfo(..)                      ,
    newZeroDBusSignalInfo                   ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveDBusSignalInfoMethod             ,
#endif


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    DBusSignalInfoRefMethodInfo             ,
#endif
    dBusSignalInfoRef                       ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    DBusSignalInfoUnrefMethodInfo           ,
#endif
    dBusSignalInfoUnref                     ,




 -- * 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.

    clearDBusSignalInfoAnnotations          ,
#if defined(ENABLE_OVERLOADING)
    dBusSignalInfo_annotations              ,
#endif
    getDBusSignalInfoAnnotations            ,
    setDBusSignalInfoAnnotations            ,


-- ** args #attr:args#
-- | 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 arguments.

    clearDBusSignalInfoArgs                 ,
#if defined(ENABLE_OVERLOADING)
    dBusSignalInfo_args                     ,
#endif
    getDBusSignalInfoArgs                   ,
    setDBusSignalInfoArgs                   ,


-- ** name #attr:name#
-- | The name of the D-Bus signal, e.g. \"NameOwnerChanged\".

    clearDBusSignalInfoName                 ,
#if defined(ENABLE_OVERLOADING)
    dBusSignalInfo_name                     ,
#endif
    getDBusSignalInfoName                   ,
    setDBusSignalInfoName                   ,


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

#if defined(ENABLE_OVERLOADING)
    dBusSignalInfo_refCount                 ,
#endif
    getDBusSignalInfoRefCount               ,
    setDBusSignalInfoRefCount               ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
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 Control.Monad.IO.Class as MIO
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 DBusSignalInfo = DBusSignalInfo (SP.ManagedPtr DBusSignalInfo)
    deriving (DBusSignalInfo -> DBusSignalInfo -> Bool
(DBusSignalInfo -> DBusSignalInfo -> Bool)
-> (DBusSignalInfo -> DBusSignalInfo -> Bool) -> Eq DBusSignalInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusSignalInfo -> DBusSignalInfo -> Bool
$c/= :: DBusSignalInfo -> DBusSignalInfo -> Bool
== :: DBusSignalInfo -> DBusSignalInfo -> Bool
$c== :: DBusSignalInfo -> DBusSignalInfo -> Bool
Eq)

instance SP.ManagedPtrNewtype DBusSignalInfo where
    toManagedPtr :: DBusSignalInfo -> ManagedPtr DBusSignalInfo
toManagedPtr (DBusSignalInfo ManagedPtr DBusSignalInfo
p) = ManagedPtr DBusSignalInfo
p

foreign import ccall "g_dbus_signal_info_get_type" c_g_dbus_signal_info_get_type :: 
    IO GType

type instance O.ParentTypes DBusSignalInfo = '[]
instance O.HasParentTypes DBusSignalInfo

instance B.Types.TypedObject DBusSignalInfo where
    glibType :: IO GType
glibType = IO GType
c_g_dbus_signal_info_get_type

instance B.Types.GBoxed DBusSignalInfo

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

-- | Construct a `DBusSignalInfo` struct initialized to zero.
newZeroDBusSignalInfo :: MonadIO m => m DBusSignalInfo
newZeroDBusSignalInfo :: m DBusSignalInfo
newZeroDBusSignalInfo = IO DBusSignalInfo -> m DBusSignalInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusSignalInfo -> m DBusSignalInfo)
-> IO DBusSignalInfo -> m DBusSignalInfo
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr DBusSignalInfo)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 IO (Ptr DBusSignalInfo)
-> (Ptr DBusSignalInfo -> IO DBusSignalInfo) -> IO DBusSignalInfo
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr DBusSignalInfo -> DBusSignalInfo)
-> Ptr DBusSignalInfo -> IO DBusSignalInfo
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusSignalInfo -> DBusSignalInfo
DBusSignalInfo

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


-- | 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' dBusSignalInfo #refCount
-- @
getDBusSignalInfoRefCount :: MonadIO m => DBusSignalInfo -> m Int32
getDBusSignalInfoRefCount :: DBusSignalInfo -> m Int32
getDBusSignalInfoRefCount DBusSignalInfo
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
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO Int32) -> IO Int32)
-> (Ptr DBusSignalInfo -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
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' dBusSignalInfo [ #refCount 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusSignalInfoRefCount :: MonadIO m => DBusSignalInfo -> Int32 -> m ()
setDBusSignalInfoRefCount :: DBusSignalInfo -> Int32 -> m ()
setDBusSignalInfoRefCount DBusSignalInfo
s 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
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Int32
val :: Int32)

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoRefCountFieldInfo
instance AttrInfo DBusSignalInfoRefCountFieldInfo where
    type AttrBaseTypeConstraint DBusSignalInfoRefCountFieldInfo = (~) DBusSignalInfo
    type AttrAllowedOps DBusSignalInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint DBusSignalInfoRefCountFieldInfo = (~) Int32
    type AttrTransferTypeConstraint DBusSignalInfoRefCountFieldInfo = (~)Int32
    type AttrTransferType DBusSignalInfoRefCountFieldInfo = Int32
    type AttrGetType DBusSignalInfoRefCountFieldInfo = Int32
    type AttrLabel DBusSignalInfoRefCountFieldInfo = "ref_count"
    type AttrOrigin DBusSignalInfoRefCountFieldInfo = DBusSignalInfo
    attrGet = getDBusSignalInfoRefCount
    attrSet = setDBusSignalInfoRefCount
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v

dBusSignalInfo_refCount :: AttrLabelProxy "refCount"
dBusSignalInfo_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' dBusSignalInfo #name
-- @
getDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> m (Maybe T.Text)
getDBusSignalInfoName :: DBusSignalInfo -> m (Maybe Text)
getDBusSignalInfoName DBusSignalInfo
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
$ DBusSignalInfo
-> (Ptr DBusSignalInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr DBusSignalInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
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
$ \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' dBusSignalInfo [ #name 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> CString -> m ()
setDBusSignalInfoName :: DBusSignalInfo -> CString -> m ()
setDBusSignalInfoName DBusSignalInfo
s 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
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
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
-- @
clearDBusSignalInfoName :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoName :: DBusSignalInfo -> m ()
clearDBusSignalInfoName DBusSignalInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
forall a. Ptr a
FP.nullPtr :: CString)

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoNameFieldInfo
instance AttrInfo DBusSignalInfoNameFieldInfo where
    type AttrBaseTypeConstraint DBusSignalInfoNameFieldInfo = (~) DBusSignalInfo
    type AttrAllowedOps DBusSignalInfoNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusSignalInfoNameFieldInfo = (~) CString
    type AttrTransferTypeConstraint DBusSignalInfoNameFieldInfo = (~)CString
    type AttrTransferType DBusSignalInfoNameFieldInfo = CString
    type AttrGetType DBusSignalInfoNameFieldInfo = Maybe T.Text
    type AttrLabel DBusSignalInfoNameFieldInfo = "name"
    type AttrOrigin DBusSignalInfoNameFieldInfo = DBusSignalInfo
    attrGet = getDBusSignalInfoName
    attrSet = setDBusSignalInfoName
    attrConstruct = undefined
    attrClear = clearDBusSignalInfoName
    attrTransfer _ v = do
        return v

dBusSignalInfo_name :: AttrLabelProxy "name"
dBusSignalInfo_name = AttrLabelProxy

#endif


-- | Get the value of the “@args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' dBusSignalInfo #args
-- @
getDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> m (Maybe [Gio.DBusArgInfo.DBusArgInfo])
getDBusSignalInfoArgs :: DBusSignalInfo -> m (Maybe [DBusArgInfo])
getDBusSignalInfoArgs DBusSignalInfo
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
$ DBusSignalInfo
-> (Ptr DBusSignalInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO (Maybe [DBusArgInfo]))
 -> IO (Maybe [DBusArgInfo]))
-> (Ptr DBusSignalInfo -> IO (Maybe [DBusArgInfo]))
-> IO (Maybe [DBusArgInfo])
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr DBusArgInfo)
val <- Ptr (Ptr (Ptr DBusArgInfo)) -> IO (Ptr (Ptr DBusArgInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
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
$ \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, GBoxed 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 “@args@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' dBusSignalInfo [ #args 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo) -> m ()
setDBusSignalInfoArgs :: DBusSignalInfo -> Ptr (Ptr DBusArgInfo) -> m ()
setDBusSignalInfoArgs DBusSignalInfo
s 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
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr (Ptr DBusArgInfo)
val :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))

-- | Set the value of the “@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' #args
-- @
clearDBusSignalInfoArgs :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoArgs :: DBusSignalInfo -> m ()
clearDBusSignalInfoArgs DBusSignalInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr (Ptr DBusArgInfo)) -> Ptr (Ptr DBusArgInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusArgInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr (Ptr DBusArgInfo)
forall a. Ptr a
FP.nullPtr :: Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoArgsFieldInfo
instance AttrInfo DBusSignalInfoArgsFieldInfo where
    type AttrBaseTypeConstraint DBusSignalInfoArgsFieldInfo = (~) DBusSignalInfo
    type AttrAllowedOps DBusSignalInfoArgsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusSignalInfoArgsFieldInfo = (~) (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
    type AttrTransferTypeConstraint DBusSignalInfoArgsFieldInfo = (~)(Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
    type AttrTransferType DBusSignalInfoArgsFieldInfo = (Ptr (Ptr Gio.DBusArgInfo.DBusArgInfo))
    type AttrGetType DBusSignalInfoArgsFieldInfo = Maybe [Gio.DBusArgInfo.DBusArgInfo]
    type AttrLabel DBusSignalInfoArgsFieldInfo = "args"
    type AttrOrigin DBusSignalInfoArgsFieldInfo = DBusSignalInfo
    attrGet = getDBusSignalInfoArgs
    attrSet = setDBusSignalInfoArgs
    attrConstruct = undefined
    attrClear = clearDBusSignalInfoArgs
    attrTransfer _ v = do
        return v

dBusSignalInfo_args :: AttrLabelProxy "args"
dBusSignalInfo_args = 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' dBusSignalInfo #annotations
-- @
getDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusSignalInfoAnnotations :: DBusSignalInfo -> m (Maybe [DBusAnnotationInfo])
getDBusSignalInfoAnnotations DBusSignalInfo
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
$ DBusSignalInfo
-> (Ptr DBusSignalInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO (Maybe [DBusAnnotationInfo]))
 -> IO (Maybe [DBusAnnotationInfo]))
-> (Ptr DBusSignalInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr DBusAnnotationInfo)
val <- Ptr (Ptr (Ptr DBusAnnotationInfo))
-> IO (Ptr (Ptr DBusAnnotationInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: 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
$ \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, GBoxed 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' dBusSignalInfo [ #annotations 'Data.GI.Base.Attributes.:=' value ]
-- @
setDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusSignalInfoAnnotations :: DBusSignalInfo -> Ptr (Ptr DBusAnnotationInfo) -> m ()
setDBusSignalInfoAnnotations DBusSignalInfo
s 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
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (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
-- @
clearDBusSignalInfoAnnotations :: MonadIO m => DBusSignalInfo -> m ()
clearDBusSignalInfoAnnotations :: DBusSignalInfo -> m ()
clearDBusSignalInfoAnnotations DBusSignalInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusSignalInfo -> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusSignalInfo
s ((Ptr DBusSignalInfo -> IO ()) -> IO ())
-> (Ptr DBusSignalInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DBusSignalInfo
ptr -> do
    Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusSignalInfo
ptr Ptr DBusSignalInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr (Ptr DBusAnnotationInfo)
forall a. Ptr a
FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoAnnotationsFieldInfo
instance AttrInfo DBusSignalInfoAnnotationsFieldInfo where
    type AttrBaseTypeConstraint DBusSignalInfoAnnotationsFieldInfo = (~) DBusSignalInfo
    type AttrAllowedOps DBusSignalInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusSignalInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
    type AttrTransferTypeConstraint DBusSignalInfoAnnotationsFieldInfo = (~)(Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
    type AttrTransferType DBusSignalInfoAnnotationsFieldInfo = (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
    type AttrGetType DBusSignalInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
    type AttrLabel DBusSignalInfoAnnotationsFieldInfo = "annotations"
    type AttrOrigin DBusSignalInfoAnnotationsFieldInfo = DBusSignalInfo
    attrGet = getDBusSignalInfoAnnotations
    attrSet = setDBusSignalInfoAnnotations
    attrConstruct = undefined
    attrClear = clearDBusSignalInfoAnnotations
    attrTransfer _ v = do
        return v

dBusSignalInfo_annotations :: AttrLabelProxy "annotations"
dBusSignalInfo_annotations = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusSignalInfo
type instance O.AttributeList DBusSignalInfo = DBusSignalInfoAttributeList
type DBusSignalInfoAttributeList = ('[ '("refCount", DBusSignalInfoRefCountFieldInfo), '("name", DBusSignalInfoNameFieldInfo), '("args", DBusSignalInfoArgsFieldInfo), '("annotations", DBusSignalInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif

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

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

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

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoRefMethodInfo
instance (signature ~ (m DBusSignalInfo), MonadIO m) => O.MethodInfo DBusSignalInfoRefMethodInfo DBusSignalInfo signature where
    overloadedMethod = dBusSignalInfoRef

#endif

-- method DBusSignalInfo::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "DBusSignalInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDBusSignalInfo."
--                 , 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_signal_info_unref" g_dbus_signal_info_unref :: 
    Ptr DBusSignalInfo ->                   -- info : TInterface (Name {namespace = "Gio", name = "DBusSignalInfo"})
    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/
dBusSignalInfoUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DBusSignalInfo
    -- ^ /@info@/: A t'GI.Gio.Structs.DBusSignalInfo.DBusSignalInfo'.
    -> m ()
dBusSignalInfoUnref :: DBusSignalInfo -> m ()
dBusSignalInfoUnref DBusSignalInfo
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 DBusSignalInfo
info' <- DBusSignalInfo -> IO (Ptr DBusSignalInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusSignalInfo
info
    Ptr DBusSignalInfo -> IO ()
g_dbus_signal_info_unref Ptr DBusSignalInfo
info'
    DBusSignalInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusSignalInfo
info
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DBusSignalInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusSignalInfoUnrefMethodInfo DBusSignalInfo signature where
    overloadedMethod = dBusSignalInfoUnref

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveDBusSignalInfoMethod (t :: Symbol) (o :: *) :: * where
    ResolveDBusSignalInfoMethod "ref" o = DBusSignalInfoRefMethodInfo
    ResolveDBusSignalInfoMethod "unref" o = DBusSignalInfoUnrefMethodInfo
    ResolveDBusSignalInfoMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDBusSignalInfoMethod t DBusSignalInfo, O.MethodInfo info DBusSignalInfo p) => OL.IsLabel t (DBusSignalInfo -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif