{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is used to create, monitor and delete object
proxies for remote objects exported by a 'GI.Gio.Objects.DBusObjectManagerServer.DBusObjectManagerServer' (or any
code implementing the
<http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager org.freedesktop.DBus.ObjectManager>
interface).

Once an instance of this type has been created, you can connect to
the 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-added/@ and
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-removed/@ signals and inspect the
'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' objects returned by
'GI.Gio.Interfaces.DBusObjectManager.dBusObjectManagerGetObjects'.

If the name for a 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is not owned by anyone at
object construction time, the default behavior is to request the
message bus to launch an owner for the name. This behavior can be
disabled using the 'GI.Gio.Flags.DBusObjectManagerClientFlagsDoNotAutoStart'
flag. It\'s also worth noting that this only works if the name of
interest is activatable in the first place. E.g. in some cases it
is not possible to launch an owner for the requested name. In this
case, 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object construction still succeeds but
there will be no object proxies
(e.g. 'GI.Gio.Interfaces.DBusObjectManager.dBusObjectManagerGetObjects' returns the empty list) and
the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ property is 'Nothing'.

The owner of the requested name can come and go (for example
consider a system service being restarted) – 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'
handles this case too; simply connect to the 'GI.GObject.Objects.Object.Object'::@/notify/@
signal to watch for changes on the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@
property. When the name owner vanishes, the behavior is that
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is set to 'Nothing' (this includes
emission of the 'GI.GObject.Objects.Object.Object'::@/notify/@ signal) and then
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-removed/@ signals are synthesized
for all currently existing object proxies. Since
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is 'Nothing' when this happens, you can
use this information to disambiguate a synthesized signal from a
genuine signal caused by object removal on the remote
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. Similarly, when a new name owner appears,
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-added/@ signals are synthesized
while 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is still 'Nothing'. Only when all
object proxies have been added, the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@
is set to the new name owner (this includes emission of the
'GI.GObject.Objects.Object.Object'::@/notify/@ signal).  Furthermore, you are guaranteed that
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ will alternate between a name owner
(e.g. @:1.42@) and 'Nothing' even in the case where
the name of interest is atomically replaced

Ultimately, 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is used to obtain 'GI.Gio.Objects.DBusProxy.DBusProxy'
instances. All signals (including the
org.freedesktop.DBus.Properties::PropertiesChanged signal)
delivered to 'GI.Gio.Objects.DBusProxy.DBusProxy' instances are guaranteed to originate
from the name owner. This guarantee along with the behavior
described above, means that certain race conditions including the
\"half the proxy is from the old owner and the other half is from
the new owner\" problem cannot happen.

To avoid having the application connect to signals on the returned
'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' and 'GI.Gio.Objects.DBusProxy.DBusProxy' objects, the
'GI.Gio.Interfaces.DBusObject.DBusObject'::@/interface-added/@,
'GI.Gio.Interfaces.DBusObject.DBusObject'::@/interface-removed/@,
'GI.Gio.Objects.DBusProxy.DBusProxy'::@/g-properties-changed/@ and
'GI.Gio.Objects.DBusProxy.DBusProxy'::@/g-signal/@ signals
are also emitted on the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' instance managing these
objects. The signals emitted are
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/interface-added/@,
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/interface-removed/@,
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'::@/interface-proxy-properties-changed/@ and
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'::@/interface-proxy-signal/@.

Note that all callbacks and signals are emitted in the
[thread-default main context][g-main-context-push-thread-default]
that the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object was constructed
in. Additionally, the 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' and 'GI.Gio.Objects.DBusProxy.DBusProxy' objects
originating from the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object will be created in
the same context and, consequently, will deliver signals in the
same main loop.

/Since: 2.30/
-}

#define ENABLE_OVERLOADING \
       (!defined(__HADDOCK_VERSION__))

