1.24 <GDBusProxy>

Class: <GDBusProxy>

It derives from <GObject>.

<GDBusProxy> is a base class used for proxies to access a D-Bus interface on a remote object. A <GDBusProxy> can be constructed for both well-known and unique names.

By default, <GDBusProxy> will cache all properties (and listen to changes) of the remote object, and proxy all signals that get emitted. This behaviour can be changed by passing suitable <GDBusProxyFlags> when the proxy is created. If the proxy is for a well-known name, the property cache is flushed when the name owner vanishes and reloaded when a name owner appears.

The unique name owner of the proxy’s name is tracked and can be read from dbus-proxy:g-name-owner. Connect to the object:notify signal to get notified of changes. Additionally, only signals and property changes emitted from the current name owner are considered and calls are always sent to the current name owner. This avoids a number of race conditions when the name is lost by one owner and claimed by another. However, if no name owner currently exists, then calls will be sent to the well-known name which may result in the message bus launching an owner (unless do-not-auto-start is set).

If the proxy is for a stateless D-Bus service, where the name owner may be started and stopped between calls, the dbus-proxy:g-name-owner tracking of <GDBusProxy> will cause the proxy to drop signal and property changes from the service after it has restarted for the first time. When interacting with a stateless D-Bus service, do not use <GDBusProxy> — use direct D-Bus method calls and signal connections.

The generic dbus-proxy:g-properties-changed and dbus-proxy:g-signal signals are not very convenient to work with. Therefore, the recommended way of working with proxies is to subclass <GDBusProxy>, and have more natural properties and signals in your derived class. This example shows how this can easily be done using the ‘gdbus-codegen‘ tool.

A <GDBusProxy> instance can be used from multiple threads but note that all signals (e.g. dbus-proxy:g-signal, dbus-proxy:g-properties-changed and object:notify) are emitted in the thread-default main context (see main-context:push-thread-default) of the thread where the instance was constructed.

A watch proxy example

An example using a proxy for a well-known name can be found in ‘gdbus-example-watch-proxy.c‘.

Properties

Property: dbus-proxy:g-bus-type self

If this property is not none, then dbus-proxy:g-connection must be #f and will be set to the <GDBusConnection> obtained by calling bus-get with the value of this property.

Its value is a <GBusType>, or one of its symbols.

It can only be set when the object is made, with #:g-bus-type. It cannot be read.

Property: dbus-proxy:g-connection self

The <GDBusConnection> the proxy is for.

Its value is a <GDBusConnection>, or #f.

It can only be set when the object is made, with #:g-connection.

Property: dbus-proxy:g-default-timeout self

The timeout to use if -1 (specifying default timeout) is passed as timeout-msec in the dbus-proxy:call and dbus-proxy:call-sync functions.

This allows applications to set a proxy-wide timeout for all remote method invocations on the proxy. If this property is -1, the default timeout (typically 25 seconds) is used. If set to G_MAXINT, then no timeout is used.

Its value is a 32-bit integer.

Set it with (set! (dbus-proxy:g-default-timeout self) value).

Property: dbus-proxy:g-flags self

Flags from the <GDBusProxyFlags> enumeration.

Its value is a <GDBusProxyFlags> (or, to set it, a list of its symbols, or one of them).

It can only be set when the object is made, with #:g-flags.

Property: dbus-proxy:g-interface-info self

Ensure that interactions with this proxy conform to the given interface. This is mainly to ensure that malformed data received from the other peer is ignored. The given <GDBusInterfaceInfo> is said to be the "expected interface".

The checks performed are:

  • When completing a method call, if the type signature of the reply message isn’t what’s expected, the reply is discarded and the <GError> is set to invalid-argument.
  • Received signals that have a type signature mismatch are dropped and a warning is logged via g_warning().

Note that these checks are never done on methods, signals and properties that are not referenced in the given <GDBusInterfaceInfo>, since extending a D-Bus interface on the service-side is not considered an ABI break.

