1.16 <GDBusInterfaceSkeleton>

Class: <GDBusInterfaceSkeleton>

It derives from <GObject>.

Abstract base class for D-Bus interfaces on the service side.

Properties

Property: dbus-interface-skeleton:g-flags self

Flags from the <GDBusInterfaceSkeletonFlags> enumeration.

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

Set it with (set! (dbus-interface-skeleton:g-flags self) value).

Procedures

Method: dbus-interface-skeleton:export? self connection object-path ⇒ %return
Method: export? self connection object-path ⇒ %return

Exports self at object-path on connection.

This can be called multiple times to export the same self onto multiple connections however the object-path provided must be the same for all connections.

Use dbus-interface-skeleton:unexport to unexport the object.

self

Passed: a <GDBusInterfaceSkeleton>.

The D-Bus interface to export.

connection

Passed: a <GDBusConnection>.

A <GDBusConnection> to export self on.

object-path

Passed: a string.

The path to export the interface at.

%return

Returned: a boolean.

#t if the interface was exported on connection, otherwise #f with error set.

Method: dbus-interface-skeleton:flush self
Method: flush self

If self has outstanding changes, request for these changes to be emitted immediately.

For example, an exported D-Bus interface may queue up property changes and emit the org.freedesktop.DBus.Properties.PropertiesChanged signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

Method: dbus-interface-skeleton:get-connection self ⇒ %return
Method: get-connection self ⇒ %return

Gets the first connection that self is exported on, if any.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GDBusConnection>, or #f.

A <GDBusConnection> or #f if self is not exported anywhere. Do not free, the object belongs to self.

Method: dbus-interface-skeleton:get-connections self ⇒ %return
Method: get-connections self ⇒ %return

Gets a list of the connections that self is exported on.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a list, each a <GDBusConnection>.

A list of all the connections that self is exported on. The returned list should be freed with g_list_free() after each element has been freed with object:unref.

Method: dbus-interface-skeleton:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the <GDBusInterfaceSkeletonFlags> that describes what the behavior of self

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GDBusInterfaceSkeletonFlags>.

One or more flags from the <GDBusInterfaceSkeletonFlags> enumeration.

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

Gets D-Bus introspection information for the D-Bus interface implemented by self.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GDBusInterfaceInfo>.

A <GDBusInterfaceInfo> (never #f). Do not free.

Method: dbus-interface-skeleton:get-object-path self ⇒ %return
Method: get-object-path self ⇒ %return

Gets the object path that self is exported on, if any.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a string, or #f.

A string owned by self or #f if self is not exported anywhere. Do not free, the string belongs to self.

Method: dbus-interface-skeleton:get-properties self ⇒ %return
Method: get-properties self ⇒ %return

Gets all D-Bus properties for self.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GVariant>.

A <GVariant> of type ’a{sv}’. Free with variant:unref.

Method: dbus-interface-skeleton:has-connection? self connection ⇒ %return
Method: has-connection? self connection ⇒ %return

Checks if self is exported on connection.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

%return

Returned: a boolean.

#t if self is exported on connection, #f otherwise.

Method: dbus-interface-skeleton:set-flags self flags
Method: set-flags self flags

Sets flags describing what the behavior of skeleton should be.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

flags

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

Flags from the <GDBusInterfaceSkeletonFlags> enumeration.

Method: dbus-interface-skeleton:unexport self
Method: unexport self

Stops exporting self on all connections it is exported on.

To unexport self from only a single connection, use dbus-interface-skeleton:unexport-from-connection

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

Method: dbus-interface-skeleton:unexport-from-connection self connection
Method: unexport-from-connection self connection

Stops exporting self on connection.

To stop exporting on all connections the interface is exported on, use dbus-interface-skeleton:unexport.

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

Signals

Signal: dbus-interface-skeleton:g-authorize-method

Connect a handler with (connect object dbus-interface-skeleton:g-authorize-method handler). It is called as (handler self invocation) ⇒ %return.

Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.

Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.

If #f is returned then no further handlers are run and the signal handler must take a reference to invocation and finish handling the call (e.g. return an error via g_dbus_method_invocation_return_error()).

Otherwise, if #t is returned, signal emission continues. If no handlers return #f, then the method is dispatched. If interface has an enclosing <GDBusObjectSkeleton>, then the dbus-object-skeleton:authorize-method signal handlers run before the handlers for this signal.

The default class handler just returns #t.

Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn’t overridden (for both interface and the enclosing <GDBusObjectSkeleton>, if any) and dbus-interface-skeleton:g-flags does not have the handle-method-invocations-in-thread flags set, no dedicated thread is ever used and the call will be handled in the same thread as the object that interface belongs to was exported in.

self

Passed: a <GDBusInterfaceSkeleton>.

invocation

Passed: a <GDBusMethodInvocation>.

A <GDBusMethodInvocation>.

%return

Returned: a boolean.

#t if the call is authorized, #f otherwise.

Virtual methods

Virtual method: dbus-interface-skeleton:do-flush implementor self

If self has outstanding changes, request for these changes to be emitted immediately.

For example, an exported D-Bus interface may queue up property changes and emit the org.freedesktop.DBus.Properties.PropertiesChanged signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.

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

implementor

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

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

Virtual method: dbus-interface-skeleton:do-g-authorize-method implementor self invocation ⇒ %return

Signal class handler for the dbus-interface-skeleton:g-authorize-method signal.

To override it in a new class, give register-type #:vfuncs `((g-authorize-method . ,procedure)). The procedure is called as (procedure self invocation) ⇒ %return.

implementor

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

self

Passed: a <GDBusInterfaceSkeleton>.

invocation

Passed: a <GDBusMethodInvocation>.

%return

Returned: a boolean.

Virtual method: dbus-interface-skeleton:do-get-info implementor self ⇒ %return

Gets D-Bus introspection information for the D-Bus interface implemented by self.

To override it in a new class, give register-type #:vfuncs `((get-info . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

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

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GDBusInterfaceInfo>.

A <GDBusInterfaceInfo> (never #f). Do not free.

Virtual method: dbus-interface-skeleton:do-get-properties implementor self ⇒ %return

Gets all D-Bus properties for self.

To override it in a new class, give register-type #:vfuncs `((get-properties . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

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

self

Passed: a <GDBusInterfaceSkeleton>.

A <GDBusInterfaceSkeleton>.

%return

Returned: a <GVariant>.

A <GVariant> of type ’a{sv}’. Free with variant:unref.