module GI.Gio.Objects.DBusObjectManagerClient
    ( 

-- * Exported types
    DBusObjectManagerClient(..)             ,
    IsDBusObjectManagerClient               ,
    toDBusObjectManagerClient               ,
    noDBusObjectManagerClient               ,


 -- * Methods
-- ** getConnection #method:getConnection#

#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetConnectionMethodInfo,
#endif
    dBusObjectManagerClientGetConnection    ,


-- ** getFlags #method:getFlags#

#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetFlagsMethodInfo,
#endif
    dBusObjectManagerClientGetFlags         ,


-- ** getName #method:getName#

#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetNameMethodInfo,
#endif
    dBusObjectManagerClientGetName          ,


-- ** getNameOwner #method:getNameOwner#

#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetNameOwnerMethodInfo,
#endif
    dBusObjectManagerClientGetNameOwner     ,


-- ** new #method:new#

    dBusObjectManagerClientNew              ,


-- ** newFinish #method:newFinish#

    dBusObjectManagerClientNewFinish        ,


-- ** newForBus #method:newForBus#

    dBusObjectManagerClientNewForBus        ,


-- ** newForBusFinish #method:newForBusFinish#

    dBusObjectManagerClientNewForBusFinish  ,


-- ** newForBusSync #method:newForBusSync#

    dBusObjectManagerClientNewForBusSync    ,


-- ** newSync #method:newSync#

    dBusObjectManagerClientNewSync          ,




 -- * Properties
-- ** busType #attr:busType#
{- | If this property is not 'GI.Gio.Enums.BusTypeNone', then
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/connection/@ must be 'Nothing' and will be set to the
'GI.Gio.Objects.DBusConnection.DBusConnection' obtained by calling 'GI.Gio.Functions.busGet' with the value
of this property.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientBusTypePropertyInfo,
#endif
    constructDBusObjectManagerClientBusType ,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientBusType          ,
#endif


-- ** connection #attr:connection#
{- | The 'GI.Gio.Objects.DBusConnection.DBusConnection' to use.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientConnectionPropertyInfo,
#endif
    constructDBusObjectManagerClientConnection,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientConnection       ,
#endif
    getDBusObjectManagerClientConnection    ,


-- ** flags #attr:flags#
{- | Flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientFlagsPropertyInfo,
#endif
    constructDBusObjectManagerClientFlags   ,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientFlags            ,
#endif
    getDBusObjectManagerClientFlags         ,


-- ** getProxyTypeDestroyNotify #attr:getProxyTypeDestroyNotify#
{- | A 'GI.GLib.Callbacks.DestroyNotify' for the @/gpointer/@ user_data in 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/get-proxy-type-user-data/@.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo,
#endif
    constructDBusObjectManagerClientGetProxyTypeDestroyNotify,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientGetProxyTypeDestroyNotify,
#endif
    getDBusObjectManagerClientGetProxyTypeDestroyNotify,


-- ** getProxyTypeFunc #attr:getProxyTypeFunc#
{- | The 'GI.Gio.Callbacks.DBusProxyTypeFunc' to use when determining what 'GType' to
use for interface proxies or 'Nothing'.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetProxyTypeFuncPropertyInfo,
#endif
    constructDBusObjectManagerClientGetProxyTypeFunc,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientGetProxyTypeFunc ,
#endif
    getDBusObjectManagerClientGetProxyTypeFunc,


-- ** getProxyTypeUserData #attr:getProxyTypeUserData#
{- | The @/gpointer/@ user_data to pass to 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/get-proxy-type-func/@.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo,
#endif
    constructDBusObjectManagerClientGetProxyTypeUserData,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientGetProxyTypeUserData,
#endif
    getDBusObjectManagerClientGetProxyTypeUserData,


-- ** name #attr:name#
{- | The well-known name or unique name that the manager is for.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientNamePropertyInfo ,
#endif
    constructDBusObjectManagerClientName    ,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientName             ,
#endif
    getDBusObjectManagerClientName          ,


-- ** nameOwner #attr:nameOwner#
{- | The unique name that owns 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name/@ or 'Nothing' if
no-one is currently owning the name. Connect to the
'GI.GObject.Objects.Object.Object'::@/notify/@ signal to track changes to this property.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientNameOwnerPropertyInfo,
#endif
#if ENABLE_OVERLOADING
    dBusObjectManagerClientNameOwner        ,
#endif
    getDBusObjectManagerClientNameOwner     ,


-- ** objectPath #attr:objectPath#
{- | The object path the manager is for.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    DBusObjectManagerClientObjectPathPropertyInfo,
#endif
    constructDBusObjectManagerClientObjectPath,
#if ENABLE_OVERLOADING
    dBusObjectManagerClientObjectPath       ,
#endif
    getDBusObjectManagerClientObjectPath    ,




 -- * Signals
-- ** interfaceProxyPropertiesChanged #signal:interfaceProxyPropertiesChanged#

    C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
#if ENABLE_OVERLOADING
    DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo,
#endif
    afterDBusObjectManagerClientInterfaceProxyPropertiesChanged,
    genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged,
    mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    onDBusObjectManagerClientInterfaceProxyPropertiesChanged,
    wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,


-- ** interfaceProxySignal #signal:interfaceProxySignal#

    C_DBusObjectManagerClientInterfaceProxySignalCallback,
    DBusObjectManagerClientInterfaceProxySignalCallback,
#if ENABLE_OVERLOADING
    DBusObjectManagerClientInterfaceProxySignalSignalInfo,
#endif
    afterDBusObjectManagerClientInterfaceProxySignal,
    genClosure_DBusObjectManagerClientInterfaceProxySignal,
    mk_DBusObjectManagerClientInterfaceProxySignalCallback,
    noDBusObjectManagerClientInterfaceProxySignalCallback,
    onDBusObjectManagerClientInterfaceProxySignal,
    wrap_DBusObjectManagerClientInterfaceProxySignalCallback,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DBusObjectManager as Gio.DBusObjectManager
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusObjectProxy as Gio.DBusObjectProxy
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusProxy as Gio.DBusProxy

-- | Memory-managed wrapper type.
newtype DBusObjectManagerClient = DBusObjectManagerClient (ManagedPtr DBusObjectManagerClient)
foreign import ccall "g_dbus_object_manager_client_get_type"
    c_g_dbus_object_manager_client_get_type :: IO GType

instance GObject DBusObjectManagerClient where
    gobjectType :: DBusObjectManagerClient -> IO GType
gobjectType _ = IO GType
c_g_dbus_object_manager_client_get_type
    

-- | Type class for types which can be safely cast to `DBusObjectManagerClient`, for instance with `toDBusObjectManagerClient`.
class GObject o => IsDBusObjectManagerClient o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DBusObjectManagerClient a) =>
    IsDBusObjectManagerClient a
#endif
instance IsDBusObjectManagerClient DBusObjectManagerClient
instance GObject.Object.IsObject DBusObjectManagerClient
instance Gio.AsyncInitable.IsAsyncInitable DBusObjectManagerClient
instance Gio.DBusObjectManager.IsDBusObjectManager DBusObjectManagerClient
instance Gio.Initable.IsInitable DBusObjectManagerClient

-- | Cast to `DBusObjectManagerClient`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDBusObjectManagerClient :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m DBusObjectManagerClient
toDBusObjectManagerClient :: o -> m DBusObjectManagerClient
toDBusObjectManagerClient = IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusObjectManagerClient -> m DBusObjectManagerClient)
-> (o -> IO DBusObjectManagerClient)
-> o
-> m DBusObjectManagerClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient)
-> o -> IO DBusObjectManagerClient
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient
DBusObjectManagerClient

-- | A convenience alias for `Nothing` :: `Maybe` `DBusObjectManagerClient`.
noDBusObjectManagerClient :: Maybe DBusObjectManagerClient
noDBusObjectManagerClient :: Maybe DBusObjectManagerClient
noDBusObjectManagerClient = Maybe DBusObjectManagerClient
forall a. Maybe a
Nothing

#if ENABLE_OVERLOADING
type family ResolveDBusObjectManagerClientMethod (t :: Symbol) (o :: *) :: * where
    ResolveDBusObjectManagerClientMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDBusObjectManagerClientMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDBusObjectManagerClientMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDBusObjectManagerClientMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveDBusObjectManagerClientMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
    ResolveDBusObjectManagerClientMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
    ResolveDBusObjectManagerClientMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDBusObjectManagerClientMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDBusObjectManagerClientMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDBusObjectManagerClientMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDBusObjectManagerClientMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDBusObjectManagerClientMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDBusObjectManagerClientMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDBusObjectManagerClientMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDBusObjectManagerClientMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDBusObjectManagerClientMethod "getConnection" o = DBusObjectManagerClientGetConnectionMethodInfo
    ResolveDBusObjectManagerClientMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDBusObjectManagerClientMethod "getFlags" o = DBusObjectManagerClientGetFlagsMethodInfo
    ResolveDBusObjectManagerClientMethod "getInterface" o = Gio.DBusObjectManager.DBusObjectManagerGetInterfaceMethodInfo
    ResolveDBusObjectManagerClientMethod "getName" o = DBusObjectManagerClientGetNameMethodInfo
    ResolveDBusObjectManagerClientMethod "getNameOwner" o = DBusObjectManagerClientGetNameOwnerMethodInfo
    ResolveDBusObjectManagerClientMethod "getObject" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectMethodInfo
    ResolveDBusObjectManagerClientMethod "getObjectPath" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectPathMethodInfo
    ResolveDBusObjectManagerClientMethod "getObjects" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectsMethodInfo
    ResolveDBusObjectManagerClientMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDBusObjectManagerClientMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDBusObjectManagerClientMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDBusObjectManagerClientMethod t DBusObjectManagerClient, O.MethodInfo info DBusObjectManagerClient p) => O.IsLabelProxy t (DBusObjectManagerClient -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDBusObjectManagerClientMethod t DBusObjectManagerClient, O.MethodInfo info DBusObjectManagerClient p) => O.IsLabel t (DBusObjectManagerClient -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

-- signal DBusObjectManagerClient::interface-proxy-properties-changed
{- |
Emitted when one or more D-Bus properties on proxy changes. The
local cache has already been updated when this signal fires. Note
that both /@changedProperties@/ and /@invalidatedProperties@/ are
guaranteed to never be 'Nothing' (either may be empty though).

This signal exists purely as a convenience to avoid having to
connect signals to all interface proxies managed by /@manager@/.

This signal is emitted in the
[thread-default main context][g-main-context-push-thread-default]
that /@manager@/ was constructed in.

/Since: 2.30/
-}
type DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback =
    Gio.DBusObjectProxy.DBusObjectProxy
    {- ^ /@objectProxy@/: The 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' on which an interface has properties that are changing. -}
    -> Gio.DBusProxy.DBusProxy
    {- ^ /@interfaceProxy@/: The 'GI.Gio.Objects.DBusProxy.DBusProxy' that has properties that are changing. -}
    -> GVariant
    {- ^ /@changedProperties@/: A 'GVariant' containing the properties that changed (type: @a{sv}@). -}
    -> [T.Text]
    {- ^ /@invalidatedProperties@/: A 'Nothing' terminated
  array of properties that were invalidated. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback`@.
noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: Maybe DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: Maybe
  DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback = Maybe
  DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    Ptr GVariant ->
    Ptr CString ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback`.
foreign import ccall "wrapper"
    mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> IO (FunPtr C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged cb :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb = do
    let cb' :: C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb' = DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb
    C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> IO
     (FunPtr
        C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)
mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb' IO
  (FunPtr
     C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)
-> (FunPtr
      C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
    -> IO Closure)
-> IO Closure
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr
  C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> IO Closure
forall a. FunPtr a -> IO Closure
newCClosure


-- | Wrap a `DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback` into a `C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback`.
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback ::
    DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback ->
    C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback _cb :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
_cb _ objectProxy :: Ptr DBusObjectProxy
objectProxy interfaceProxy :: Ptr DBusProxy
interfaceProxy changedProperties :: Ptr GVariant
changedProperties invalidatedProperties :: Ptr CString
invalidatedProperties _ = do
    DBusObjectProxy
objectProxy' <- ((ManagedPtr DBusObjectProxy -> DBusObjectProxy)
-> Ptr DBusObjectProxy -> IO DBusObjectProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusObjectProxy -> DBusObjectProxy
Gio.DBusObjectProxy.DBusObjectProxy) Ptr DBusObjectProxy
objectProxy
    DBusProxy
interfaceProxy' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusProxy -> DBusProxy
Gio.DBusProxy.DBusProxy) Ptr DBusProxy
interfaceProxy
    GVariant
changedProperties' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
changedProperties
    [Text]
invalidatedProperties' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
invalidatedProperties
    DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
_cb  DBusObjectProxy
objectProxy' DBusProxy
interfaceProxy' GVariant
changedProperties' [Text]
invalidatedProperties'


{- |
Connect a signal handler for the “@interface-proxy-properties-changed@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' dBusObjectManagerClient #interfaceProxyPropertiesChanged callback
@
-}
onDBusObjectManagerClientInterfaceProxyPropertiesChanged :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxyPropertiesChanged :: a
-> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxyPropertiesChanged obj :: a
obj cb :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb' = DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb
    FunPtr
  C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'' <- C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> IO
     (FunPtr
        C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)
mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'
    a
-> String
-> FunPtr
     C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> SignalConnectMode
-> IO SignalHandlerId
forall o a.
GObject o =>
o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId
connectSignalFunPtr a
obj "interface-proxy-properties-changed" FunPtr
  C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'' SignalConnectMode
SignalConnectBefore

{- |
Connect a signal handler for the “@interface-proxy-properties-changed@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' dBusObjectManagerClient #interfaceProxyPropertiesChanged callback
@
-}
afterDBusObjectManagerClientInterfaceProxyPropertiesChanged :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxyPropertiesChanged :: a
-> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxyPropertiesChanged obj :: a
obj cb :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb' = DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb
    FunPtr
  C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'' <- C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> IO
     (FunPtr
        C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)
mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'
    a
-> String
-> FunPtr
     C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
-> SignalConnectMode
-> IO SignalHandlerId
forall o a.
GObject o =>
o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId
connectSignalFunPtr a
obj "interface-proxy-properties-changed" FunPtr
  C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
cb'' SignalConnectMode
SignalConnectAfter


-- signal DBusObjectManagerClient::interface-proxy-signal
{- |
Emitted when a D-Bus signal is received on /@interfaceProxy@/.

This signal exists purely as a convenience to avoid having to
connect signals to all interface proxies managed by /@manager@/.

This signal is emitted in the
[thread-default main context][g-main-context-push-thread-default]
that /@manager@/ was constructed in.

/Since: 2.30/
-}
type DBusObjectManagerClientInterfaceProxySignalCallback =
    Gio.DBusObjectProxy.DBusObjectProxy
    {- ^ /@objectProxy@/: The 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' on which an interface is emitting a D-Bus signal. -}
    -> Gio.DBusProxy.DBusProxy
    {- ^ /@interfaceProxy@/: The 'GI.Gio.Objects.DBusProxy.DBusProxy' that is emitting a D-Bus signal. -}
    -> T.Text
    {- ^ /@senderName@/: The sender of the signal or NULL if the connection is not a bus connection. -}
    -> T.Text
    {- ^ /@signalName@/: The signal name. -}
    -> GVariant
    {- ^ /@parameters@/: A 'GVariant' tuple with parameters for the signal. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerClientInterfaceProxySignalCallback`@.
noDBusObjectManagerClientInterfaceProxySignalCallback :: Maybe DBusObjectManagerClientInterfaceProxySignalCallback
noDBusObjectManagerClientInterfaceProxySignalCallback :: Maybe DBusObjectManagerClientInterfaceProxySignalCallback
noDBusObjectManagerClientInterfaceProxySignalCallback = Maybe DBusObjectManagerClientInterfaceProxySignalCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerClientInterfaceProxySignalCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DBusObjectManagerClientInterfaceProxySignalCallback`.
foreign import ccall "wrapper"
    mk_DBusObjectManagerClientInterfaceProxySignalCallback :: C_DBusObjectManagerClientInterfaceProxySignalCallback -> IO (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerClientInterfaceProxySignal :: DBusObjectManagerClientInterfaceProxySignalCallback -> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxySignal :: DBusObjectManagerClientInterfaceProxySignalCallback -> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxySignal cb :: DBusObjectManagerClientInterfaceProxySignalCallback
cb = do
    let cb' :: C_DBusObjectManagerClientInterfaceProxySignalCallback
cb' = DBusObjectManagerClientInterfaceProxySignalCallback
-> C_DBusObjectManagerClientInterfaceProxySignalCallback
wrap_DBusObjectManagerClientInterfaceProxySignalCallback DBusObjectManagerClientInterfaceProxySignalCallback
cb
    C_DBusObjectManagerClientInterfaceProxySignalCallback
-> IO
     (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)
mk_DBusObjectManagerClientInterfaceProxySignalCallback C_DBusObjectManagerClientInterfaceProxySignalCallback
cb' IO (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)
-> (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
    -> IO Closure)
-> IO Closure
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
-> IO Closure
forall a. FunPtr a -> IO Closure
newCClosure


-- | Wrap a `DBusObjectManagerClientInterfaceProxySignalCallback` into a `C_DBusObjectManagerClientInterfaceProxySignalCallback`.
wrap_DBusObjectManagerClientInterfaceProxySignalCallback ::
    DBusObjectManagerClientInterfaceProxySignalCallback ->
    C_DBusObjectManagerClientInterfaceProxySignalCallback
wrap_DBusObjectManagerClientInterfaceProxySignalCallback :: DBusObjectManagerClientInterfaceProxySignalCallback
-> C_DBusObjectManagerClientInterfaceProxySignalCallback
wrap_DBusObjectManagerClientInterfaceProxySignalCallback _cb :: DBusObjectManagerClientInterfaceProxySignalCallback
_cb _ objectProxy :: Ptr DBusObjectProxy
objectProxy interfaceProxy :: Ptr DBusProxy
interfaceProxy senderName :: CString
senderName signalName :: CString
signalName parameters :: Ptr GVariant
parameters _ = do
    DBusObjectProxy
objectProxy' <- ((ManagedPtr DBusObjectProxy -> DBusObjectProxy)
-> Ptr DBusObjectProxy -> IO DBusObjectProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusObjectProxy -> DBusObjectProxy
Gio.DBusObjectProxy.DBusObjectProxy) Ptr DBusObjectProxy
objectProxy
    DBusProxy
interfaceProxy' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusProxy -> DBusProxy
Gio.DBusProxy.DBusProxy) Ptr DBusProxy
interfaceProxy
    Text
senderName' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
senderName
    Text
signalName' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
signalName
    GVariant
parameters' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
parameters
    DBusObjectManagerClientInterfaceProxySignalCallback
_cb  DBusObjectProxy
objectProxy' DBusProxy
interfaceProxy' Text
senderName' Text
signalName' GVariant
parameters'


{- |
Connect a signal handler for the “@interface-proxy-signal@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' dBusObjectManagerClient #interfaceProxySignal callback
@
-}
onDBusObjectManagerClientInterfaceProxySignal :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxySignalCallback -> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxySignal :: a
-> DBusObjectManagerClientInterfaceProxySignalCallback
-> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxySignal obj :: a
obj cb :: DBusObjectManagerClientInterfaceProxySignalCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_DBusObjectManagerClientInterfaceProxySignalCallback
cb' = DBusObjectManagerClientInterfaceProxySignalCallback
-> C_DBusObjectManagerClientInterfaceProxySignalCallback
wrap_DBusObjectManagerClientInterfaceProxySignalCallback DBusObjectManagerClientInterfaceProxySignalCallback
cb
    FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'' <- C_DBusObjectManagerClientInterfaceProxySignalCallback
-> IO
     (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)
mk_DBusObjectManagerClientInterfaceProxySignalCallback C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'
    a
-> String
-> FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
-> SignalConnectMode
-> IO SignalHandlerId
forall o a.
GObject o =>
o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId
connectSignalFunPtr a
obj "interface-proxy-signal" FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'' SignalConnectMode
SignalConnectBefore

{- |
Connect a signal handler for the “@interface-proxy-signal@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' dBusObjectManagerClient #interfaceProxySignal callback
@
-}
afterDBusObjectManagerClientInterfaceProxySignal :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxySignalCallback -> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxySignal :: a
-> DBusObjectManagerClientInterfaceProxySignalCallback
-> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxySignal obj :: a
obj cb :: DBusObjectManagerClientInterfaceProxySignalCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_DBusObjectManagerClientInterfaceProxySignalCallback
cb' = DBusObjectManagerClientInterfaceProxySignalCallback
-> C_DBusObjectManagerClientInterfaceProxySignalCallback
wrap_DBusObjectManagerClientInterfaceProxySignalCallback DBusObjectManagerClientInterfaceProxySignalCallback
cb
    FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'' <- C_DBusObjectManagerClientInterfaceProxySignalCallback
-> IO
     (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)
mk_DBusObjectManagerClientInterfaceProxySignalCallback C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'
    a
-> String
-> FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
-> SignalConnectMode
-> IO SignalHandlerId
forall o a.
GObject o =>
o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId
connectSignalFunPtr a
obj "interface-proxy-signal" FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback
cb'' SignalConnectMode
SignalConnectAfter


-- VVV Prop "bus-type"
   -- Type: TInterface (Name {namespace = "Gio", name = "BusType"})
   -- Flags: [PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Construct a `GValueConstruct` with valid value for the “@bus-type@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientBusType :: (IsDBusObjectManagerClient o) => Gio.Enums.BusType -> IO (GValueConstruct o)
constructDBusObjectManagerClientBusType :: BusType -> IO (GValueConstruct o)
constructDBusObjectManagerClientBusType val :: BusType
val = String -> BusType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
constructObjectPropertyEnum "bus-type" BusType
val

#if ENABLE_OVERLOADING
data DBusObjectManagerClientBusTypePropertyInfo
instance AttrInfo DBusObjectManagerClientBusTypePropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientBusTypePropertyInfo = '[ 'AttrConstruct]
    type AttrSetTypeConstraint DBusObjectManagerClientBusTypePropertyInfo = (~) Gio.Enums.BusType
    type AttrBaseTypeConstraint DBusObjectManagerClientBusTypePropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientBusTypePropertyInfo = ()
    type AttrLabel DBusObjectManagerClientBusTypePropertyInfo = "bus-type"
    type AttrOrigin DBusObjectManagerClientBusTypePropertyInfo = DBusObjectManagerClient
    attrGet _ = undefined
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientBusType
    attrClear _ = undefined
#endif

-- VVV Prop "connection"
   -- Type: TInterface (Name {namespace = "Gio", name = "DBusConnection"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

{- |
Get the value of the “@connection@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #connection
@
-}
getDBusObjectManagerClientConnection :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m Gio.DBusConnection.DBusConnection
getDBusObjectManagerClientConnection :: o -> m DBusConnection
getDBusObjectManagerClientConnection obj :: o
obj = IO DBusConnection -> m DBusConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusConnection -> m DBusConnection)
-> IO DBusConnection -> m DBusConnection
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe DBusConnection) -> IO DBusConnection
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDBusObjectManagerClientConnection" (IO (Maybe DBusConnection) -> IO DBusConnection)
-> IO (Maybe DBusConnection) -> IO DBusConnection
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr DBusConnection -> DBusConnection)
-> IO (Maybe DBusConnection)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyObject o
obj "connection" ManagedPtr DBusConnection -> DBusConnection
Gio.DBusConnection.DBusConnection

{- |
Construct a `GValueConstruct` with valid value for the “@connection@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientConnection :: (IsDBusObjectManagerClient o, Gio.DBusConnection.IsDBusConnection a) => a -> IO (GValueConstruct o)
constructDBusObjectManagerClientConnection :: a -> IO (GValueConstruct o)
constructDBusObjectManagerClientConnection val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyObject "connection" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

#if ENABLE_OVERLOADING
data DBusObjectManagerClientConnectionPropertyInfo
instance AttrInfo DBusObjectManagerClientConnectionPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientConnectionPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
    type AttrBaseTypeConstraint DBusObjectManagerClientConnectionPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientConnectionPropertyInfo = Gio.DBusConnection.DBusConnection
    type AttrLabel DBusObjectManagerClientConnectionPropertyInfo = "connection"
    type AttrOrigin DBusObjectManagerClientConnectionPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientConnection
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientConnection
    attrClear _ = undefined
#endif

-- VVV Prop "flags"
   -- Type: TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

{- |
Get the value of the “@flags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #flags
@
-}
getDBusObjectManagerClientFlags :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m [Gio.Flags.DBusObjectManagerClientFlags]
getDBusObjectManagerClientFlags :: o -> m [DBusObjectManagerClientFlags]
getDBusObjectManagerClientFlags obj :: o
obj = IO [DBusObjectManagerClientFlags]
-> m [DBusObjectManagerClientFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusObjectManagerClientFlags]
 -> m [DBusObjectManagerClientFlags])
-> IO [DBusObjectManagerClientFlags]
-> m [DBusObjectManagerClientFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [DBusObjectManagerClientFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
getObjectPropertyFlags o
obj "flags"

{- |
Construct a `GValueConstruct` with valid value for the “@flags@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientFlags :: (IsDBusObjectManagerClient o) => [Gio.Flags.DBusObjectManagerClientFlags] -> IO (GValueConstruct o)
constructDBusObjectManagerClientFlags :: [DBusObjectManagerClientFlags] -> IO (GValueConstruct o)
constructDBusObjectManagerClientFlags val :: [DBusObjectManagerClientFlags]
val = String -> [DBusObjectManagerClientFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
constructObjectPropertyFlags "flags" [DBusObjectManagerClientFlags]
val

#if ENABLE_OVERLOADING
data DBusObjectManagerClientFlagsPropertyInfo
instance AttrInfo DBusObjectManagerClientFlagsPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientFlagsPropertyInfo = (~) [Gio.Flags.DBusObjectManagerClientFlags]
    type AttrBaseTypeConstraint DBusObjectManagerClientFlagsPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientFlagsPropertyInfo = [Gio.Flags.DBusObjectManagerClientFlags]
    type AttrLabel DBusObjectManagerClientFlagsPropertyInfo = "flags"
    type AttrOrigin DBusObjectManagerClientFlagsPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientFlags
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientFlags
    attrClear _ = undefined
#endif

-- VVV Prop "get-proxy-type-destroy-notify"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@get-proxy-type-destroy-notify@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #getProxyTypeDestroyNotify
@
-}
getDBusObjectManagerClientGetProxyTypeDestroyNotify :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeDestroyNotify :: o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeDestroyNotify obj :: o
obj = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
getObjectPropertyPtr o
obj "get-proxy-type-destroy-notify"

{- |
Construct a `GValueConstruct` with valid value for the “@get-proxy-type-destroy-notify@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientGetProxyTypeDestroyNotify :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeDestroyNotify :: Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeDestroyNotify val :: Ptr ()
val = String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
constructObjectPropertyPtr "get-proxy-type-destroy-notify" Ptr ()
val

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = "get-proxy-type-destroy-notify"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeDestroyNotify
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeDestroyNotify
    attrClear _ = undefined
#endif

-- VVV Prop "get-proxy-type-func"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@get-proxy-type-func@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #getProxyTypeFunc
@
-}
getDBusObjectManagerClientGetProxyTypeFunc :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeFunc :: o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeFunc obj :: o
obj = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
getObjectPropertyPtr o
obj "get-proxy-type-func"

{- |
Construct a `GValueConstruct` with valid value for the “@get-proxy-type-func@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientGetProxyTypeFunc :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeFunc :: Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeFunc val :: Ptr ()
val = String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
constructObjectPropertyPtr "get-proxy-type-func" Ptr ()
val

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetProxyTypeFuncPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeFuncPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = "get-proxy-type-func"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeFunc
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeFunc
    attrClear _ = undefined
#endif

-- VVV Prop "get-proxy-type-user-data"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@get-proxy-type-user-data@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #getProxyTypeUserData
@
-}
getDBusObjectManagerClientGetProxyTypeUserData :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeUserData :: o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeUserData obj :: o
obj = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
getObjectPropertyPtr o
obj "get-proxy-type-user-data"

{- |
Construct a `GValueConstruct` with valid value for the “@get-proxy-type-user-data@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientGetProxyTypeUserData :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeUserData :: Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeUserData val :: Ptr ()
val = String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
constructObjectPropertyPtr "get-proxy-type-user-data" Ptr ()
val

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = "get-proxy-type-user-data"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeUserData
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeUserData
    attrClear _ = undefined
#endif

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

{- |
Get the value of the “@name@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #name
@
-}
getDBusObjectManagerClientName :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m T.Text
getDBusObjectManagerClientName :: o -> m Text
getDBusObjectManagerClientName obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDBusObjectManagerClientName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "name"

{- |
Construct a `GValueConstruct` with valid value for the “@name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientName :: (IsDBusObjectManagerClient o) => T.Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientName :: Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientName val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
data DBusObjectManagerClientNamePropertyInfo
instance AttrInfo DBusObjectManagerClientNamePropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientNamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DBusObjectManagerClientNamePropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientNamePropertyInfo = T.Text
    type AttrLabel DBusObjectManagerClientNamePropertyInfo = "name"
    type AttrOrigin DBusObjectManagerClientNamePropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientName
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientName
    attrClear _ = undefined
#endif

-- VVV Prop "name-owner"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@name-owner@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #nameOwner
@
-}
getDBusObjectManagerClientNameOwner :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Maybe T.Text)
getDBusObjectManagerClientNameOwner :: o -> m (Maybe Text)
getDBusObjectManagerClientNameOwner obj :: o
obj = 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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "name-owner"

#if ENABLE_OVERLOADING
data DBusObjectManagerClientNameOwnerPropertyInfo
instance AttrInfo DBusObjectManagerClientNameOwnerPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientNameOwnerPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientNameOwnerPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DBusObjectManagerClientNameOwnerPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientNameOwnerPropertyInfo = (Maybe T.Text)
    type AttrLabel DBusObjectManagerClientNameOwnerPropertyInfo = "name-owner"
    type AttrOrigin DBusObjectManagerClientNameOwnerPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientNameOwner
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "object-path"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@object-path@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dBusObjectManagerClient #objectPath
@
-}
getDBusObjectManagerClientObjectPath :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Maybe T.Text)
getDBusObjectManagerClientObjectPath :: o -> m (Maybe Text)
getDBusObjectManagerClientObjectPath obj :: o
obj = 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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "object-path"

{- |
Construct a `GValueConstruct` with valid value for the “@object-path@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDBusObjectManagerClientObjectPath :: (IsDBusObjectManagerClient o) => T.Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientObjectPath :: Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientObjectPath val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "object-path" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
data DBusObjectManagerClientObjectPathPropertyInfo
instance AttrInfo DBusObjectManagerClientObjectPathPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientObjectPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientObjectPathPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DBusObjectManagerClientObjectPathPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientObjectPathPropertyInfo = (Maybe T.Text)
    type AttrLabel DBusObjectManagerClientObjectPathPropertyInfo = "object-path"
    type AttrOrigin DBusObjectManagerClientObjectPathPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientObjectPath
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientObjectPath
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusObjectManagerClient
type instance O.AttributeList DBusObjectManagerClient = DBusObjectManagerClientAttributeList
type DBusObjectManagerClientAttributeList = ('[ '("busType", DBusObjectManagerClientBusTypePropertyInfo), '("connection", DBusObjectManagerClientConnectionPropertyInfo), '("flags", DBusObjectManagerClientFlagsPropertyInfo), '("getProxyTypeDestroyNotify", DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo), '("getProxyTypeFunc", DBusObjectManagerClientGetProxyTypeFuncPropertyInfo), '("getProxyTypeUserData", DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo), '("name", DBusObjectManagerClientNamePropertyInfo), '("nameOwner", DBusObjectManagerClientNameOwnerPropertyInfo), '("objectPath", DBusObjectManagerClientObjectPathPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dBusObjectManagerClientBusType :: AttrLabelProxy "busType"
dBusObjectManagerClientBusType = AttrLabelProxy

dBusObjectManagerClientConnection :: AttrLabelProxy "connection"
dBusObjectManagerClientConnection = AttrLabelProxy

dBusObjectManagerClientFlags :: AttrLabelProxy "flags"
dBusObjectManagerClientFlags = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeDestroyNotify :: AttrLabelProxy "getProxyTypeDestroyNotify"
dBusObjectManagerClientGetProxyTypeDestroyNotify = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeFunc :: AttrLabelProxy "getProxyTypeFunc"
dBusObjectManagerClientGetProxyTypeFunc = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeUserData :: AttrLabelProxy "getProxyTypeUserData"
dBusObjectManagerClientGetProxyTypeUserData = AttrLabelProxy

dBusObjectManagerClientName :: AttrLabelProxy "name"
dBusObjectManagerClientName = AttrLabelProxy

dBusObjectManagerClientNameOwner :: AttrLabelProxy "nameOwner"
dBusObjectManagerClientNameOwner = AttrLabelProxy

dBusObjectManagerClientObjectPath :: AttrLabelProxy "objectPath"
dBusObjectManagerClientObjectPath = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
data DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo
instance SignalInfo DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo where
    type HaskellCallbackType DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo = DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb
        cb'' <- mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb'
        connectSignalFunPtr obj "interface-proxy-properties-changed" cb'' connectMode

data DBusObjectManagerClientInterfaceProxySignalSignalInfo
instance SignalInfo DBusObjectManagerClientInterfaceProxySignalSignalInfo where
    type HaskellCallbackType DBusObjectManagerClientInterfaceProxySignalSignalInfo = DBusObjectManagerClientInterfaceProxySignalCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerClientInterfaceProxySignalCallback cb
        cb'' <- mk_DBusObjectManagerClientInterfaceProxySignalCallback cb'
        connectSignalFunPtr obj "interface-proxy-signal" cb'' connectMode

type instance O.SignalList DBusObjectManagerClient = DBusObjectManagerClientSignalList
type DBusObjectManagerClientSignalList = ('[ '("interfaceAdded", Gio.DBusObjectManager.DBusObjectManagerInterfaceAddedSignalInfo), '("interfaceProxyPropertiesChanged", DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo), '("interfaceProxySignal", DBusObjectManagerClientInterfaceProxySignalSignalInfo), '("interfaceRemoved", Gio.DBusObjectManager.DBusObjectManagerInterfaceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("objectAdded", Gio.DBusObjectManager.DBusObjectManagerObjectAddedSignalInfo), '("objectRemoved", Gio.DBusObjectManager.DBusObjectManagerObjectRemovedSignalInfo)] :: [(Symbol, *)])

#endif

-- method DBusObjectManagerClient::new_finish
-- method type : Constructor
-- Args : [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_finish" g_dbus_object_manager_client_new_finish :: 
    Ptr Gio.AsyncResult.AsyncResult ->      -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Finishes an operation started with 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'.

/Since: 2.30/
-}
dBusObjectManagerClientNewFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@res@/: A 'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the 'GI.Gio.Callbacks.AsyncReadyCallback' passed to 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'. -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewFinish :: a -> m DBusObjectManagerClient
dBusObjectManagerClientNewFinish res :: a
res = IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusObjectManagerClient -> m DBusObjectManagerClient)
-> IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall a b. (a -> b) -> a -> b
$ do
    Ptr AsyncResult
res' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
    IO DBusObjectManagerClient -> IO () -> IO DBusObjectManagerClient
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr DBusObjectManagerClient
result <- (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
 -> IO (Ptr DBusObjectManagerClient))
-> (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult
-> Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient)
g_dbus_object_manager_client_new_finish Ptr AsyncResult
res'
        Text -> Ptr DBusObjectManagerClient -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientNewFinish" Ptr DBusObjectManagerClient
result
        DBusObjectManagerClient
result' <- ((ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient)
-> Ptr DBusObjectManagerClient -> IO DBusObjectManagerClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient
DBusObjectManagerClient) Ptr DBusObjectManagerClient
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
        DBusObjectManagerClient -> IO DBusObjectManagerClient
forall (m :: * -> *) a. Monad m => a -> m a
return DBusObjectManagerClient
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if ENABLE_OVERLOADING
#endif

-- method DBusObjectManagerClient::new_for_bus_finish
-- method type : Constructor
-- Args : [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_for_bus_finish" g_dbus_object_manager_client_new_for_bus_finish :: 
    Ptr Gio.AsyncResult.AsyncResult ->      -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Finishes an operation started with 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'.

/Since: 2.30/
-}
dBusObjectManagerClientNewForBusFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@res@/: A 'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the 'GI.Gio.Callbacks.AsyncReadyCallback' passed to 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'. -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewForBusFinish :: a -> m DBusObjectManagerClient
dBusObjectManagerClientNewForBusFinish res :: a
res = IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusObjectManagerClient -> m DBusObjectManagerClient)
-> IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall a b. (a -> b) -> a -> b
$ do
    Ptr AsyncResult
res' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
    IO DBusObjectManagerClient -> IO () -> IO DBusObjectManagerClient
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr DBusObjectManagerClient
result <- (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
 -> IO (Ptr DBusObjectManagerClient))
-> (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult
-> Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient)
g_dbus_object_manager_client_new_for_bus_finish Ptr AsyncResult
res'
        Text -> Ptr DBusObjectManagerClient -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientNewForBusFinish" Ptr DBusObjectManagerClient
result
        DBusObjectManagerClient
result' <- ((ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient)
-> Ptr DBusObjectManagerClient -> IO DBusObjectManagerClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient
DBusObjectManagerClient) Ptr DBusObjectManagerClient
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
        DBusObjectManagerClient -> IO DBusObjectManagerClient
forall (m :: * -> *) a. Monad m => a -> m a
return DBusObjectManagerClient
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if ENABLE_OVERLOADING
#endif

-- method DBusObjectManagerClient::new_for_bus_sync
-- method type : Constructor
-- Args : [Arg {argCName = "bus_type", argType = TInterface (Name {namespace = "Gio", name = "BusType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GBusType.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_for_bus_sync" g_dbus_object_manager_client_new_for_bus_sync :: 
    CInt ->                                 -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Like 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewSync' but takes a 'GI.Gio.Enums.BusType' instead
of a 'GI.Gio.Objects.DBusConnection.DBusConnection'.

This is a synchronous failable constructor - the calling thread is
blocked until a reply is received. See 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'
for the asynchronous version.

/Since: 2.30/
-}
dBusObjectManagerClientNewForBusSync ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Gio.Enums.BusType
    {- ^ /@busType@/: A 'GI.Gio.Enums.BusType'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (a)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewForBusSync :: BusType
-> [DBusObjectManagerClientFlags]
-> Text
-> Text
-> Maybe DBusProxyTypeFunc
-> Maybe a
-> m DBusObjectManagerClient
dBusObjectManagerClientNewForBusSync busType :: BusType
busType flags :: [DBusObjectManagerClientFlags]
flags name :: Text
name objectPath :: Text
objectPath getProxyTypeFunc :: Maybe DBusProxyTypeFunc
getProxyTypeFunc cancellable :: Maybe a
cancellable = IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusObjectManagerClient -> m DBusObjectManagerClient)
-> IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall a b. (a -> b) -> a -> b
$ do
    let busType' :: CInt
busType' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (BusType -> Int) -> BusType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BusType -> Int
forall a. Enum a => a -> Int
fromEnum) BusType
busType
    let flags' :: CUInt
flags' = [DBusObjectManagerClientFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusObjectManagerClientFlags]
flags
    CString
name' <- Text -> IO CString
textToCString Text
name
    CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
    FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc <- case Maybe DBusProxyTypeFunc
getProxyTypeFunc of
        Nothing -> FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DBusProxyTypeFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jGetProxyTypeFunc :: DBusProxyTypeFunc
jGetProxyTypeFunc -> do
            FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc' <- C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
Gio.Callbacks.mk_DBusProxyTypeFunc (Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
-> DBusProxyTypeFunc_WithClosures -> C_DBusProxyTypeFunc
Gio.Callbacks.wrap_DBusProxyTypeFunc Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
forall a. Maybe a
Nothing (DBusProxyTypeFunc -> DBusProxyTypeFunc_WithClosures
Gio.Callbacks.drop_closures_DBusProxyTypeFunc DBusProxyTypeFunc
jGetProxyTypeFunc))
            FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc'
    Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: a
jCancellable -> do
            Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    let getProxyTypeUserData :: Ptr ()
getProxyTypeUserData = FunPtr C_DBusProxyTypeFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify :: FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
    IO DBusObjectManagerClient -> IO () -> IO DBusObjectManagerClient
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr DBusObjectManagerClient
result <- (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
 -> IO (Ptr DBusObjectManagerClient))
-> (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a b. (a -> b) -> a -> b
$ CInt
-> CUInt
-> CString
-> CString
-> FunPtr C_DBusProxyTypeFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusObjectManagerClient)
g_dbus_object_manager_client_new_for_bus_sync CInt
busType' CUInt
flags' CString
name' CString
objectPath' FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc Ptr ()
getProxyTypeUserData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify Ptr Cancellable
maybeCancellable
        Text -> Ptr DBusObjectManagerClient -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientNewForBusSync" Ptr DBusObjectManagerClient
result
        DBusObjectManagerClient
result' <- ((ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient)
-> Ptr DBusObjectManagerClient -> IO DBusObjectManagerClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient
DBusObjectManagerClient) Ptr DBusObjectManagerClient
result
        Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
        DBusObjectManagerClient -> IO DBusObjectManagerClient
forall (m :: * -> *) a. Monad m => a -> m a
return DBusObjectManagerClient
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
     )

#if ENABLE_OVERLOADING
#endif

-- method DBusObjectManagerClient::new_sync
-- method type : Constructor
-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_sync" g_dbus_object_manager_client_new_sync :: 
    Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Creates a new 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object.

This is a synchronous failable constructor - the calling thread is
blocked until a reply is received. See 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'
for the asynchronous version.

/Since: 2.30/
-}
dBusObjectManagerClientNewSync ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> Maybe (T.Text)
    {- ^ /@name@/: The owner of the control object (unique or well-known name), or 'Nothing' when not using a message bus connection. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewSync :: a
-> [DBusObjectManagerClientFlags]
-> Maybe Text
-> Text
-> Maybe DBusProxyTypeFunc
-> Maybe b
-> m DBusObjectManagerClient
dBusObjectManagerClientNewSync connection :: a
connection flags :: [DBusObjectManagerClientFlags]
flags name :: Maybe Text
name objectPath :: Text
objectPath getProxyTypeFunc :: Maybe DBusProxyTypeFunc
getProxyTypeFunc cancellable :: Maybe b
cancellable = IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusObjectManagerClient -> m DBusObjectManagerClient)
-> IO DBusObjectManagerClient -> m DBusObjectManagerClient
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
    let flags' :: CUInt
flags' = [DBusObjectManagerClientFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusObjectManagerClientFlags]
flags
    CString
maybeName <- case Maybe Text
name of
        Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just jName :: Text
jName -> do
            CString
jName' <- Text -> IO CString
textToCString Text
jName
            CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jName'
    CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
    FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc <- case Maybe DBusProxyTypeFunc
getProxyTypeFunc of
        Nothing -> FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DBusProxyTypeFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jGetProxyTypeFunc :: DBusProxyTypeFunc
jGetProxyTypeFunc -> do
            FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc' <- C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
Gio.Callbacks.mk_DBusProxyTypeFunc (Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
-> DBusProxyTypeFunc_WithClosures -> C_DBusProxyTypeFunc
Gio.Callbacks.wrap_DBusProxyTypeFunc Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
forall a. Maybe a
Nothing (DBusProxyTypeFunc -> DBusProxyTypeFunc_WithClosures
Gio.Callbacks.drop_closures_DBusProxyTypeFunc DBusProxyTypeFunc
jGetProxyTypeFunc))
            FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc'
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    let getProxyTypeUserData :: Ptr ()
getProxyTypeUserData = FunPtr C_DBusProxyTypeFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify :: FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
    IO DBusObjectManagerClient -> IO () -> IO DBusObjectManagerClient
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr DBusObjectManagerClient
result <- (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
 -> IO (Ptr DBusObjectManagerClient))
-> (Ptr (Ptr GError) -> IO (Ptr DBusObjectManagerClient))
-> IO (Ptr DBusObjectManagerClient)
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CUInt
-> CString
-> CString
-> FunPtr C_DBusProxyTypeFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusObjectManagerClient)
g_dbus_object_manager_client_new_sync Ptr DBusConnection
connection' CUInt
flags' CString
maybeName CString
objectPath' FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc Ptr ()
getProxyTypeUserData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify Ptr Cancellable
maybeCancellable
        Text -> Ptr DBusObjectManagerClient -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientNewSync" Ptr DBusObjectManagerClient
result
        DBusObjectManagerClient
result' <- ((ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient)
-> Ptr DBusObjectManagerClient -> IO DBusObjectManagerClient
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusObjectManagerClient -> DBusObjectManagerClient
DBusObjectManagerClient) Ptr DBusObjectManagerClient
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
        Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
        DBusObjectManagerClient -> IO DBusObjectManagerClient
forall (m :: * -> *) a. Monad m => a -> m a
return DBusObjectManagerClient
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
     )

#if ENABLE_OVERLOADING
#endif

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

foreign import ccall "g_dbus_object_manager_client_get_connection" g_dbus_object_manager_client_get_connection :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO (Ptr Gio.DBusConnection.DBusConnection)

{- |
Gets the 'GI.Gio.Objects.DBusConnection.DBusConnection' used by /@manager@/.

/Since: 2.30/
-}
dBusObjectManagerClientGetConnection ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m Gio.DBusConnection.DBusConnection
    {- ^ __Returns:__ A 'GI.Gio.Objects.DBusConnection.DBusConnection' object. Do not free,
  the object belongs to /@manager@/. -}
dBusObjectManagerClientGetConnection :: a -> m DBusConnection
dBusObjectManagerClientGetConnection manager :: a
manager = IO DBusConnection -> m DBusConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusConnection -> m DBusConnection)
-> IO DBusConnection -> m DBusConnection
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusObjectManagerClient
manager' <- a -> IO (Ptr DBusObjectManagerClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr DBusConnection
result <- Ptr DBusObjectManagerClient -> IO (Ptr DBusConnection)
g_dbus_object_manager_client_get_connection Ptr DBusObjectManagerClient
manager'
    Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientGetConnection" Ptr DBusConnection
result
    DBusConnection
result' <- ((ManagedPtr DBusConnection -> DBusConnection)
-> Ptr DBusConnection -> IO DBusConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusConnection -> DBusConnection
Gio.DBusConnection.DBusConnection) Ptr DBusConnection
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetConnectionMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetConnection

#endif

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

foreign import ccall "g_dbus_object_manager_client_get_flags" g_dbus_object_manager_client_get_flags :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CUInt

{- |
Gets the flags that /@manager@/ was constructed with.

/Since: 2.30/
-}
dBusObjectManagerClientGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ __Returns:__ Zero of more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags'
enumeration. -}
dBusObjectManagerClientGetFlags :: a -> m [DBusObjectManagerClientFlags]
dBusObjectManagerClientGetFlags manager :: a
manager = IO [DBusObjectManagerClientFlags]
-> m [DBusObjectManagerClientFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusObjectManagerClientFlags]
 -> m [DBusObjectManagerClientFlags])