Its value is a <GDBusInterfaceInfo>, or #f.

Set it with (set! (dbus-proxy:g-interface-info self) value).

Property: dbus-proxy:g-interface-name self

The D-Bus interface name the proxy is for.

Its value is a string, or #f.

It can only be set when the object is made, with #:g-interface-name.

Property: dbus-proxy:g-name self

The well-known or unique name that the proxy is for.

Its value is a string, or #f.

It can only be set when the object is made, with #:g-name.

Property: dbus-proxy:g-name-owner self

The unique name that owns dbus-proxy:g-name or #f if no-one currently owns that name. You may connect to object:notify signal to track changes to this property.

Its value is a string, or #f.

It is read only.

Property: dbus-proxy:g-object-path self

The object path the proxy is for.

Its value is a string, or #f.

It can only be set when the object is made, with #:g-object-path.

Procedures

Method: dbus-proxy:call self method-name parameters flags timeout-msec [cancellable] [callback]
Method: call self method-name parameters flags timeout-msec [cancellable] [callback]

Asynchronously invokes the method-name method on self.

If method-name contains any dots, then name is split into interface and method name parts. This allows using self for invoking methods on other interfaces.

If the <GDBusConnection> associated with self is closed then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with invalid-argument.

If the parameters <GVariant> is floating, it is consumed. This allows convenient ’inline’ use of g_variant_new(), e.g.:


 g_dbus_proxy_call (proxy,
                    "TwoStrings",
                    g_variant_new ("(ss)",
                                   "Thing One",
                                   "Thing Two"),
                    G_DBUS_CALL_FLAGS_NONE,
                    -1,
                    NULL,
                    (GAsyncReadyCallback) two_strings_done,
                    &data);

If self has an expected interface (see dbus-proxy:g-interface-info) and method-name is referenced by it, then the return value is checked against the return type.

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-proxy:call-finish to get the result of the operation. See dbus-proxy:call-sync for the synchronous version of this method.

If callback is #f then the D-Bus method call message will be sent with the no-reply-expected flag set.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

method-name

Passed: a string.

Name of method to invoke.

parameters

Passed: a <GVariant>, or #f.

A <GVariant> tuple with parameters for the signal or #f if not passing parameters.

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

Flags from the <GDBusCallFlags> enumeration.

timeout-msec

Passed: a 32-bit integer.

