{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.DBusConnection
(
DBusConnection(..) ,
IsDBusConnection ,
toDBusConnection ,
noDBusConnection ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusConnectionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusConnectionAddFilterMethodInfo ,
#endif
dBusConnectionAddFilter ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallMethodInfo ,
#endif
dBusConnectionCall ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallFinishMethodInfo ,
#endif
dBusConnectionCallFinish ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallSyncMethodInfo ,
#endif
dBusConnectionCallSync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallWithUnixFdListMethodInfo,
#endif
dBusConnectionCallWithUnixFdList ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallWithUnixFdListFinishMethodInfo,
#endif
dBusConnectionCallWithUnixFdListFinish ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCallWithUnixFdListSyncMethodInfo,
#endif
dBusConnectionCallWithUnixFdListSync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCloseMethodInfo ,
#endif
dBusConnectionClose ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCloseFinishMethodInfo ,
#endif
dBusConnectionCloseFinish ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionCloseSyncMethodInfo ,
#endif
dBusConnectionCloseSync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionEmitSignalMethodInfo ,
#endif
dBusConnectionEmitSignal ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionExportActionGroupMethodInfo,
#endif
dBusConnectionExportActionGroup ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionExportMenuModelMethodInfo ,
#endif
dBusConnectionExportMenuModel ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionFlushMethodInfo ,
#endif
dBusConnectionFlush ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionFlushFinishMethodInfo ,
#endif
dBusConnectionFlushFinish ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionFlushSyncMethodInfo ,
#endif
dBusConnectionFlushSync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetCapabilitiesMethodInfo ,
#endif
dBusConnectionGetCapabilities ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetExitOnCloseMethodInfo ,
#endif
dBusConnectionGetExitOnClose ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetFlagsMethodInfo ,
#endif
dBusConnectionGetFlags ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetGuidMethodInfo ,
#endif
dBusConnectionGetGuid ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetLastSerialMethodInfo ,
#endif
dBusConnectionGetLastSerial ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetPeerCredentialsMethodInfo,
#endif
dBusConnectionGetPeerCredentials ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetStreamMethodInfo ,
#endif
dBusConnectionGetStream ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGetUniqueNameMethodInfo ,
#endif
dBusConnectionGetUniqueName ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionIsClosedMethodInfo ,
#endif
dBusConnectionIsClosed ,
dBusConnectionNew ,
dBusConnectionNewFinish ,
dBusConnectionNewForAddress ,
dBusConnectionNewForAddressFinish ,
dBusConnectionNewForAddressSync ,
dBusConnectionNewSync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionRegisterObjectMethodInfo ,
#endif
dBusConnectionRegisterObject ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionRegisterSubtreeMethodInfo ,
#endif
dBusConnectionRegisterSubtree ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionRemoveFilterMethodInfo ,
#endif
dBusConnectionRemoveFilter ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSendMessageMethodInfo ,
#endif
dBusConnectionSendMessage ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSendMessageWithReplyMethodInfo,
#endif
dBusConnectionSendMessageWithReply ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSendMessageWithReplyFinishMethodInfo,
#endif
dBusConnectionSendMessageWithReplyFinish,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSendMessageWithReplySyncMethodInfo,
#endif
dBusConnectionSendMessageWithReplySync ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSetExitOnCloseMethodInfo ,
#endif
dBusConnectionSetExitOnClose ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSignalSubscribeMethodInfo ,
#endif
dBusConnectionSignalSubscribe ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionSignalUnsubscribeMethodInfo,
#endif
dBusConnectionSignalUnsubscribe ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionStartMessageProcessingMethodInfo,
#endif
dBusConnectionStartMessageProcessing ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionUnexportActionGroupMethodInfo,
#endif
dBusConnectionUnexportActionGroup ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionUnexportMenuModelMethodInfo,
#endif
dBusConnectionUnexportMenuModel ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionUnregisterObjectMethodInfo,
#endif
dBusConnectionUnregisterObject ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionUnregisterSubtreeMethodInfo,
#endif
dBusConnectionUnregisterSubtree ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionAddressPropertyInfo ,
#endif
constructDBusConnectionAddress ,
#if defined(ENABLE_OVERLOADING)
dBusConnectionAddress ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusConnectionAuthenticationObserverPropertyInfo,
#endif
constructDBusConnectionAuthenticationObserver,
#if defined(ENABLE_OVERLOADING)
dBusConnectionAuthenticationObserver ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusConnectionCapabilitiesPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dBusConnectionCapabilities ,
#endif
getDBusConnectionCapabilities ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionClosedPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dBusConnectionClosed ,
#endif
getDBusConnectionClosed ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionExitOnClosePropertyInfo ,
#endif
constructDBusConnectionExitOnClose ,
#if defined(ENABLE_OVERLOADING)
dBusConnectionExitOnClose ,
#endif
getDBusConnectionExitOnClose ,
setDBusConnectionExitOnClose ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionFlagsPropertyInfo ,
#endif
constructDBusConnectionFlags ,
#if defined(ENABLE_OVERLOADING)
dBusConnectionFlags ,
#endif
getDBusConnectionFlags ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionGuidPropertyInfo ,
#endif
constructDBusConnectionGuid ,
#if defined(ENABLE_OVERLOADING)
dBusConnectionGuid ,
#endif
getDBusConnectionGuid ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionStreamPropertyInfo ,
#endif
constructDBusConnectionStream ,
#if defined(ENABLE_OVERLOADING)
dBusConnectionStream ,
#endif
getDBusConnectionStream ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionUniqueNamePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dBusConnectionUniqueName ,
#endif
getDBusConnectionUniqueName ,
C_DBusConnectionClosedCallback ,
DBusConnectionClosedCallback ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionClosedSignalInfo ,
#endif
afterDBusConnectionClosed ,
genClosure_DBusConnectionClosed ,
mk_DBusConnectionClosedCallback ,
noDBusConnectionClosedCallback ,
onDBusConnectionClosed ,
wrap_DBusConnectionClosedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.ActionGroup as Gio.ActionGroup
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.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.Credentials as Gio.Credentials
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusAuthObserver as Gio.DBusAuthObserver
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusMessage as Gio.DBusMessage
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
import {-# SOURCE #-} qualified GI.Gio.Objects.UnixFDList as Gio.UnixFDList
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceInfo as Gio.DBusInterfaceInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusSubtreeVTable as Gio.DBusSubtreeVTable
newtype DBusConnection = DBusConnection (ManagedPtr DBusConnection)
deriving (DBusConnection -> DBusConnection -> Bool
(DBusConnection -> DBusConnection -> Bool)
-> (DBusConnection -> DBusConnection -> Bool) -> Eq DBusConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusConnection -> DBusConnection -> Bool
$c/= :: DBusConnection -> DBusConnection -> Bool
== :: DBusConnection -> DBusConnection -> Bool
$c== :: DBusConnection -> DBusConnection -> Bool
Eq)
foreign import ccall "g_dbus_connection_get_type"
c_g_dbus_connection_get_type :: IO GType
instance GObject DBusConnection where
gobjectType :: IO GType
gobjectType = IO GType
c_g_dbus_connection_get_type
instance B.GValue.IsGValue DBusConnection where
toGValue :: DBusConnection -> IO GValue
toGValue o :: DBusConnection
o = do
GType
gtype <- IO GType
c_g_dbus_connection_get_type
DBusConnection -> (Ptr DBusConnection -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusConnection
o (GType
-> (GValue -> Ptr DBusConnection -> IO ())
-> Ptr DBusConnection
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DBusConnection -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DBusConnection
fromGValue gv :: GValue
gv = do
Ptr DBusConnection
ptr <- GValue -> IO (Ptr DBusConnection)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DBusConnection)
(ManagedPtr DBusConnection -> DBusConnection)
-> Ptr DBusConnection -> IO DBusConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection Ptr DBusConnection
ptr
class (GObject o, O.IsDescendantOf DBusConnection o) => IsDBusConnection o
instance (GObject o, O.IsDescendantOf DBusConnection o) => IsDBusConnection o
instance O.HasParentTypes DBusConnection
type instance O.ParentTypes DBusConnection = '[GObject.Object.Object, Gio.AsyncInitable.AsyncInitable, Gio.Initable.Initable]
toDBusConnection :: (MonadIO m, IsDBusConnection o) => o -> m DBusConnection
toDBusConnection :: o -> m DBusConnection
toDBusConnection = IO DBusConnection -> m DBusConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusConnection -> m DBusConnection)
-> (o -> IO DBusConnection) -> o -> m DBusConnection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DBusConnection -> DBusConnection)
-> o -> IO DBusConnection
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DBusConnection -> DBusConnection
DBusConnection
noDBusConnection :: Maybe DBusConnection
noDBusConnection :: Maybe DBusConnection
noDBusConnection = Maybe DBusConnection
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusConnectionMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusConnectionMethod "addFilter" o = DBusConnectionAddFilterMethodInfo
ResolveDBusConnectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusConnectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusConnectionMethod "call" o = DBusConnectionCallMethodInfo
ResolveDBusConnectionMethod "callFinish" o = DBusConnectionCallFinishMethodInfo
ResolveDBusConnectionMethod "callSync" o = DBusConnectionCallSyncMethodInfo
ResolveDBusConnectionMethod "callWithUnixFdList" o = DBusConnectionCallWithUnixFdListMethodInfo
ResolveDBusConnectionMethod "callWithUnixFdListFinish" o = DBusConnectionCallWithUnixFdListFinishMethodInfo
ResolveDBusConnectionMethod "callWithUnixFdListSync" o = DBusConnectionCallWithUnixFdListSyncMethodInfo
ResolveDBusConnectionMethod "close" o = DBusConnectionCloseMethodInfo
ResolveDBusConnectionMethod "closeFinish" o = DBusConnectionCloseFinishMethodInfo
ResolveDBusConnectionMethod "closeSync" o = DBusConnectionCloseSyncMethodInfo
ResolveDBusConnectionMethod "emitSignal" o = DBusConnectionEmitSignalMethodInfo
ResolveDBusConnectionMethod "exportActionGroup" o = DBusConnectionExportActionGroupMethodInfo
ResolveDBusConnectionMethod "exportMenuModel" o = DBusConnectionExportMenuModelMethodInfo
ResolveDBusConnectionMethod "flush" o = DBusConnectionFlushMethodInfo
ResolveDBusConnectionMethod "flushFinish" o = DBusConnectionFlushFinishMethodInfo
ResolveDBusConnectionMethod "flushSync" o = DBusConnectionFlushSyncMethodInfo
ResolveDBusConnectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusConnectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusConnectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusConnectionMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveDBusConnectionMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolveDBusConnectionMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolveDBusConnectionMethod "isClosed" o = DBusConnectionIsClosedMethodInfo
ResolveDBusConnectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusConnectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusConnectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusConnectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusConnectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusConnectionMethod "registerObject" o = DBusConnectionRegisterObjectMethodInfo
ResolveDBusConnectionMethod "registerSubtree" o = DBusConnectionRegisterSubtreeMethodInfo
ResolveDBusConnectionMethod "removeFilter" o = DBusConnectionRemoveFilterMethodInfo
ResolveDBusConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusConnectionMethod "sendMessage" o = DBusConnectionSendMessageMethodInfo
ResolveDBusConnectionMethod "sendMessageWithReply" o = DBusConnectionSendMessageWithReplyMethodInfo
ResolveDBusConnectionMethod "sendMessageWithReplyFinish" o = DBusConnectionSendMessageWithReplyFinishMethodInfo
ResolveDBusConnectionMethod "sendMessageWithReplySync" o = DBusConnectionSendMessageWithReplySyncMethodInfo
ResolveDBusConnectionMethod "signalSubscribe" o = DBusConnectionSignalSubscribeMethodInfo
ResolveDBusConnectionMethod "signalUnsubscribe" o = DBusConnectionSignalUnsubscribeMethodInfo
ResolveDBusConnectionMethod "startMessageProcessing" o = DBusConnectionStartMessageProcessingMethodInfo
ResolveDBusConnectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusConnectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusConnectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusConnectionMethod "unexportActionGroup" o = DBusConnectionUnexportActionGroupMethodInfo
ResolveDBusConnectionMethod "unexportMenuModel" o = DBusConnectionUnexportMenuModelMethodInfo
ResolveDBusConnectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusConnectionMethod "unregisterObject" o = DBusConnectionUnregisterObjectMethodInfo
ResolveDBusConnectionMethod "unregisterSubtree" o = DBusConnectionUnregisterSubtreeMethodInfo
ResolveDBusConnectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusConnectionMethod "getCapabilities" o = DBusConnectionGetCapabilitiesMethodInfo
ResolveDBusConnectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusConnectionMethod "getExitOnClose" o = DBusConnectionGetExitOnCloseMethodInfo
ResolveDBusConnectionMethod "getFlags" o = DBusConnectionGetFlagsMethodInfo
ResolveDBusConnectionMethod "getGuid" o = DBusConnectionGetGuidMethodInfo
ResolveDBusConnectionMethod "getLastSerial" o = DBusConnectionGetLastSerialMethodInfo
ResolveDBusConnectionMethod "getPeerCredentials" o = DBusConnectionGetPeerCredentialsMethodInfo
ResolveDBusConnectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusConnectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusConnectionMethod "getStream" o = DBusConnectionGetStreamMethodInfo
ResolveDBusConnectionMethod "getUniqueName" o = DBusConnectionGetUniqueNameMethodInfo
ResolveDBusConnectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusConnectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusConnectionMethod "setExitOnClose" o = DBusConnectionSetExitOnCloseMethodInfo
ResolveDBusConnectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusConnectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusConnectionMethod t DBusConnection, O.MethodInfo info DBusConnection p) => OL.IsLabel t (DBusConnection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DBusConnectionClosedCallback =
Bool
-> Maybe GError
-> IO ()
noDBusConnectionClosedCallback :: Maybe DBusConnectionClosedCallback
noDBusConnectionClosedCallback :: Maybe DBusConnectionClosedCallback
noDBusConnectionClosedCallback = Maybe DBusConnectionClosedCallback
forall a. Maybe a
Nothing
type C_DBusConnectionClosedCallback =
Ptr () ->
CInt ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusConnectionClosedCallback :: C_DBusConnectionClosedCallback -> IO (FunPtr C_DBusConnectionClosedCallback)
genClosure_DBusConnectionClosed :: MonadIO m => DBusConnectionClosedCallback -> m (GClosure C_DBusConnectionClosedCallback)
genClosure_DBusConnectionClosed :: DBusConnectionClosedCallback
-> m (GClosure C_DBusConnectionClosedCallback)
genClosure_DBusConnectionClosed cb :: DBusConnectionClosedCallback
cb = IO (GClosure C_DBusConnectionClosedCallback)
-> m (GClosure C_DBusConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DBusConnectionClosedCallback)
-> m (GClosure C_DBusConnectionClosedCallback))
-> IO (GClosure C_DBusConnectionClosedCallback)
-> m (GClosure C_DBusConnectionClosedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusConnectionClosedCallback
cb' = DBusConnectionClosedCallback -> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback DBusConnectionClosedCallback
cb
C_DBusConnectionClosedCallback
-> IO (FunPtr C_DBusConnectionClosedCallback)
mk_DBusConnectionClosedCallback C_DBusConnectionClosedCallback
cb' IO (FunPtr C_DBusConnectionClosedCallback)
-> (FunPtr C_DBusConnectionClosedCallback
-> IO (GClosure C_DBusConnectionClosedCallback))
-> IO (GClosure C_DBusConnectionClosedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusConnectionClosedCallback
-> IO (GClosure C_DBusConnectionClosedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DBusConnectionClosedCallback ::
DBusConnectionClosedCallback ->
C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback :: DBusConnectionClosedCallback -> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback _cb :: DBusConnectionClosedCallback
_cb _ remotePeerVanished :: CInt
remotePeerVanished error_ :: Ptr GError
error_ _ = do
let remotePeerVanished' :: Bool
remotePeerVanished' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
remotePeerVanished
Maybe GError
maybeError_ <-
if Ptr GError
error_ Ptr GError -> Ptr GError -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr GError
forall a. Ptr a
nullPtr
then Maybe GError -> IO (Maybe GError)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GError
forall a. Maybe a
Nothing
else do
GError
error_' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_
Maybe GError -> IO (Maybe GError)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe GError -> IO (Maybe GError))
-> Maybe GError -> IO (Maybe GError)
forall a b. (a -> b) -> a -> b
$ GError -> Maybe GError
forall a. a -> Maybe a
Just GError
error_'
DBusConnectionClosedCallback
_cb Bool
remotePeerVanished' Maybe GError
maybeError_
onDBusConnectionClosed :: (IsDBusConnection a, MonadIO m) => a -> DBusConnectionClosedCallback -> m SignalHandlerId
onDBusConnectionClosed :: a -> DBusConnectionClosedCallback -> m SignalHandlerId
onDBusConnectionClosed obj :: a
obj cb :: DBusConnectionClosedCallback
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_DBusConnectionClosedCallback
cb' = DBusConnectionClosedCallback -> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback DBusConnectionClosedCallback
cb
FunPtr C_DBusConnectionClosedCallback
cb'' <- C_DBusConnectionClosedCallback
-> IO (FunPtr C_DBusConnectionClosedCallback)
mk_DBusConnectionClosedCallback C_DBusConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_DBusConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "closed" FunPtr C_DBusConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDBusConnectionClosed :: (IsDBusConnection a, MonadIO m) => a -> DBusConnectionClosedCallback -> m SignalHandlerId
afterDBusConnectionClosed :: a -> DBusConnectionClosedCallback -> m SignalHandlerId
afterDBusConnectionClosed obj :: a
obj cb :: DBusConnectionClosedCallback
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_DBusConnectionClosedCallback
cb' = DBusConnectionClosedCallback -> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback DBusConnectionClosedCallback
cb
FunPtr C_DBusConnectionClosedCallback
cb'' <- C_DBusConnectionClosedCallback
-> IO (FunPtr C_DBusConnectionClosedCallback)
mk_DBusConnectionClosedCallback C_DBusConnectionClosedCallback
cb'
a
-> Text
-> FunPtr C_DBusConnectionClosedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "closed" FunPtr C_DBusConnectionClosedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DBusConnectionClosedSignalInfo
instance SignalInfo DBusConnectionClosedSignalInfo where
type HaskellCallbackType DBusConnectionClosedSignalInfo = DBusConnectionClosedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DBusConnectionClosedCallback cb
cb'' <- mk_DBusConnectionClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' connectMode detail
#endif
constructDBusConnectionAddress :: (IsDBusConnection o) => T.Text -> IO (GValueConstruct o)
constructDBusConnectionAddress :: Text -> IO (GValueConstruct o)
constructDBusConnectionAddress val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "address" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionAddressPropertyInfo
instance AttrInfo DBusConnectionAddressPropertyInfo where
type AttrAllowedOps DBusConnectionAddressPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint DBusConnectionAddressPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionAddressPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DBusConnectionAddressPropertyInfo = (~) T.Text
type AttrTransferType DBusConnectionAddressPropertyInfo = T.Text
type AttrGetType DBusConnectionAddressPropertyInfo = ()
type AttrLabel DBusConnectionAddressPropertyInfo = "address"
type AttrOrigin DBusConnectionAddressPropertyInfo = DBusConnection
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusConnectionAddress
attrClear = undefined
#endif
constructDBusConnectionAuthenticationObserver :: (IsDBusConnection o, Gio.DBusAuthObserver.IsDBusAuthObserver a) => a -> IO (GValueConstruct o)
constructDBusConnectionAuthenticationObserver :: a -> IO (GValueConstruct o)
constructDBusConnectionAuthenticationObserver val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "authentication-observer" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionAuthenticationObserverPropertyInfo
instance AttrInfo DBusConnectionAuthenticationObserverPropertyInfo where
type AttrAllowedOps DBusConnectionAuthenticationObserverPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint DBusConnectionAuthenticationObserverPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionAuthenticationObserverPropertyInfo = Gio.DBusAuthObserver.IsDBusAuthObserver
type AttrTransferTypeConstraint DBusConnectionAuthenticationObserverPropertyInfo = Gio.DBusAuthObserver.IsDBusAuthObserver
type AttrTransferType DBusConnectionAuthenticationObserverPropertyInfo = Gio.DBusAuthObserver.DBusAuthObserver
type AttrGetType DBusConnectionAuthenticationObserverPropertyInfo = ()
type AttrLabel DBusConnectionAuthenticationObserverPropertyInfo = "authentication-observer"
type AttrOrigin DBusConnectionAuthenticationObserverPropertyInfo = DBusConnection
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.DBusAuthObserver.DBusAuthObserver v
attrConstruct = constructDBusConnectionAuthenticationObserver
attrClear = undefined
#endif
getDBusConnectionCapabilities :: (MonadIO m, IsDBusConnection o) => o -> m [Gio.Flags.DBusCapabilityFlags]
getDBusConnectionCapabilities :: o -> m [DBusCapabilityFlags]
getDBusConnectionCapabilities obj :: o
obj = IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags])
-> IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [DBusCapabilityFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "capabilities"
#if defined(ENABLE_OVERLOADING)
data DBusConnectionCapabilitiesPropertyInfo
instance AttrInfo DBusConnectionCapabilitiesPropertyInfo where
type AttrAllowedOps DBusConnectionCapabilitiesPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DBusConnectionCapabilitiesPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionCapabilitiesPropertyInfo = (~) ()
type AttrTransferTypeConstraint DBusConnectionCapabilitiesPropertyInfo = (~) ()
type AttrTransferType DBusConnectionCapabilitiesPropertyInfo = ()
type AttrGetType DBusConnectionCapabilitiesPropertyInfo = [Gio.Flags.DBusCapabilityFlags]
type AttrLabel DBusConnectionCapabilitiesPropertyInfo = "capabilities"
type AttrOrigin DBusConnectionCapabilitiesPropertyInfo = DBusConnection
attrGet = getDBusConnectionCapabilities
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDBusConnectionClosed :: (MonadIO m, IsDBusConnection o) => o -> m Bool
getDBusConnectionClosed :: o -> m Bool
getDBusConnectionClosed obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "closed"
#if defined(ENABLE_OVERLOADING)
data DBusConnectionClosedPropertyInfo
instance AttrInfo DBusConnectionClosedPropertyInfo where
type AttrAllowedOps DBusConnectionClosedPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DBusConnectionClosedPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionClosedPropertyInfo = (~) ()
type AttrTransferTypeConstraint DBusConnectionClosedPropertyInfo = (~) ()
type AttrTransferType DBusConnectionClosedPropertyInfo = ()
type AttrGetType DBusConnectionClosedPropertyInfo = Bool
type AttrLabel DBusConnectionClosedPropertyInfo = "closed"
type AttrOrigin DBusConnectionClosedPropertyInfo = DBusConnection
attrGet = getDBusConnectionClosed
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDBusConnectionExitOnClose :: (MonadIO m, IsDBusConnection o) => o -> m Bool
getDBusConnectionExitOnClose :: o -> m Bool
getDBusConnectionExitOnClose obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "exit-on-close"
setDBusConnectionExitOnClose :: (MonadIO m, IsDBusConnection o) => o -> Bool -> m ()
setDBusConnectionExitOnClose :: o -> Bool -> m ()
setDBusConnectionExitOnClose obj :: o
obj val :: Bool
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 -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "exit-on-close" Bool
val
constructDBusConnectionExitOnClose :: (IsDBusConnection o) => Bool -> IO (GValueConstruct o)
constructDBusConnectionExitOnClose :: Bool -> IO (GValueConstruct o)
constructDBusConnectionExitOnClose val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "exit-on-close" Bool
val
#if defined(ENABLE_OVERLOADING)
data DBusConnectionExitOnClosePropertyInfo
instance AttrInfo DBusConnectionExitOnClosePropertyInfo where
type AttrAllowedOps DBusConnectionExitOnClosePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DBusConnectionExitOnClosePropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionExitOnClosePropertyInfo = (~) Bool
type AttrTransferTypeConstraint DBusConnectionExitOnClosePropertyInfo = (~) Bool
type AttrTransferType DBusConnectionExitOnClosePropertyInfo = Bool
type AttrGetType DBusConnectionExitOnClosePropertyInfo = Bool
type AttrLabel DBusConnectionExitOnClosePropertyInfo = "exit-on-close"
type AttrOrigin DBusConnectionExitOnClosePropertyInfo = DBusConnection
attrGet = getDBusConnectionExitOnClose
attrSet = setDBusConnectionExitOnClose
attrTransfer _ v = do
return v
attrConstruct = constructDBusConnectionExitOnClose
attrClear = undefined
#endif
getDBusConnectionFlags :: (MonadIO m, IsDBusConnection o) => o -> m [Gio.Flags.DBusConnectionFlags]
getDBusConnectionFlags :: o -> m [DBusConnectionFlags]
getDBusConnectionFlags obj :: o
obj = IO [DBusConnectionFlags] -> m [DBusConnectionFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusConnectionFlags] -> m [DBusConnectionFlags])
-> IO [DBusConnectionFlags] -> m [DBusConnectionFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [DBusConnectionFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "flags"
constructDBusConnectionFlags :: (IsDBusConnection o) => [Gio.Flags.DBusConnectionFlags] -> IO (GValueConstruct o)
constructDBusConnectionFlags :: [DBusConnectionFlags] -> IO (GValueConstruct o)
constructDBusConnectionFlags val :: [DBusConnectionFlags]
val = String -> [DBusConnectionFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags "flags" [DBusConnectionFlags]
val
#if defined(ENABLE_OVERLOADING)
data DBusConnectionFlagsPropertyInfo
instance AttrInfo DBusConnectionFlagsPropertyInfo where
type AttrAllowedOps DBusConnectionFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DBusConnectionFlagsPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionFlagsPropertyInfo = (~) [Gio.Flags.DBusConnectionFlags]
type AttrTransferTypeConstraint DBusConnectionFlagsPropertyInfo = (~) [Gio.Flags.DBusConnectionFlags]
type AttrTransferType DBusConnectionFlagsPropertyInfo = [Gio.Flags.DBusConnectionFlags]
type AttrGetType DBusConnectionFlagsPropertyInfo = [Gio.Flags.DBusConnectionFlags]
type AttrLabel DBusConnectionFlagsPropertyInfo = "flags"
type AttrOrigin DBusConnectionFlagsPropertyInfo = DBusConnection
attrGet = getDBusConnectionFlags
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusConnectionFlags
attrClear = undefined
#endif
getDBusConnectionGuid :: (MonadIO m, IsDBusConnection o) => o -> m T.Text
getDBusConnectionGuid :: o -> m Text
getDBusConnectionGuid obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDBusConnectionGuid" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "guid"
constructDBusConnectionGuid :: (IsDBusConnection o) => T.Text -> IO (GValueConstruct o)
constructDBusConnectionGuid :: Text -> IO (GValueConstruct o)
constructDBusConnectionGuid val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "guid" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGuidPropertyInfo
instance AttrInfo DBusConnectionGuidPropertyInfo where
type AttrAllowedOps DBusConnectionGuidPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusConnectionGuidPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionGuidPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DBusConnectionGuidPropertyInfo = (~) T.Text
type AttrTransferType DBusConnectionGuidPropertyInfo = T.Text
type AttrGetType DBusConnectionGuidPropertyInfo = T.Text
type AttrLabel DBusConnectionGuidPropertyInfo = "guid"
type AttrOrigin DBusConnectionGuidPropertyInfo = DBusConnection
attrGet = getDBusConnectionGuid
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDBusConnectionGuid
attrClear = undefined
#endif
getDBusConnectionStream :: (MonadIO m, IsDBusConnection o) => o -> m Gio.IOStream.IOStream
getDBusConnectionStream :: o -> m IOStream
getDBusConnectionStream obj :: o
obj = IO IOStream -> m IOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe IOStream) -> IO IOStream
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDBusConnectionStream" (IO (Maybe IOStream) -> IO IOStream)
-> IO (Maybe IOStream) -> IO IOStream
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr IOStream -> IOStream)
-> IO (Maybe IOStream)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "stream" ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream
constructDBusConnectionStream :: (IsDBusConnection o, Gio.IOStream.IsIOStream a) => a -> IO (GValueConstruct o)
constructDBusConnectionStream :: a -> IO (GValueConstruct o)
constructDBusConnectionStream val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "stream" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionStreamPropertyInfo
instance AttrInfo DBusConnectionStreamPropertyInfo where
type AttrAllowedOps DBusConnectionStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusConnectionStreamPropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrTransferTypeConstraint DBusConnectionStreamPropertyInfo = Gio.IOStream.IsIOStream
type AttrTransferType DBusConnectionStreamPropertyInfo = Gio.IOStream.IOStream
type AttrGetType DBusConnectionStreamPropertyInfo = Gio.IOStream.IOStream
type AttrLabel DBusConnectionStreamPropertyInfo = "stream"
type AttrOrigin DBusConnectionStreamPropertyInfo = DBusConnection
attrGet = getDBusConnectionStream
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.IOStream.IOStream v
attrConstruct = constructDBusConnectionStream
attrClear = undefined
#endif
getDBusConnectionUniqueName :: (MonadIO m, IsDBusConnection o) => o -> m (Maybe T.Text)
getDBusConnectionUniqueName :: o -> m (Maybe Text)
getDBusConnectionUniqueName obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "unique-name"
#if defined(ENABLE_OVERLOADING)
data DBusConnectionUniqueNamePropertyInfo
instance AttrInfo DBusConnectionUniqueNamePropertyInfo where
type AttrAllowedOps DBusConnectionUniqueNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DBusConnectionUniqueNamePropertyInfo = IsDBusConnection
type AttrSetTypeConstraint DBusConnectionUniqueNamePropertyInfo = (~) ()
type AttrTransferTypeConstraint DBusConnectionUniqueNamePropertyInfo = (~) ()
type AttrTransferType DBusConnectionUniqueNamePropertyInfo = ()
type AttrGetType DBusConnectionUniqueNamePropertyInfo = (Maybe T.Text)
type AttrLabel DBusConnectionUniqueNamePropertyInfo = "unique-name"
type AttrOrigin DBusConnectionUniqueNamePropertyInfo = DBusConnection
attrGet = getDBusConnectionUniqueName
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusConnection
type instance O.AttributeList DBusConnection = DBusConnectionAttributeList
type DBusConnectionAttributeList = ('[ '("address", DBusConnectionAddressPropertyInfo), '("authenticationObserver", DBusConnectionAuthenticationObserverPropertyInfo), '("capabilities", DBusConnectionCapabilitiesPropertyInfo), '("closed", DBusConnectionClosedPropertyInfo), '("exitOnClose", DBusConnectionExitOnClosePropertyInfo), '("flags", DBusConnectionFlagsPropertyInfo), '("guid", DBusConnectionGuidPropertyInfo), '("stream", DBusConnectionStreamPropertyInfo), '("uniqueName", DBusConnectionUniqueNamePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
dBusConnectionAddress :: AttrLabelProxy "address"
dBusConnectionAddress = AttrLabelProxy
dBusConnectionAuthenticationObserver :: AttrLabelProxy "authenticationObserver"
dBusConnectionAuthenticationObserver = AttrLabelProxy
dBusConnectionCapabilities :: AttrLabelProxy "capabilities"
dBusConnectionCapabilities = AttrLabelProxy
dBusConnectionClosed :: AttrLabelProxy "closed"
dBusConnectionClosed = AttrLabelProxy
dBusConnectionExitOnClose :: AttrLabelProxy "exitOnClose"
dBusConnectionExitOnClose = AttrLabelProxy
dBusConnectionFlags :: AttrLabelProxy "flags"
dBusConnectionFlags = AttrLabelProxy
dBusConnectionGuid :: AttrLabelProxy "guid"
dBusConnectionGuid = AttrLabelProxy
dBusConnectionStream :: AttrLabelProxy "stream"
dBusConnectionStream = AttrLabelProxy
dBusConnectionUniqueName :: AttrLabelProxy "uniqueName"
dBusConnectionUniqueName = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DBusConnection = DBusConnectionSignalList
type DBusConnectionSignalList = ('[ '("closed", DBusConnectionClosedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_connection_new_finish" g_dbus_connection_new_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr DBusConnection)
dBusConnectionNewFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m DBusConnection
dBusConnectionNewFinish :: a -> m DBusConnection
dBusConnectionNewFinish res :: a
res = 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 AsyncResult
res' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
IO DBusConnection -> IO () -> IO DBusConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection))
-> (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusConnection)
g_dbus_connection_new_finish Ptr AsyncResult
res'
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionNewFinish" 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
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_connection_new_for_address_finish" g_dbus_connection_new_for_address_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr DBusConnection)
dBusConnectionNewForAddressFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m DBusConnection
dBusConnectionNewForAddressFinish :: a -> m DBusConnection
dBusConnectionNewForAddressFinish res :: a
res = 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 AsyncResult
res' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
IO DBusConnection -> IO () -> IO DBusConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection))
-> (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusConnection)
g_dbus_connection_new_for_address_finish Ptr AsyncResult
res'
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionNewForAddressFinish" 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
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_connection_new_for_address_sync" g_dbus_connection_new_for_address_sync ::
CString ->
CUInt ->
Ptr Gio.DBusAuthObserver.DBusAuthObserver ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr DBusConnection)
dBusConnectionNewForAddressSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusAuthObserver.IsDBusAuthObserver a, Gio.Cancellable.IsCancellable b) =>
T.Text
-> [Gio.Flags.DBusConnectionFlags]
-> Maybe (a)
-> Maybe (b)
-> m DBusConnection
dBusConnectionNewForAddressSync :: Text
-> [DBusConnectionFlags] -> Maybe a -> Maybe b -> m DBusConnection
dBusConnectionNewForAddressSync address :: Text
address flags :: [DBusConnectionFlags]
flags observer :: Maybe a
observer cancellable :: Maybe b
cancellable = 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
CString
address' <- Text -> IO CString
textToCString Text
address
let flags' :: CUInt
flags' = [DBusConnectionFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe a
observer of
Nothing -> Ptr DBusAuthObserver -> IO (Ptr DBusAuthObserver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
forall a. Ptr a
nullPtr
Just jObserver :: a
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- a -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jObserver
Ptr DBusAuthObserver -> IO (Ptr DBusAuthObserver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO DBusConnection -> IO () -> IO DBusConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection))
-> (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a b. (a -> b) -> a -> b
$ CString
-> CUInt
-> Ptr DBusAuthObserver
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusConnection)
g_dbus_connection_new_for_address_sync CString
address' CUInt
flags' Ptr DBusAuthObserver
maybeObserver Ptr Cancellable
maybeCancellable
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionNewForAddressSync" 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
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
observer a -> 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
address'
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
address'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_connection_new_sync" g_dbus_connection_new_sync ::
Ptr Gio.IOStream.IOStream ->
CString ->
CUInt ->
Ptr Gio.DBusAuthObserver.DBusAuthObserver ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr DBusConnection)
dBusConnectionNewSync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.IOStream.IsIOStream a, Gio.DBusAuthObserver.IsDBusAuthObserver b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> [Gio.Flags.DBusConnectionFlags]
-> Maybe (b)
-> Maybe (c)
-> m DBusConnection
dBusConnectionNewSync :: a
-> Maybe Text
-> [DBusConnectionFlags]
-> Maybe b
-> Maybe c
-> m DBusConnection
dBusConnectionNewSync stream :: a
stream guid :: Maybe Text
guid flags :: [DBusConnectionFlags]
flags observer :: Maybe b
observer cancellable :: Maybe c
cancellable = 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 IOStream
stream' <- a -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
maybeGuid <- case Maybe Text
guid of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jGuid :: Text
jGuid -> do
CString
jGuid' <- Text -> IO CString
textToCString Text
jGuid
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jGuid'
let flags' :: CUInt
flags' = [DBusConnectionFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe b
observer of
Nothing -> Ptr DBusAuthObserver -> IO (Ptr DBusAuthObserver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
forall a. Ptr a
nullPtr
Just jObserver :: b
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- b -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jObserver
Ptr DBusAuthObserver -> IO (Ptr DBusAuthObserver)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 DBusConnection -> IO () -> IO DBusConnection
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection))
-> (Ptr (Ptr GError) -> IO (Ptr DBusConnection))
-> IO (Ptr DBusConnection)
forall a b. (a -> b) -> a -> b
$ Ptr IOStream
-> CString
-> CUInt
-> Ptr DBusAuthObserver
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusConnection)
g_dbus_connection_new_sync Ptr IOStream
stream' CString
maybeGuid CUInt
flags' Ptr DBusAuthObserver
maybeObserver Ptr Cancellable
maybeCancellable
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionNewSync" 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
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
observer 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
maybeGuid
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeGuid
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_connection_add_filter" g_dbus_connection_add_filter ::
Ptr DBusConnection ->
FunPtr Gio.Callbacks.C_DBusMessageFilterFunction ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO Word32
dBusConnectionAddFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Gio.Callbacks.DBusMessageFilterFunction
-> m Word32
dBusConnectionAddFilter :: a -> DBusMessageFilterFunction -> m Word32
dBusConnectionAddFilter connection :: a
connection filterFunction :: DBusMessageFilterFunction
filterFunction = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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
FunPtr C_DBusMessageFilterFunction
filterFunction' <- C_DBusMessageFilterFunction
-> IO (FunPtr C_DBusMessageFilterFunction)
Gio.Callbacks.mk_DBusMessageFilterFunction (Maybe (Ptr (FunPtr C_DBusMessageFilterFunction))
-> DBusMessageFilterFunction_WithClosures
-> C_DBusMessageFilterFunction
Gio.Callbacks.wrap_DBusMessageFilterFunction Maybe (Ptr (FunPtr C_DBusMessageFilterFunction))
forall a. Maybe a
Nothing (DBusMessageFilterFunction -> DBusMessageFilterFunction_WithClosures
Gio.Callbacks.drop_closures_DBusMessageFilterFunction DBusMessageFilterFunction
filterFunction))
let userData :: Ptr ()
userData = FunPtr C_DBusMessageFilterFunction -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusMessageFilterFunction
filterFunction'
let userDataFreeFunc :: FunPtr (Ptr a -> IO ())
userDataFreeFunc = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
Word32
result <- Ptr DBusConnection
-> FunPtr C_DBusMessageFilterFunction
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO Word32
g_dbus_connection_add_filter Ptr DBusConnection
connection' FunPtr C_DBusMessageFilterFunction
filterFunction' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
userDataFreeFunc
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data DBusConnectionAddFilterMethodInfo
instance (signature ~ (Gio.Callbacks.DBusMessageFilterFunction -> m Word32), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionAddFilterMethodInfo a signature where
overloadedMethod = dBusConnectionAddFilter
#endif
foreign import ccall "g_dbus_connection_call" g_dbus_connection_call ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr GLib.VariantType.VariantType ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionCall ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (GLib.VariantType.VariantType)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionCall :: a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionCall connection :: a
connection busName :: Maybe Text
busName objectPath :: Text
objectPath interfaceName :: Text
interfaceName methodName :: Text
methodName parameters :: Maybe GVariant
parameters replyType :: Maybe VariantType
replyType flags :: [DBusCallFlags]
flags timeoutMsec :: Int32
timeoutMsec cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBusName :: Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBusName'
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameters :: 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'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
nullPtr
Just jReplyType :: VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusConnection
-> CString
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr VariantType
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_call Ptr DBusConnection
connection' CString
maybeBusName CString
objectPath' CString
interfaceName' CString
methodName' Ptr GVariant
maybeParameters Ptr VariantType
maybeReplyType 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
connection
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 VariantType -> (VariantType -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType VariantType -> 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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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 DBusConnectionCallMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GLib.VariantType.VariantType) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionCallMethodInfo a signature where
overloadedMethod = dBusConnectionCall
#endif
foreign import ccall "g_dbus_connection_call_finish" g_dbus_connection_call_finish ::
Ptr DBusConnection ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusConnectionCallFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GVariant
dBusConnectionCallFinish :: a -> b -> m GVariant
dBusConnectionCallFinish connection :: a
connection res :: 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
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 DBusConnection
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr GVariant)
g_dbus_connection_call_finish Ptr DBusConnection
connection' Ptr AsyncResult
res'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionCallFinish" 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
connection
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 DBusConnectionCallFinishMethodInfo
instance (signature ~ (b -> m GVariant), MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusConnectionCallFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCallFinish
#endif
foreign import ccall "g_dbus_connection_call_sync" g_dbus_connection_call_sync ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr GLib.VariantType.VariantType ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusConnectionCallSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (GLib.VariantType.VariantType)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> m GVariant
dBusConnectionCallSync :: a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> m GVariant
dBusConnectionCallSync connection :: a
connection busName :: Maybe Text
busName objectPath :: Text
objectPath interfaceName :: Text
interfaceName methodName :: Text
methodName parameters :: Maybe GVariant
parameters replyType :: Maybe VariantType
replyType flags :: [DBusCallFlags]
flags timeoutMsec :: Int32
timeoutMsec cancellable :: 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBusName :: Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBusName'
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameters :: 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'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
nullPtr
Just jReplyType :: VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
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 DBusConnection
-> CString
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr VariantType
-> CUInt
-> Int32
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_connection_call_sync Ptr DBusConnection
connection' CString
maybeBusName CString
objectPath' CString
interfaceName' CString
methodName' Ptr GVariant
maybeParameters Ptr VariantType
maybeReplyType CUInt
flags' Int32
timeoutMsec Ptr Cancellable
maybeCancellable
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionCallSync" 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
connection
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 VariantType -> (VariantType -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType VariantType -> 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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
methodName'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionCallSyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GLib.VariantType.VariantType) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> m GVariant), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionCallSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCallSync
#endif
foreign import ccall "g_dbus_connection_call_with_unix_fd_list" g_dbus_connection_call_with_unix_fd_list ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr GLib.VariantType.VariantType ->
CUInt ->
Int32 ->
Ptr Gio.UnixFDList.UnixFDList ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionCallWithUnixFdList ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (GLib.VariantType.VariantType)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionCallWithUnixFdList :: a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionCallWithUnixFdList connection :: a
connection busName :: Maybe Text
busName objectPath :: Text
objectPath interfaceName :: Text
interfaceName methodName :: Text
methodName parameters :: Maybe GVariant
parameters replyType :: Maybe VariantType
replyType flags :: [DBusCallFlags]
flags timeoutMsec :: Int32
timeoutMsec fdList :: Maybe b
fdList cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBusName :: Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBusName'
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameters :: 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'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
nullPtr
Just jReplyType :: VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
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
Nothing -> Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
forall a. Ptr a
nullPtr
Just jFdList :: 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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusConnection
-> CString
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr VariantType
-> CUInt
-> Int32
-> Ptr UnixFDList
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_call_with_unix_fd_list Ptr DBusConnection
connection' CString
maybeBusName CString
objectPath' CString
interfaceName' CString
methodName' Ptr GVariant
maybeParameters Ptr VariantType
maybeReplyType 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
connection
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 VariantType -> (VariantType -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType VariantType -> 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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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 DBusConnectionCallWithUnixFdListMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GLib.VariantType.VariantType) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusConnection a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DBusConnectionCallWithUnixFdListMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdList
#endif
foreign import ccall "g_dbus_connection_call_with_unix_fd_list_finish" g_dbus_connection_call_with_unix_fd_list_finish ::
Ptr DBusConnection ->
Ptr (Ptr Gio.UnixFDList.UnixFDList) ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusConnectionCallWithUnixFdListFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((GVariant, Gio.UnixFDList.UnixFDList))
dBusConnectionCallWithUnixFdListFinish :: a -> b -> m (GVariant, UnixFDList)
dBusConnectionCallWithUnixFdListFinish connection :: a
connection res :: 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr (Ptr UnixFDList)
outFdList <- IO (Ptr (Ptr UnixFDList))
forall a. Storable a => IO (Ptr a)
allocMem :: 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 DBusConnection
-> Ptr (Ptr UnixFDList)
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_connection_call_with_unix_fd_list_finish Ptr DBusConnection
connection' Ptr (Ptr UnixFDList)
outFdList Ptr AsyncResult
res'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionCallWithUnixFdListFinish" 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
connection
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 DBusConnectionCallWithUnixFdListFinishMethodInfo
instance (signature ~ (b -> m ((GVariant, Gio.UnixFDList.UnixFDList))), MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusConnectionCallWithUnixFdListFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdListFinish
#endif
foreign import ccall "g_dbus_connection_call_with_unix_fd_list_sync" g_dbus_connection_call_with_unix_fd_list_sync ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr GLib.VariantType.VariantType ->
CUInt ->
Int32 ->
Ptr Gio.UnixFDList.UnixFDList ->
Ptr (Ptr Gio.UnixFDList.UnixFDList) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
dBusConnectionCallWithUnixFdListSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (GLib.VariantType.VariantType)
-> [Gio.Flags.DBusCallFlags]
-> Int32
-> Maybe (b)
-> Maybe (c)
-> m ((GVariant, Gio.UnixFDList.UnixFDList))
dBusConnectionCallWithUnixFdListSync :: a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> m (GVariant, UnixFDList)
dBusConnectionCallWithUnixFdListSync connection :: a
connection busName :: Maybe Text
busName objectPath :: Text
objectPath interfaceName :: Text
interfaceName methodName :: Text
methodName parameters :: Maybe GVariant
parameters replyType :: Maybe VariantType
replyType flags :: [DBusCallFlags]
flags timeoutMsec :: Int32
timeoutMsec fdList :: Maybe b
fdList cancellable :: 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBusName :: Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBusName'
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
CString
methodName' <- Text -> IO CString
textToCString Text
methodName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameters :: 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'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
nullPtr
Just jReplyType :: VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
Ptr VariantType -> IO (Ptr VariantType)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
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
Nothing -> Ptr UnixFDList -> IO (Ptr UnixFDList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
forall a. Ptr a
nullPtr
Just jFdList :: 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)
allocMem :: IO (Ptr (Ptr Gio.UnixFDList.UnixFDList))
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 DBusConnection
-> CString
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr VariantType
-> CUInt
-> Int32
-> Ptr UnixFDList
-> Ptr (Ptr UnixFDList)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GVariant)
g_dbus_connection_call_with_unix_fd_list_sync Ptr DBusConnection
connection' CString
maybeBusName CString
objectPath' CString
interfaceName' CString
methodName' Ptr GVariant
maybeParameters Ptr VariantType
maybeReplyType 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 "dBusConnectionCallWithUnixFdListSync" 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
connection
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 VariantType -> (VariantType -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType VariantType -> 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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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
maybeBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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 DBusConnectionCallWithUnixFdListSyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GLib.VariantType.VariantType) -> [Gio.Flags.DBusCallFlags] -> Int32 -> Maybe (b) -> Maybe (c) -> m ((GVariant, Gio.UnixFDList.UnixFDList))), MonadIO m, IsDBusConnection a, Gio.UnixFDList.IsUnixFDList b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DBusConnectionCallWithUnixFdListSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdListSync
#endif
foreign import ccall "g_dbus_connection_close" g_dbus_connection_close ::
Ptr DBusConnection ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionClose ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionClose :: a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dBusConnectionClose connection :: a
connection cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusConnection
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_close Ptr DBusConnection
connection' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionCloseMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionCloseMethodInfo a signature where
overloadedMethod = dBusConnectionClose
#endif
foreign import ccall "g_dbus_connection_close_finish" g_dbus_connection_close_finish ::
Ptr DBusConnection ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionCloseFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
dBusConnectionCloseFinish :: a -> b -> m ()
dBusConnectionCloseFinish connection :: a
connection res :: b
res = 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
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_dbus_connection_close_finish Ptr DBusConnection
connection' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionCloseFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusConnectionCloseFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCloseFinish
#endif
foreign import ccall "g_dbus_connection_close_sync" g_dbus_connection_close_sync ::
Ptr DBusConnection ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionCloseSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
dBusConnectionCloseSync :: a -> Maybe b -> m ()
dBusConnectionCloseSync connection :: a
connection cancellable :: Maybe b
cancellable = 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
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
g_dbus_connection_close_sync Ptr DBusConnection
connection' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionCloseSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionCloseSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCloseSync
#endif
foreign import ccall "g_dbus_connection_emit_signal" g_dbus_connection_emit_signal ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionEmitSignal ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Maybe (T.Text)
-> T.Text
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> m ()
dBusConnectionEmitSignal :: a -> Maybe Text -> Text -> Text -> Text -> Maybe GVariant -> m ()
dBusConnectionEmitSignal connection :: a
connection destinationBusName :: Maybe Text
destinationBusName objectPath :: Text
objectPath interfaceName :: Text
interfaceName signalName :: Text
signalName parameters :: Maybe GVariant
parameters = 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
CString
maybeDestinationBusName <- case Maybe Text
destinationBusName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jDestinationBusName :: Text
jDestinationBusName -> do
CString
jDestinationBusName' <- Text -> IO CString
textToCString Text
jDestinationBusName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jDestinationBusName'
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
CString
interfaceName' <- Text -> IO CString
textToCString Text
interfaceName
CString
signalName' <- Text -> IO CString
textToCString Text
signalName
Ptr GVariant
maybeParameters <- case Maybe GVariant
parameters of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameters :: 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'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CString
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr (Ptr GError)
-> IO CInt
g_dbus_connection_emit_signal Ptr DBusConnection
connection' CString
maybeDestinationBusName CString
objectPath' CString
interfaceName' CString
signalName' Ptr GVariant
maybeParameters
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDestinationBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
signalName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDestinationBusName
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
signalName'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionEmitSignalMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionEmitSignalMethodInfo a signature where
overloadedMethod = dBusConnectionEmitSignal
#endif
foreign import ccall "g_dbus_connection_export_action_group" g_dbus_connection_export_action_group ::
Ptr DBusConnection ->
CString ->
Ptr Gio.ActionGroup.ActionGroup ->
Ptr (Ptr GError) ->
IO Word32
dBusConnectionExportActionGroup ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.ActionGroup.IsActionGroup b) =>
a
-> T.Text
-> b
-> m Word32
dBusConnectionExportActionGroup :: a -> Text -> b -> m Word32
dBusConnectionExportActionGroup connection :: a
connection objectPath :: Text
objectPath actionGroup :: b
actionGroup = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr ActionGroup
actionGroup' <- b -> IO (Ptr ActionGroup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
actionGroup
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CString -> Ptr ActionGroup -> Ptr (Ptr GError) -> IO Word32
g_dbus_connection_export_action_group Ptr DBusConnection
connection' CString
objectPath' Ptr ActionGroup
actionGroup'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
actionGroup
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionExportActionGroupMethodInfo
instance (signature ~ (T.Text -> b -> m Word32), MonadIO m, IsDBusConnection a, Gio.ActionGroup.IsActionGroup b) => O.MethodInfo DBusConnectionExportActionGroupMethodInfo a signature where
overloadedMethod = dBusConnectionExportActionGroup
#endif
foreign import ccall "g_dbus_connection_export_menu_model" ::
Ptr DBusConnection ->
CString ->
Ptr Gio.MenuModel.MenuModel ->
Ptr (Ptr GError) ->
IO Word32
dBusConnectionExportMenuModel ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.MenuModel.IsMenuModel b) =>
a
-> T.Text
-> b
-> m Word32
connection :: a
connection objectPath :: Text
objectPath menu :: b
menu = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr MenuModel
menu' <- b -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
menu
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CString -> Ptr MenuModel -> Ptr (Ptr GError) -> IO Word32
g_dbus_connection_export_menu_model Ptr DBusConnection
connection' CString
objectPath' Ptr MenuModel
menu'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
menu
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionExportMenuModelMethodInfo
instance (signature ~ (T.Text -> b -> m Word32), MonadIO m, IsDBusConnection a, Gio.MenuModel.IsMenuModel b) => O.MethodInfo DBusConnectionExportMenuModelMethodInfo a signature where
overloadedMethod = dBusConnectionExportMenuModel
#endif
foreign import ccall "g_dbus_connection_flush" g_dbus_connection_flush ::
Ptr DBusConnection ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionFlush ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionFlush :: a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dBusConnectionFlush connection :: a
connection cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DBusConnection
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_flush Ptr DBusConnection
connection' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionFlushMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionFlushMethodInfo a signature where
overloadedMethod = dBusConnectionFlush
#endif
foreign import ccall "g_dbus_connection_flush_finish" g_dbus_connection_flush_finish ::
Ptr DBusConnection ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionFlushFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
dBusConnectionFlushFinish :: a -> b -> m ()
dBusConnectionFlushFinish connection :: a
connection res :: b
res = 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
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_dbus_connection_flush_finish Ptr DBusConnection
connection' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionFlushFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DBusConnectionFlushFinishMethodInfo a signature where
overloadedMethod = dBusConnectionFlushFinish
#endif
foreign import ccall "g_dbus_connection_flush_sync" g_dbus_connection_flush_sync ::
Ptr DBusConnection ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionFlushSync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
dBusConnectionFlushSync :: a -> Maybe b -> m ()
dBusConnectionFlushSync connection :: a
connection cancellable :: Maybe b
cancellable = 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
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
g_dbus_connection_flush_sync Ptr DBusConnection
connection' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionFlushSyncMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDBusConnection a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DBusConnectionFlushSyncMethodInfo a signature where
overloadedMethod = dBusConnectionFlushSync
#endif
foreign import ccall "g_dbus_connection_get_capabilities" g_dbus_connection_get_capabilities ::
Ptr DBusConnection ->
IO CUInt
dBusConnectionGetCapabilities ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m [Gio.Flags.DBusCapabilityFlags]
dBusConnectionGetCapabilities :: a -> m [DBusCapabilityFlags]
dBusConnectionGetCapabilities connection :: a
connection = IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags])
-> IO [DBusCapabilityFlags] -> m [DBusCapabilityFlags]
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
CUInt
result <- Ptr DBusConnection -> IO CUInt
g_dbus_connection_get_capabilities Ptr DBusConnection
connection'
let result' :: [DBusCapabilityFlags]
result' = CUInt -> [DBusCapabilityFlags]
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
connection
[DBusCapabilityFlags] -> IO [DBusCapabilityFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusCapabilityFlags]
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetCapabilitiesMethodInfo
instance (signature ~ (m [Gio.Flags.DBusCapabilityFlags]), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionGetCapabilitiesMethodInfo a signature where
overloadedMethod = dBusConnectionGetCapabilities
#endif
foreign import ccall "g_dbus_connection_get_exit_on_close" g_dbus_connection_get_exit_on_close ::
Ptr DBusConnection ->
IO CInt
dBusConnectionGetExitOnClose ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m Bool
dBusConnectionGetExitOnClose :: a -> m Bool
dBusConnectionGetExitOnClose connection :: a
connection = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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
CInt
result <- Ptr DBusConnection -> IO CInt
g_dbus_connection_get_exit_on_close Ptr DBusConnection
connection'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetExitOnCloseMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionGetExitOnCloseMethodInfo a signature where
overloadedMethod = dBusConnectionGetExitOnClose
#endif
foreign import ccall "g_dbus_connection_get_flags" g_dbus_connection_get_flags ::
Ptr DBusConnection ->
IO CUInt
dBusConnectionGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m [Gio.Flags.DBusConnectionFlags]
dBusConnectionGetFlags :: a -> m [DBusConnectionFlags]
dBusConnectionGetFlags connection :: a
connection = IO [DBusConnectionFlags] -> m [DBusConnectionFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DBusConnectionFlags] -> m [DBusConnectionFlags])
-> IO [DBusConnectionFlags] -> m [DBusConnectionFlags]
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
CUInt
result <- Ptr DBusConnection -> IO CUInt
g_dbus_connection_get_flags Ptr DBusConnection
connection'
let result' :: [DBusConnectionFlags]
result' = CUInt -> [DBusConnectionFlags]
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
connection
[DBusConnectionFlags] -> IO [DBusConnectionFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusConnectionFlags]
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.DBusConnectionFlags]), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionGetFlagsMethodInfo a signature where
overloadedMethod = dBusConnectionGetFlags
#endif
foreign import ccall "g_dbus_connection_get_guid" g_dbus_connection_get_guid ::
Ptr DBusConnection ->
IO CString
dBusConnectionGetGuid ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m T.Text
dBusConnectionGetGuid :: a -> m Text
dBusConnectionGetGuid connection :: a
connection = 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 DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
result <- Ptr DBusConnection -> IO CString
g_dbus_connection_get_guid Ptr DBusConnection
connection'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusConnectionGetGuid" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetGuidMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionGetGuidMethodInfo a signature where
overloadedMethod = dBusConnectionGetGuid
#endif
foreign import ccall "g_dbus_connection_get_last_serial" g_dbus_connection_get_last_serial ::
Ptr DBusConnection ->
IO Word32
dBusConnectionGetLastSerial ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m Word32
dBusConnectionGetLastSerial :: a -> m Word32
dBusConnectionGetLastSerial connection :: a
connection = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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
Word32
result <- Ptr DBusConnection -> IO Word32
g_dbus_connection_get_last_serial Ptr DBusConnection
connection'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetLastSerialMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDBusConnection a) => O.MethodInfo DBusConnectionGetLastSerialMethodInfo a signature where
overloadedMethod = dBusConnectionGetLastSerial
#endif
foreign import ccall "g_dbus_connection_get_peer_credentials" g_dbus_connection_get_peer_credentials ::
Ptr DBusConnection