-> IO [DBusObjectManagerClientFlags]
-> m [DBusObjectManagerClientFlags]
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusObjectManagerClient
manager' <- a -> IO (Ptr DBusObjectManagerClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    CUInt
result <- Ptr DBusObjectManagerClient -> IO CUInt
g_dbus_object_manager_client_get_flags Ptr DBusObjectManagerClient
manager'
    let result' :: [DBusObjectManagerClientFlags]
result' = CUInt -> [DBusObjectManagerClientFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    [DBusObjectManagerClientFlags] -> IO [DBusObjectManagerClientFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusObjectManagerClientFlags]
result'

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.DBusObjectManagerClientFlags]), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetFlagsMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetFlags

#endif

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

foreign import ccall "g_dbus_object_manager_client_get_name" g_dbus_object_manager_client_get_name :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CString

{- |
Gets the name that /@manager@/ is for, or 'Nothing' if not a message bus
connection.

/Since: 2.30/
-}
dBusObjectManagerClientGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m T.Text
    {- ^ __Returns:__ A unique or well-known name. Do not free, the string
belongs to /@manager@/. -}
dBusObjectManagerClientGetName :: a -> m Text
dBusObjectManagerClientGetName manager :: a
manager = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr DBusObjectManagerClient
manager' <- a -> IO (Ptr DBusObjectManagerClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    CString
result <- Ptr DBusObjectManagerClient -> IO CString
g_dbus_object_manager_client_get_name Ptr DBusObjectManagerClient
manager'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusObjectManagerClientGetName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetNameMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetName

