Basics
Guides
API Reference
Basics
Guides
API Reference
[14:7] extends: object
A type for representing D-Bus messages that can be sent or received on a [class@Gio.DBusConnection].
DBusMessage ()
Creates a new empty #GDBusMessage.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.copy ()
Copies @message. The copy is a deep copy and the returned #GDBusMessage 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.
get_arg0 ()
Convenience to get the first item in the body of @message. See [method@Gio.DBusMessage.get_arg0_path] for returning object-path-typed arg0 values.
get_arg0_path ()
Convenience to get the first item in the body of @message. See [method@Gio.DBusMessage.get_arg0] for returning string-typed arg0 values.
get_body ()
Gets the body of a message.
get_byte_order ()
Gets the byte order of @message.
get_destination ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
get_error_name ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
get_flags ()
Gets the flags for @message.
get_header (string header_field)
Gets a header field on @message. The caller is responsible for checking the type of the returned #GVariant matches what is expected.
header_field is A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration).get_interface ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
get_locked ()
Checks whether @message is locked. To monitor changes to this value, connect to the #GObject::notify signal to listen for changes on the #GDBusMessage:locked property.
get_member ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
get_message_type ()
Gets the type of @message.
get_path ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
get_sender ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
get_signature ()
Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. This will always be non-%NULL, but may be an empty string.
get_unix_fd_list ()
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 g_variant_get_handle() 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, ...).
lock ()
If @message is locked, does nothing. Otherwise locks the message.
None.new_method_error_literal (string error_name, string error_message)
Creates a new #GDBusMessage that is an error reply to
error_name is A valid D-Bus error name..error_message is The D-Bus error message..new_method_reply ()
Creates a new #GDBusMessage that is a reply to @method_call_message.
print (int indent)
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 '/org/gtk/GDBus/TestObject' interface -> 'org.gtk.GDBus.TestInterface' member -> 'GimmeStdout' destination -> ':1.146' Body: () UNIX File Descriptors: (none)orFlags: 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
indent is Indentation level..set_body (object body)
Sets the body @message. As a side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the type string of @body (or cleared if @body is %NULL). If @body is floating,
assumes ownership of @body.body is Either %NULL or a #GVariant that is a tuple..None.set_byte_order (string byte_order)
Sets the byte order of @message.
byte_order is The byte order..None.set_destination (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
value is The value to set..None.set_error_name (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
value is The value to set..None.set_flags (string flags)
Sets the flags to set on @message.
flags is Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together)..None.set_header (string header_field, object value)
Sets a header field on @message. If @value is floating, @message assumes ownership of @value.
header_field is A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration).value is A #GVariant to set the header field or %NULL to clear the header field..None.set_interface (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
value is The value to set..None.set_member (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
value is The value to set..None.set_message_type (string type)
Sets @message to be of @type.
type is A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration)..None.set_path (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
value is The value to set..None.set_sender (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
value is The value to set..None.set_signature (string value)
Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
value is The value to set..None.set_unix_fd_list (object fd_list)
Sets the UNIX file descriptors associated with @message. As a side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field is set to the number of fds in @fd_list (or cleared if @fd_list is %NULL). 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.
fd_list is A #GUnixFDList or %NULL..None.to_gerror ()
If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR 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 %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as well as the first string item in @message's body.
[554:14] static extends: object
Generated metadata helpers for DBusMessage class surfaces.
properties ()
Returns property metadata for
DBusMessage.
A list.[507:14] static extends: object
Alternate constructors for DBusMessage. Usage:
DBusMessageCtors.<name>(...). The primary constructor lives
directly on DBusMessage.
newMethodCall (string name, string path, string interface_, string method)
Creates a new #GDBusMessage for a method call.
name is A valid D-Bus name or %NULL..path is A valid object path..interface_ is A valid D-Bus interface name or %NULL..method is A valid method name..A new DBusMessage.newSignal (string path, string interface_, string signal)
Creates a new #GDBusMessage for a signal emission.
path is A valid object path..interface_ is A valid D-Bus interface name..signal is A valid signal name..A new DBusMessage.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.