package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.D_bus_message

type t = [ `d_bus_message | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new DBusMessage

val new_method_call : string option -> string -> string option -> string -> t

Create a new DBusMessage

val new_signal : string -> string -> string -> t

Create a new DBusMessage

val to_gerror : t -> (bool, GError.t) result

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.

val set_unix_fd_list : t -> [ `unix_fd_list | `object_ ] Gobject.obj option -> unit

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.

val set_signature : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

val set_serial : t -> UInt32.t -> unit

Sets the serial for @message.

val set_sender : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

val set_reply_serial : t -> UInt32.t -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

val set_path : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.

val set_num_unix_fds : t -> UInt32.t -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.

val set_message_type : t -> Gio_enums.dbusmessagetype -> unit

Sets @message to be of @type.

val set_member : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

val set_interface : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

val set_header : t -> Gio_enums.dbusmessageheaderfield -> Gvariant.t option -> unit

Sets a header field on @message.

If @value is floating, @message assumes ownership of @value.

val set_flags : t -> Gio_enums.dbusmessageflags -> unit

Sets the flags to set on @message.

val set_error_name : t -> string -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

val set_destination : t -> string option -> unit

Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

val set_byte_order : t -> Gio_enums.dbusmessagebyteorder -> unit

Sets the byte order of @message.

val set_body : t -> Gvariant.t -> unit

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, @message assumes ownership of @body.

val print : t -> int -> string

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) ``` 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 ```

val new_method_reply : t -> t

Creates a new #GDBusMessage that is a reply to @method_call_message.

val new_method_error_literal : t -> string -> string -> t

Creates a new #GDBusMessage that is an error reply to @method_call_message.

val lock : t -> unit

If @message is locked, does nothing. Otherwise locks the message.

val get_unix_fd_list : t -> [ `unix_fd_list | `object_ ] Gobject.obj option

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, ...)`.

val get_signature : t -> string

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

This will always be non-%NULL, but may be an empty string.

val get_serial : t -> UInt32.t

Gets the serial for @message.

val get_sender : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

val get_reply_serial : t -> UInt32.t

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

val get_path : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.

val get_num_unix_fds : t -> UInt32.t

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.

val get_message_type : t -> Gio_enums.dbusmessagetype

Gets the type of @message.

val get_member : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

val get_locked : t -> bool

Checks whether @message is locked. To monitor changes to this value, conncet to the #GObject::notify signal to listen for changes on the #GDBusMessage:locked property.

val get_interface : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

val get_header : t -> Gio_enums.dbusmessageheaderfield -> Gvariant.t option

Gets a header field on @message.

The caller is responsible for checking the type of the returned #GVariant matches what is expected.

val get_flags : t -> Gio_enums.dbusmessageflags

Gets the flags for @message.

val get_error_name : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

val get_destination : t -> string option

Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

val get_byte_order : t -> Gio_enums.dbusmessagebyteorder

Gets the byte order of @message.

val get_body : t -> Gvariant.t option

Gets the body of a message.

val get_arg0_path : t -> string option

Convenience to get the first item in the body of @message.

See method@Gio.DBusMessage.get_arg0 for returning string-typed arg0 values.

val get_arg0 : t -> string option

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.

val copy : t -> (t, GError.t) result

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.