#endif

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

foreign import ccall "g_dbus_object_manager_client_get_name_owner" g_dbus_object_manager_client_get_name_owner :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CString

{- |
The unique name that owns the name that /@manager@/ is for or 'Nothing' if
no-one currently owns that name. You can connect to the
'GI.GObject.Objects.Object.Object'::@/notify/@ signal to track changes to the
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ property.

/Since: 2.30/
-}
dBusObjectManagerClientGetNameOwner ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'. -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ The name owner or 'Nothing' if no name owner
exists. Free with 'GI.GLib.Functions.free'. -}
dBusObjectManagerClientGetNameOwner :: a -> m (Maybe Text)
dBusObjectManagerClientGetNameOwner manager :: a
manager = 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
$ do
    Ptr DBusObjectManagerClient
manager' <- a -> IO (Ptr DBusObjectManagerClient)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    CString
result <- Ptr DBusObjectManagerClient -> IO CString
g_dbus_object_manager_client_get_name_owner Ptr DBusObjectManagerClient
manager'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if ENABLE_OVERLOADING
data DBusObjectManagerClientGetNameOwnerMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetNameOwnerMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetNameOwner

#endif

-- method DBusObjectManagerClient::new
-- method type : MemberFunction
-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GAsyncReadyCallback to call when the request is satisfied.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 9, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The data to pass to @callback.", 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_object_manager_client_new" g_dbus_object_manager_client_new :: 
    Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Asynchronously creates a new 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object.

