Commit 6ccca557 authored by David Zeuthen's avatar David Zeuthen

GDBus: Use Skeleton instead of Stub

After some brainstorming with Simon, see

 https://bugzilla.gnome.org/show_bug.cgi?id=647577#c8Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 683943b4
......@@ -57,11 +57,11 @@
#GTypeInterface<!-- -->-derived type is generated for each D-Bus
interface. Additionally, for every generated type,
<type>FooBar</type>, two concrete instantiable types,
<type>FooBarProxy</type> and <type>FooBarStub</type>, implementing
<type>FooBarProxy</type> and <type>FooBarSkeleton</type>, implementing
said interface are also generated. The former is derived from
#GDBusProxy and intended for use on the client side
while the latter is derived from the
#GDBusInterfaceStub type making it easy to export on a
#GDBusInterfaceSkeleton type making it easy to export on a
#GDBusConnection either directly or via a
#GDBusObjectManagerServer instance.
</para>
......@@ -375,13 +375,13 @@ gdbus-codegen --generate-c-code myapp-generated \
#GTypeInterface<!-- -->-derived type called
<type>MyAppFrobber</type> as well as two instantiable types with
the same name but suffixed with <type>Proxy</type> and
<type>Stub</type>. The generated file, roughly, contains the
<type>Skeleton</type>. The generated file, roughly, contains the
following facilities:
</para>
<informalexample><programlisting><![CDATA[
/* GType macros for the three generated types */
#define MY_APP_TYPE_FROBBER (my_app_frobber_get_type ())
#define MY_APP_TYPE_FROBBER_STUB (my_app_frobber_stub_get_type ())
#define MY_APP_TYPE_FROBBER_SKELETON (my_app_frobber_skeleton_get_type ())
#define MY_APP_TYPE_FROBBER_PROXY (my_app_frobber_proxy_get_type ())
typedef struct _MyAppFrobber MyAppFrobber; /* Dummy typedef */
......@@ -450,8 +450,8 @@ void my_app_frobber_set_verbose (MyAppFrobber *object,
/* Gets the interface info */
GDBusInterfaceInfo *my_app_frobber_interface_info (void);
/* Creates a new stub object, ready to be exported */
MyAppFrobber *my_app_frobber_stub_new (void);
/* Creates a new skeleton object, ready to be exported */
MyAppFrobber *my_app_frobber_skeleton_new (void);
/* Client-side proxy constructors.
*
......@@ -591,7 +591,7 @@ my_app_frobber_proxy_new_sync (GDBusConnection *connection,
</para>
<para>
Instead of subclassing, it is often easier to use the generated
<type>MyAppFrobberStub</type> subclass. To handle incoming
<type>MyAppFrobberSkeleton</type> subclass. To handle incoming
method calls, use <function>g_signal_connect()</function> with
the <function>::handle-*</function> signals and instead of
overriding #GObject<!-- -->'s
......@@ -628,7 +628,7 @@ on_handle_hello_world (MyAppFrobber *object,
[...]
object = my_app_frobber_stub_new ();
object = my_app_frobber_skeleton_new ();
my_app_frobber_set_verbose (object, TRUE);
g_signal_connect (object,
......@@ -651,7 +651,7 @@ on_handle_hello_world (MyAppFrobber *object,
emissions of the <ulink
url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties::PropertiesChanged</ulink>
signal with all the properties that has changed. Use
g_dbus_interface_stub_flush() or g_dbus_object_stub_flush() to
g_dbus_interface_skeleton_flush() or g_dbus_object_skeleton_flush() to
empty the queue immediately.
</para>
</refsect2>
......
......@@ -165,10 +165,10 @@
<xi:include href="xml/gdbusnameowning.xml"/>
<xi:include href="xml/gdbusnamewatching.xml"/>
<xi:include href="xml/gdbusinterface.xml"/>
<xi:include href="xml/gdbusinterfacestub.xml"/>
<xi:include href="xml/gdbusinterfaceskeleton.xml"/>
<xi:include href="xml/gdbusproxy.xml"/>
<xi:include href="xml/gdbusobject.xml"/>
<xi:include href="xml/gdbusobjectstub.xml"/>
<xi:include href="xml/gdbusobjectskeleton.xml"/>
<xi:include href="xml/gdbusobjectproxy.xml"/>
<xi:include href="xml/gdbusobjectmanager.xml"/>
<xi:include href="xml/gdbusobjectmanagerserver.xml"/>
......
......@@ -3145,33 +3145,33 @@ g_dbus_object_peek_with_typecheck
<SECTION>
<FILE>gdbusinterfacestub</FILE>
<TITLE>GDBusInterfaceStub</TITLE>
GDBusInterfaceStub
GDBusInterfaceStubClass
g_dbus_interface_stub_flush
g_dbus_interface_stub_get_info
g_dbus_interface_stub_get_vtable
g_dbus_interface_stub_get_properties
g_dbus_interface_stub_export
g_dbus_interface_stub_unexport
g_dbus_interface_stub_get_connection
g_dbus_interface_stub_get_object_path
GDBusInterfaceStubFlags
g_dbus_interface_stub_get_flags
g_dbus_interface_stub_set_flags
<SUBSECTION Standard>
G_DBUS_INTERFACE_STUB
G_IS_DBUS_INTERFACE_STUB
G_TYPE_DBUS_INTERFACE_STUB
g_dbus_interface_stub_get_type
G_DBUS_INTERFACE_STUB_CLASS
G_IS_DBUS_INTERFACE_STUB_CLASS
G_DBUS_INTERFACE_STUB_GET_CLASS
<SUBSECTION Private>
GDBusInterfaceStubPrivate
G_TYPE_DBUS_INTERFACE_STUB_FLAGS
g_dbus_interface_stub_flags_get_type
<FILE>gdbusinterfaceskeleton</FILE>
<TITLE>GDBusInterfaceSkeleton</TITLE>
GDBusInterfaceSkeleton
GDBusInterfaceSkeletonClass
g_dbus_interface_skeleton_flush
g_dbus_interface_skeleton_get_info
g_dbus_interface_skeleton_get_vtable
g_dbus_interface_skeleton_get_properties
g_dbus_interface_skeleton_export
g_dbus_interface_skeleton_unexport
g_dbus_interface_skeleton_get_connection
g_dbus_interface_skeleton_get_object_path
GDBusInterfaceSkeletonFlags
g_dbus_interface_skeleton_get_flags
g_dbus_interface_skeleton_set_flags
<SUBSECTION Standard>
G_DBUS_INTERFACE_SKELETON
G_IS_DBUS_INTERFACE_SKELETON
G_TYPE_DBUS_INTERFACE_SKELETON
g_dbus_interface_skeleton_get_type
G_DBUS_INTERFACE_SKELETON_CLASS
G_IS_DBUS_INTERFACE_SKELETON_CLASS
G_DBUS_INTERFACE_SKELETON_GET_CLASS
<SUBSECTION Private>
GDBusInterfaceSkeletonPrivate
G_TYPE_DBUS_INTERFACE_SKELETON_FLAGS
g_dbus_interface_skeleton_flags_get_type
</SECTION>
<SECTION>
......@@ -3209,26 +3209,26 @@ GDBusObjectProxyPrivate
</SECTION>
<SECTION>
<FILE>gdbusobjectstub</FILE>
<TITLE>GDBusObjectStub</TITLE>
GDBusObjectStub
GDBusObjectStubClass
g_dbus_object_stub_new
g_dbus_object_stub_flush
g_dbus_object_stub_add_interface
g_dbus_object_stub_remove_interface
g_dbus_object_stub_remove_interface_by_name
g_dbus_object_stub_set_object_path
<FILE>gdbusobjectskeleton</FILE>
<TITLE>GDBusObjectSkeleton</TITLE>
GDBusObjectSkeleton
GDBusObjectSkeletonClass
g_dbus_object_skeleton_new
g_dbus_object_skeleton_flush
g_dbus_object_skeleton_add_interface
g_dbus_object_skeleton_remove_interface
g_dbus_object_skeleton_remove_interface_by_name
g_dbus_object_skeleton_set_object_path
<SUBSECTION Standard>
G_DBUS_OBJECT_STUB
G_IS_DBUS_OBJECT_STUB
G_TYPE_DBUS_OBJECT_STUB
g_dbus_object_stub_get_type
G_DBUS_OBJECT_STUB_CLASS
G_IS_DBUS_OBJECT_STUB_CLASS
G_DBUS_OBJECT_STUB_GET_CLASS
G_DBUS_OBJECT_SKELETON
G_IS_DBUS_OBJECT_SKELETON
G_TYPE_DBUS_OBJECT_SKELETON
g_dbus_object_skeleton_get_type
G_DBUS_OBJECT_SKELETON_CLASS
G_IS_DBUS_OBJECT_SKELETON_CLASS
G_DBUS_OBJECT_SKELETON_GET_CLASS
<SUBSECTION Private>
GDBusObjectStubPrivate
GDBusObjectSkeletonPrivate
</SECTION>
<SECTION>
......
......@@ -138,9 +138,9 @@ g_credentials_get_type
g_unix_credentials_message_get_type
g_time_zone_monitor_get_type
g_dbus_interface_get_type
g_dbus_interface_stub_get_type
g_dbus_interface_skeleton_get_type
g_dbus_object_get_type
g_dbus_object_stub_get_type
g_dbus_object_skeleton_get_type
g_dbus_object_proxy_get_type
g_dbus_object_manager_get_type
g_dbus_object_manager_client_get_type
......
......@@ -83,9 +83,9 @@ gdbus_headers = \
gdbusmethodinvocation.h \
gdbusserver.h \
gdbusinterface.h \
gdbusinterfacestub.h \
gdbusinterfaceskeleton.h \
gdbusobject.h \
gdbusobjectstub.h \
gdbusobjectskeleton.h \
gdbusobjectproxy.h \
gdbusobjectmanager.h \
gdbusobjectmanagerclient.h \
......@@ -112,9 +112,9 @@ gdbus_sources = \
gdbusmethodinvocation.h gdbusmethodinvocation.c \
gdbusserver.h gdbusserver.c \
gdbusinterface.h gdbusinterface.c \
gdbusinterfacestub.h gdbusinterfacestub.c \
gdbusinterfaceskeleton.h gdbusinterfaceskeleton.c \
gdbusobject.h gdbusobject.c \
gdbusobjectstub.h gdbusobjectstub.c \
gdbusobjectskeleton.h gdbusobjectskeleton.c \
gdbusobjectproxy.h gdbusobjectproxy.c \
gdbusobjectmanager.h gdbusobjectmanager.c \
gdbusobjectmanagerclient.h gdbusobjectmanagerclient.c \
......
This diff is collapsed.
......@@ -34,8 +34,8 @@
* @include: gio/gio.h
*
* The #GDBusInterface type is the base type for D-Bus interfaces both
* on the service side (see #GDBusInterfaceStub) and client side (see
* #GDBusProxy).
* on the service side (see #GDBusInterfaceSkeleton) and client side
* (see #GDBusProxy).
*/
typedef GDBusInterfaceIface GDBusInterfaceInterface;
......
......@@ -20,90 +20,90 @@
* Author: David Zeuthen <davidz@redhat.com>
*/
#ifndef __G_DBUS_INTERFACE_STUB_H__
#define __G_DBUS_INTERFACE_STUB_H__
#ifndef __G_DBUS_INTERFACE_SKELETON_H__
#define __G_DBUS_INTERFACE_SKELETON_H__
#include <gio/giotypes.h>
G_BEGIN_DECLS
#define G_TYPE_DBUS_INTERFACE_STUB (g_dbus_interface_stub_get_type ())
#define G_DBUS_INTERFACE_STUB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_INTERFACE_STUB, GDBusInterfaceStub))
#define G_DBUS_INTERFACE_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_INTERFACE_STUB, GDBusInterfaceStubClass))
#define G_DBUS_INTERFACE_STUB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_INTERFACE_STUB, GDBusInterfaceStubClass))
#define G_IS_DBUS_INTERFACE_STUB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_INTERFACE_STUB))
#define G_IS_DBUS_INTERFACE_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_INTERFACE_STUB))
#define G_TYPE_DBUS_INTERFACE_SKELETON (g_dbus_interface_skeleton_get_type ())
#define G_DBUS_INTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeleton))
#define G_DBUS_INTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonClass))
#define G_DBUS_INTERFACE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonClass))
#define G_IS_DBUS_INTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_INTERFACE_SKELETON))
#define G_IS_DBUS_INTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_INTERFACE_SKELETON))
typedef struct _GDBusInterfaceStubClass GDBusInterfaceStubClass;
typedef struct _GDBusInterfaceStubPrivate GDBusInterfaceStubPrivate;
typedef struct _GDBusInterfaceSkeletonClass GDBusInterfaceSkeletonClass;
typedef struct _GDBusInterfaceSkeletonPrivate GDBusInterfaceSkeletonPrivate;
/**
* GDBusInterfaceStub:
* GDBusInterfaceSkeleton:
*
* The #GDBusInterfaceStub structure contains private data and should
* The #GDBusInterfaceSkeleton structure contains private data and should
* only be accessed using the provided API.
*
* Since: 2.30
*/
struct _GDBusInterfaceStub
struct _GDBusInterfaceSkeleton
{
/*< private >*/
GObject parent_instance;
GDBusInterfaceStubPrivate *priv;
GDBusInterfaceSkeletonPrivate *priv;
};
/**
* GDBusInterfaceStubClass:
* GDBusInterfaceSkeletonClass:
* @parent_class: The parent class.
* @get_info: Returns a #GDBusInterfaceInfo. See g_dbus_interface_stub_get_info() for details.
* @get_vtable: Returns a #GDBusInterfaceVTable. See g_dbus_interface_stub_get_vtable() for details.
* @get_properties: Returns a new, floating, #GVariant with all properties. See g_dbus_interface_stub_get_properties().
* @flush: Emits outstanding changes, if any. See g_dbus_interface_stub_flush().
* @g_authorize_method: Signal class handler for the #GDBusInterfaceStub::g-authorize-method signal.
* @get_info: Returns a #GDBusInterfaceInfo. See g_dbus_interface_skeleton_get_info() for details.
* @get_vtable: Returns a #GDBusInterfaceVTable. See g_dbus_interface_skeleton_get_vtable() for details.
* @get_properties: Returns a new, floating, #GVariant with all properties. See g_dbus_interface_skeleton_get_properties().
* @flush: Emits outstanding changes, if any. See g_dbus_interface_skeleton_flush().
* @g_authorize_method: Signal class handler for the #GDBusInterfaceSkeleton::g-authorize-method signal.
*
* Class structure for #GDBusInterfaceStub.
* Class structure for #GDBusInterfaceSkeleton.
*
* Since: 2.30
*/
struct _GDBusInterfaceStubClass
struct _GDBusInterfaceSkeletonClass
{
GObjectClass parent_class;
/* Virtual Functions */
GDBusInterfaceInfo *(*get_info) (GDBusInterfaceStub *interface_);
GDBusInterfaceVTable *(*get_vtable) (GDBusInterfaceStub *interface_);
GVariant *(*get_properties) (GDBusInterfaceStub *interface_);
void (*flush) (GDBusInterfaceStub *interface_);
GDBusInterfaceInfo *(*get_info) (GDBusInterfaceSkeleton *interface_);
GDBusInterfaceVTable *(*get_vtable) (GDBusInterfaceSkeleton *interface_);
GVariant *(*get_properties) (GDBusInterfaceSkeleton *interface_);
void (*flush) (GDBusInterfaceSkeleton *interface_);
/*< private >*/
gpointer vfunc_padding[8];
/*< public >*/
/* Signals */
gboolean (*g_authorize_method) (GDBusInterfaceStub *interface_,
GDBusMethodInvocation *invocation);
gboolean (*g_authorize_method) (GDBusInterfaceSkeleton *interface_,
GDBusMethodInvocation *invocation);
/*< private >*/
gpointer signal_padding[8];
};
GType g_dbus_interface_stub_get_type (void) G_GNUC_CONST;
GDBusInterfaceStubFlags g_dbus_interface_stub_get_flags (GDBusInterfaceStub *interface_);
void g_dbus_interface_stub_set_flags (GDBusInterfaceStub *interface_,
GDBusInterfaceStubFlags flags);
GDBusInterfaceInfo *g_dbus_interface_stub_get_info (GDBusInterfaceStub *interface_);
GDBusInterfaceVTable *g_dbus_interface_stub_get_vtable (GDBusInterfaceStub *interface_);
GVariant *g_dbus_interface_stub_get_properties (GDBusInterfaceStub *interface_);
void g_dbus_interface_stub_flush (GDBusInterfaceStub *interface_);
GType g_dbus_interface_skeleton_get_type (void) G_GNUC_CONST;
GDBusInterfaceSkeletonFlags g_dbus_interface_skeleton_get_flags (GDBusInterfaceSkeleton *interface_);
void g_dbus_interface_skeleton_set_flags (GDBusInterfaceSkeleton *interface_,
GDBusInterfaceSkeletonFlags flags);
GDBusInterfaceInfo *g_dbus_interface_skeleton_get_info (GDBusInterfaceSkeleton *interface_);
GDBusInterfaceVTable *g_dbus_interface_skeleton_get_vtable (GDBusInterfaceSkeleton *interface_);
GVariant *g_dbus_interface_skeleton_get_properties (GDBusInterfaceSkeleton *interface_);
void g_dbus_interface_skeleton_flush (GDBusInterfaceSkeleton *interface_);
gboolean g_dbus_interface_stub_export (GDBusInterfaceStub *interface_,
GDBusConnection *connection,
const gchar *object_path,
GError **error);
void g_dbus_interface_stub_unexport (GDBusInterfaceStub *interface_);
GDBusConnection *g_dbus_interface_stub_get_connection (GDBusInterfaceStub *interface_);
const gchar *g_dbus_interface_stub_get_object_path (GDBusInterfaceStub *interface_);
gboolean g_dbus_interface_skeleton_export (GDBusInterfaceSkeleton *interface_,
GDBusConnection *connection,
const gchar *object_path,
GError **error);
void g_dbus_interface_skeleton_unexport (GDBusInterfaceSkeleton *interface_);
GDBusConnection *g_dbus_interface_skeleton_get_connection (GDBusInterfaceSkeleton *interface_);
const gchar *g_dbus_interface_skeleton_get_object_path (GDBusInterfaceSkeleton *interface_);
G_END_DECLS
#endif /* __G_DBUS_INTERFACE_STUB_H */
#endif /* __G_DBUS_INTERFACE_SKELETON_H */
......@@ -35,8 +35,8 @@
* @include: gio/gio.h
*
* The #GDBusObject type is the base type for D-Bus objects on both
* the service side (see #GDBusObjectStub) and the client side (see
* #GDBusObjectProxy). It is essentially just a container of
* the service side (see #GDBusObjectSkeleton) and the client side
* (see #GDBusObjectProxy). It is essentially just a container of
* interfaces.
*/
......
......@@ -25,8 +25,8 @@
#include "gdbusobjectmanager.h"
#include "gdbusobjectmanagerserver.h"
#include "gdbusobject.h"
#include "gdbusobjectstub.h"
#include "gdbusinterfacestub.h"
#include "gdbusobjectskeleton.h"
#include "gdbusinterfaceskeleton.h"
#include "gdbusconnection.h"
#include "gdbusintrospection.h"
#include "gdbusmethodinvocation.h"
......@@ -54,7 +54,7 @@
typedef struct
{
GDBusObjectStub *object;
GDBusObjectSkeleton *object;
GDBusObjectManagerServer *manager;
GHashTable *map_iface_name_to_iface;
gboolean exported;
......@@ -270,8 +270,8 @@ g_dbus_object_manager_server_get_connection (GDBusObjectManagerServer *manager)
/* ---------------------------------------------------------------------------------------------------- */
static void
registration_data_export_interface (RegistrationData *data,
GDBusInterfaceStub *interface_stub)
registration_data_export_interface (RegistrationData *data,
GDBusInterfaceSkeleton *interface_skeleton)
{
GDBusInterfaceInfo *info;
GError *error;
......@@ -279,12 +279,12 @@ registration_data_export_interface (RegistrationData *data,
object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object));
info = g_dbus_interface_stub_get_info (interface_stub);
info = g_dbus_interface_skeleton_get_info (interface_skeleton);
error = NULL;
if (!g_dbus_interface_stub_export (interface_stub,
data->manager->priv->connection,
object_path,
&error))
if (!g_dbus_interface_skeleton_export (interface_skeleton,
data->manager->priv->connection,
object_path,
&error))
{
/* TODO: probably wrong to complain on stderr */
g_warning ("%s: Error registering object at %s with interface %s: %s",
......@@ -299,7 +299,7 @@ registration_data_export_interface (RegistrationData *data,
g_assert (g_hash_table_lookup (data->map_iface_name_to_iface, info->name) == NULL);
g_hash_table_insert (data->map_iface_name_to_iface,
info->name,
g_object_ref (interface_stub));
g_object_ref (interface_skeleton));
/* if we are already exported, then... */
if (data->exported)
......@@ -316,17 +316,17 @@ registration_data_export_interface (RegistrationData *data,
}
static void
registration_data_unexport_interface (RegistrationData *data,
GDBusInterfaceStub *interface_stub)
registration_data_unexport_interface (RegistrationData *data,
GDBusInterfaceSkeleton *interface_skeleton)
{
GDBusInterfaceInfo *info;
GDBusInterfaceStub *iface;
GDBusInterfaceSkeleton *iface;
info = g_dbus_interface_stub_get_info (interface_stub);
info = g_dbus_interface_skeleton_get_info (interface_skeleton);
iface = g_hash_table_lookup (data->map_iface_name_to_iface, info->name);
g_assert (iface != NULL);
g_dbus_interface_stub_unexport (iface);
g_dbus_interface_skeleton_unexport (iface);
g_warn_if_fail (g_hash_table_remove (data->map_iface_name_to_iface, info->name));
......@@ -349,7 +349,7 @@ on_interface_added (GDBusObject *object,
gpointer user_data)
{
RegistrationData *data = user_data;
registration_data_export_interface (data, G_DBUS_INTERFACE_STUB (interface));
registration_data_export_interface (data, G_DBUS_INTERFACE_SKELETON (interface));
}
static void
......@@ -358,7 +358,7 @@ on_interface_removed (GDBusObject *object,
gpointer user_data)
{
RegistrationData *data = user_data;
registration_data_unexport_interface (data, G_DBUS_INTERFACE_STUB (interface));
registration_data_unexport_interface (data, G_DBUS_INTERFACE_SKELETON (interface));
}
/* ---------------------------------------------------------------------------------------------------- */
......@@ -368,13 +368,13 @@ static void
registration_data_free (RegistrationData *data)
{
GHashTableIter iter;
GDBusInterfaceStub *iface;
GDBusInterfaceSkeleton *iface;
data->exported = FALSE;
g_hash_table_iter_init (&iter, data->map_iface_name_to_iface);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &iface))
g_dbus_interface_stub_unexport (iface);
g_dbus_interface_skeleton_unexport (iface);
g_signal_handlers_disconnect_by_func (data->object, G_CALLBACK (on_interface_added), data);
g_signal_handlers_disconnect_by_func (data->object, G_CALLBACK (on_interface_removed), data);
......@@ -388,7 +388,7 @@ registration_data_free (RegistrationData *data)
/**
* g_dbus_object_manager_server_export:
* @manager: A #GDBusObjectManagerServer.
* @object: A #GDBusObjectStub.
* @object: A #GDBusObjectSkeleton.
*
* Exports @object on @manager.
*
......@@ -405,7 +405,7 @@ registration_data_free (RegistrationData *data)
*/
void
g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
GDBusObjectStub *object)
GDBusObjectSkeleton *object)
{
RegistrationData *data;
GList *existing_interfaces;
......@@ -448,9 +448,9 @@ g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
existing_interfaces = g_dbus_object_get_interfaces (G_DBUS_OBJECT (object));
for (l = existing_interfaces; l != NULL; l = l->next)
{
GDBusInterfaceStub *interface_stub = G_DBUS_INTERFACE_STUB (l->data);
registration_data_export_interface (data, interface_stub);
g_ptr_array_add (interface_names, g_dbus_interface_stub_get_info (interface_stub)->name);
GDBusInterfaceSkeleton *interface_skeleton = G_DBUS_INTERFACE_SKELETON (l->data);
registration_data_export_interface (data, interface_skeleton);
g_ptr_array_add (interface_names, g_dbus_interface_skeleton_get_info (interface_skeleton)->name);
}
g_list_foreach (existing_interfaces, (GFunc) g_object_unref, NULL);
g_list_free (existing_interfaces);
......@@ -481,8 +481,8 @@ g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
* Since: 2.30
*/
void
g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
GDBusObjectStub *object)
g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
GDBusObjectSkeleton *object)
{
gchar *orig_object_path;
gchar *object_path;
......@@ -512,7 +512,7 @@ g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager
}
if (modified)
g_dbus_object_stub_set_object_path (G_DBUS_OBJECT_STUB (object), object_path);
g_dbus_object_skeleton_set_object_path (G_DBUS_OBJECT_SKELETON (object), object_path);
g_dbus_object_manager_server_export (manager, object);
......@@ -705,7 +705,7 @@ manager_method_call (GDBusConnection *connection,
{
GVariantBuilder interfaces_builder;
GHashTableIter interface_iter;
GDBusInterfaceStub *iface;
GDBusInterfaceSkeleton *iface;
const gchar *iter_object_path;
g_variant_builder_init (&interfaces_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
......@@ -714,8 +714,8 @@ manager_method_call (GDBusConnection *connection,
{
g_variant_builder_add_value (&interfaces_builder,
g_variant_new ("{s@a{sv}}",
g_dbus_interface_stub_get_info (iface)->name,
g_dbus_interface_stub_get_properties (iface)));
g_dbus_interface_skeleton_get_info (iface)->name,
g_dbus_interface_skeleton_get_properties (iface)));
}
iter_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object));
g_variant_builder_add (&array_builder,
......@@ -788,13 +788,13 @@ g_dbus_object_manager_server_emit_interfaces_added (GDBusObjectManagerServer *ma
g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
for (n = 0; interfaces[n] != NULL; n++)
{
GDBusInterfaceStub *iface;
GDBusInterfaceSkeleton *iface;
iface = g_hash_table_lookup (data->map_iface_name_to_iface, interfaces[n]);
g_assert (iface != NULL);
g_variant_builder_add_value (&array_builder,
g_variant_new ("{s@a{sv}}",
interfaces[n],
g_dbus_interface_stub_get_properties (iface)));
g_dbus_interface_skeleton_get_properties (iface)));
}
error = NULL;
......
......@@ -73,9 +73,9 @@ GDBusObjectManagerServer *g_dbus_object_manager_server_new (GDBu
const gchar *object_path);
GDBusConnection *g_dbus_object_manager_server_get_connection (GDBusObjectManagerServer *manager);
void g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
GDBusObjectStub *object);
GDBusObjectSkeleton *object);
void g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
GDBusObjectStub *object);
GDBusObjectSkeleton *object);
void g_dbus_object_manager_server_unexport (GDBusObjectManagerServer *manager,
const gchar *object_path);
......
......@@ -23,8 +23,8 @@
#include "config.h"
#include "gdbusobject.h"
#include "gdbusobjectstub.h"
#include "gdbusinterfacestub.h"
#include "gdbusobjectskeleton.h"
#include "gdbusinterfaceskeleton.h"
#include "gio-marshal.h"
#include "gdbusprivate.h"
#include "gdbusmethodinvocation.h"
......@@ -35,18 +35,18 @@
#include "glibintl.h"
/**
* SECTION:gdbusobjectstub
* SECTION:gdbusobjectskeleton
* @short_description: Service-side D-Bus object
* @include: gio/gio.h
*
* A #GDBusObjectStub instance is essentially a group of D-Bus
* A #GDBusObjectSkeleton instance is essentially a group of D-Bus
* interfaces. The set of exported interfaces on the object may be
* dynamic and change at runtime.
*
* This type is intended to be used with #GDBusObjectManager.
*/
struct _GDBusObjectStubPrivate
struct _GDBusObjectSkeletonPrivate
{
gchar *object_path;
GHashTable *map_name_to_iface;
......@@ -68,29 +68,29 @@ static guint signals[LAST_SIGNAL] = {0};
static void dbus_object_interface_init (GDBusObjectIface *iface);
G_DEFINE_TYPE_WITH_CODE (GDBusObjectStub, g_dbus_object_stub, G_TYPE_OBJECT,
G_DEFINE_TYPE_WITH_CODE (GDBusObjectSkeleton, g_dbus_object_skeleton, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, dbus_object_interface_init));
static void
g_dbus_object_stub_finalize (GObject *_object)
g_dbus_object_skeleton_finalize (GObject *_object)
{
GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
g_free (object->priv->object_path);
g_hash_table_unref (object->priv->map_name_to_iface);
if (G_OBJECT_CLASS (g_dbus_object_stub_parent_class)->finalize != NULL)
G_OBJECT_CLASS (g_dbus_object_stub_parent_class)->finalize (_object);
if (G_OBJECT_CLASS (g_dbus_object_skeleton_parent_class)->finalize != NULL)
G_OBJECT_CLASS (g_dbus_object_skeleton_parent_class)->finalize (_object);
}
static void
g_dbus_object_stub_get_property (GObject *_object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
g_dbus_object_skeleton_get_property (GObject *_object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
switch (prop_id)
{
......@@ -105,17 +105,17 @@ g_dbus_object_stub_get_property (GObject *_object,
}
static void
g_dbus_object_stub_set_property (GObject *_object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
g_dbus_object_skeleton_set_property (GObject *_object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
switch (prop_id)
{
case PROP_OBJECT_PATH:
g_dbus_object_stub_set_object_path (object, g_value_get_string (value));
g_dbus_object_skeleton_set_object_path (object, g_value_get_string (value));
break;
default:
......@@ -125,26 +125,26 @@ g_dbus_object_stub_set_property (GObject *_object,
}
static gboolean
g_dbus_object_stub_authorize_method_default (GDBusObjectStub *object,
GDBusInterfaceStub *interface,
GDBusMethodInvocation *invocation)
g_dbus_object_skeleton_authorize_method_default (GDBusObjectSkeleton *object,
GDBusInterfaceSkeleton *interface,
GDBusMethodInvocation *invocation)
{
return TRUE;
}
static void
g_dbus_object_stub_class_init (GDBusObjectStubClass *klass)
g_dbus_object_skeleton_class_init (GDBusObjectSkeletonClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = g_dbus_object_stub_finalize;
gobject_class->set_property = g_dbus_object_stub_set_property;
gobject_class->get_property = g_dbus_object_stub_get_property;
gobject_class->finalize = g_dbus_object_skeleton_finalize;
gobject_class->set_property = g_dbus_object_skeleton_set_property;
gobject_class->get_property = g_dbus_object_skeleton_get_property;
klass->authorize_method = g_dbus_object_stub_authorize_method_default;
klass->authorize_method = g_dbus_object_skeleton_authorize_method_default;
/**
* GDBusObjectStub:object-path:
* GDBusObjectSkeleton:object-path:
*
* The object path where the object is exported.
*
......@@ -162,16 +162,16 @@ g_dbus_object_stub_class_init (GDBusObjectStubClass *klass)
G_PARAM_STATIC_STRINGS));
/**
* GDBusObjectStub::authorize-method:
* @object: The #GDBusObjectStub emitting the signal.
* @interface: The #GDBusInterfaceStub that @invocation is on.
* GDBusObjectSkeleton::authorize-method:
* @object: The #GDBusObjectSkeleton emitting the signal.
* @interface: The #GDBusInterfaceSkeleton that @invocation is on.
* @invocation: A #GDBusMethodInvocation.