{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
#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 ,
DBusConnectionClosedCallback ,
#if defined(ENABLE_OVERLOADING)
DBusConnectionClosedSignalInfo ,
#endif
afterDBusConnectionClosed ,
onDBusConnectionClosed ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
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 (SP.ManagedPtr DBusConnection)
deriving (DBusConnection -> DBusConnection -> Bool
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)
instance SP.ManagedPtrNewtype DBusConnection where
toManagedPtr :: DBusConnection -> ManagedPtr DBusConnection
toManagedPtr (DBusConnection ManagedPtr DBusConnection
p) = ManagedPtr DBusConnection
p
foreign import ccall "g_dbus_connection_get_type"
c_g_dbus_connection_get_type :: IO B.Types.GType
instance B.Types.TypedObject DBusConnection where
glibType :: IO GType
glibType = IO GType
c_g_dbus_connection_get_type
instance B.Types.GObject DBusConnection
class (SP.GObject o, O.IsDescendantOf DBusConnection o) => IsDBusConnection o
instance (SP.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 :: (MIO.MonadIO m, IsDBusConnection o) => o -> m DBusConnection
toDBusConnection :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m DBusConnection
toDBusConnection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DBusConnection -> DBusConnection
DBusConnection
instance B.GValue.IsGValue (Maybe DBusConnection) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_dbus_connection_get_type
gvalueSet_ :: Ptr GValue -> Maybe DBusConnection -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DBusConnection
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr DBusConnection)
gvalueSet_ Ptr GValue
gv (P.Just DBusConnection
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusConnection
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DBusConnection)
gvalueGet_ Ptr GValue
gv = do
Ptr DBusConnection
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DBusConnection)
if Ptr DBusConnection
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> 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
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusConnectionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDBusConnectionMethod t DBusConnection, O.OverloadedMethod info DBusConnection p, R.HasField t DBusConnection p) => R.HasField t DBusConnection p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDBusConnectionMethod t DBusConnection, O.OverloadedMethodInfo info DBusConnection) => OL.IsLabel t (O.MethodProxy info DBusConnection) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type DBusConnectionClosedCallback =
Bool
-> Maybe GError
-> IO ()
type C_DBusConnectionClosedCallback =
Ptr DBusConnection ->
CInt ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusConnectionClosedCallback :: C_DBusConnectionClosedCallback -> IO (FunPtr C_DBusConnectionClosedCallback)
wrap_DBusConnectionClosedCallback ::
GObject a => (a -> DBusConnectionClosedCallback) ->
C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback :: forall a.
GObject a =>
(a -> DBusConnectionClosedCallback)
-> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback a -> DBusConnectionClosedCallback
gi'cb Ptr DBusConnection
gi'selfPtr CInt
remotePeerVanished Ptr GError
error_ Ptr ()
_ = do
let remotePeerVanished' :: Bool
remotePeerVanished' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
remotePeerVanished
Maybe GError
maybeError_ <-
if Ptr GError
error_ forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr
then forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
Nothing
else do
GError
error_' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall a. a -> Maybe a
Just GError
error_'
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DBusConnection
gi'selfPtr forall a b. (a -> b) -> a -> b
$ \DBusConnection
gi'self -> a -> DBusConnectionClosedCallback
gi'cb (coerce :: forall a b. Coercible a b => a -> b
Coerce.coerce DBusConnection
gi'self) Bool
remotePeerVanished' Maybe GError
maybeError_
onDBusConnectionClosed :: (IsDBusConnection a, MonadIO m) => a -> ((?self :: a) => DBusConnectionClosedCallback) -> m SignalHandlerId
onDBusConnectionClosed :: forall a (m :: * -> *).
(IsDBusConnection a, MonadIO m) =>
a
-> ((?self::a) => DBusConnectionClosedCallback)
-> m SignalHandlerId
onDBusConnectionClosed a
obj (?self::a) => DBusConnectionClosedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DBusConnectionClosedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DBusConnectionClosedCallback
cb
let wrapped' :: C_DBusConnectionClosedCallback
wrapped' = forall a.
GObject a =>
(a -> DBusConnectionClosedCallback)
-> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback a -> DBusConnectionClosedCallback
wrapped
FunPtr C_DBusConnectionClosedCallback
wrapped'' <- C_DBusConnectionClosedCallback
-> IO (FunPtr C_DBusConnectionClosedCallback)
mk_DBusConnectionClosedCallback C_DBusConnectionClosedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_DBusConnectionClosedCallback
wrapped'' SignalConnectMode
SignalConnectBefore forall a. Maybe a
Nothing
afterDBusConnectionClosed :: (IsDBusConnection a, MonadIO m) => a -> ((?self :: a) => DBusConnectionClosedCallback) -> m SignalHandlerId
afterDBusConnectionClosed :: forall a (m :: * -> *).
(IsDBusConnection a, MonadIO m) =>
a
-> ((?self::a) => DBusConnectionClosedCallback)
-> m SignalHandlerId
afterDBusConnectionClosed a
obj (?self::a) => DBusConnectionClosedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DBusConnectionClosedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DBusConnectionClosedCallback
cb
let wrapped' :: C_DBusConnectionClosedCallback
wrapped' = forall a.
GObject a =>
(a -> DBusConnectionClosedCallback)
-> C_DBusConnectionClosedCallback
wrap_DBusConnectionClosedCallback a -> DBusConnectionClosedCallback
wrapped
FunPtr C_DBusConnectionClosedCallback
wrapped'' <- C_DBusConnectionClosedCallback
-> IO (FunPtr C_DBusConnectionClosedCallback)
mk_DBusConnectionClosedCallback C_DBusConnectionClosedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_DBusConnectionClosedCallback
wrapped'' SignalConnectMode
SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection::closed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:signal:closed"})
#endif
constructDBusConnectionAddress :: (IsDBusConnection o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDBusConnectionAddress :: forall o (m :: * -> *).
(IsDBusConnection o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructDBusConnectionAddress Text
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"address" (forall a. a -> Maybe a
P.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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.address"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:address"
})
#endif
constructDBusConnectionAuthenticationObserver :: (IsDBusConnection o, MIO.MonadIO m, Gio.DBusAuthObserver.IsDBusAuthObserver a) => a -> m (GValueConstruct o)
constructDBusConnectionAuthenticationObserver :: forall o (m :: * -> *) a.
(IsDBusConnection o, MonadIO m, IsDBusAuthObserver a) =>
a -> m (GValueConstruct o)
constructDBusConnectionAuthenticationObserver a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"authentication-observer" (forall a. a -> Maybe a
P.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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.authenticationObserver"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:authenticationObserver"
})
#endif
getDBusConnectionCapabilities :: (MonadIO m, IsDBusConnection o) => o -> m [Gio.Flags.DBusCapabilityFlags]
getDBusConnectionCapabilities :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m [DBusCapabilityFlags]
getDBusConnectionCapabilities o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.capabilities"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:capabilities"
})
#endif
getDBusConnectionClosed :: (MonadIO m, IsDBusConnection o) => o -> m Bool
getDBusConnectionClosed :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m Bool
getDBusConnectionClosed o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.closed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:closed"
})
#endif
getDBusConnectionExitOnClose :: (MonadIO m, IsDBusConnection o) => o -> m Bool
getDBusConnectionExitOnClose :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m Bool
getDBusConnectionExitOnClose o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"exit-on-close"
setDBusConnectionExitOnClose :: (MonadIO m, IsDBusConnection o) => o -> Bool -> m ()
setDBusConnectionExitOnClose :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> Bool -> m ()
setDBusConnectionExitOnClose o
obj Bool
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"exit-on-close" Bool
val
constructDBusConnectionExitOnClose :: (IsDBusConnection o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructDBusConnectionExitOnClose :: forall o (m :: * -> *).
(IsDBusConnection o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructDBusConnectionExitOnClose Bool
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.exitOnClose"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:exitOnClose"
})
#endif
getDBusConnectionFlags :: (MonadIO m, IsDBusConnection o) => o -> m [Gio.Flags.DBusConnectionFlags]
getDBusConnectionFlags :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m [DBusConnectionFlags]
getDBusConnectionFlags o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"flags"
constructDBusConnectionFlags :: (IsDBusConnection o, MIO.MonadIO m) => [Gio.Flags.DBusConnectionFlags] -> m (GValueConstruct o)
constructDBusConnectionFlags :: forall o (m :: * -> *).
(IsDBusConnection o, MonadIO m) =>
[DBusConnectionFlags] -> m (GValueConstruct o)
constructDBusConnectionFlags [DBusConnectionFlags]
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.flags"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:flags"
})
#endif
getDBusConnectionGuid :: (MonadIO m, IsDBusConnection o) => o -> m T.Text
getDBusConnectionGuid :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m Text
getDBusConnectionGuid o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDBusConnectionGuid" forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"guid"
constructDBusConnectionGuid :: (IsDBusConnection o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDBusConnectionGuid :: forall o (m :: * -> *).
(IsDBusConnection o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructDBusConnectionGuid Text
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"guid" (forall a. a -> Maybe a
P.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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.guid"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:guid"
})
#endif
getDBusConnectionStream :: (MonadIO m, IsDBusConnection o) => o -> m Gio.IOStream.IOStream
getDBusConnectionStream :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m IOStream
getDBusConnectionStream o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDBusConnectionStream" forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"stream" ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream
constructDBusConnectionStream :: (IsDBusConnection o, MIO.MonadIO m, Gio.IOStream.IsIOStream a) => a -> m (GValueConstruct o)
constructDBusConnectionStream :: forall o (m :: * -> *) a.
(IsDBusConnection o, MonadIO m, IsIOStream a) =>
a -> m (GValueConstruct o)
constructDBusConnectionStream a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"stream" (forall a. a -> Maybe a
P.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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.stream"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:stream"
})
#endif
getDBusConnectionUniqueName :: (MonadIO m, IsDBusConnection o) => o -> m (Maybe T.Text)
getDBusConnectionUniqueName :: forall (m :: * -> *) o.
(MonadIO m, IsDBusConnection o) =>
o -> m (Maybe Text)
getDBusConnectionUniqueName o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.uniqueName"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#g:attr:uniqueName"
})
#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, DK.Type)])
#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, DK.Type)])
#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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m DBusConnection
dBusConnectionNewFinish a
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusConnection)
g_dbus_connection_new_finish Ptr AsyncResult
res'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionNewFinish" Ptr DBusConnection
result
DBusConnection
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m DBusConnection
dBusConnectionNewForAddressFinish a
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionNewForAddressFinish" Ptr DBusConnection
result
DBusConnection
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusAuthObserver a, IsCancellable b) =>
Text
-> [DBusConnectionFlags] -> Maybe a -> Maybe b -> m DBusConnection
dBusConnectionNewForAddressSync Text
address [DBusConnectionFlags]
flags Maybe a
observer Maybe b
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
CString
address' <- Text -> IO CString
textToCString Text
address
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe a
observer of
Maybe a
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just a
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jObserver
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionNewForAddressSync" Ptr DBusConnection
result
DBusConnection
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
observer forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
address'
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsIOStream a, IsDBusAuthObserver b,
IsCancellable c) =>
a
-> Maybe Text
-> [DBusConnectionFlags]
-> Maybe b
-> Maybe c
-> m DBusConnection
dBusConnectionNewSync a
stream Maybe Text
guid [DBusConnectionFlags]
flags Maybe b
observer Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr IOStream
stream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
maybeGuid <- case Maybe Text
guid of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jGuid -> do
CString
jGuid' <- Text -> IO CString
textToCString Text
jGuid
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jGuid'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe b
observer of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jObserver
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusConnection
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionNewSync" Ptr DBusConnection
result
DBusConnection
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusConnection -> DBusConnection
DBusConnection) Ptr DBusConnection
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
observer forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeGuid
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
) (do
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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> DBusMessageFilterFunction -> m Word32
dBusConnectionAddFilter a
connection DBusMessageFilterFunction
filterFunction = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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 forall a. Maybe a
Nothing (DBusMessageFilterFunction -> DBusMessageFilterFunction_WithClosures
Gio.Callbacks.drop_closures_DBusMessageFilterFunction DBusMessageFilterFunction
filterFunction))
let userData :: Ptr ()
userData = forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusMessageFilterFunction
filterFunction'
let userDataFreeFunc :: FunPtr (Ptr a -> IO ())
userDataFreeFunc = forall a. FunPtr (Ptr a -> IO ())
SP.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 forall a. FunPtr (Ptr a -> IO ())
userDataFreeFunc
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionAddFilterMethodInfo a signature where
overloadedMethod = dBusConnectionAddFilter
instance O.OverloadedMethodInfo DBusConnectionAddFilterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionAddFilter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionCall a
connection Maybe Text
busName Text
objectPath Text
interfaceName Text
methodName Maybe GVariant
parameters Maybe VariantType
replyType [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
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
Maybe GVariant
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Maybe VariantType
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = 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 forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
methodName'
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.OverloadedMethod DBusConnectionCallMethodInfo a signature where
overloadedMethod = dBusConnectionCall
instance O.OverloadedMethodInfo DBusConnectionCallMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCall",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsAsyncResult b) =>
a -> b -> m GVariant
dBusConnectionCallFinish a
connection b
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionCallFinish" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
) (do
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.OverloadedMethod DBusConnectionCallFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCallFinish
instance O.OverloadedMethodInfo DBusConnectionCallFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCallFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> m GVariant
dBusConnectionCallSync a
connection Maybe Text
busName Text
objectPath Text
interfaceName Text
methodName Maybe GVariant
parameters Maybe VariantType
replyType [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
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
Maybe GVariant
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Maybe VariantType
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionCallSync" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
methodName'
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
) (do
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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.OverloadedMethod DBusConnectionCallSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCallSync
instance O.OverloadedMethodInfo DBusConnectionCallSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCallSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDBusConnection a, IsUnixFDList b,
IsCancellable c) =>
a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionCallWithUnixFdList a
connection Maybe Text
busName Text
objectPath Text
interfaceName Text
methodName Maybe GVariant
parameters Maybe VariantType
replyType [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
fdList Maybe c
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
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
Maybe GVariant
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Maybe VariantType
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr UnixFDList
maybeFdList <- case Maybe b
fdList of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jFdList -> do
Ptr UnixFDList
jFdList' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFdList
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
jFdList'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = 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 forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
fdList forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
methodName'
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.OverloadedMethod DBusConnectionCallWithUnixFdListMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdList
instance O.OverloadedMethodInfo DBusConnectionCallWithUnixFdListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCallWithUnixFdList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsAsyncResult b) =>
a -> b -> m (GVariant, UnixFDList)
dBusConnectionCallWithUnixFdListFinish a
connection b
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr (Ptr UnixFDList)
outFdList <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gio.UnixFDList.UnixFDList))
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionCallWithUnixFdListFinish" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
Ptr UnixFDList
outFdList' <- forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr UnixFDList)
outFdList
UnixFDList
outFdList'' <- (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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
forall (m :: * -> *) a. Monad m => a -> m a
return (GVariant
result', UnixFDList
outFdList'')
) (do
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.OverloadedMethod DBusConnectionCallWithUnixFdListFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdListFinish
instance O.OverloadedMethodInfo DBusConnectionCallWithUnixFdListFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCallWithUnixFdListFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDBusConnection a, IsUnixFDList b,
IsCancellable c) =>
a
-> Maybe Text
-> Text
-> Text
-> Text
-> Maybe GVariant
-> Maybe VariantType
-> [DBusCallFlags]
-> Int32
-> Maybe b
-> Maybe c
-> m (GVariant, UnixFDList)
dBusConnectionCallWithUnixFdListSync a
connection Maybe Text
busName Text
objectPath Text
interfaceName Text
methodName Maybe GVariant
parameters Maybe VariantType
replyType [DBusCallFlags]
flags Int32
timeoutMsec Maybe b
fdList Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeBusName <- case Maybe Text
busName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jBusName -> do
CString
jBusName' <- Text -> IO CString
textToCString Text
jBusName
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
Maybe GVariant
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
Ptr VariantType
maybeReplyType <- case Maybe VariantType
replyType of
Maybe VariantType
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just VariantType
jReplyType -> do
Ptr VariantType
jReplyType' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
jReplyType
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
jReplyType'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusCallFlags]
flags
Ptr UnixFDList
maybeFdList <- case Maybe b
fdList of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jFdList -> do
Ptr UnixFDList
jFdList' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFdList
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnixFDList
jFdList'
Ptr (Ptr UnixFDList)
outFdList <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gio.UnixFDList.UnixFDList))
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionCallWithUnixFdListSync" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
Ptr UnixFDList
outFdList' <- forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr UnixFDList)
outFdList
UnixFDList
outFdList'' <- (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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VariantType
replyType forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
fdList forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
methodName'
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr UnixFDList)
outFdList
forall (m :: * -> *) a. Monad m => a -> m a
return (GVariant
result', UnixFDList
outFdList'')
) (do
forall a. Ptr a -> IO ()
freeMem CString
maybeBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
methodName'
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.OverloadedMethod DBusConnectionCallWithUnixFdListSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCallWithUnixFdListSync
instance O.OverloadedMethodInfo DBusConnectionCallWithUnixFdListSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCallWithUnixFdListSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dBusConnectionClose a
connection Maybe b
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = 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 forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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.OverloadedMethod DBusConnectionCloseMethodInfo a signature where
overloadedMethod = dBusConnectionClose
instance O.OverloadedMethodInfo DBusConnectionCloseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionClose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsAsyncResult b) =>
a -> b -> m ()
dBusConnectionCloseFinish a
connection b
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
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.OverloadedMethod DBusConnectionCloseFinishMethodInfo a signature where
overloadedMethod = dBusConnectionCloseFinish
instance O.OverloadedMethodInfo DBusConnectionCloseFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCloseFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a -> Maybe b -> m ()
dBusConnectionCloseSync a
connection Maybe b
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
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.OverloadedMethod DBusConnectionCloseSyncMethodInfo a signature where
overloadedMethod = dBusConnectionCloseSync
instance O.OverloadedMethodInfo DBusConnectionCloseSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionCloseSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Maybe Text -> Text -> Text -> Text -> Maybe GVariant -> m ()
dBusConnectionEmitSignal a
connection Maybe Text
destinationBusName Text
objectPath Text
interfaceName Text
signalName Maybe GVariant
parameters = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeDestinationBusName <- case Maybe Text
destinationBusName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jDestinationBusName -> do
CString
jDestinationBusName' <- Text -> IO CString
textToCString Text
jDestinationBusName
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
Maybe GVariant
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GVariant
jParameters -> do
Ptr GVariant
jParameters' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameters
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameters'
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameters forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeDestinationBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
forall a. Ptr a -> IO ()
freeMem CString
signalName'
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
forall a. Ptr a -> IO ()
freeMem CString
maybeDestinationBusName
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall a. Ptr a -> IO ()
freeMem CString
interfaceName'
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.OverloadedMethod DBusConnectionEmitSignalMethodInfo a signature where
overloadedMethod = dBusConnectionEmitSignal
instance O.OverloadedMethodInfo DBusConnectionEmitSignalMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionEmitSignal",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsActionGroup b) =>
a -> Text -> b -> m Word32
dBusConnectionExportActionGroup a
connection Text
objectPath b
actionGroup = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr ActionGroup
actionGroup' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
actionGroup
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
actionGroup
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
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.OverloadedMethod DBusConnectionExportActionGroupMethodInfo a signature where
overloadedMethod = dBusConnectionExportActionGroup
instance O.OverloadedMethodInfo DBusConnectionExportActionGroupMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionExportActionGroup",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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
a
connection Text
objectPath b
menu = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr MenuModel
menu' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
menu
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
menu
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
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.OverloadedMethod DBusConnectionExportMenuModelMethodInfo a signature where
overloadedMethod = dBusConnectionExportMenuModel
instance O.OverloadedMethodInfo DBusConnectionExportMenuModelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionExportMenuModel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dBusConnectionFlush a
connection Maybe b
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = 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 forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
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.OverloadedMethod DBusConnectionFlushMethodInfo a signature where
overloadedMethod = dBusConnectionFlush
instance O.OverloadedMethodInfo DBusConnectionFlushMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionFlush",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsAsyncResult b) =>
a -> b -> m ()
dBusConnectionFlushFinish a
connection b
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
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.OverloadedMethod DBusConnectionFlushFinishMethodInfo a signature where
overloadedMethod = dBusConnectionFlushFinish
instance O.OverloadedMethodInfo DBusConnectionFlushFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionFlushFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) =>
a -> Maybe b -> m ()
dBusConnectionFlushSync a
connection Maybe b
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError 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
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
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.OverloadedMethod DBusConnectionFlushSyncMethodInfo a signature where
overloadedMethod = dBusConnectionFlushSync
instance O.OverloadedMethodInfo DBusConnectionFlushSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionFlushSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m [DBusCapabilityFlags]
dBusConnectionGetCapabilities a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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' = forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionGetCapabilitiesMethodInfo a signature where
overloadedMethod = dBusConnectionGetCapabilities
instance O.OverloadedMethodInfo DBusConnectionGetCapabilitiesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetCapabilities",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m Bool
dBusConnectionGetExitOnClose a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionGetExitOnCloseMethodInfo a signature where
overloadedMethod = dBusConnectionGetExitOnClose
instance O.OverloadedMethodInfo DBusConnectionGetExitOnCloseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetExitOnClose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m [DBusConnectionFlags]
dBusConnectionGetFlags a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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' = forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionGetFlagsMethodInfo a signature where
overloadedMethod = dBusConnectionGetFlags
instance O.OverloadedMethodInfo DBusConnectionGetFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m Text
dBusConnectionGetGuid a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionGetGuid" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionGetGuidMethodInfo a signature where
overloadedMethod = dBusConnectionGetGuid
instance O.OverloadedMethodInfo DBusConnectionGetGuidMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetGuid",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m Word32
dBusConnectionGetLastSerial a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- 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'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
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.OverloadedMethod DBusConnectionGetLastSerialMethodInfo a signature where
overloadedMethod = dBusConnectionGetLastSerial
instance O.OverloadedMethodInfo DBusConnectionGetLastSerialMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetLastSerial",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionGetLastSerial"
})
#endif
foreign import ccall "g_dbus_connection_get_peer_credentials" g_dbus_connection_get_peer_credentials ::
Ptr DBusConnection ->
IO (Ptr Gio.Credentials.Credentials)
dBusConnectionGetPeerCredentials ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m (Maybe Gio.Credentials.Credentials)
dBusConnectionGetPeerCredentials :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m (Maybe Credentials)
dBusConnectionGetPeerCredentials a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Credentials
result <- Ptr DBusConnection -> IO (Ptr Credentials)
g_dbus_connection_get_peer_credentials Ptr DBusConnection
connection'
Maybe Credentials
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Credentials
result forall a b. (a -> b) -> a -> b
$ \Ptr Credentials
result' -> do
Credentials
result'' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Credentials -> Credentials
Gio.Credentials.Credentials) Ptr Credentials
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Credentials
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Credentials
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetPeerCredentialsMethodInfo
instance (signature ~ (m (Maybe Gio.Credentials.Credentials)), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionGetPeerCredentialsMethodInfo a signature where
overloadedMethod = dBusConnectionGetPeerCredentials
instance O.OverloadedMethodInfo DBusConnectionGetPeerCredentialsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetPeerCredentials",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionGetPeerCredentials"
})
#endif
foreign import ccall "g_dbus_connection_get_stream" g_dbus_connection_get_stream ::
Ptr DBusConnection ->
IO (Ptr Gio.IOStream.IOStream)
dBusConnectionGetStream ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m Gio.IOStream.IOStream
dBusConnectionGetStream :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m IOStream
dBusConnectionGetStream a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr IOStream
result <- Ptr DBusConnection -> IO (Ptr IOStream)
g_dbus_connection_get_stream Ptr DBusConnection
connection'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionGetStream" Ptr IOStream
result
IOStream
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return IOStream
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetStreamMethodInfo
instance (signature ~ (m Gio.IOStream.IOStream), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionGetStreamMethodInfo a signature where
overloadedMethod = dBusConnectionGetStream
instance O.OverloadedMethodInfo DBusConnectionGetStreamMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetStream",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionGetStream"
})
#endif
foreign import ccall "g_dbus_connection_get_unique_name" g_dbus_connection_get_unique_name ::
Ptr DBusConnection ->
IO CString
dBusConnectionGetUniqueName ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m (Maybe T.Text)
dBusConnectionGetUniqueName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m (Maybe Text)
dBusConnectionGetUniqueName a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
result <- Ptr DBusConnection -> IO CString
g_dbus_connection_get_unique_name Ptr DBusConnection
connection'
Maybe Text
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
cstringToText CString
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data DBusConnectionGetUniqueNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionGetUniqueNameMethodInfo a signature where
overloadedMethod = dBusConnectionGetUniqueName
instance O.OverloadedMethodInfo DBusConnectionGetUniqueNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionGetUniqueName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionGetUniqueName"
})
#endif
foreign import ccall "g_dbus_connection_is_closed" g_dbus_connection_is_closed ::
Ptr DBusConnection ->
IO CInt
dBusConnectionIsClosed ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m Bool
dBusConnectionIsClosed :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m Bool
dBusConnectionIsClosed a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CInt
result <- Ptr DBusConnection -> IO CInt
g_dbus_connection_is_closed Ptr DBusConnection
connection'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionIsClosedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionIsClosedMethodInfo a signature where
overloadedMethod = dBusConnectionIsClosed
instance O.OverloadedMethodInfo DBusConnectionIsClosedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionIsClosed",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionIsClosed"
})
#endif
foreign import ccall "g_dbus_connection_register_object_with_closures" g_dbus_connection_register_object_with_closures ::
Ptr DBusConnection ->
CString ->
Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo ->
Ptr (GClosure ()) ->
Ptr (GClosure ()) ->
Ptr (GClosure ()) ->
Ptr (Ptr GError) ->
IO Word32
dBusConnectionRegisterObject ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> T.Text
-> Gio.DBusInterfaceInfo.DBusInterfaceInfo
-> Maybe (GClosure b)
-> Maybe (GClosure c)
-> Maybe (GClosure d)
-> m Word32
dBusConnectionRegisterObject :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Text
-> DBusInterfaceInfo
-> Maybe (GClosure b)
-> Maybe (GClosure c)
-> Maybe (GClosure d)
-> m Word32
dBusConnectionRegisterObject a
connection Text
objectPath DBusInterfaceInfo
interfaceInfo Maybe (GClosure b)
methodCallClosure Maybe (GClosure c)
getPropertyClosure Maybe (GClosure d)
setPropertyClosure = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr DBusInterfaceInfo
interfaceInfo' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusInterfaceInfo
interfaceInfo
Ptr (GClosure ())
maybeMethodCallClosure <- case Maybe (GClosure b)
methodCallClosure of
Maybe (GClosure b)
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GClosure b
jMethodCallClosure -> do
Ptr (GClosure ())
jMethodCallClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr GClosure b
jMethodCallClosure
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GClosure ())
jMethodCallClosure'
Ptr (GClosure ())
maybeGetPropertyClosure <- case Maybe (GClosure c)
getPropertyClosure of
Maybe (GClosure c)
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GClosure c
jGetPropertyClosure -> do
Ptr (GClosure ())
jGetPropertyClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr GClosure c
jGetPropertyClosure
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GClosure ())
jGetPropertyClosure'
Ptr (GClosure ())
maybeSetPropertyClosure <- case Maybe (GClosure d)
setPropertyClosure of
Maybe (GClosure d)
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just GClosure d
jSetPropertyClosure -> do
Ptr (GClosure ())
jSetPropertyClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr GClosure d
jSetPropertyClosure
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GClosure ())
jSetPropertyClosure'
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CString
-> Ptr DBusInterfaceInfo
-> Ptr (GClosure ())
-> Ptr (GClosure ())
-> Ptr (GClosure ())
-> Ptr (Ptr GError)
-> IO Word32
g_dbus_connection_register_object_with_closures Ptr DBusConnection
connection' CString
objectPath' Ptr DBusInterfaceInfo
interfaceInfo' Ptr (GClosure ())
maybeMethodCallClosure Ptr (GClosure ())
maybeGetPropertyClosure Ptr (GClosure ())
maybeSetPropertyClosure
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusInterfaceInfo
interfaceInfo
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe (GClosure b)
methodCallClosure forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe (GClosure c)
getPropertyClosure forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe (GClosure d)
setPropertyClosure forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionRegisterObjectMethodInfo
instance (signature ~ (T.Text -> Gio.DBusInterfaceInfo.DBusInterfaceInfo -> Maybe (GClosure b) -> Maybe (GClosure c) -> Maybe (GClosure d) -> m Word32), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionRegisterObjectMethodInfo a signature where
overloadedMethod = dBusConnectionRegisterObject
instance O.OverloadedMethodInfo DBusConnectionRegisterObjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionRegisterObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionRegisterObject"
})
#endif
foreign import ccall "g_dbus_connection_register_subtree" g_dbus_connection_register_subtree ::
Ptr DBusConnection ->
CString ->
Ptr Gio.DBusSubtreeVTable.DBusSubtreeVTable ->
CUInt ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
Ptr (Ptr GError) ->
IO Word32
dBusConnectionRegisterSubtree ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> T.Text
-> Gio.DBusSubtreeVTable.DBusSubtreeVTable
-> [Gio.Flags.DBusSubtreeFlags]
-> Ptr ()
-> GLib.Callbacks.DestroyNotify
-> m Word32
dBusConnectionRegisterSubtree :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Text
-> DBusSubtreeVTable
-> [DBusSubtreeFlags]
-> Ptr ()
-> C_DestroyNotify
-> m Word32
dBusConnectionRegisterSubtree a
connection Text
objectPath DBusSubtreeVTable
vtable [DBusSubtreeFlags]
flags Ptr ()
userData C_DestroyNotify
userDataFreeFunc = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
objectPath' <- Text -> IO CString
textToCString Text
objectPath
Ptr DBusSubtreeVTable
vtable' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusSubtreeVTable
vtable
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusSubtreeFlags]
flags
Ptr (FunPtr C_DestroyNotify)
ptruserDataFreeFunc <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
FunPtr C_DestroyNotify
userDataFreeFunc' <- C_DestroyNotify -> IO (FunPtr C_DestroyNotify)
GLib.Callbacks.mk_DestroyNotify (Maybe (Ptr (FunPtr C_DestroyNotify))
-> C_DestroyNotify -> C_DestroyNotify
GLib.Callbacks.wrap_DestroyNotify (forall a. a -> Maybe a
Just Ptr (FunPtr C_DestroyNotify)
ptruserDataFreeFunc) C_DestroyNotify
userDataFreeFunc)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_DestroyNotify)
ptruserDataFreeFunc FunPtr C_DestroyNotify
userDataFreeFunc'
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> CString
-> Ptr DBusSubtreeVTable
-> CUInt
-> Ptr ()
-> FunPtr C_DestroyNotify
-> Ptr (Ptr GError)
-> IO Word32
g_dbus_connection_register_subtree Ptr DBusConnection
connection' CString
objectPath' Ptr DBusSubtreeVTable
vtable' CUInt
flags' Ptr ()
userData FunPtr C_DestroyNotify
userDataFreeFunc'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusSubtreeVTable
vtable
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
forall a. Ptr a -> IO ()
freeMem CString
objectPath'
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionRegisterSubtreeMethodInfo
instance (signature ~ (T.Text -> Gio.DBusSubtreeVTable.DBusSubtreeVTable -> [Gio.Flags.DBusSubtreeFlags] -> Ptr () -> GLib.Callbacks.DestroyNotify -> m Word32), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionRegisterSubtreeMethodInfo a signature where
overloadedMethod = dBusConnectionRegisterSubtree
instance O.OverloadedMethodInfo DBusConnectionRegisterSubtreeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionRegisterSubtree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionRegisterSubtree"
})
#endif
foreign import ccall "g_dbus_connection_remove_filter" g_dbus_connection_remove_filter ::
Ptr DBusConnection ->
Word32 ->
IO ()
dBusConnectionRemoveFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m ()
dBusConnectionRemoveFilter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Word32 -> m ()
dBusConnectionRemoveFilter a
connection Word32
filterId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusConnection -> Word32 -> IO ()
g_dbus_connection_remove_filter Ptr DBusConnection
connection' Word32
filterId
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionRemoveFilterMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionRemoveFilterMethodInfo a signature where
overloadedMethod = dBusConnectionRemoveFilter
instance O.OverloadedMethodInfo DBusConnectionRemoveFilterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionRemoveFilter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionRemoveFilter"
})
#endif
foreign import ccall "g_dbus_connection_send_message" g_dbus_connection_send_message ::
Ptr DBusConnection ->
Ptr Gio.DBusMessage.DBusMessage ->
CUInt ->
Ptr Word32 ->
Ptr (Ptr GError) ->
IO CInt
dBusConnectionSendMessage ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b) =>
a
-> b
-> [Gio.Flags.DBusSendMessageFlags]
-> m (Word32)
dBusConnectionSendMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsDBusMessage b) =>
a -> b -> [DBusSendMessageFlags] -> m Word32
dBusConnectionSendMessage a
connection b
message [DBusSendMessageFlags]
flags = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusMessage
message' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
message
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusSendMessageFlags]
flags
Ptr Word32
outSerial <- forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr DBusMessage
-> CUInt
-> Ptr Word32
-> Ptr (Ptr GError)
-> IO CInt
g_dbus_connection_send_message Ptr DBusConnection
connection' Ptr DBusMessage
message' CUInt
flags' Ptr Word32
outSerial
Word32
outSerial' <- forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outSerial
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
message
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSerial
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
outSerial'
) (do
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSerial
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSendMessageMethodInfo
instance (signature ~ (b -> [Gio.Flags.DBusSendMessageFlags] -> m (Word32)), MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b) => O.OverloadedMethod DBusConnectionSendMessageMethodInfo a signature where
overloadedMethod = dBusConnectionSendMessage
instance O.OverloadedMethodInfo DBusConnectionSendMessageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSendMessage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSendMessage"
})
#endif
foreign import ccall "g_dbus_connection_send_message_with_reply" g_dbus_connection_send_message_with_reply ::
Ptr DBusConnection ->
Ptr Gio.DBusMessage.DBusMessage ->
CUInt ->
Int32 ->
Ptr Word32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionSendMessageWithReply ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> [Gio.Flags.DBusSendMessageFlags]
-> Int32
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m (Word32)
dBusConnectionSendMessageWithReply :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDBusConnection a, IsDBusMessage b,
IsCancellable c) =>
a
-> b
-> [DBusSendMessageFlags]
-> Int32
-> Maybe c
-> Maybe AsyncReadyCallback
-> m Word32
dBusConnectionSendMessageWithReply a
connection b
message [DBusSendMessageFlags]
flags Int32
timeoutMsec Maybe c
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusMessage
message' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
message
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusSendMessageFlags]
flags
Ptr Word32
outSerial <- forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
Ptr DBusConnection
-> Ptr DBusMessage
-> CUInt
-> Int32
-> Ptr Word32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_send_message_with_reply Ptr DBusConnection
connection' Ptr DBusMessage
message' CUInt
flags' Int32
timeoutMsec Ptr Word32
outSerial Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
Word32
outSerial' <- forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outSerial
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
message
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSerial
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
outSerial'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSendMessageWithReplyMethodInfo
instance (signature ~ (b -> [Gio.Flags.DBusSendMessageFlags] -> Int32 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m (Word32)), MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod DBusConnectionSendMessageWithReplyMethodInfo a signature where
overloadedMethod = dBusConnectionSendMessageWithReply
instance O.OverloadedMethodInfo DBusConnectionSendMessageWithReplyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSendMessageWithReply",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSendMessageWithReply"
})
#endif
foreign import ccall "g_dbus_connection_send_message_with_reply_finish" g_dbus_connection_send_message_with_reply_finish ::
Ptr DBusConnection ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.DBusMessage.DBusMessage)
dBusConnectionSendMessageWithReplyFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.DBusMessage.DBusMessage
dBusConnectionSendMessageWithReplyFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusConnection a, IsAsyncResult b) =>
a -> b -> m DBusMessage
dBusConnectionSendMessageWithReplyFinish a
connection b
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusMessage
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusMessage)
g_dbus_connection_send_message_with_reply_finish Ptr DBusConnection
connection' Ptr AsyncResult
res'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionSendMessageWithReplyFinish" Ptr DBusMessage
result
DBusMessage
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusMessage -> DBusMessage
Gio.DBusMessage.DBusMessage) Ptr DBusMessage
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
forall (m :: * -> *) a. Monad m => a -> m a
return DBusMessage
result'
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSendMessageWithReplyFinishMethodInfo
instance (signature ~ (b -> m Gio.DBusMessage.DBusMessage), MonadIO m, IsDBusConnection a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod DBusConnectionSendMessageWithReplyFinishMethodInfo a signature where
overloadedMethod = dBusConnectionSendMessageWithReplyFinish
instance O.OverloadedMethodInfo DBusConnectionSendMessageWithReplyFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSendMessageWithReplyFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSendMessageWithReplyFinish"
})
#endif
foreign import ccall "g_dbus_connection_send_message_with_reply_sync" g_dbus_connection_send_message_with_reply_sync ::
Ptr DBusConnection ->
Ptr Gio.DBusMessage.DBusMessage ->
CUInt ->
Int32 ->
Ptr Word32 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.DBusMessage.DBusMessage)
dBusConnectionSendMessageWithReplySync ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> [Gio.Flags.DBusSendMessageFlags]
-> Int32
-> Maybe (c)
-> m ((Gio.DBusMessage.DBusMessage, Word32))
dBusConnectionSendMessageWithReplySync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDBusConnection a, IsDBusMessage b,
IsCancellable c) =>
a
-> b
-> [DBusSendMessageFlags]
-> Int32
-> Maybe c
-> m (DBusMessage, Word32)
dBusConnectionSendMessageWithReplySync a
connection b
message [DBusSendMessageFlags]
flags Int32
timeoutMsec Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusMessage
message' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
message
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusSendMessageFlags]
flags
Ptr Word32
outSerial <- forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr DBusMessage
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr DBusConnection
-> Ptr DBusMessage
-> CUInt
-> Int32
-> Ptr Word32
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr DBusMessage)
g_dbus_connection_send_message_with_reply_sync Ptr DBusConnection
connection' Ptr DBusMessage
message' CUInt
flags' Int32
timeoutMsec Ptr Word32
outSerial Ptr Cancellable
maybeCancellable
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dBusConnectionSendMessageWithReplySync" Ptr DBusMessage
result
DBusMessage
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusMessage -> DBusMessage
Gio.DBusMessage.DBusMessage) Ptr DBusMessage
result
Word32
outSerial' <- forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outSerial
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
message
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSerial
forall (m :: * -> *) a. Monad m => a -> m a
return (DBusMessage
result', Word32
outSerial')
) (do
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSerial
)
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSendMessageWithReplySyncMethodInfo
instance (signature ~ (b -> [Gio.Flags.DBusSendMessageFlags] -> Int32 -> Maybe (c) -> m ((Gio.DBusMessage.DBusMessage, Word32))), MonadIO m, IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod DBusConnectionSendMessageWithReplySyncMethodInfo a signature where
overloadedMethod = dBusConnectionSendMessageWithReplySync
instance O.OverloadedMethodInfo DBusConnectionSendMessageWithReplySyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSendMessageWithReplySync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSendMessageWithReplySync"
})
#endif
foreign import ccall "g_dbus_connection_set_exit_on_close" g_dbus_connection_set_exit_on_close ::
Ptr DBusConnection ->
CInt ->
IO ()
dBusConnectionSetExitOnClose ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Bool
-> m ()
dBusConnectionSetExitOnClose :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Bool -> m ()
dBusConnectionSetExitOnClose a
connection Bool
exitOnClose = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
let exitOnClose' :: CInt
exitOnClose' = (forall a b. (Integral a, Num b) => a -> b
P.fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
P.fromEnum) Bool
exitOnClose
Ptr DBusConnection -> CInt -> IO ()
g_dbus_connection_set_exit_on_close Ptr DBusConnection
connection' CInt
exitOnClose'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSetExitOnCloseMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionSetExitOnCloseMethodInfo a signature where
overloadedMethod = dBusConnectionSetExitOnClose
instance O.OverloadedMethodInfo DBusConnectionSetExitOnCloseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSetExitOnClose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSetExitOnClose"
})
#endif
foreign import ccall "g_dbus_connection_signal_subscribe" g_dbus_connection_signal_subscribe ::
Ptr DBusConnection ->
CString ->
CString ->
CString ->
CString ->
CString ->
CUInt ->
FunPtr Gio.Callbacks.C_DBusSignalCallback ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO Word32
dBusConnectionSignalSubscribe ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> [Gio.Flags.DBusSignalFlags]
-> Gio.Callbacks.DBusSignalCallback
-> m Word32
dBusConnectionSignalSubscribe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> [DBusSignalFlags]
-> DBusSignalCallback
-> m Word32
dBusConnectionSignalSubscribe a
connection Maybe Text
sender Maybe Text
interfaceName Maybe Text
member Maybe Text
objectPath Maybe Text
arg0 [DBusSignalFlags]
flags DBusSignalCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CString
maybeSender <- case Maybe Text
sender of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jSender -> do
CString
jSender' <- Text -> IO CString
textToCString Text
jSender
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jSender'
CString
maybeInterfaceName <- case Maybe Text
interfaceName of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jInterfaceName -> do
CString
jInterfaceName' <- Text -> IO CString
textToCString Text
jInterfaceName
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jInterfaceName'
CString
maybeMember <- case Maybe Text
member of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jMember -> do
CString
jMember' <- Text -> IO CString
textToCString Text
jMember
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jMember'
CString
maybeObjectPath <- case Maybe Text
objectPath of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jObjectPath -> do
CString
jObjectPath' <- Text -> IO CString
textToCString Text
jObjectPath
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jObjectPath'
CString
maybeArg0 <- case Maybe Text
arg0 of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jArg0 -> do
CString
jArg0' <- Text -> IO CString
textToCString Text
jArg0
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jArg0'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusSignalFlags]
flags
FunPtr C_DBusSignalCallback
callback' <- C_DBusSignalCallback -> IO (FunPtr C_DBusSignalCallback)
Gio.Callbacks.mk_DBusSignalCallback (Maybe (Ptr (FunPtr C_DBusSignalCallback))
-> DBusSignalCallback_WithClosures -> C_DBusSignalCallback
Gio.Callbacks.wrap_DBusSignalCallback forall a. Maybe a
Nothing (DBusSignalCallback -> DBusSignalCallback_WithClosures
Gio.Callbacks.drop_closures_DBusSignalCallback DBusSignalCallback
callback))
let userData :: Ptr ()
userData = forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DBusSignalCallback
callback'
let userDataFreeFunc :: FunPtr (Ptr a -> IO ())
userDataFreeFunc = forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Word32
result <- Ptr DBusConnection
-> CString
-> CString
-> CString
-> CString
-> CString
-> CUInt
-> FunPtr C_DBusSignalCallback
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO Word32
g_dbus_connection_signal_subscribe Ptr DBusConnection
connection' CString
maybeSender CString
maybeInterfaceName CString
maybeMember CString
maybeObjectPath CString
maybeArg0 CUInt
flags' FunPtr C_DBusSignalCallback
callback' Ptr ()
userData forall a. FunPtr (Ptr a -> IO ())
userDataFreeFunc
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall a. Ptr a -> IO ()
freeMem CString
maybeSender
forall a. Ptr a -> IO ()
freeMem CString
maybeInterfaceName
forall a. Ptr a -> IO ()
freeMem CString
maybeMember
forall a. Ptr a -> IO ()
freeMem CString
maybeObjectPath
forall a. Ptr a -> IO ()
freeMem CString
maybeArg0
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSignalSubscribeMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> [Gio.Flags.DBusSignalFlags] -> Gio.Callbacks.DBusSignalCallback -> m Word32), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionSignalSubscribeMethodInfo a signature where
overloadedMethod = dBusConnectionSignalSubscribe
instance O.OverloadedMethodInfo DBusConnectionSignalSubscribeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSignalSubscribe",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSignalSubscribe"
})
#endif
foreign import ccall "g_dbus_connection_signal_unsubscribe" g_dbus_connection_signal_unsubscribe ::
Ptr DBusConnection ->
Word32 ->
IO ()
dBusConnectionSignalUnsubscribe ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m ()
dBusConnectionSignalUnsubscribe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Word32 -> m ()
dBusConnectionSignalUnsubscribe a
connection Word32
subscriptionId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusConnection -> Word32 -> IO ()
g_dbus_connection_signal_unsubscribe Ptr DBusConnection
connection' Word32
subscriptionId
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionSignalUnsubscribeMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionSignalUnsubscribeMethodInfo a signature where
overloadedMethod = dBusConnectionSignalUnsubscribe
instance O.OverloadedMethodInfo DBusConnectionSignalUnsubscribeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionSignalUnsubscribe",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionSignalUnsubscribe"
})
#endif
foreign import ccall "g_dbus_connection_start_message_processing" g_dbus_connection_start_message_processing ::
Ptr DBusConnection ->
IO ()
dBusConnectionStartMessageProcessing ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> m ()
dBusConnectionStartMessageProcessing :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m ()
dBusConnectionStartMessageProcessing a
connection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusConnection -> IO ()
g_dbus_connection_start_message_processing Ptr DBusConnection
connection'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionStartMessageProcessingMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionStartMessageProcessingMethodInfo a signature where
overloadedMethod = dBusConnectionStartMessageProcessing
instance O.OverloadedMethodInfo DBusConnectionStartMessageProcessingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionStartMessageProcessing",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionStartMessageProcessing"
})
#endif
foreign import ccall "g_dbus_connection_unexport_action_group" g_dbus_connection_unexport_action_group ::
Ptr DBusConnection ->
Word32 ->
IO ()
dBusConnectionUnexportActionGroup ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m ()
dBusConnectionUnexportActionGroup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Word32 -> m ()
dBusConnectionUnexportActionGroup a
connection Word32
exportId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusConnection -> Word32 -> IO ()
g_dbus_connection_unexport_action_group Ptr DBusConnection
connection' Word32
exportId
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionUnexportActionGroupMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionUnexportActionGroupMethodInfo a signature where
overloadedMethod = dBusConnectionUnexportActionGroup
instance O.OverloadedMethodInfo DBusConnectionUnexportActionGroupMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionUnexportActionGroup",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionUnexportActionGroup"
})
#endif
foreign import ccall "g_dbus_connection_unexport_menu_model" ::
Ptr DBusConnection ->
Word32 ->
IO ()
dBusConnectionUnexportMenuModel ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m ()
a
connection Word32
exportId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr DBusConnection -> Word32 -> IO ()
g_dbus_connection_unexport_menu_model Ptr DBusConnection
connection' Word32
exportId
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusConnectionUnexportMenuModelMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionUnexportMenuModelMethodInfo a signature where
overloadedMethod = dBusConnectionUnexportMenuModel
instance O.OverloadedMethodInfo DBusConnectionUnexportMenuModelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionUnexportMenuModel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionUnexportMenuModel"
})
#endif
foreign import ccall "g_dbus_connection_unregister_object" g_dbus_connection_unregister_object ::
Ptr DBusConnection ->
Word32 ->
IO CInt
dBusConnectionUnregisterObject ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m Bool
dBusConnectionUnregisterObject :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Word32 -> m Bool
dBusConnectionUnregisterObject a
connection Word32
registrationId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CInt
result <- Ptr DBusConnection -> Word32 -> IO CInt
g_dbus_connection_unregister_object Ptr DBusConnection
connection' Word32
registrationId
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionUnregisterObjectMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionUnregisterObjectMethodInfo a signature where
overloadedMethod = dBusConnectionUnregisterObject
instance O.OverloadedMethodInfo DBusConnectionUnregisterObjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionUnregisterObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionUnregisterObject"
})
#endif
foreign import ccall "g_dbus_connection_unregister_subtree" g_dbus_connection_unregister_subtree ::
Ptr DBusConnection ->
Word32 ->
IO CInt
dBusConnectionUnregisterSubtree ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusConnection a) =>
a
-> Word32
-> m Bool
dBusConnectionUnregisterSubtree :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> Word32 -> m Bool
dBusConnectionUnregisterSubtree a
connection Word32
registrationId = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
CInt
result <- Ptr DBusConnection -> Word32 -> IO CInt
g_dbus_connection_unregister_subtree Ptr DBusConnection
connection' Word32
registrationId
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusConnectionUnregisterSubtreeMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m, IsDBusConnection a) => O.OverloadedMethod DBusConnectionUnregisterSubtreeMethodInfo a signature where
overloadedMethod = dBusConnectionUnregisterSubtree
instance O.OverloadedMethodInfo DBusConnectionUnregisterSubtreeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusConnection.dBusConnectionUnregisterSubtree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-DBusConnection.html#v:dBusConnectionUnregisterSubtree"
})
#endif
foreign import ccall "g_dbus_connection_new" g_dbus_connection_new ::
Ptr Gio.IOStream.IOStream ->
CString ->
CUInt ->
Ptr Gio.DBusAuthObserver.DBusAuthObserver ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionNew ::
(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)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionNew :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsIOStream a, IsDBusAuthObserver b,
IsCancellable c) =>
a
-> Maybe Text
-> [DBusConnectionFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionNew a
stream Maybe Text
guid [DBusConnectionFlags]
flags Maybe b
observer Maybe c
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr IOStream
stream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
maybeGuid <- case Maybe Text
guid of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jGuid -> do
CString
jGuid' <- Text -> IO CString
textToCString Text
jGuid
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jGuid'
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe b
observer of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jObserver
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
Ptr IOStream
-> CString
-> CUInt
-> Ptr DBusAuthObserver
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_new Ptr IOStream
stream' CString
maybeGuid CUInt
flags' Ptr DBusAuthObserver
maybeObserver Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
observer forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeGuid
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_connection_new_for_address" g_dbus_connection_new_for_address ::
CString ->
CUInt ->
Ptr Gio.DBusAuthObserver.DBusAuthObserver ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dBusConnectionNewForAddress ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusAuthObserver.IsDBusAuthObserver a, Gio.Cancellable.IsCancellable b) =>
T.Text
-> [Gio.Flags.DBusConnectionFlags]
-> Maybe (a)
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dBusConnectionNewForAddress :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDBusAuthObserver a, IsCancellable b) =>
Text
-> [DBusConnectionFlags]
-> Maybe a
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dBusConnectionNewForAddress Text
address [DBusConnectionFlags]
flags Maybe a
observer Maybe b
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
CString
address' <- Text -> IO CString
textToCString Text
address
let flags' :: CUInt
flags' = forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DBusConnectionFlags]
flags
Ptr DBusAuthObserver
maybeObserver <- case Maybe a
observer of
Maybe a
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just a
jObserver -> do
Ptr DBusAuthObserver
jObserver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jObserver
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DBusAuthObserver
jObserver'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- 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 -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
CString
-> CUInt
-> Ptr DBusAuthObserver
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
g_dbus_connection_new_for_address CString
address' CUInt
flags' Ptr DBusAuthObserver
maybeObserver Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
observer forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
address'
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif