Functions
g_dbus_interface_skeleton_flush ()
void
g_dbus_interface_skeleton_flush (GDBusInterfaceSkeleton *interface_);
If interface_
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.
Since: 2.30
g_dbus_interface_skeleton_get_info ()
GDBusInterfaceInfo *
g_dbus_interface_skeleton_get_info (GDBusInterfaceSkeleton *interface_);
Gets D-Bus introspection information for the D-Bus interface
implemented by interface_
.
Since: 2.30
g_dbus_interface_skeleton_get_vtable ()
GDBusInterfaceVTable *
g_dbus_interface_skeleton_get_vtable (GDBusInterfaceSkeleton *interface_);
Gets the interface vtable for the D-Bus interface implemented by
interface_
. The returned function pointers should expect interface_
itself to be passed as user_data
.
[skip]
Since: 2.30
g_dbus_interface_skeleton_get_properties ()
GVariant *
g_dbus_interface_skeleton_get_properties
(GDBusInterfaceSkeleton *interface_);
Gets all D-Bus properties for interface_
.
Returns
A GVariant of type
'a{sv}'.
Free with g_variant_unref().
[transfer full]
Since: 2.30
g_dbus_interface_skeleton_export ()
gboolean
g_dbus_interface_skeleton_export (GDBusInterfaceSkeleton *interface_,
GDBusConnection *connection,
const gchar *object_path,
GError **error);
Exports interface_
at object_path
on connection
.
This can be called multiple times to export the same interface_
onto multiple connections however the object_path
provided must be
the same for all connections.
Use g_dbus_interface_skeleton_unexport() to unexport the object.
Returns
TRUE if the interface was exported on connection
, otherwise FALSE with
error
set.
Since: 2.30
g_dbus_interface_skeleton_get_connection ()
GDBusConnection *
g_dbus_interface_skeleton_get_connection
(GDBusInterfaceSkeleton *interface_);
Gets the first connection that interface_
is exported on, if any.
Returns
A GDBusConnection or NULL if interface_
is
not exported anywhere. Do not free, the object belongs to interface_
.
[transfer none]
Since: 2.30
g_dbus_interface_skeleton_get_connections ()
GList *
g_dbus_interface_skeleton_get_connections
(GDBusInterfaceSkeleton *interface_);
Gets a list of the connections that interface_
is exported on.
Returns
A list of
all the connections that interface_
is exported on. The returned
list should be freed with g_list_free() after each element has
been freed with g_object_unref().
[element-type GDBusConnection][transfer full]
Since: 2.32
g_dbus_interface_skeleton_has_connection ()
gboolean
g_dbus_interface_skeleton_has_connection
(GDBusInterfaceSkeleton *interface_,
GDBusConnection *connection);
Checks if interface_
is exported on connection
.
Returns
TRUE if interface_
is exported on connection
, FALSE otherwise.
Since: 2.32
g_dbus_interface_skeleton_get_object_path ()
const gchar *
g_dbus_interface_skeleton_get_object_path
(GDBusInterfaceSkeleton *interface_);
Gets the object path that interface_
is exported on, if any.
Returns
A string owned by interface_
or NULL if interface_
is not exported
anywhere. Do not free, the string belongs to interface_
.
Since: 2.30
Types and Values
GDBusInterfaceSkeleton
typedef struct _GDBusInterfaceSkeleton GDBusInterfaceSkeleton;
The GDBusInterfaceSkeleton structure contains private data and should
only be accessed using the provided API.
Since: 2.30
struct GDBusInterfaceSkeletonClass
struct GDBusInterfaceSkeletonClass {
GObjectClass parent_class;
/* Virtual Functions */
GDBusInterfaceInfo *(*get_info) (GDBusInterfaceSkeleton *interface_);
GDBusInterfaceVTable *(*get_vtable) (GDBusInterfaceSkeleton *interface_);
GVariant *(*get_properties) (GDBusInterfaceSkeleton *interface_);
void (*flush) (GDBusInterfaceSkeleton *interface_);
/* Signals */
gboolean (*g_authorize_method) (GDBusInterfaceSkeleton *interface_,
GDBusMethodInvocation *invocation);
};
Class structure for GDBusInterfaceSkeleton.
Since: 2.30
Signal Details
The “g-authorize-method” signal
gboolean
user_function (GDBusInterfaceSkeleton *interface,
GDBusMethodInvocation *invocation,
gpointer user_data)
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 FALSE 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 TRUE is returned, signal emission continues. If no
handlers return FALSE, then the method is dispatched. If
interface
has an enclosing GDBusObjectSkeleton, then the
“authorize-method” signal handlers run before
the handlers for this signal.
The default class handler just returns TRUE.
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 “g-flags” does
not have the
G_DBUS_INTERFACE_SKELETON_FLAGS_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.
Returns
TRUE if the call is authorized, FALSE otherwise.
Flags: Run Last
Since: 2.30