Top |
Functions
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::Propert`` 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
.
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_
.
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.
Parameters
interface_ |
The D-Bus interface to export. |
|
connection |
A GDBusConnection to export |
|
object_path |
The path to export the interface at. |
|
error |
Return location for error or |
Since 2.30
g_dbus_interface_skeleton_unexport ()
void
g_dbus_interface_skeleton_unexport (GDBusInterfaceSkeleton *interface_
);
Stops exporting interface_
on all connections it is exported on.
To unexport interface_
from only a single connection, use
g_dbus_interface_skeleton_unexport_from_connection()
Since 2.30
g_dbus_interface_skeleton_unexport_from_connection ()
void g_dbus_interface_skeleton_unexport_from_connection (GDBusInterfaceSkeleton *interface_
,GDBusConnection *connection
);
Stops exporting interface_
on connection
.
To stop exporting on all connections the interface is exported on,
use g_dbus_interface_skeleton_unexport()
.
Since 2.32
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
.
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
g_dbus_interface_skeleton_get_flags ()
GDBusInterfaceSkeletonFlags
g_dbus_interface_skeleton_get_flags (GDBusInterfaceSkeleton *interface_
);
Gets the GDBusInterfaceSkeletonFlags that describes what the behavior
of interface_
Since 2.30
g_dbus_interface_skeleton_set_flags ()
void g_dbus_interface_skeleton_set_flags (GDBusInterfaceSkeleton *interface_
,GDBusInterfaceSkeletonFlags flags
);
Sets flags describing what the behavior of skeleton
should be.
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.
Members
GObjectClass |
The parent class. |
|
Returns a GDBusInterfaceInfo. See |
||
Returns a GDBusInterfaceVTable. See |
||
Returns a GVariant with all properties. See |
||
Emits outstanding changes, if any. See |
||
Signal class handler for the “g-authorize-method” signal. |
Since 2.30
enum GDBusInterfaceSkeletonFlags
Flags describing the behavior of a GDBusInterfaceSkeleton instance.
Members
Since 2.30
Property Details
The “g-flags”
property
“g-flags” GDBusInterfaceSkeletonFlags
Flags from the GDBusInterfaceSkeletonFlags enumeration.
Flags: Read / Write
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.
Parameters
interface |
The GDBusInterfaceSkeleton emitting the signal. |
|
invocation |
||
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 2.30