{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.DBusProxy
(
DBusProxy(..) ,
IsDBusProxy ,
toDBusProxy ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusProxyMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusProxyCallMethodInfo ,
#endif
dBusProxyCall ,
#if defined(ENABLE_OVERLOADING)
DBusProxyCallFinishMethodInfo ,
#endif
dBusProxyCallFinish ,
#if defined(ENABLE_OVERLOADING)
DBusProxyCallSyncMethodInfo ,
#endif
dBusProxyCallSync ,
#if defined(ENABLE_OVERLOADING)
DBusProxyCallWithUnixFdListMethodInfo ,
#endif
dBusProxyCallWithUnixFdList ,
#if defined(ENABLE_OVERLOADING)
DBusProxyCallWithUnixFdListFinishMethodInfo,
#endif
dBusProxyCallWithUnixFdListFinish ,
#if defined(ENABLE_OVERLOADING)
DBusProxyCallWithUnixFdListSyncMethodInfo,
#endif
dBusProxyCallWithUnixFdListSync ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetCachedPropertyMethodInfo ,
#endif
dBusProxyGetCachedProperty ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetCachedPropertyNamesMethodInfo,
#endif
dBusProxyGetCachedPropertyNames ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetConnectionMethodInfo ,
#endif
dBusProxyGetConnection ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetDefaultTimeoutMethodInfo ,
#endif
dBusProxyGetDefaultTimeout ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetFlagsMethodInfo ,
#endif
dBusProxyGetFlags ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetInterfaceInfoMethodInfo ,
#endif
dBusProxyGetInterfaceInfo ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetInterfaceNameMethodInfo ,
#endif
dBusProxyGetInterfaceName ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetNameMethodInfo ,
#endif
dBusProxyGetName ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetNameOwnerMethodInfo ,
#endif
dBusProxyGetNameOwner ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGetObjectPathMethodInfo ,
#endif
dBusProxyGetObjectPath ,
dBusProxyNew ,
dBusProxyNewFinish ,
dBusProxyNewForBus ,
dBusProxyNewForBusFinish ,
dBusProxyNewForBusSync ,
dBusProxyNewSync ,
#if defined(ENABLE_OVERLOADING)
DBusProxySetCachedPropertyMethodInfo ,
#endif
dBusProxySetCachedProperty ,
#if defined(ENABLE_OVERLOADING)
DBusProxySetDefaultTimeoutMethodInfo ,
#endif
dBusProxySetDefaultTimeout ,
#if defined(ENABLE_OVERLOADING)
DBusProxySetInterfaceInfoMethodInfo ,
#endif
dBusProxySetInterfaceInfo ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGBusTypePropertyInfo ,
#endif
constructDBusProxyGBusType ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGBusType ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusProxyGConnectionPropertyInfo ,
#endif
constructDBusProxyGConnection ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGConnection ,
#endif
getDBusProxyGConnection ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGDefaultTimeoutPropertyInfo ,
#endif
constructDBusProxyGDefaultTimeout ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGDefaultTimeout ,
#endif
getDBusProxyGDefaultTimeout ,
setDBusProxyGDefaultTimeout ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGFlagsPropertyInfo ,
#endif
constructDBusProxyGFlags ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGFlags ,
#endif
getDBusProxyGFlags ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGInterfaceInfoPropertyInfo ,
#endif
clearDBusProxyGInterfaceInfo ,
constructDBusProxyGInterfaceInfo ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGInterfaceInfo ,
#endif
getDBusProxyGInterfaceInfo ,
setDBusProxyGInterfaceInfo ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGInterfaceNamePropertyInfo ,
#endif
constructDBusProxyGInterfaceName ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGInterfaceName ,
#endif
getDBusProxyGInterfaceName ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGNamePropertyInfo ,
#endif
constructDBusProxyGName ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGName ,
#endif
getDBusProxyGName ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGNameOwnerPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dBusProxyGNameOwner ,
#endif
getDBusProxyGNameOwner ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGObjectPathPropertyInfo ,
#endif
constructDBusProxyGObjectPath ,
#if defined(ENABLE_OVERLOADING)
dBusProxyGObjectPath ,
#endif
getDBusProxyGObjectPath ,
C_DBusProxyGPropertiesChangedCallback ,
DBusProxyGPropertiesChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGPropertiesChangedSignalInfo ,
#endif
afterDBusProxyGPropertiesChanged ,
genClosure_DBusProxyGPropertiesChanged ,
mk_DBusProxyGPropertiesChangedCallback ,
noDBusProxyGPropertiesChangedCallback ,
onDBusProxyGPropertiesChanged ,
wrap_DBusProxyGPropertiesChangedCallback,
C_DBusProxyGSignalCallback ,
DBusProxyGSignalCallback ,
#if defined(ENABLE_OVERLOADING)
DBusProxyGSignalSignalInfo ,
#endif
afterDBusProxyGSignal ,
genClosure_DBusProxyGSignal ,
mk_DBusProxyGSignalCallback ,
noDBusProxyGSignalCallback ,
onDBusProxyGSignal ,
wrap_DBusProxyGSignalCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import 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.DBusInterface as Gio.DBusInterface
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.UnixFDList as Gio.UnixFDList
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceInfo as Gio.DBusInterfaceInfo
newtype DBusProxy = DBusProxy (SP.ManagedPtr DBusProxy)
deriving (DBusProxy -> DBusProxy -> Bool
(DBusProxy -> DBusProxy -> Bool)
-> (DBusProxy -> DBusProxy -> Bool) -> Eq DBusProxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusProxy -> DBusProxy -> Bool
$c/= :: DBusProxy -> DBusProxy -> Bool
== :: DBusProxy -> DBusProxy -> Bool
$c== :: DBusProxy -> DBusProxy -> Bool
Eq)
instance SP.ManagedPtrNewtype DBusProxy where
toManagedPtr :: DBusProxy -> ManagedPtr DBusProxy
toManagedPtr (DBusProxy ManagedPtr DBusProxy
p) = ManagedPtr DBusProxy
p
foreign import ccall "g_dbus_proxy_get_type"
c_g_dbus_proxy_get_type :: IO B.Types.GType
instance B.Types.TypedObject DBusProxy where
glibType :: IO GType
glibType = IO GType
c_g_dbus_proxy_get_type
instance B.Types.GObject DBusProxy
instance B.GValue.IsGValue DBusProxy where
toGValue :: DBusProxy -> IO GValue
toGValue DBusProxy
o = do
GType
gtype <- IO GType
c_g_dbus_proxy_get_type
DBusProxy -> (Ptr DBusProxy -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusProxy
o (GType
-> (GValue -> Ptr DBusProxy -> IO ()) -> Ptr DBusProxy -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DBusProxy -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DBusProxy
fromGValue GValue
gv = do
Ptr DBusProxy
ptr <- GValue -> IO (Ptr DBusProxy)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DBusProxy)
(ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DBusProxy -> DBusProxy
DBusProxy Ptr DBusProxy
ptr
class (SP.GObject o, O.IsDescendantOf DBusProxy o) => IsDBusProxy o
instance (SP.GObject o, O.IsDescendantOf DBusProxy o) => IsDBusProxy o
instance O.HasParentTypes DBusProxy
type instance O.ParentTypes DBusProxy = '[GObject.Object.Object, Gio.AsyncInitable.AsyncInitable, Gio.DBusInterface.DBusInterface, Gio.Initable.Initable]
toDBusProxy :: (MonadIO m, IsDBusProxy o) => o -> m DBusProxy
toDBusProxy :: o -> m DBusProxy
toDBusProxy = IO DBusProxy -> m DBusProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusProxy -> m DBusProxy)
-> (o -> IO DBusProxy) -> o -> m DBusProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DBusProxy -> DBusProxy) -> o -> IO DBusProxy
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DBusProxy -> DBusProxy
DBusProxy
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusProxyMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusProxyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusProxyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusProxyMethod "call" o = DBusProxyCallMethodInfo
ResolveDBusProxyMethod "callFinish" o = DBusProxyCallFinishMethodInfo
ResolveDBusProxyMethod "callSync" o = DBusProxyCallSyncMethodInfo
ResolveDBusProxyMethod "callWithUnixFdList" o = DBusProxyCallWithUnixFdListMethodInfo
ResolveDBusProxyMethod "callWithUnixFdListFinish" o = DBusProxyCallWithUnixFdListFinishMethodInfo
ResolveDBusProxyMethod "callWithUnixFdListSync" o = DBusProxyCallWithUnixFdListSyncMethodInfo
ResolveDBusProxyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusProxyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusProxyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusProxyMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveDBusProxyMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolveDBusProxyMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolveDBusProxyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusProxyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusProxyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusProxyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusProxyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusProxyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusProxyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusProxyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusProxyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusProxyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusProxyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusProxyMethod "getCachedProperty" o = DBusProxyGetCachedPropertyMethodInfo
ResolveDBusProxyMethod "getCachedPropertyNames" o = DBusProxyGetCachedPropertyNamesMethodInfo
ResolveDBusProxyMethod "getConnection" o = DBusProxyGetConnectionMethodInfo
ResolveDBusProxyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusProxyMethod "getDefaultTimeout" o = DBusProxyGetDefaultTimeoutMethodInfo
ResolveDBusProxyMethod "getFlags" o = DBusProxyGetFlagsMethodInfo
ResolveDBusProxyMethod "getInfo" o = Gio.DBusInterface.DBusInterfaceGetInfoMethodInfo
ResolveDBusProxyMethod "getInterfaceInfo" o = DBusProxyGetInterfaceInfoMethodInfo
ResolveDBusProxyMethod "getInterfaceName" o = DBusProxyGetInterfaceNameMethodInfo
ResolveDBusProxyMethod "getName" o = DBusProxyGetNameMethodInfo
ResolveDBusProxyMethod "getNameOwner" o = DBusProxyGetNameOwnerMethodInfo
ResolveDBusProxyMethod "getObject" o = Gio.DBusInterface.DBusInterfaceGetObjectMethodInfo
ResolveDBusProxyMethod "getObjectPath" o = DBusProxyGetObjectPathMethodInfo
ResolveDBusProxyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusProxyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusProxyMethod "setCachedProperty" o = DBusProxySetCachedPropertyMethodInfo
ResolveDBusProxyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusProxyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusProxyMethod "setDefaultTimeout" o = DBusProxySetDefaultTimeoutMethodInfo
ResolveDBusProxyMethod "setInterfaceInfo" o = DBusProxySetInterfaceInfoMethodInfo
ResolveDBusProxyMethod "setObject" o = Gio.DBusInterface.DBusInterfaceSetObjectMethodInfo
ResolveDBusProxyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusProxyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusProxyMethod t DBusProxy, O.MethodInfo info DBusProxy p) => OL.IsLabel t (DBusProxy -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DBusProxyGPropertiesChangedCallback =
GVariant
-> [T.Text]
-> IO ()
noDBusProxyGPropertiesChangedCallback :: Maybe DBusProxyGPropertiesChangedCallback
noDBusProxyGPropertiesChangedCallback :: Maybe DBusProxyGPropertiesChangedCallback
noDBusProxyGPropertiesChangedCallback = Maybe DBusProxyGPropertiesChangedCallback
forall a. Maybe a
Nothing
type C_DBusProxyGPropertiesChangedCallback =
Ptr () ->
Ptr GVariant ->
Ptr CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusProxyGPropertiesChangedCallback :: C_DBusProxyGPropertiesChangedCallback -> IO (FunPtr C_DBusProxyGPropertiesChangedCallback)
genClosure_DBusProxyGPropertiesChanged :: MonadIO m => DBusProxyGPropertiesChangedCallback -> m (GClosure C_DBusProxyGPropertiesChangedCallback)
genClosure_DBusProxyGPropertiesChanged :: DBusProxyGPropertiesChangedCallback
-> m (GClosure C_DBusProxyGPropertiesChangedCallback)
genClosure_DBusProxyGPropertiesChanged DBusProxyGPropertiesChangedCallback
cb = IO (GClosure C_DBusProxyGPropertiesChangedCallback)
-> m (GClosure C_DBusProxyGPropertiesChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DBusProxyGPropertiesChangedCallback)
-> m (GClosure C_DBusProxyGPropertiesChangedCallback))
-> IO (GClosure C_DBusProxyGPropertiesChangedCallback)
-> m (GClosure C_DBusProxyGPropertiesChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusProxyGPropertiesChangedCallback
cb' = DBusProxyGPropertiesChangedCallback
-> C_DBusProxyGPropertiesChangedCallback
wrap_DBusProxyGPropertiesChangedCallback DBusProxyGPropertiesChangedCallback
cb
C_DBusProxyGPropertiesChangedCallback
-> IO (FunPtr C_DBusProxyGPropertiesChangedCallback)
mk_DBusProxyGPropertiesChangedCallback C_DBusProxyGPropertiesChangedCallback
cb' IO (FunPtr C_DBusProxyGPropertiesChangedCallback)
-> (FunPtr C_DBusProxyGPropertiesChangedCallback
-> IO (GClosure C_DBusProxyGPropertiesChangedCallback))
-> IO (GClosure C_DBusProxyGPropertiesChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusProxyGPropertiesChangedCallback
-> IO (GClosure C_DBusProxyGPropertiesChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DBusProxyGPropertiesChangedCallback ::
DBusProxyGPropertiesChangedCallback ->
C_DBusProxyGPropertiesChangedCallback
wrap_DBusProxyGPropertiesChangedCallback :: DBusProxyGPropertiesChangedCallback
-> C_DBusProxyGPropertiesChangedCallback
wrap_DBusProxyGPropertiesChangedCallback DBusProxyGPropertiesChangedCallback
_cb Ptr ()
_ Ptr GVariant
changedProperties Ptr CString
invalidatedProperties Ptr ()
_ = do
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
DBusProxyGPropertiesChangedCallback
_cb GVariant
changedProperties' [Text]
invalidatedProperties'
onDBusProxyGPropertiesChanged :: (IsDBusProxy a, MonadIO m) => a -> DBusProxyGPropertiesChangedCallback -> m SignalHandlerId
onDBusProxyGPropertiesChanged :: a -> DBusProxyGPropertiesChangedCallback -> m SignalHandlerId
onDBusProxyGPropertiesChanged a
obj DBusProxyGPropertiesChangedCallback
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_DBusProxyGPropertiesChangedCallback
cb' = DBusProxyGPropertiesChangedCallback
-> C_DBusProxyGPropertiesChangedCallback
wrap_DBusProxyGPropertiesChangedCallback DBusProxyGPropertiesChangedCallback
cb
FunPtr C_DBusProxyGPropertiesChangedCallback
cb'' <- C_DBusProxyGPropertiesChangedCallback
-> IO (FunPtr C_DBusProxyGPropertiesChangedCallback)
mk_DBusProxyGPropertiesChangedCallback C_DBusProxyGPropertiesChangedCallback
cb'
a
-> Text
-> FunPtr C_DBusProxyGPropertiesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"g-properties-changed" FunPtr C_DBusProxyGPropertiesChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDBusProxyGPropertiesChanged :: (IsDBusProxy a, MonadIO m) => a -> DBusProxyGPropertiesChangedCallback -> m SignalHandlerId
afterDBusProxyGPropertiesChanged :: a -> DBusProxyGPropertiesChangedCallback -> m SignalHandlerId
afterDBusProxyGPropertiesChanged a
obj DBusProxyGPropertiesChangedCallback
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_DBusProxyGPropertiesChangedCallback
cb' = DBusProxyGPropertiesChangedCallback
-> C_DBusProxyGPropertiesChangedCallback
wrap_DBusProxyGPropertiesChangedCallback DBusProxyGPropertiesChangedCallback
cb
FunPtr C_DBusProxyGPropertiesChangedCallback
cb'' <- C_DBusProxyGPropertiesChangedCallback
-> IO (FunPtr C_DBusProxyGPropertiesChangedCallback)
mk_DBusProxyGPropertiesChangedCallback C_DBusProxyGPropertiesChangedCallback
cb'
a
-> Text
-> FunPtr C_DBusProxyGPropertiesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"g-properties-changed" FunPtr C_DBusProxyGPropertiesChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DBusProxyGPropertiesChangedSignalInfo
instance SignalInfo DBusProxyGPropertiesChangedSignalInfo where
type HaskellCallbackType DBusProxyGPropertiesChangedSignalInfo = DBusProxyGPropertiesChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DBusProxyGPropertiesChangedCallback cb
cb'' <- mk_DBusProxyGPropertiesChangedCallback cb'
connectSignalFunPtr obj "g-properties-changed" cb'' connectMode detail
#endif
type DBusProxyGSignalCallback =
Maybe T.Text
-> T.Text
-> GVariant
-> IO ()
noDBusProxyGSignalCallback :: Maybe DBusProxyGSignalCallback
noDBusProxyGSignalCallback :: Maybe DBusProxyGSignalCallback
noDBusProxyGSignalCallback = Maybe DBusProxyGSignalCallback
forall a. Maybe a
Nothing
type C_DBusProxyGSignalCallback =
Ptr () ->
CString ->
CString ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusProxyGSignalCallback :: C_DBusProxyGSignalCallback -> IO (FunPtr C_DBusProxyGSignalCallback)
genClosure_DBusProxyGSignal :: MonadIO m => DBusProxyGSignalCallback -> m (GClosure C_DBusProxyGSignalCallback)
genClosure_DBusProxyGSignal :: DBusProxyGSignalCallback -> m (GClosure C_DBusProxyGSignalCallback)
genClosure_DBusProxyGSignal DBusProxyGSignalCallback
cb = IO (GClosure C_DBusProxyGSignalCallback)
-> m (GClosure C_DBusProxyGSignalCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DBusProxyGSignalCallback)
-> m (GClosure C_DBusProxyGSignalCallback))
-> IO (GClosure C_DBusProxyGSignalCallback)
-> m (GClosure C_DBusProxyGSignalCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusProxyGSignalCallback
cb' = DBusProxyGSignalCallback -> C_DBusProxyGSignalCallback
wrap_DBusProxyGSignalCallback DBusProxyGSignalCallback
cb
C_DBusProxyGSignalCallback
-> IO (FunPtr C_DBusProxyGSignalCallback)
mk_DBusProxyGSignalCallback C_DBusProxyGSignalCallback
cb' IO (FunPtr C_DBusProxyGSignalCallback)
-> (FunPtr C_DBusProxyGSignalCallback
-> IO (GClosure C_DBusProxyGSignalCallback))
-> IO (GClosure C_DBusProxyGSignalCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusProxyGSignalCallback
-> IO (GClosure C_DBusProxyGSignalCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DBusProxyGSignalCallback ::
DBusProxyGSignalCallback ->
C_DBusProxyGSignalCallback
wrap_DBusProxyGSignalCallback :: DBusProxyGSignalCallback -> C_DBusProxyGSignalCallback
wrap_DBusProxyGSignalCallback DBusProxyGSignalCallback
_cb Ptr ()
_ CString
senderName CString
signalName Ptr GVariant
parameters Ptr ()
_ = do
Maybe Text
maybeSenderName <-
if CString
senderName CString -> CString -> Bool
forall a. Eq a => a -> a -> Bool
== CString
forall a. Ptr a
nullPtr
then Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
forall a. Maybe a
Nothing
else do
Text
senderName' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
senderName
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Text -> IO (Maybe Text)) -> Maybe Text -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Text -> Maybe Text
forall a. a -> Maybe a
Just Text
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
DBusProxyGSignalCallback
_cb Maybe Text
maybeSenderName Text
signalName' GVariant
parameters'
onDBusProxyGSignal :: (IsDBusProxy a, MonadIO m) => a -> DBusProxyGSignalCallback -> m SignalHandlerId
onDBusProxyGSignal :: a -> DBusProxyGSignalCallback -> m SignalHandlerId
onDBusProxyGSignal a
obj DBusProxyGSignalCallback
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_DBusProxyGSignalCallback
cb' = DBusProxyGSignalCallback -> C_DBusProxyGSignalCallback
wrap_DBusProxyGSignalCallback DBusProxyGSignalCallback
cb
FunPtr C_DBusProxyGSignalCallback
cb'' <- C_DBusProxyGSignalCallback
-> IO (FunPtr C_DBusProxyGSignalCallback)
mk_DBusProxyGSignalCallback C_DBusProxyGSignalCallback
cb'
a
-> Text
-> FunPtr C_DBusProxyGSignalCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"g-signal" FunPtr C_DBusProxyGSignalCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDBusProxyGSignal :: (IsDBusProxy a, MonadIO m) => a -> DBusProxyGSignalCallback -> m SignalHandlerId
afterDBusProxyGSignal :: a -> DBusProxyGSignalCallback -> m SignalHandlerId
afterDBusProxyGSignal a
obj DBusProxyGSignalCallback
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_DBusProxyGSignalCallback
cb' = DBusProxyGSignalCallback -> C_DBusProxyGSignalCallback
wrap_DBusProxyGSignalCallback DBusProxyGSignalCallback
cb
FunPtr C_DBusProxyGSignalCallback
cb'' <- C_DBusProxyGSignalCallback
-> IO (FunPtr C_DBusProxyGSignalCallback)
mk_DBusProxyGSignalCallback C_DBusProxyGSignalCallback
cb'
a
-> Text
-> FunPtr C_DBusProxyGSignalCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"g-signal" FunPtr C_DBusProxyGSignalCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DBusProxyGSignalSignalInfo
instance SignalInfo DBusProxyGSignalSignalInfo where
type HaskellCallbackType DBusProxyGSignalSignalInfo = DBusProxyGSignalCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DBusProxyGSignalCallback cb
cb'' <- mk_DBusProxyGSignalCallback cb'
connectSignalFunPtr obj "g-signal" cb'' connectMode detail
#endif
constructDBusProxyGBusType :: (IsDBusProxy o, MIO.MonadIO m) => Gio.Enums.BusType -> m (GValueConstruct o)
constructDBusProxyGBusType :: BusType -> m (GValueConstruct o)
constructDBusProxyGBusType BusType
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> BusType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"g-bus-type" BusType
val
#if defined(ENABLE_OVERLOADING)
data DBusProxyGBusTypePropertyInfo
instance AttrInfo DBusProxyGBusTypePropertyInfo where
type AttrAllowedOps DBusProxyGBusTypePropertyInfo = '[ 'AttrConstruct]
type AttrBaseTypeConstraint DBusProxyGBusTypePropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGBusTypePropertyInfo = (~) Gio.Enums.BusType
type AttrTransferTypeConstraint DBusProxyGBusTypePropertyInfo = (~) Gio.Enums.BusType
type AttrTransferType DBusProxyGBusTypePropertyInfo = Gio.Enums.BusType
type AttrGetType DBusProxyGBusTypePropertyInfo = ()
type AttrLabel DBusProxyGBusTypePropertyInfo = "g-bus-type"
type AttrOrigin DBusProxyGBusTypePropertyInfo = DBusProxy
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGBusType
attrClear = undefined
#endif
getDBusProxyGConnection :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe Gio.DBusConnection.DBusConnection)
getDBusProxyGConnection :: o -> m (Maybe DBusConnection)
getDBusProxyGConnection o
obj = IO (Maybe DBusConnection) -> m (Maybe DBusConnection)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DBusConnection) -> m (Maybe DBusConnection))
-> IO (Maybe DBusConnection) -> m (Maybe 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)
B.Properties.getObjectPropertyObject o
obj String
"g-connection" ManagedPtr DBusConnection -> DBusConnection
Gio.DBusConnection.DBusConnection
constructDBusProxyGConnection :: (IsDBusProxy o, MIO.MonadIO m, Gio.DBusConnection.IsDBusConnection a) => a -> m (GValueConstruct o)
constructDBusProxyGConnection :: a -> m (GValueConstruct o)
constructDBusProxyGConnection a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"g-connection" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DBusProxyGConnectionPropertyInfo
instance AttrInfo DBusProxyGConnectionPropertyInfo where
type AttrAllowedOps DBusProxyGConnectionPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGConnectionPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
type AttrTransferTypeConstraint DBusProxyGConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
type AttrTransferType DBusProxyGConnectionPropertyInfo = Gio.DBusConnection.DBusConnection
type AttrGetType DBusProxyGConnectionPropertyInfo = (Maybe Gio.DBusConnection.DBusConnection)
type AttrLabel DBusProxyGConnectionPropertyInfo = "g-connection"
type AttrOrigin DBusProxyGConnectionPropertyInfo = DBusProxy
attrGet = getDBusProxyGConnection
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.DBusConnection.DBusConnection v
attrConstruct = constructDBusProxyGConnection
attrClear = undefined
#endif
getDBusProxyGDefaultTimeout :: (MonadIO m, IsDBusProxy o) => o -> m Int32
getDBusProxyGDefaultTimeout :: o -> m Int32
getDBusProxyGDefaultTimeout o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"g-default-timeout"
setDBusProxyGDefaultTimeout :: (MonadIO m, IsDBusProxy o) => o -> Int32 -> m ()
setDBusProxyGDefaultTimeout :: o -> Int32 -> m ()
setDBusProxyGDefaultTimeout o
obj Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"g-default-timeout" Int32
val
constructDBusProxyGDefaultTimeout :: (IsDBusProxy o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructDBusProxyGDefaultTimeout :: Int32 -> m (GValueConstruct o)
constructDBusProxyGDefaultTimeout Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"g-default-timeout" Int32
val
#if defined(ENABLE_OVERLOADING)
data DBusProxyGDefaultTimeoutPropertyInfo
instance AttrInfo DBusProxyGDefaultTimeoutPropertyInfo where
type AttrAllowedOps DBusProxyGDefaultTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DBusProxyGDefaultTimeoutPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGDefaultTimeoutPropertyInfo = (~) Int32
type AttrTransferTypeConstraint DBusProxyGDefaultTimeoutPropertyInfo = (~) Int32
type AttrTransferType DBusProxyGDefaultTimeoutPropertyInfo = Int32
type AttrGetType DBusProxyGDefaultTimeoutPropertyInfo = Int32
type AttrLabel DBusProxyGDefaultTimeoutPropertyInfo = "g-default-timeout"
type AttrOrigin DBusProxyGDefaultTimeoutPropertyInfo = DBusProxy
attrGet = getDBusProxyGDefaultTimeout
attrSet = setDBusProxyGDefaultTimeout
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGDefaultTimeout
attrClear = undefined
#endif
getDBusProxyGFlags :: (MonadIO m, IsDBusProxy o) => o -> m [Gio.Flags.DBusProxyFlags]
getDBusProxyGFlags :: o -> m [DBusProxyFlags]
getDBusProxyGFlags o
obj = IO [DBusProxyFlags] -> m [DBusProxyFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusProxyFlags] -> m [DBusProxyFlags])
-> IO [DBusProxyFlags] -> m [DBusProxyFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [DBusProxyFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"g-flags"
constructDBusProxyGFlags :: (IsDBusProxy o, MIO.MonadIO m) => [Gio.Flags.DBusProxyFlags] -> m (GValueConstruct o)
constructDBusProxyGFlags :: [DBusProxyFlags] -> m (GValueConstruct o)
constructDBusProxyGFlags [DBusProxyFlags]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [DBusProxyFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"g-flags" [DBusProxyFlags]
val
#if defined(ENABLE_OVERLOADING)
data DBusProxyGFlagsPropertyInfo
instance AttrInfo DBusProxyGFlagsPropertyInfo where
type AttrAllowedOps DBusProxyGFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DBusProxyGFlagsPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGFlagsPropertyInfo = (~) [Gio.Flags.DBusProxyFlags]
type AttrTransferTypeConstraint DBusProxyGFlagsPropertyInfo = (~) [Gio.Flags.DBusProxyFlags]
type AttrTransferType DBusProxyGFlagsPropertyInfo = [Gio.Flags.DBusProxyFlags]
type AttrGetType DBusProxyGFlagsPropertyInfo = [Gio.Flags.DBusProxyFlags]
type AttrLabel DBusProxyGFlagsPropertyInfo = "g-flags"
type AttrOrigin DBusProxyGFlagsPropertyInfo = DBusProxy
attrGet = getDBusProxyGFlags
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGFlags
attrClear = undefined
#endif
getDBusProxyGInterfaceInfo :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe Gio.DBusInterfaceInfo.DBusInterfaceInfo)
getDBusProxyGInterfaceInfo :: o -> m (Maybe DBusInterfaceInfo)
getDBusProxyGInterfaceInfo o
obj = IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo))
-> IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr DBusInterfaceInfo -> DBusInterfaceInfo)
-> IO (Maybe DBusInterfaceInfo)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"g-interface-info" ManagedPtr DBusInterfaceInfo -> DBusInterfaceInfo
Gio.DBusInterfaceInfo.DBusInterfaceInfo
setDBusProxyGInterfaceInfo :: (MonadIO m, IsDBusProxy o) => o -> Gio.DBusInterfaceInfo.DBusInterfaceInfo -> m ()
setDBusProxyGInterfaceInfo :: o -> DBusInterfaceInfo -> m ()
setDBusProxyGInterfaceInfo o
obj DBusInterfaceInfo
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe DBusInterfaceInfo -> IO ()
forall a b.
(GObject a, GBoxed b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj String
"g-interface-info" (DBusInterfaceInfo -> Maybe DBusInterfaceInfo
forall a. a -> Maybe a
Just DBusInterfaceInfo
val)
constructDBusProxyGInterfaceInfo :: (IsDBusProxy o, MIO.MonadIO m) => Gio.DBusInterfaceInfo.DBusInterfaceInfo -> m (GValueConstruct o)
constructDBusProxyGInterfaceInfo :: DBusInterfaceInfo -> m (GValueConstruct o)
constructDBusProxyGInterfaceInfo DBusInterfaceInfo
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe DBusInterfaceInfo -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"g-interface-info" (DBusInterfaceInfo -> Maybe DBusInterfaceInfo
forall a. a -> Maybe a
P.Just DBusInterfaceInfo
val)
clearDBusProxyGInterfaceInfo :: (MonadIO m, IsDBusProxy o) => o -> m ()
clearDBusProxyGInterfaceInfo :: o -> m ()
clearDBusProxyGInterfaceInfo o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe DBusInterfaceInfo -> IO ()
forall a b.
(GObject a, GBoxed b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj String
"g-interface-info" (Maybe DBusInterfaceInfo
forall a. Maybe a
Nothing :: Maybe Gio.DBusInterfaceInfo.DBusInterfaceInfo)
#if defined(ENABLE_OVERLOADING)
data DBusProxyGInterfaceInfoPropertyInfo
instance AttrInfo DBusProxyGInterfaceInfoPropertyInfo where
type AttrAllowedOps DBusProxyGInterfaceInfoPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGInterfaceInfoPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGInterfaceInfoPropertyInfo = (~) Gio.DBusInterfaceInfo.DBusInterfaceInfo
type AttrTransferTypeConstraint DBusProxyGInterfaceInfoPropertyInfo = (~) Gio.DBusInterfaceInfo.DBusInterfaceInfo
type AttrTransferType DBusProxyGInterfaceInfoPropertyInfo = Gio.DBusInterfaceInfo.DBusInterfaceInfo
type AttrGetType DBusProxyGInterfaceInfoPropertyInfo = (Maybe Gio.DBusInterfaceInfo.DBusInterfaceInfo)
type AttrLabel DBusProxyGInterfaceInfoPropertyInfo = "g-interface-info"
type AttrOrigin DBusProxyGInterfaceInfoPropertyInfo = DBusProxy
attrGet = getDBusProxyGInterfaceInfo
attrSet = setDBusProxyGInterfaceInfo
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGInterfaceInfo
attrClear = clearDBusProxyGInterfaceInfo
#endif
getDBusProxyGInterfaceName :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe T.Text)
getDBusProxyGInterfaceName :: o -> m (Maybe Text)
getDBusProxyGInterfaceName 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)
B.Properties.getObjectPropertyString o
obj String
"g-interface-name"
constructDBusProxyGInterfaceName :: (IsDBusProxy o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDBusProxyGInterfaceName :: Text -> m (GValueConstruct o)
constructDBusProxyGInterfaceName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"g-interface-name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DBusProxyGInterfaceNamePropertyInfo
instance AttrInfo DBusProxyGInterfaceNamePropertyInfo where
type AttrAllowedOps DBusProxyGInterfaceNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGInterfaceNamePropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGInterfaceNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DBusProxyGInterfaceNamePropertyInfo = (~) T.Text
type AttrTransferType DBusProxyGInterfaceNamePropertyInfo = T.Text
type AttrGetType DBusProxyGInterfaceNamePropertyInfo = (Maybe T.Text)
type AttrLabel DBusProxyGInterfaceNamePropertyInfo = "g-interface-name"
type AttrOrigin DBusProxyGInterfaceNamePropertyInfo = DBusProxy
attrGet = getDBusProxyGInterfaceName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGInterfaceName
attrClear = undefined
#endif
getDBusProxyGName :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe T.Text)
getDBusProxyGName :: o -> m (Maybe Text)
getDBusProxyGName 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)
B.Properties.getObjectPropertyString o
obj String
"g-name"
constructDBusProxyGName :: (IsDBusProxy o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDBusProxyGName :: Text -> m (GValueConstruct o)
constructDBusProxyGName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"g-name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DBusProxyGNamePropertyInfo
instance AttrInfo DBusProxyGNamePropertyInfo where
type AttrAllowedOps DBusProxyGNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGNamePropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DBusProxyGNamePropertyInfo = (~) T.Text
type AttrTransferType DBusProxyGNamePropertyInfo = T.Text
type AttrGetType DBusProxyGNamePropertyInfo = (Maybe T.Text)
type AttrLabel DBusProxyGNamePropertyInfo = "g-name"
type AttrOrigin DBusProxyGNamePropertyInfo = DBusProxy
attrGet = getDBusProxyGName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGName
attrClear = undefined
#endif
getDBusProxyGNameOwner :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe T.Text)
getDBusProxyGNameOwner :: o -> m (Maybe Text)
getDBusProxyGNameOwner 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)
B.Properties.getObjectPropertyString o
obj String
"g-name-owner"
#if defined(ENABLE_OVERLOADING)
data DBusProxyGNameOwnerPropertyInfo
instance AttrInfo DBusProxyGNameOwnerPropertyInfo where
type AttrAllowedOps DBusProxyGNameOwnerPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGNameOwnerPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGNameOwnerPropertyInfo = (~) ()
type AttrTransferTypeConstraint DBusProxyGNameOwnerPropertyInfo = (~) ()
type AttrTransferType DBusProxyGNameOwnerPropertyInfo = ()
type AttrGetType DBusProxyGNameOwnerPropertyInfo = (Maybe T.Text)
type AttrLabel DBusProxyGNameOwnerPropertyInfo = "g-name-owner"
type AttrOrigin DBusProxyGNameOwnerPropertyInfo = DBusProxy
attrGet = getDBusProxyGNameOwner
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDBusProxyGObjectPath :: (MonadIO m, IsDBusProxy o) => o -> m (Maybe T.Text)
getDBusProxyGObjectPath :: o -> m (Maybe Text)
getDBusProxyGObjectPath 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)
B.Properties.getObjectPropertyString o
obj String
"g-object-path"
constructDBusProxyGObjectPath :: (IsDBusProxy o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDBusProxyGObjectPath :: Text -> m (GValueConstruct o)
constructDBusProxyGObjectPath Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"g-object-path" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DBusProxyGObjectPathPropertyInfo
instance AttrInfo DBusProxyGObjectPathPropertyInfo where
type AttrAllowedOps DBusProxyGObjectPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusProxyGObjectPathPropertyInfo = IsDBusProxy
type AttrSetTypeConstraint DBusProxyGObjectPathPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DBusProxyGObjectPathPropertyInfo = (~) T.Text
type AttrTransferType DBusProxyGObjectPathPropertyInfo = T.Text
type AttrGetType DBusProxyGObjectPathPropertyInfo = (Maybe T.Text)
type AttrLabel DBusProxyGObjectPathPropertyInfo = "g-object-path"
type AttrOrigin DBusProxyGObjectPathPropertyInfo = DBusProxy
attrGet = getDBusProxyGObjectPath
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusProxyGObjectPath
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusProxy
type instance O.AttributeList DBusProxy = DBusProxyAttributeList
type DBusProxyAttributeList = ('[ '("gBusType", DBusProxyGBusTypePropertyInfo), '("gConnection", DBusProxyGConnectionPropertyInfo), '("gDefaultTimeout", DBusProxyGDefaultTimeoutPropertyInfo), '("gFlags", DBusProxyGFlagsPropertyInfo), '("gInterfaceInfo", DBusProxyGInterfaceInfoPropertyInfo), '("gInterfaceName", DBusProxyGInterfaceNamePropertyInfo), '("gName", DBusProxyGNamePropertyInfo), '("gNameOwner", DBusProxyGNameOwnerPropertyInfo), '("gObjectPath", DBusProxyGObjectPathPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
dBusProxyGBusType :: AttrLabelProxy "gBusType"
dBusProxyGBusType = AttrLabelProxy
dBusProxyGConnection :: AttrLabelProxy "gConnection"
dBusProxyGConnection = AttrLabelProxy
dBusProxyGDefaultTimeout :: AttrLabelProxy "gDefaultTimeout"
dBusProxyGDefaultTimeout = AttrLabelProxy
dBusProxyGFlags :: AttrLabelProxy "gFlags"
dBusProxyGFlags = AttrLabelProxy
dBusProxyGInterfaceInfo :: AttrLabelProxy "gInterfaceInfo"
dBusProxyGInterfaceInfo = AttrLabelProxy
dBusProxyGInterfaceName :: AttrLabelProxy "gInterfaceName"
dBusProxyGInterfaceName = AttrLabelProxy
dBusProxyGName :: AttrLabelProxy "gName"
dBusProxyGName = AttrLabelProxy
dBusProxyGNameOwner :: AttrLabelProxy "gNameOwner"
dBusProxyGNameOwner = AttrLabelProxy
dBusProxyGObjectPath :: AttrLabelProxy "gObjectPath"
dBusProxyGObjectPath = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DBusProxy = DBusProxySignalList
type DBusProxySignalList = ('[ '("gPropertiesChanged", DBusProxyGPropertiesChangedSignalInfo), '("gSignal", DBusProxyGSignalSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_proxy_new_finish" g_dbus_proxy_new_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr DBusProxy)
dBusProxyNewFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m DBusProxy
dBusProxyNewFinish :: a -> m DBusProxy
dBusProxyNewFinish a
res = IO DBusProxy -> m DBusProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusProxy -> m DBusProxy) -> IO DBusProxy -> m DBusProxy
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 DBusProxy -> IO () -> IO DBusProxy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusProxy
result <- (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy))
-> (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusProxy)
g_dbus_proxy_new_finish Ptr AsyncResult
res'
Text -> Ptr DBusProxy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyNewFinish" Ptr DBusProxy
result
DBusProxy
result' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusProxy -> DBusProxy
DBusProxy) Ptr DBusProxy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
DBusProxy -> IO DBusProxy
forall (m :: * -> *) a. Monad m => a -> m a
return DBusProxy
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_proxy_new_for_bus_finish" g_dbus_proxy_new_for_bus_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr DBusProxy)
dBusProxyNewForBusFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m DBusProxy
dBusProxyNewForBusFinish :: a -> m DBusProxy
dBusProxyNewForBusFinish a
res = IO DBusProxy -> m DBusProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusProxy -> m DBusProxy) -> IO DBusProxy -> m DBusProxy
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 DBusProxy -> IO () -> IO DBusProxy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusProxy
result <- (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy))
-> (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusProxy)
g_dbus_proxy_new_for_bus_finish Ptr AsyncResult
res'
Text -> Ptr DBusProxy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyNewForBusFinish" Ptr DBusProxy
result
DBusProxy
result' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusProxy -> DBusProxy
DBusProxy) Ptr DBusProxy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
DBusProxy -> IO DBusProxy
forall (m :: * -> *) a. Monad m => a -> m a
return DBusProxy
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_proxy_new_for_bus_sync" g_dbus_proxy_new_for_bus_sync ::
CInt ->
CUInt ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr DBusProxy)
dBusProxyNewForBusSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
Gio.Enums.BusType
-> [Gio.Flags.DBusProxyFlags]
-> Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (a)
-> m DBusProxy
dBusProxyNewForBusSync :: BusType
-> [DBusProxyFlags]
-> Maybe DBusInterfaceInfo
-> Text
-> Text
-> Text
-> Maybe a
-> m DBusProxy
dBusProxyNewForBusSync BusType
busType [DBusProxyFlags]
flags Maybe DBusInterfaceInfo
info Text
name Text
objectPath Text
interfaceName Maybe a
cancellable = IO DBusProxy -> m DBusProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusProxy -> m DBusProxy) -> IO DBusProxy -> m DBusProxy
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' = [DBusProxyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusProxyFlags]
flags
Ptr DBusInterfaceInfo
maybeInfo <- case Maybe DBusInterfaceInfo
info of
Maybe DBusInterfaceInfo
Nothing -> Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
forall a. Ptr a
nullPtr
Just DBusInterfaceInfo
jInfo -> do
Ptr DBusInterfaceInfo
jInfo' <- DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
jInfo
Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
jInfo'
CString
name' <- Text -> IO CString
textToCString Text
name
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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'
IO DBusProxy -> IO () -> IO DBusProxy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusProxy
result <- (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy))
-> (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a b. (a -> b) -> a -> b
$ CInt
-> CUInt
-> Ptr DBusInterfaceInfo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusProxy)
g_dbus_proxy_new_for_bus_sync CInt
busType' CUInt
flags' Ptr DBusInterfaceInfo
maybeInfo CString
name' CString
objectPath' CString
interfaceName' Ptr Cancellable
maybeCancellable
Text -> Ptr DBusProxy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyNewForBusSync" Ptr DBusProxy
result
DBusProxy
result' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusProxy -> DBusProxy
DBusProxy) Ptr DBusProxy
result
Maybe DBusInterfaceInfo -> (DBusInterfaceInfo -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe DBusInterfaceInfo
info DBusInterfaceInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
DBusProxy -> IO DBusProxy
forall (m :: * -> *) a. Monad m => a -> m a
return DBusProxy
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_proxy_new_sync" g_dbus_proxy_new_sync ::
Ptr Gio.DBusConnection.DBusConnection ->
CUInt ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr DBusProxy)
dBusProxyNewSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.DBusProxyFlags]
-> Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo)
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> Maybe (b)
-> m DBusProxy
dBusProxyNewSync :: a
-> [DBusProxyFlags]
-> Maybe DBusInterfaceInfo
-> Maybe Text
-> Text
-> Text
-> Maybe b
-> m DBusProxy
dBusProxyNewSync a
connection [DBusProxyFlags]
flags Maybe DBusInterfaceInfo
info Maybe Text
name Text
objectPath Text
interfaceName Maybe b
cancellable = IO DBusProxy -> m DBusProxy
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusProxy -> m DBusProxy) -> IO DBusProxy -> m DBusProxy
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' = [DBusProxyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusProxyFlags]
flags
Ptr DBusInterfaceInfo
maybeInfo <- case Maybe DBusInterfaceInfo
info of
Maybe DBusInterfaceInfo
Nothing -> Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
forall a. Ptr a
nullPtr
Just DBusInterfaceInfo
jInfo -> do
Ptr DBusInterfaceInfo
jInfo' <- DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
jInfo
Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
jInfo'
CString
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just 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
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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'
IO DBusProxy -> IO () -> IO DBusProxy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusProxy
result <- (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy))
-> (Ptr (Ptr GError) -> IO (Ptr DBusProxy)) -> IO (Ptr DBusProxy)
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CUInt
-> Ptr DBusInterfaceInfo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusProxy)
g_dbus_proxy_new_sync Ptr DBusConnection
connection' CUInt
flags' Ptr DBusInterfaceInfo
maybeInfo CString
maybeName CString
objectPath' CString
interfaceName' Ptr Cancellable
maybeCancellable
Text -> Ptr DBusProxy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyNewSync" Ptr DBusProxy
result
DBusProxy
result' <- ((ManagedPtr DBusProxy -> DBusProxy)
-> Ptr DBusProxy -> IO DBusProxy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusProxy -> DBusProxy
DBusProxy) Ptr DBusProxy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Maybe DBusInterfaceInfo -> (DBusInterfaceInfo -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe DBusInterfaceInfo
info DBusInterfaceInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
DBusProxy -> IO DBusProxy
forall (m :: * -> *) a. Monad m => a -> m a
return DBusProxy
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_proxy_call" g_dbus_proxy_call ::
Ptr DBusProxy ->
CString ->
Ptr GVariant ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusProxyCall ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (GVariant)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusProxyCall :: a
-> Text
-> Maybe GVariant
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusProxyCall a
proxy Text
methodName Maybe GVariant
parameters [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
cancellable 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
let flags' :: CUInt
flags' = [DBusCallFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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
Maybe AsyncReadyCallback
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 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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusProxy
-> CString
-> Ptr GVariant
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_dbus_proxy_call Ptr DBusProxy
proxy' CString
methodName' Ptr GVariant
maybeParameters CUInt
flags' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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
methodName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusProxy a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusProxyCallMethodInfo a signature where
overloadedMethod = dBusProxyCall
#endif
foreign import ccall "g_dbus_proxy_call_finish" g_dbus_proxy_call_finish ::
Ptr DBusProxy ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusProxyCallFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GVariant
dBusProxyCallFinish :: a -> b -> m GVariant
dBusProxyCallFinish a
proxy b
res = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant))
-> (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a b. (a -> b) -> a -> b
$ Ptr DBusProxy
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr GVariant)
g_dbus_proxy_call_finish Ptr DBusProxy
proxy' Ptr AsyncResult
res'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyCallFinish" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallFinishMethodInfo
instance (signature ~ (b -> m GVariant), MonadIO m, IsDBusProxy a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusProxyCallFinishMethodInfo a signature where
overloadedMethod = dBusProxyCallFinish
#endif
foreign import ccall "g_dbus_proxy_call_sync" g_dbus_proxy_call_sync ::
Ptr DBusProxy ->
CString ->
Ptr GVariant ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusProxyCallSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (GVariant)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> m GVariant
dBusProxyCallSync :: a
-> Text
-> Maybe GVariant
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> m GVariant
dBusProxyCallSync a
proxy Text
methodName Maybe GVariant
parameters [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
cancellable = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
let flags' :: CUInt
flags' = [DBusCallFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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'
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant))
-> (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a b. (a -> b) -> a -> b
$ Ptr DBusProxy
-> CString
-> Ptr GVariant
-> CUInt
-> Int32
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_proxy_call_sync Ptr DBusProxy
proxy' CString
methodName' Ptr GVariant
maybeParameters CUInt
flags' Int32
timeoutMsec Ptr Cancellable
maybeCancellable
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyCallSync" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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
methodName'
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
methodName'
)
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallSyncMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> m GVariant), MonadIO m, IsDBusProxy a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusProxyCallSyncMethodInfo a signature where
overloadedMethod = dBusProxyCallSync
#endif
foreign import ccall "g_dbus_proxy_call_with_unix_fd_list" g_dbus_proxy_call_with_unix_fd_list ::
Ptr DBusProxy ->
CString ->
Ptr GVariant ->
CUInt ->
Int32 ->
Ptr Gio.UnixFDList.UnixFDList ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusProxyCallWithUnixFdList ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> Maybe (GVariant)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusProxyCallWithUnixFdList :: a
-> Text
-> Maybe GVariant
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
dBusProxyCallWithUnixFdList a
proxy Text
methodName Maybe GVariant
parameters [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
fdList Maybe c
cancellable 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
let flags' :: CUInt
flags' = [DBusCallFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr UnixFDList
maybeFdList <- case Maybe b
fdList of
Maybe b
Nothing -> Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
forall a. Ptr a
nullPtr
Just b
jFdList -> do
Ptr UnixFDList
jFdList' <- b -> IO (Ptr UnixFDList)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFdList
Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
jFdList'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
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
Maybe AsyncReadyCallback
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 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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusProxy
-> CString
-> Ptr GVariant
-> CUInt
-> Int32
-> Ptr UnixFDList
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_dbus_proxy_call_with_unix_fd_list Ptr DBusProxy
proxy' CString
methodName' Ptr GVariant
maybeParameters CUInt
flags' Int32
timeoutMsec Ptr UnixFDList
maybeFdList Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
fdList b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
methodName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallWithUnixFdListMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusProxy a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DBusProxyCallWithUnixFdListMethodInfo a signature where
overloadedMethod = dBusProxyCallWithUnixFdList
#endif
foreign import ccall "g_dbus_proxy_call_with_unix_fd_list_finish" g_dbus_proxy_call_with_unix_fd_list_finish ::
Ptr DBusProxy ->
Ptr (Ptr Gio.UnixFDList.UnixFDList) ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusProxyCallWithUnixFdListFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((GVariant, Gio.UnixFDList.UnixFDList))
dBusProxyCallWithUnixFdListFinish :: a -> b -> m (GVariant, UnixFDList)
dBusProxyCallWithUnixFdListFinish a
proxy b
res = IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList))
-> IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList)
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr (Ptr UnixFDList)
outFdList <- IO (Ptr (Ptr UnixFDList))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gio.UnixFDList.UnixFDList))
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO (GVariant, UnixFDList) -> IO () -> IO (GVariant, UnixFDList)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant))
-> (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a b. (a -> b) -> a -> b
$ Ptr DBusProxy
-> Ptr (Ptr UnixFDList)
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_proxy_call_with_unix_fd_list_finish Ptr DBusProxy
proxy' Ptr (Ptr UnixFDList)
outFdList Ptr AsyncResult
res'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyCallWithUnixFdListFinish" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
Ptr UnixFDList
outFdList' <- Ptr (Ptr UnixFDList) -> IO (Ptr UnixFDList)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr UnixFDList)
outFdList
UnixFDList
outFdList'' <- ((ManagedPtr UnixFDList -> UnixFDList)
-> Ptr UnixFDList -> IO UnixFDList
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UnixFDList -> UnixFDList
Gio.UnixFDList.UnixFDList) Ptr UnixFDList
outFdList'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Ptr (Ptr UnixFDList) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
(GVariant, UnixFDList) -> IO (GVariant, UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return (GVariant
result', UnixFDList
outFdList'')
) (do
Ptr (Ptr UnixFDList) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
)
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallWithUnixFdListFinishMethodInfo
instance (signature ~ (b -> m ((GVariant, Gio.UnixFDList.UnixFDList))), MonadIO m, IsDBusProxy a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusProxyCallWithUnixFdListFinishMethodInfo a signature where
overloadedMethod = dBusProxyCallWithUnixFdListFinish
#endif
foreign import ccall "g_dbus_proxy_call_with_unix_fd_list_sync" g_dbus_proxy_call_with_unix_fd_list_sync ::
Ptr DBusProxy ->
CString ->
Ptr GVariant ->
CUInt ->
Int32 ->
Ptr Gio.UnixFDList.UnixFDList ->
Ptr (Ptr Gio.UnixFDList.UnixFDList) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusProxyCallWithUnixFdListSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> Maybe (GVariant)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (c)
-> m ((GVariant, Gio.UnixFDList.UnixFDList))
dBusProxyCallWithUnixFdListSync :: a
-> Text
-> Maybe GVariant
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> m (GVariant, UnixFDList)
dBusProxyCallWithUnixFdListSync a
proxy Text
methodName Maybe GVariant
parameters [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
fdList Maybe c
cancellable = IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList))
-> IO (GVariant, UnixFDList) -> m (GVariant, UnixFDList)
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
let flags' :: CUInt
flags' = [DBusCallFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr UnixFDList
maybeFdList <- case Maybe b
fdList of
Maybe b
Nothing -> Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
forall a. Ptr a
nullPtr
Just b
jFdList -> do
Ptr UnixFDList
jFdList' <- b -> IO (Ptr UnixFDList)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFdList
Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
jFdList'
Ptr (Ptr UnixFDList)
outFdList <- IO (Ptr (Ptr UnixFDList))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gio.UnixFDList.UnixFDList))
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (GVariant, UnixFDList) -> IO () -> IO (GVariant, UnixFDList)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant))
-> (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a b. (a -> b) -> a -> b
$ Ptr DBusProxy
-> CString
-> Ptr GVariant
-> CUInt
-> Int32
-> Ptr UnixFDList
-> Ptr (Ptr UnixFDList)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_proxy_call_with_unix_fd_list_sync Ptr DBusProxy
proxy' CString
methodName' Ptr GVariant
maybeParameters CUInt
flags' Int32
timeoutMsec Ptr UnixFDList
maybeFdList Ptr (Ptr UnixFDList)
outFdList Ptr Cancellable
maybeCancellable
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyCallWithUnixFdListSync" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
Ptr UnixFDList
outFdList' <- Ptr (Ptr UnixFDList) -> IO (Ptr UnixFDList)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr UnixFDList)
outFdList
UnixFDList
outFdList'' <- ((ManagedPtr UnixFDList -> UnixFDList)
-> Ptr UnixFDList -> IO UnixFDList
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UnixFDList -> UnixFDList
Gio.UnixFDList.UnixFDList) Ptr UnixFDList
outFdList'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
fdList b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
methodName'
Ptr (Ptr UnixFDList) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
(GVariant, UnixFDList) -> IO (GVariant, UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return (GVariant
result', UnixFDList
outFdList'')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
methodName'
Ptr (Ptr UnixFDList) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
)
#if defined(ENABLE_OVERLOADING)
data DBusProxyCallWithUnixFdListSyncMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (c) -> m ((GVariant, Gio.UnixFDList.UnixFDList))), MonadIO m, IsDBusProxy a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DBusProxyCallWithUnixFdListSyncMethodInfo a signature where
overloadedMethod = dBusProxyCallWithUnixFdListSync
#endif
foreign import ccall "g_dbus_proxy_get_cached_property" g_dbus_proxy_get_cached_property ::
Ptr DBusProxy ->
CString ->
IO (Ptr GVariant)
dBusProxyGetCachedProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> T.Text
-> m (Maybe GVariant)
dBusProxyGetCachedProperty :: a -> Text -> m (Maybe GVariant)
dBusProxyGetCachedProperty a
proxy Text
propertyName = IO (Maybe GVariant) -> m (Maybe GVariant)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr GVariant
result <- Ptr DBusProxy -> CString -> IO (Ptr GVariant)
g_dbus_proxy_get_cached_property Ptr DBusProxy
proxy' CString
propertyName'
Maybe GVariant
maybeResult <- Ptr GVariant
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GVariant
result ((Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant))
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ \Ptr GVariant
result' -> do
GVariant
result'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result'
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
Maybe GVariant -> IO (Maybe GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GVariant
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetCachedPropertyMethodInfo
instance (signature ~ (T.Text -> m (Maybe GVariant)), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetCachedPropertyMethodInfo a signature where
overloadedMethod = dBusProxyGetCachedProperty
#endif
foreign import ccall "g_dbus_proxy_get_cached_property_names" g_dbus_proxy_get_cached_property_names ::
Ptr DBusProxy ->
IO (Ptr CString)
dBusProxyGetCachedPropertyNames ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m (Maybe [T.Text])
dBusProxyGetCachedPropertyNames :: a -> m (Maybe [Text])
dBusProxyGetCachedPropertyNames a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr CString
result <- Ptr DBusProxy -> IO (Ptr CString)
g_dbus_proxy_get_cached_property_names Ptr DBusProxy
proxy'
Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
[Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr 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
proxy
Maybe [Text] -> IO (Maybe [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetCachedPropertyNamesMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetCachedPropertyNamesMethodInfo a signature where
overloadedMethod = dBusProxyGetCachedPropertyNames
#endif
foreign import ccall "g_dbus_proxy_get_connection" g_dbus_proxy_get_connection ::
Ptr DBusProxy ->
IO (Ptr Gio.DBusConnection.DBusConnection)
dBusProxyGetConnection ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m Gio.DBusConnection.DBusConnection
dBusProxyGetConnection :: a -> m DBusConnection
dBusProxyGetConnection a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr DBusConnection
result <- Ptr DBusProxy -> IO (Ptr DBusConnection)
g_dbus_proxy_get_connection Ptr DBusProxy
proxy'
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyGetConnection" 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
proxy
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetConnectionMethodInfo a signature where
overloadedMethod = dBusProxyGetConnection
#endif
foreign import ccall "g_dbus_proxy_get_default_timeout" g_dbus_proxy_get_default_timeout ::
Ptr DBusProxy ->
IO Int32
dBusProxyGetDefaultTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m Int32
dBusProxyGetDefaultTimeout :: a -> m Int32
dBusProxyGetDefaultTimeout a
proxy = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Int32
result <- Ptr DBusProxy -> IO Int32
g_dbus_proxy_get_default_timeout Ptr DBusProxy
proxy'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetDefaultTimeoutMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetDefaultTimeoutMethodInfo a signature where
overloadedMethod = dBusProxyGetDefaultTimeout
#endif
foreign import ccall "g_dbus_proxy_get_flags" g_dbus_proxy_get_flags ::
Ptr DBusProxy ->
IO CUInt
dBusProxyGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m [Gio.Flags.DBusProxyFlags]
dBusProxyGetFlags :: a -> m [DBusProxyFlags]
dBusProxyGetFlags a
proxy = IO [DBusProxyFlags] -> m [DBusProxyFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusProxyFlags] -> m [DBusProxyFlags])
-> IO [DBusProxyFlags] -> m [DBusProxyFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CUInt
result <- Ptr DBusProxy -> IO CUInt
g_dbus_proxy_get_flags Ptr DBusProxy
proxy'
let result' :: [DBusProxyFlags]
result' = CUInt -> [DBusProxyFlags]
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
proxy
[DBusProxyFlags] -> IO [DBusProxyFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusProxyFlags]
result'
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.DBusProxyFlags]), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetFlagsMethodInfo a signature where
overloadedMethod = dBusProxyGetFlags
#endif
foreign import ccall "g_dbus_proxy_get_interface_info" g_dbus_proxy_get_interface_info ::
Ptr DBusProxy ->
IO (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo)
dBusProxyGetInterfaceInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m (Maybe Gio.DBusInterfaceInfo.DBusInterfaceInfo)
dBusProxyGetInterfaceInfo :: a -> m (Maybe DBusInterfaceInfo)
dBusProxyGetInterfaceInfo a
proxy = IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo))
-> IO (Maybe DBusInterfaceInfo) -> m (Maybe DBusInterfaceInfo)
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr DBusInterfaceInfo
result <- Ptr DBusProxy -> IO (Ptr DBusInterfaceInfo)
g_dbus_proxy_get_interface_info Ptr DBusProxy
proxy'
Maybe DBusInterfaceInfo
maybeResult <- Ptr DBusInterfaceInfo
-> (Ptr DBusInterfaceInfo -> IO DBusInterfaceInfo)
-> IO (Maybe DBusInterfaceInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DBusInterfaceInfo
result ((Ptr DBusInterfaceInfo -> IO DBusInterfaceInfo)
-> IO (Maybe DBusInterfaceInfo))
-> (Ptr DBusInterfaceInfo -> IO DBusInterfaceInfo)
-> IO (Maybe DBusInterfaceInfo)
forall a b. (a -> b) -> a -> b
$ \Ptr DBusInterfaceInfo
result' -> do
DBusInterfaceInfo
result'' <- ((ManagedPtr DBusInterfaceInfo -> DBusInterfaceInfo)
-> Ptr DBusInterfaceInfo -> IO DBusInterfaceInfo
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusInterfaceInfo -> DBusInterfaceInfo
Gio.DBusInterfaceInfo.DBusInterfaceInfo) Ptr DBusInterfaceInfo
result'
DBusInterfaceInfo -> IO DBusInterfaceInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DBusInterfaceInfo
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe DBusInterfaceInfo -> IO (Maybe DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DBusInterfaceInfo
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetInterfaceInfoMethodInfo
instance (signature ~ (m (Maybe Gio.DBusInterfaceInfo.DBusInterfaceInfo)), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetInterfaceInfoMethodInfo a signature where
overloadedMethod = dBusProxyGetInterfaceInfo
#endif
foreign import ccall "g_dbus_proxy_get_interface_name" g_dbus_proxy_get_interface_name ::
Ptr DBusProxy ->
IO CString
dBusProxyGetInterfaceName ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m T.Text
dBusProxyGetInterfaceName :: a -> m Text
dBusProxyGetInterfaceName a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
result <- Ptr DBusProxy -> IO CString
g_dbus_proxy_get_interface_name Ptr DBusProxy
proxy'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyGetInterfaceName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetInterfaceNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetInterfaceNameMethodInfo a signature where
overloadedMethod = dBusProxyGetInterfaceName
#endif
foreign import ccall "g_dbus_proxy_get_name" g_dbus_proxy_get_name ::
Ptr DBusProxy ->
IO CString
dBusProxyGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m T.Text
dBusProxyGetName :: a -> m Text
dBusProxyGetName a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
result <- Ptr DBusProxy -> IO CString
g_dbus_proxy_get_name Ptr DBusProxy
proxy'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetNameMethodInfo a signature where
overloadedMethod = dBusProxyGetName
#endif
foreign import ccall "g_dbus_proxy_get_name_owner" g_dbus_proxy_get_name_owner ::
Ptr DBusProxy ->
IO CString
dBusProxyGetNameOwner ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m (Maybe T.Text)
dBusProxyGetNameOwner :: a -> m (Maybe Text)
dBusProxyGetNameOwner a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
result <- Ptr DBusProxy -> IO CString
g_dbus_proxy_get_name_owner Ptr DBusProxy
proxy'
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
$ \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
proxy
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetNameOwnerMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetNameOwnerMethodInfo a signature where
overloadedMethod = dBusProxyGetNameOwner
#endif
foreign import ccall "g_dbus_proxy_get_object_path" g_dbus_proxy_get_object_path ::
Ptr DBusProxy ->
IO CString
dBusProxyGetObjectPath ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> m T.Text
dBusProxyGetObjectPath :: a -> m Text
dBusProxyGetObjectPath a
proxy = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
result <- Ptr DBusProxy -> IO CString
g_dbus_proxy_get_object_path Ptr DBusProxy
proxy'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusProxyGetObjectPath" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DBusProxyGetObjectPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxyGetObjectPathMethodInfo a signature where
overloadedMethod = dBusProxyGetObjectPath
#endif
foreign import ccall "g_dbus_proxy_set_cached_property" g_dbus_proxy_set_cached_property ::
Ptr DBusProxy ->
CString ->
Ptr GVariant ->
IO ()
dBusProxySetCachedProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> T.Text
-> Maybe (GVariant)
-> m ()
dBusProxySetCachedProperty :: a -> Text -> Maybe GVariant -> m ()
dBusProxySetCachedProperty a
proxy Text
propertyName Maybe GVariant
value = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr GVariant
maybeValue <- case Maybe GVariant
value of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jValue -> do
Ptr GVariant
jValue' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jValue
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jValue'
Ptr DBusProxy -> CString -> Ptr GVariant -> IO ()
g_dbus_proxy_set_cached_property Ptr DBusProxy
proxy' CString
propertyName' Ptr GVariant
maybeValue
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
value GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusProxySetCachedPropertyMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxySetCachedPropertyMethodInfo a signature where
overloadedMethod = dBusProxySetCachedProperty
#endif
foreign import ccall "g_dbus_proxy_set_default_timeout" g_dbus_proxy_set_default_timeout ::
Ptr DBusProxy ->
Int32 ->
IO ()
dBusProxySetDefaultTimeout ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> Int32
-> m ()
dBusProxySetDefaultTimeout :: a -> Int32 -> m ()
dBusProxySetDefaultTimeout a
proxy Int32
timeoutMsec = 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 DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr DBusProxy -> Int32 -> IO ()
g_dbus_proxy_set_default_timeout Ptr DBusProxy
proxy' Int32
timeoutMsec
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusProxySetDefaultTimeoutMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxySetDefaultTimeoutMethodInfo a signature where
overloadedMethod = dBusProxySetDefaultTimeout
#endif
foreign import ccall "g_dbus_proxy_set_interface_info" g_dbus_proxy_set_interface_info ::
Ptr DBusProxy ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
IO ()
dBusProxySetInterfaceInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusProxy a) =>
a
-> Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo)
-> m ()
dBusProxySetInterfaceInfo :: a -> Maybe DBusInterfaceInfo -> m ()
dBusProxySetInterfaceInfo a
proxy Maybe DBusInterfaceInfo
info = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusProxy
proxy' <- a -> IO (Ptr DBusProxy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr DBusInterfaceInfo
maybeInfo <- case Maybe DBusInterfaceInfo
info of
Maybe DBusInterfaceInfo
Nothing -> Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
forall a. Ptr a
nullPtr
Just DBusInterfaceInfo
jInfo -> do
Ptr DBusInterfaceInfo
jInfo' <- DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
jInfo
Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
jInfo'
Ptr DBusProxy -> Ptr DBusInterfaceInfo -> IO ()
g_dbus_proxy_set_interface_info Ptr DBusProxy
proxy' Ptr DBusInterfaceInfo
maybeInfo
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
Maybe DBusInterfaceInfo -> (DBusInterfaceInfo -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe DBusInterfaceInfo
info DBusInterfaceInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusProxySetInterfaceInfoMethodInfo
instance (signature ~ (Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo) -> m ()), MonadIO m, IsDBusProxy a) => O.MethodInfo DBusProxySetInterfaceInfoMethodInfo a signature where
overloadedMethod = dBusProxySetInterfaceInfo
#endif
foreign import ccall "g_dbus_proxy_new" g_dbus_proxy_new ::
Ptr Gio.DBusConnection.DBusConnection ->
CUInt ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusProxyNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.DBusProxyFlags]
-> Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo)
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusProxyNew :: a
-> [DBusProxyFlags]
-> Maybe DBusInterfaceInfo
-> Maybe Text
-> Text
-> Text
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusProxyNew a
connection [DBusProxyFlags]
flags Maybe DBusInterfaceInfo
info Maybe Text
name Text
objectPath Text
interfaceName Maybe b
cancellable 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' = [DBusProxyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusProxyFlags]
flags
Ptr DBusInterfaceInfo
maybeInfo <- case Maybe DBusInterfaceInfo
info of
Maybe DBusInterfaceInfo
Nothing -> Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
forall a. Ptr a
nullPtr
Just DBusInterfaceInfo
jInfo -> do
Ptr DBusInterfaceInfo
jInfo' <- DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
jInfo
Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
jInfo'
CString
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just 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
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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
Maybe AsyncReadyCallback
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 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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusConnection
-> CUInt
-> Ptr DBusInterfaceInfo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_dbus_proxy_new Ptr DBusConnection
connection' CUInt
flags' Ptr DBusInterfaceInfo
maybeInfo CString
maybeName CString
objectPath' CString
interfaceName' 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 DBusInterfaceInfo -> (DBusInterfaceInfo -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe DBusInterfaceInfo
info DBusInterfaceInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_proxy_new_for_bus" g_dbus_proxy_new_for_bus ::
CInt ->
CUInt ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusProxyNewForBus ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
Gio.Enums.BusType
-> [Gio.Flags.DBusProxyFlags]
-> Maybe (Gio.DBusInterfaceInfo.DBusInterfaceInfo)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusProxyNewForBus :: BusType
-> [DBusProxyFlags]
-> Maybe DBusInterfaceInfo
-> Text
-> Text
-> Text
-> Maybe a
-> Maybe AsyncReadyCallback
-> m ()
dBusProxyNewForBus BusType
busType [DBusProxyFlags]
flags Maybe DBusInterfaceInfo
info Text
name Text
objectPath Text
interfaceName Maybe a
cancellable 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' = [DBusProxyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusProxyFlags]
flags
Ptr DBusInterfaceInfo
maybeInfo <- case Maybe DBusInterfaceInfo
info of
Maybe DBusInterfaceInfo
Nothing -> Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
forall a. Ptr a
nullPtr
Just DBusInterfaceInfo
jInfo -> do
Ptr DBusInterfaceInfo
jInfo' <- DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
jInfo
Ptr DBusInterfaceInfo -> IO (Ptr DBusInterfaceInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusInterfaceInfo
jInfo'
CString
name' <- Text -> IO CString
textToCString Text
name
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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
Maybe AsyncReadyCallback
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 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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
CInt
-> CUInt
-> Ptr DBusInterfaceInfo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_dbus_proxy_new_for_bus CInt
busType' CUInt
flags' Ptr DBusInterfaceInfo
maybeInfo CString
name' CString
objectPath' CString
interfaceName' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
Maybe DBusInterfaceInfo -> (DBusInterfaceInfo -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe DBusInterfaceInfo
info DBusInterfaceInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif