Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- bytesNeeded
- copy
- getArg0
- getBody
- getByteOrder
- getDestination
- getErrorName
- getFlags
- getHeader
- getHeaderFields
- getInterface
- getLocked
- getMember
- getMessageType
- getNumUnixFds
- getPath
- getReplySerial
- getSender
- getSerial
- getSignature
- getUnixFdList
- lock
- new
- newFromBlob
- newMethodCall
- newMethodErrorLiteral
- newMethodReply
- newSignal
- setBody
- setByteOrder
- setDestination
- setErrorName
- setFlags
- setHeader
- setInterface
- setMember
- setMessageType
- setNumUnixFds
- setPath
- setReplySerial
- setSender
- setSerial
- setSignature
- setUnixFdList
- toBlob
- toGerror
- Properties
A type for representing D-Bus messages that can be sent or received
on a DBusConnection
.
Since: 2.26
Synopsis
- newtype DBusMessage = DBusMessage (ManagedPtr DBusMessage)
- class (GObject o, IsDescendantOf DBusMessage o) => IsDBusMessage o
- toDBusMessage :: (MonadIO m, IsDBusMessage o) => o -> m DBusMessage
- dBusMessageBytesNeeded :: (HasCallStack, MonadIO m) => ByteString -> m Int64
- dBusMessageCopy :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m DBusMessage
- dBusMessageGetArg0 :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetBody :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe GVariant)
- dBusMessageGetByteOrder :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m DBusMessageByteOrder
- dBusMessageGetDestination :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetErrorName :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetFlags :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m [DBusMessageFlags]
- dBusMessageGetHeader :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> DBusMessageHeaderField -> m (Maybe GVariant)
- dBusMessageGetHeaderFields :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m ByteString
- dBusMessageGetInterface :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetLocked :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m Bool
- dBusMessageGetMember :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetMessageType :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m DBusMessageType
- dBusMessageGetNumUnixFds :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m Word32
- dBusMessageGetPath :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetReplySerial :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m Word32
- dBusMessageGetSender :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe Text)
- dBusMessageGetSerial :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m Word32
- dBusMessageGetSignature :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m Text
- dBusMessageGetUnixFdList :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m (Maybe UnixFDList)
- dBusMessageLock :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m ()
- dBusMessageNew :: (HasCallStack, MonadIO m) => m DBusMessage
- dBusMessageNewFromBlob :: (HasCallStack, MonadIO m) => ByteString -> [DBusCapabilityFlags] -> m DBusMessage
- dBusMessageNewMethodCall :: (HasCallStack, MonadIO m) => Maybe Text -> Text -> Maybe Text -> Text -> m DBusMessage
- dBusMessageNewMethodErrorLiteral :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Text -> Text -> m DBusMessage
- dBusMessageNewMethodReply :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m DBusMessage
- dBusMessageNewSignal :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> m DBusMessage
- dBusMessagePrint :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Word32 -> m Text
- dBusMessageSetBody :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> GVariant -> m ()
- dBusMessageSetByteOrder :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> DBusMessageByteOrder -> m ()
- dBusMessageSetDestination :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetErrorName :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Text -> m ()
- dBusMessageSetFlags :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> [DBusMessageFlags] -> m ()
- dBusMessageSetHeader :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> DBusMessageHeaderField -> Maybe GVariant -> m ()
- dBusMessageSetInterface :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetMember :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetMessageType :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> DBusMessageType -> m ()
- dBusMessageSetNumUnixFds :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Word32 -> m ()
- dBusMessageSetPath :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetReplySerial :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Word32 -> m ()
- dBusMessageSetSender :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetSerial :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Word32 -> m ()
- dBusMessageSetSignature :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> Maybe Text -> m ()
- dBusMessageSetUnixFdList :: (HasCallStack, MonadIO m, IsDBusMessage a, IsUnixFDList b) => a -> Maybe b -> m ()
- dBusMessageToBlob :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> [DBusCapabilityFlags] -> m ByteString
- dBusMessageToGerror :: (HasCallStack, MonadIO m, IsDBusMessage a) => a -> m ()
- getDBusMessageLocked :: (MonadIO m, IsDBusMessage o) => o -> m Bool
Exported types
newtype DBusMessage Source #
Memory-managed wrapper type.
Instances
Eq DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage (==) :: DBusMessage -> DBusMessage -> Bool # (/=) :: DBusMessage -> DBusMessage -> Bool # | |
GObject DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage | |
ManagedPtrNewtype DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage | |
TypedObject DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage | |
HasParentTypes DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage | |
IsGValue (Maybe DBusMessage) Source # | Convert |
Defined in GI.Gio.Objects.DBusMessage gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe DBusMessage -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe DBusMessage) # | |
type ParentTypes DBusMessage Source # | |
Defined in GI.Gio.Objects.DBusMessage |
class (GObject o, IsDescendantOf DBusMessage o) => IsDBusMessage o Source #
Type class for types which can be safely cast to DBusMessage
, for instance with toDBusMessage
.
Instances
(GObject o, IsDescendantOf DBusMessage o) => IsDBusMessage o Source # | |
Defined in GI.Gio.Objects.DBusMessage |
toDBusMessage :: (MonadIO m, IsDBusMessage o) => o -> m DBusMessage Source #
Cast to DBusMessage
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, copy, forceFloating, freezeNotify, getv, isFloating, lock, newMethodErrorLiteral, newMethodReply, notify, notifyByPspec, print, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toBlob, toGerror, unref, watchClosure.
Getters
getArg0, getBody, getByteOrder, getData, getDestination, getErrorName, getFlags, getHeader, getHeaderFields, getInterface, getLocked, getMember, getMessageType, getNumUnixFds, getPath, getProperty, getQdata, getReplySerial, getSender, getSerial, getSignature, getUnixFdList.
Setters
setBody, setByteOrder, setData, setDataFull, setDestination, setErrorName, setFlags, setHeader, setInterface, setMember, setMessageType, setNumUnixFds, setPath, setProperty, setReplySerial, setSender, setSerial, setSignature, setUnixFdList.
bytesNeeded
dBusMessageBytesNeeded Source #
:: (HasCallStack, MonadIO m) | |
=> ByteString |
|
-> m Int64 | Returns: Number of bytes needed or -1 if |
Utility function to calculate how many bytes are needed to
completely deserialize the D-Bus message stored at blob
.
Since: 2.26
copy
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m DBusMessage | Returns: A new |
Copies message
. The copy is a deep copy and the returned
DBusMessage
is completely identical except that it is guaranteed
to not be locked.
This operation can fail if e.g. message
contains file descriptors
and the per-process or system-wide open files limit is reached.
Since: 2.26
getArg0
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The string item or |
Convenience to get the first item in the body of message
.
Since: 2.26
getBody
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe GVariant) | Returns: A |
Gets the body of a message.
Since: 2.26
getByteOrder
dBusMessageGetByteOrder Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m DBusMessageByteOrder | Returns: The byte order. |
Gets the byte order of message
.
getDestination
dBusMessageGetDestination Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldDestination
header field.
Since: 2.26
getErrorName
dBusMessageGetErrorName Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldErrorName
header field.
Since: 2.26
getFlags
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m [DBusMessageFlags] | Returns: Flags that are set (typically values from the |
Gets the flags for message
.
Since: 2.26
getHeader
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> DBusMessageHeaderField |
|
-> m (Maybe GVariant) | Returns: A |
Gets a header field on message
.
The caller is responsible for checking the type of the returned GVariant
matches what is expected.
Since: 2.26
getHeaderFields
dBusMessageGetHeaderFields Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m ByteString | Returns: An array of header fields
terminated by |
Gets an array of all header fields on message
that are set.
Since: 2.26
getInterface
dBusMessageGetInterface Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldInterface
header field.
Since: 2.26
getLocked
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m Bool |
Checks whether message
is locked. To monitor changes to this
value, conncet to the Object::notify signal to listen for changes
on the DBusMessage:locked property.
Since: 2.26
getMember
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldMember
header field.
Since: 2.26
getMessageType
dBusMessageGetMessageType Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m DBusMessageType | Returns: A 8-bit unsigned integer (typically a value from the |
Gets the type of message
.
Since: 2.26
getNumUnixFds
dBusMessageGetNumUnixFds Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m Word32 | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldNumUnixFds
header field.
Since: 2.26
getPath
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldPath
header field.
Since: 2.26
getReplySerial
dBusMessageGetReplySerial Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m Word32 | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldReplySerial
header field.
Since: 2.26
getSender
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldSender
header field.
Since: 2.26
getSerial
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m Word32 | Returns: A |
Gets the serial for message
.
Since: 2.26
getSignature
dBusMessageGetSignature Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m Text | Returns: The value. |
Convenience getter for the DBusMessageHeaderFieldSignature
header field.
This will always be non-Nothing
, but may be an empty string.
Since: 2.26
getUnixFdList
dBusMessageGetUnixFdList Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m (Maybe UnixFDList) | Returns: A |
Gets the UNIX file descriptors associated with message
, if any.
This method is only available on UNIX.
The file descriptors normally correspond to G_VARIANT_TYPE_HANDLE
values in the body of the message. For example,
if variantGetHandle
returns 5, that is intended to be a reference
to the file descriptor that can be accessed by
g_unix_fd_list_get (list, 5, ...)
.
Since: 2.26
lock
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m () |
If message
is locked, does nothing. Otherwise locks the message.
Since: 2.26
new
:: (HasCallStack, MonadIO m) | |
=> m DBusMessage | Returns: A |
Creates a new empty DBusMessage
.
Since: 2.26
newFromBlob
dBusMessageNewFromBlob Source #
:: (HasCallStack, MonadIO m) | |
=> ByteString |
|
-> [DBusCapabilityFlags] |
|
-> m DBusMessage | Returns: A new |
Creates a new DBusMessage
from the data stored at blob
. The byte
order that the message was in can be retrieved using
dBusMessageGetByteOrder
.
If the blob
cannot be parsed, contains invalid fields, or contains invalid
headers, IOErrorEnumInvalidArgument
will be returned.
Since: 2.26
newMethodCall
dBusMessageNewMethodCall Source #
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Text |
|
-> Maybe Text |
|
-> Text |
|
-> m DBusMessage | Returns: A |
Creates a new DBusMessage
for a method call.
Since: 2.26
newMethodErrorLiteral
dBusMessageNewMethodErrorLiteral Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m DBusMessage | Returns: A |
Creates a new DBusMessage
that is an error reply to methodCallMessage
.
Since: 2.26
newMethodReply
dBusMessageNewMethodReply Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m DBusMessage | Returns: |
Creates a new DBusMessage
that is a reply to methodCallMessage
.
Since: 2.26
newSignal
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Text |
|
-> m DBusMessage | Returns: A |
Creates a new DBusMessage
for a signal emission.
Since: 2.26
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Word32 |
|
-> m Text | Returns: A string that should be freed with |
Produces a human-readable multi-line description of message
.
The contents of the description has no ABI guarantees, the contents
and formatting is subject to change at any time. Typical output
looks something like this:
>
>Flags: none
>Version: 0
>Serial: 4
>Headers:
> path -> objectpath 'orggtkGDBusTestObject'
> interface -> 'org.gtk.GDBus.TestInterface'
> member -> GimmeStdout
> destination -> ':1.146'
>Body: ()
>UNIX File Descriptors:
> (none)
or > >Flags: no-reply-expected >Version: 0 >Serial: 477 >Headers: > reply-serial -> uint32 4 > destination -> ':1.159' > sender -> ':1.146' > num-unix-fds -> uint32 1 >Body: () >UNIX File Descriptors: > fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
Since: 2.26
setBody
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> GVariant | |
-> m () |
Sets the body message
. As a side-effect the
DBusMessageHeaderFieldSignature
header field is set to the
type string of body
(or cleared if body
is Nothing
).
If body
is floating, message
assumes ownership of body
.
Since: 2.26
setByteOrder
dBusMessageSetByteOrder Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> DBusMessageByteOrder |
|
-> m () |
Sets the byte order of message
.
setDestination
dBusMessageSetDestination Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldDestination
header field.
Since: 2.26
setErrorName
dBusMessageSetErrorName Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldErrorName
header field.
Since: 2.26
setFlags
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> [DBusMessageFlags] |
|
-> m () |
Sets the flags to set on message
.
Since: 2.26
setHeader
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> DBusMessageHeaderField |
|
-> Maybe GVariant |
|
-> m () |
Sets a header field on message
.
If value
is floating, message
assumes ownership of value
.
Since: 2.26
setInterface
dBusMessageSetInterface Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldInterface
header field.
Since: 2.26
setMember
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldMember
header field.
Since: 2.26
setMessageType
dBusMessageSetMessageType Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> DBusMessageType |
|
-> m () |
Sets message
to be of type
.
Since: 2.26
setNumUnixFds
dBusMessageSetNumUnixFds Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Word32 |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldNumUnixFds
header field.
Since: 2.26
setPath
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldPath
header field.
Since: 2.26
setReplySerial
dBusMessageSetReplySerial Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Word32 |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldReplySerial
header field.
Since: 2.26
setSender
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldSender
header field.
Since: 2.26
setSerial
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the serial for message
.
Since: 2.26
setSignature
dBusMessageSetSignature Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Convenience setter for the DBusMessageHeaderFieldSignature
header field.
Since: 2.26
setUnixFdList
dBusMessageSetUnixFdList Source #
:: (HasCallStack, MonadIO m, IsDBusMessage a, IsUnixFDList b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the UNIX file descriptors associated with message
. As a
side-effect the DBusMessageHeaderFieldNumUnixFds
header
field is set to the number of fds in fdList
(or cleared if
fdList
is Nothing
).
This method is only available on UNIX.
When designing D-Bus APIs that are intended to be interoperable,
please note that non-GDBus implementations of D-Bus can usually only
access file descriptors if they are referenced by a value of type
G_VARIANT_TYPE_HANDLE
in the body of the message.
Since: 2.26
toBlob
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> [DBusCapabilityFlags] |
|
-> m ByteString | Returns: A pointer to a
valid binary D-Bus message of |
Serializes message
to a blob. The byte order returned by
dBusMessageGetByteOrder
will be used.
Since: 2.26
toGerror
:: (HasCallStack, MonadIO m, IsDBusMessage a) | |
=> a |
|
-> m () | (Can throw |
If message
is not of type DBusMessageTypeError
does
nothing and returns False
.
Otherwise this method encodes the error in message
as a GError
using g_dbus_error_set_dbus_error()
using the information in the
DBusMessageHeaderFieldErrorName
header field of message
as
well as the first string item in message
's body.
Since: 2.26
Properties
locked
No description available in the introspection data.
getDBusMessageLocked :: (MonadIO m, IsDBusMessage o) => o -> m Bool Source #
Get the value of the “locked
” property.
When overloading is enabled, this is equivalent to
get
dBusMessage #locked