This is an asynchronous failable constructor. When the result is
ready, /@callback@/ will be invoked in the
[thread-default main context][g-main-context-push-thread-default]
of the thread you are calling this method from. You can
then call 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewFinish' to get the result. See
'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewSync' for the synchronous version.

/Since: 2.30/
-}
dBusObjectManagerClientNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: A 'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied. -}
    -> m ()
dBusObjectManagerClientNew :: a
-> [DBusObjectManagerClientFlags]
-> Text
-> Text
-> Maybe DBusProxyTypeFunc
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusObjectManagerClientNew connection :: a
connection flags :: [DBusObjectManagerClientFlags]
flags name :: Text
name objectPath :: Text
objectPath getProxyTypeFunc :: Maybe DBusProxyTypeFunc
getProxyTypeFunc cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
    let flags' :: CUInt
flags' = [DBusObjectManagerClientFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusObjectManagerClientFlags]
flags
    CString
name' <- Text -> IO CString
textToCString Text
name
    CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
    FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc <- case Maybe DBusProxyTypeFunc
getProxyTypeFunc of
        Nothing -> FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DBusProxyTypeFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jGetProxyTypeFunc :: DBusProxyTypeFunc
jGetProxyTypeFunc -> do
            FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc' <- C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
Gio.Callbacks.mk_DBusProxyTypeFunc (Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
-> DBusProxyTypeFunc_WithClosures -> C_DBusProxyTypeFunc
Gio.Callbacks.wrap_DBusProxyTypeFunc Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
forall a. Maybe a
Nothing (DBusProxyTypeFunc -> DBusProxyTypeFunc_WithClosures
Gio.Callbacks.drop_closures_DBusProxyTypeFunc DBusProxyTypeFunc
jGetProxyTypeFunc))
            FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc'
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jCallback :: AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let getProxyTypeUserData :: Ptr ()
getProxyTypeUserData = FunPtr C_DBusProxyTypeFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify :: FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr DBusConnection
-> CUInt
-> CString
-> CString
-> FunPtr C_DBusProxyTypeFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_object_manager_client_new Ptr DBusConnection
connection' CUInt
flags' CString
name' CString
objectPath' FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc Ptr ()
getProxyTypeUserData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if ENABLE_OVERLOADING
#endif