The timeout in milliseconds (with G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

callback

Passed, or left out: a procedure, or #f.

A GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result of the method invocation.

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback.

Method: dbus-proxy:call-finish self res ⇒ %return
Method: call-finish self res ⇒ %return

Finishes an operation started with dbus-proxy:call.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-proxy:call.

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a <GVariant> tuple with return values. Free with variant:unref.

Method: dbus-proxy:call-sync self method-name parameters flags timeout-msec [cancellable] ⇒ %return
Method: call-sync self method-name parameters flags timeout-msec [cancellable] ⇒ %return

Synchronously invokes the method-name method on self.

If method-name contains any dots, then name is split into interface and method name parts. This allows using self for invoking methods on other interfaces.

If the <GDBusConnection> associated with self is disconnected then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with invalid-argument.

If the parameters <GVariant> is floating, it is consumed. This allows convenient ’inline’ use of g_variant_new(), e.g.:


 g_dbus_proxy_call_sync (proxy,
                         "TwoStrings",
                         g_variant_new ("(ss)",
                                        "Thing One",
                                        "Thing Two"),
                         G_DBUS_CALL_FLAGS_NONE,
                         -1,
                         NULL,
                         &error);

The calling thread is blocked until a reply is received. See dbus-proxy:call for the asynchronous version of this method.

If self has an expected interface (see dbus-proxy:g-interface-info) and method-name is referenced by it, then the return value is checked against the return type.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

method-name

Passed: a string.

Name of method to invoke.

parameters

Passed: a <GVariant>, or #f.

A <GVariant> tuple with parameters for the signal or #f if not passing parameters.

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

Flags from the <GDBusCallFlags> enumeration.

timeout-msec

Passed: a 32-bit integer.

The timeout in milliseconds (with G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a <GVariant> tuple with return values. Free with variant:unref.

Method: dbus-proxy:call-with-unix-fd-list self method-name parameters flags timeout-msec [fd-list] [cancellable] [callback]
Method: call-with-unix-fd-list self method-name parameters flags timeout-msec [fd-list] [cancellable] [callback]

Like dbus-proxy:call but also takes a <GUnixFDList> object.

This method is only available on UNIX.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

method-name

Passed: a string.

Name of method to invoke.

parameters

Passed: a <GVariant>, or #f.

A <GVariant> tuple with parameters for the signal or #f if not passing parameters.

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

Flags from the <GDBusCallFlags> enumeration.

timeout-msec

Passed: a 32-bit integer.

The timeout in milliseconds (with G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.

fd-list

Passed, or left out: a <GUnixFDList>, or #f.

A <GUnixFDList> or #f.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

callback

Passed, or left out: a procedure, or #f.

A GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result of the method invocation.

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback.

Method: dbus-proxy:call-with-unix-fd-list-finish self res ⇒ %return out-fd-list
Method: call-with-unix-fd-list-finish self res ⇒ %return out-fd-list

Finishes an operation started with dbus-proxy:call-with-unix-fd-list.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-proxy:call-with-unix-fd-list.

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a <GVariant> tuple with return values. Free with variant:unref.

out-fd-list

Returned: a <GUnixFDList>, or #f.

Return location for a <GUnixFDList> or #f.

Method: dbus-proxy:call-with-unix-fd-list-sync self method-name parameters flags timeout-msec [fd-list] [cancellable] ⇒ %return out-fd-list
Method: call-with-unix-fd-list-sync self method-name parameters flags timeout-msec [fd-list] [cancellable] ⇒ %return out-fd-list

Like dbus-proxy:call-sync but also takes and returns <GUnixFDList> objects.

This method is only available on UNIX.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

method-name

Passed: a string.

Name of method to invoke.

parameters

Passed: a <GVariant>, or #f.

A <GVariant> tuple with parameters for the signal or #f if not passing parameters.

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

Flags from the <GDBusCallFlags> enumeration.

timeout-msec

Passed: a 32-bit integer.

The timeout in milliseconds (with G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.

fd-list

Passed, or left out: a <GUnixFDList>, or #f.

A <GUnixFDList> or #f.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a <GVariant> tuple with return values. Free with variant:unref.

out-fd-list

Returned: a <GUnixFDList>, or #f.

Return location for a <GUnixFDList> or #f.

Method: dbus-proxy:get-cached-property self property-name ⇒ %return
Method: get-cached-property self property-name ⇒ %return

Looks up the value for a property from the cache. This call does no blocking IO.

If self has an expected interface (see dbus-proxy:g-interface-info) and property-name is referenced by it, then value is checked against the type of the property.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

property-name

Passed: a string.

Property name.

%return

Returned: a <GVariant>, or #f.

A reference to the <GVariant> instance that holds the value for property-name or #f if the value is not in the cache. The returned reference must be freed with variant:unref.

Method: dbus-proxy:get-cached-property-names self ⇒ %return
Method: get-cached-property-names self ⇒ %return

Gets the names of all cached properties on self.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a vector, each a string, or #f.

A #f-terminated array of strings or #f if self has no cached properties. Free the returned array with strfreev.

Method: dbus-proxy:get-connection self ⇒ %return
Method: get-connection self ⇒ %return

Gets the connection self is for.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a <GDBusConnection>.

A <GDBusConnection> owned by self. Do not free.

Method: dbus-proxy:get-default-timeout self ⇒ %return
Method: get-default-timeout self ⇒ %return

Gets the timeout to use if -1 (specifying default timeout) is passed as timeout-msec in the dbus-proxy:call and dbus-proxy:call-sync functions.

See the dbus-proxy:g-default-timeout property for more details.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a 32-bit integer.

Timeout to use for self.

Method: dbus-proxy:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the flags that self was constructed with.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a <GDBusProxyFlags>.

Flags from the <GDBusProxyFlags> enumeration.

Method: dbus-proxy:get-interface-info self ⇒ %return
Method: get-interface-info self ⇒ %return

Returns the <GDBusInterfaceInfo>, if any, specifying the interface that self conforms to. See the dbus-proxy:g-interface-info property for more details.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>

%return

Returned: a <GDBusInterfaceInfo>, or #f.

A <GDBusInterfaceInfo> or #f. Do not unref the returned object, it is owned by self.

Method: dbus-proxy:get-interface-name self ⇒ %return
Method: get-interface-name self ⇒ %return

Gets the D-Bus interface name self is for.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a string.

A string owned by self. Do not free.

Method: dbus-proxy:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name that self was constructed for.

When connected to a message bus, this will usually be non-#f. However, it may be #f for a proxy that communicates using a peer-to-peer pattern.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a string, or #f.

A string owned by self. Do not free.

Method: dbus-proxy:get-name-owner self ⇒ %return
Method: get-name-owner self ⇒ %return

The unique name that owns the name that self is for or #f if no-one currently owns that name. You may connect to the object:notify signal to track changes to the dbus-proxy:g-name-owner property.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a string, or #f.

The name owner or #f if no name owner exists. Free with byte-array:free.

Method: dbus-proxy:get-object-path self ⇒ %return
Method: get-object-path self ⇒ %return

Gets the object path self is for.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

%return

Returned: a string.

A string owned by self. Do not free.

Procedure: dbus-proxy:new connection flags info name object-path interface-name [cancellable] [callback]

Creates a proxy for accessing interface-name on the remote object at object-path owned by name at connection and asynchronously loads D-Bus properties unless the do-not-load-properties flag is used. Connect to the dbus-proxy:g-properties-changed signal to get notified about property changes.

If the do-not-connect-signals flag is not set, also sets up match rules for signals. Connect to the dbus-proxy:g-signal signal to handle signals from the remote object.

If both do-not-load-properties and do-not-connect-signals are set, this constructor is guaranteed to complete immediately without blocking.

If name is a well-known name and the do-not-auto-start and do-not-auto-start-at-construction flags aren’t set and no name owner currently exists, the message bus will be requested to launch a name owner for the name.

This is a failable asynchronous constructor - when the proxy is ready, callback will be invoked and you can use dbus-proxy:new-finish to get the result.

See dbus-proxy:new-sync and for a synchronous version of this constructor.

<GDBusProxy> is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

flags

Passed: a <GDBusProxyFlags>, or a list of its symbols, or one of them.

Flags used when constructing the proxy.

info

Passed: a <GDBusInterfaceInfo>, or #f.

A <GDBusInterfaceInfo> specifying the minimal interface that proxy conforms to or #f.

name

Passed: a string, or #f.

A bus name (well-known or unique) or #f if connection is not a message bus connection.

object-path

Passed: a string.

An object path.

interface-name

Passed: a string.

A D-Bus interface name.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

callback

Passed, or left out: a procedure, or #f.

Callback function to invoke when the proxy is ready.

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

User data to pass to callback.

Procedure: dbus-proxy:new-finish res ⇒ %return

Finishes creating a <GDBusProxy>.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback function passed to dbus-proxy:new.

%return

Returned: a <GDBusProxy>.

A <GDBusProxy> or #f if error is set. Free with object:unref.

Procedure: dbus-proxy:new-for-bus bus-type flags info name object-path interface-name [cancellable] [callback]

Like dbus-proxy:new but takes a <GBusType> instead of a <GDBusConnection>.

<GDBusProxy> is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].

bus-type

Passed: a <GBusType>, or one of its symbols.

A <GBusType>.

flags

Passed: a <GDBusProxyFlags>, or a list of its symbols, or one of them.

Flags used when constructing the proxy.

info

Passed: a <GDBusInterfaceInfo>, or #f.

A <GDBusInterfaceInfo> specifying the minimal interface that proxy conforms to or #f.

name

Passed: a string.

A bus name (well-known or unique).

object-path

Passed: a string.

An object path.

interface-name

Passed: a string.

A D-Bus interface name.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

callback

Passed, or left out: a procedure, or #f.

Callback function to invoke when the proxy is ready.

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

User data to pass to callback.

Procedure: dbus-proxy:new-for-bus-finish res ⇒ %return

Finishes creating a <GDBusProxy>.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback function passed to dbus-proxy:new-for-bus.

%return

Returned: a <GDBusProxy>.

A <GDBusProxy> or #f if error is set. Free with object:unref.

Procedure: dbus-proxy:new-for-bus-sync bus-type flags info name object-path interface-name [cancellable] ⇒ %return

Like dbus-proxy:new-sync but takes a <GBusType> instead of a <GDBusConnection>.

<GDBusProxy> is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].

bus-type

Passed: a <GBusType>, or one of its symbols.

A <GBusType>.

flags

Passed: a <GDBusProxyFlags>, or a list of its symbols, or one of them.

Flags used when constructing the proxy.

info

Passed: a <GDBusInterfaceInfo>, or #f.

A <GDBusInterfaceInfo> specifying the minimal interface that proxy conforms to or #f.

name

Passed: a string.

A bus name (well-known or unique).

object-path

Passed: a string.

An object path.

interface-name

Passed: a string.

A D-Bus interface name.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

%return

Returned: a <GDBusProxy>.

A <GDBusProxy> or #f if error is set. Free with object:unref.

Procedure: dbus-proxy:new-sync connection flags info name object-path interface-name [cancellable] ⇒ %return

Creates a proxy for accessing interface-name on the remote object at object-path owned by name at connection and synchronously loads D-Bus properties unless the do-not-load-properties flag is used.

If the do-not-connect-signals flag is not set, also sets up match rules for signals. Connect to the dbus-proxy:g-signal signal to handle signals from the remote object.

If both do-not-load-properties and do-not-connect-signals are set, this constructor is guaranteed to return immediately without blocking.

If name is a well-known name and the do-not-auto-start and do-not-auto-start-at-construction flags aren’t set and no name owner currently exists, the message bus will be requested to launch a name owner for the name.

This is a synchronous failable constructor. See dbus-proxy:new and dbus-proxy:new-finish for the asynchronous version.

<GDBusProxy> is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

flags

Passed: a <GDBusProxyFlags>, or a list of its symbols, or one of them.

Flags used when constructing the proxy.

info

Passed: a <GDBusInterfaceInfo>, or #f.

A <GDBusInterfaceInfo> specifying the minimal interface that proxy conforms to or #f.

name

Passed: a string, or #f.

A bus name (well-known or unique) or #f if connection is not a message bus connection.

object-path

Passed: a string.

An object path.

interface-name

Passed: a string.

A D-Bus interface name.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f.

%return

Returned: a <GDBusProxy>.

A <GDBusProxy> or #f if error is set. Free with object:unref.

Method: dbus-proxy:set-cached-property self property-name [value]
Method: set-cached-property self property-name [value]

If value is not #f, sets the cached value for the property with name property-name to the value in value.

If value is #f, then the cached value is removed from the property cache.

If self has an expected interface (see dbus-proxy:g-interface-info) and property-name is referenced by it, then value is checked against the type of the property.

If the value <GVariant> is floating, it is consumed. This allows convenient ’inline’ use of g_variant_new(), e.g.


 g_dbus_proxy_set_cached_property (proxy,
                                   "SomeProperty",
                                   g_variant_new ("(si)",
                                                 "A String",
                                                 42));

Normally you will not need to use this method since self is tracking changes using the org.freedesktop.DBus.Properties.PropertiesChanged D-Bus signal. However, for performance reasons an object may decide to not use this signal for some properties and instead use a proprietary out-of-band mechanism to transmit changes.

As a concrete example, consider an object with a property ChatroomParticipants which is an array of strings. Instead of transmitting the same (long) array every time the property changes, it is more efficient to only transmit the delta using e.g. signals ChatroomParticipantJoined(String name) and ChatroomParticipantParted(String name).

self

Passed: a <GDBusProxy>.

A <GDBusProxy>

property-name

Passed: a string.

Property name.

value

Passed, or left out: a <GVariant>, or #f.

Value for the property or #f to remove it from the cache.

Method: dbus-proxy:set-default-timeout self timeout-msec
Method: set-default-timeout self timeout-msec

Sets the timeout to use if -1 (specifying default timeout) is passed as timeout-msec in the dbus-proxy:call and dbus-proxy:call-sync functions.

See the dbus-proxy:g-default-timeout property for more details.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>.

timeout-msec

Passed: a 32-bit integer.

Timeout in milliseconds.

Method: dbus-proxy:set-interface-info self [info]
Method: set-interface-info self [info]

Ensure that interactions with self conform to the given interface. See the dbus-proxy:g-interface-info property for more details.

self

Passed: a <GDBusProxy>.

A <GDBusProxy>

info

Passed, or left out: a <GDBusInterfaceInfo>, or #f.

Minimum interface this proxy conforms to or #f to unset.

Signals

Signal: dbus-proxy:g-properties-changed

Connect a handler with (connect object dbus-proxy:g-properties-changed handler). It is called as (handler self changed-properties invalidated-properties).

Emitted when one or more D-Bus properties on proxy changes. The local cache has already been updated when this signal fires. Note that both changed-properties and invalidated-properties are guaranteed to never be #f (either may be empty though).

If the proxy has the flag get-invalidated-properties set, then invalidated-properties will always be empty.

This signal corresponds to the PropertiesChanged D-Bus signal on the org.freedesktop.DBus.Properties interface.

self

Passed: a <GDBusProxy>.

changed-properties

Passed: a <GVariant>.

A <GVariant> containing the properties that changed (type: a{sv})

invalidated-properties

Passed: a vector, each a string.

A #f terminated array of properties that was invalidated

Signal: dbus-proxy:g-signal

Connect a handler with (connect object dbus-proxy:g-signal handler). It is called as (handler self sender-name signal-name parameters).

Emitted when a signal from the remote object and interface that proxy is for, has been received.

Since 2.72 this signal supports detailed connections. You can connect to the detailed signal g-signal::x in order to receive callbacks only when signal x is received from the remote object.

self

Passed: a <GDBusProxy>.

sender-name

Passed: a string, or #f.

The sender of the signal or #f if the connection is not a bus connection.

signal-name

Passed: a string.

The name of the signal.

parameters

Passed: a <GVariant>.

A <GVariant> tuple with parameters for the signal.

Virtual methods

Virtual method: dbus-proxy:do-g-properties-changed implementor self changed-properties invalidated-properties

Signal class handler for the dbus-proxy:g-properties-changed signal.

To override it in a new class, give register-type #:vfuncs `((g-properties-changed . ,procedure)). The procedure is called as (procedure self changed-properties invalidated-properties).

implementor

Passed: the class whose implementation to call: <GDBusProxy>, or a class that derives from it, or its GType number.

self

Passed: a <GDBusProxy>.

changed-properties

Passed: a <GVariant>.

invalidated-properties

Passed: a string.

Virtual method: dbus-proxy:do-g-signal implementor self sender-name signal-name parameters

Signal class handler for the dbus-proxy:g-signal signal.

To override it in a new class, give register-type #:vfuncs `((g-signal . ,procedure)). The procedure is called as (procedure self sender-name signal-name parameters).

implementor

Passed: the class whose implementation to call: <GDBusProxy>, or a class that derives from it, or its GType number.

self

Passed: a <GDBusProxy>.

sender-name

Passed: a string.

signal-name

Passed: a string.

parameters

Passed: a <GVariant>.