-- method DBusObjectManagerClient::new_for_bus
-- method type : MemberFunction
-- Args : [Arg {argCName = "bus_type", argType = TInterface (Name {namespace = "Gio", name = "BusType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GBusType.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GAsyncReadyCallback to call when the request is satisfied.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 9, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The data to pass to @callback.", 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_object_manager_client_new_for_bus" g_dbus_object_manager_client_new_for_bus :: 
    CInt ->                                 -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Like 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew' but takes a 'GI.Gio.Enums.BusType' instead of a
'GI.Gio.Objects.DBusConnection.DBusConnection'.

This is an asynchronous failable constructor. When the result is
ready, /@callback@/ will be invoked in the
[thread-default main loop][g-main-context-push-thread-default]
of the thread you are calling this method from. You can
then call 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBusFinish' to get the result. See
'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBusSync' for the synchronous version.

/Since: 2.30/
-}
dBusObjectManagerClientNewForBus ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Gio.Enums.BusType
    {- ^ /@busType@/: A 'GI.Gio.Enums.BusType'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (a)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: A 'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied. -}
    -> m ()
dBusObjectManagerClientNewForBus :: BusType
-> [DBusObjectManagerClientFlags]
-> Text
-> Text
-> Maybe DBusProxyTypeFunc
-> Maybe a
-> Maybe AsyncReadyCallback
-> m ()
dBusObjectManagerClientNewForBus busType :: BusType
busType flags :: [DBusObjectManagerClientFlags]
flags name :: Text
name objectPath :: Text
objectPath getProxyTypeFunc :: Maybe DBusProxyTypeFunc
getProxyTypeFunc cancellable :: Maybe a
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let busType' :: CInt
busType' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (BusType -> Int) -> BusType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BusType -> Int
forall a. Enum a => a -> Int
fromEnum) BusType
busType
    let flags' :: CUInt
flags' = [DBusObjectManagerClientFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusObjectManagerClientFlags]
flags
    CString
name' <- Text -> IO CString
textToCString Text
name
    CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
    FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc <- case Maybe DBusProxyTypeFunc
getProxyTypeFunc of
        Nothing -> FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DBusProxyTypeFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jGetProxyTypeFunc :: DBusProxyTypeFunc
jGetProxyTypeFunc -> do
            FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc' <- C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
Gio.Callbacks.mk_DBusProxyTypeFunc (Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
-> DBusProxyTypeFunc_WithClosures -> C_DBusProxyTypeFunc
Gio.Callbacks.wrap_DBusProxyTypeFunc Maybe (Ptr (FunPtr C_DBusProxyTypeFunc))
forall a. Maybe a
Nothing (DBusProxyTypeFunc -> DBusProxyTypeFunc_WithClosures
Gio.Callbacks.drop_closures_DBusProxyTypeFunc DBusProxyTypeFunc
jGetProxyTypeFunc))
            FunPtr C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DBusProxyTypeFunc
jGetProxyTypeFunc'
    Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: a
jCancellable -> do
            Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jCallback :: AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let getProxyTypeUserData :: Ptr ()
getProxyTypeUserData = FunPtr C_DBusProxyTypeFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify :: FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    CInt
-> CUInt
-> CString
-> CString
-> FunPtr C_DBusProxyTypeFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_object_manager_client_new_for_bus CInt
busType' CUInt
flags' CString
name' CString
objectPath' FunPtr C_DBusProxyTypeFunc
maybeGetProxyTypeFunc Ptr ()
getProxyTypeUserData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
getProxyTypeDestroyNotify Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if ENABLE_OVERLOADING
#endif