#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>
#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 */
/* 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.
*
</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
[...]
- object = my_app_frobber_stub_new ();
+ object = my_app_frobber_skeleton_new ();
my_app_frobber_set_verbose (object, TRUE);
g_signal_connect (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>
<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"/>
<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>
</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>
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
gdbusmethodinvocation.h \
gdbusserver.h \
gdbusinterface.h \
- gdbusinterfacestub.h \
+ gdbusinterfaceskeleton.h \
gdbusobject.h \
- gdbusobjectstub.h \
+ gdbusobjectskeleton.h \
gdbusobjectproxy.h \
gdbusobjectmanager.h \
gdbusobjectmanagerclient.h \
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 \
self.h.write('#define %sPEEK_%s(object) (g_dbus_object_peek_with_typecheck (G_DBUS_OBJECT (object), "%s", %sTYPE_%s))\n'%(i.ns_upper, i.name_upper, i.name, i.ns_upper, i.name_upper))
self.h.write('\n')
- # Then the stub
+ # Then the skeleton
self.h.write('\n')
self.h.write('/* ---- */\n')
self.h.write('\n')
- self.h.write('#define %sTYPE_%s_STUB (%s_stub_get_gtype ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
- self.h.write('#define %s%s_STUB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_STUB, %sStub))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
- self.h.write('#define %s%s_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_STUB, %sStubClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
- self.h.write('#define %s%s_STUB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_STUB, %sStubClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
- self.h.write('#define %sIS_%s_STUB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_STUB))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
- self.h.write('#define %sIS_%s_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_STUB))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
+ self.h.write('#define %sTYPE_%s_SKELETON (%s_skeleton_get_gtype ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
+ self.h.write('#define %s%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_SKELETON, %sSkeleton))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
+ self.h.write('#define %s%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_SKELETON, %sSkeletonClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
+ self.h.write('#define %s%s_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_SKELETON, %sSkeletonClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
+ self.h.write('#define %sIS_%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_SKELETON))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
+ self.h.write('#define %sIS_%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_SKELETON))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
self.h.write('\n')
- self.h.write('typedef struct _%sStub %sStub;\n'%(i.camel_name, i.camel_name))
- self.h.write('typedef struct _%sStubClass %sStubClass;\n'%(i.camel_name, i.camel_name))
- self.h.write('typedef struct _%sStubPrivate %sStubPrivate;\n'%(i.camel_name, i.camel_name))
+ self.h.write('typedef struct _%sSkeleton %sSkeleton;\n'%(i.camel_name, i.camel_name))
+ self.h.write('typedef struct _%sSkeletonClass %sSkeletonClass;\n'%(i.camel_name, i.camel_name))
+ self.h.write('typedef struct _%sSkeletonPrivate %sSkeletonPrivate;\n'%(i.camel_name, i.camel_name))
self.h.write('\n')
- self.h.write('struct _%sStub\n'%(i.camel_name))
+ self.h.write('struct _%sSkeleton\n'%(i.camel_name))
self.h.write('{\n')
- self.h.write(' GDBusInterfaceStub parent_instance;\n')
- self.h.write(' %sStubPrivate *priv;\n'%(i.camel_name))
+ self.h.write(' GDBusInterfaceSkeleton parent_instance;\n')
+ self.h.write(' %sSkeletonPrivate *priv;\n'%(i.camel_name))
self.h.write('};\n')
self.h.write('\n')
- self.h.write('struct _%sStubClass\n'%(i.camel_name))
+ self.h.write('struct _%sSkeletonClass\n'%(i.camel_name))
self.h.write('{\n')
- self.h.write(' GDBusInterfaceStubClass parent_class;\n')
+ self.h.write(' GDBusInterfaceSkeletonClass parent_class;\n')
self.h.write('};\n')
self.h.write('\n')
- self.h.write('GType %s_stub_get_gtype (void) G_GNUC_CONST;\n'%(i.name_lower))
+ self.h.write('GType %s_skeleton_get_gtype (void) G_GNUC_CONST;\n'%(i.name_lower))
self.h.write('\n')
- self.h.write('%s *%s_stub_new (void);\n'%(i.camel_name, i.name_lower))
+ self.h.write('%s *%s_skeleton_new (void);\n'%(i.camel_name, i.name_lower))
self.h.write('\n')
# ---------------------------------------------------------------------------------------------------
- def generate_stub(self, i):
+ def generate_skeleton(self, i):
# class boilerplate
self.c.write('/* ------------------------------------------------------------------------ */\n'
'\n')
- self.c.write('struct _%sStubPrivate\n'
+ self.c.write('struct _%sSkeletonPrivate\n'
'{\n'
' GValueArray *properties;\n'
' GList *changed_properties;\n'
'\n'%i.camel_name)
self.c.write('static void\n'
- '_%s_stub_handle_method_call (\n'
+ '_%s_skeleton_handle_method_call (\n'
' GDBusConnection *connection,\n'
' const gchar *sender,\n'
' const gchar *object_path,\n'
' GDBusMethodInvocation *invocation,\n'
' gpointer user_data)\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (user_data);\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n'
' _ExtendedGDBusMethodInfo *info;\n'
' GVariantIter iter;\n'
' GVariant *child;\n'
self.c.write (' num_params = g_variant_n_children (parameters);\n'
' paramv = g_new0 (GValue, num_params + 2);\n'
' g_value_init (¶mv[0], %sTYPE_%s);\n'
- ' g_value_set_object (¶mv[0], stub);\n'
+ ' g_value_set_object (¶mv[0], skeleton);\n'
' g_value_init (¶mv[1], G_TYPE_DBUS_METHOD_INVOCATION);\n'
' g_value_set_object (¶mv[1], invocation);\n'
%(i.ns_upper, i.name_upper))
'\n')
self.c.write('static GVariant *\n'
- '_%s_stub_handle_get_property (\n'
+ '_%s_skeleton_handle_get_property (\n'
' GDBusConnection *connection,\n'
' const gchar *sender,\n'
' const gchar *object_path,\n'
' GError **error,\n'
' gpointer user_data)\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (user_data);\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n'
' GValue value = {0};\n'
' GParamSpec *pspec;\n'
' _ExtendedGDBusPropertyInfo *info;\n'
self.c.write(' ret = NULL;\n'
' info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info, property_name);\n'
' g_assert (info != NULL);\n'
- ' pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (stub), info->hyphen_name);\n'
+ ' pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);\n'
' if (pspec == NULL)\n'
' {\n'
' g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);\n'
' else\n'
' {\n'
' g_value_init (&value, pspec->value_type);\n'
- ' g_object_get_property (G_OBJECT (stub), info->hyphen_name, &value);\n'
+ ' g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);\n'
' ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));\n'
' g_value_unset (&value);\n'
' }\n'
%(i.name_lower))
self.c.write('static gboolean\n'
- '_%s_stub_handle_set_property (\n'
+ '_%s_skeleton_handle_set_property (\n'
' GDBusConnection *connection,\n'
' const gchar *sender,\n'
' const gchar *object_path,\n'
' GError **error,\n'
' gpointer user_data)\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (user_data);\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n'
' GValue value = {0};\n'
' GParamSpec *pspec;\n'
' _ExtendedGDBusPropertyInfo *info;\n'
self.c.write(' ret = FALSE;\n'
' info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info, property_name);\n'
' g_assert (info != NULL);\n'
- ' pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (stub), info->hyphen_name);\n'
+ ' pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);\n'
' if (pspec == NULL)\n'
' {\n'
' g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);\n'
' g_value_set_variant (&value, variant);\n'
' else\n'
' g_dbus_gvariant_to_gvalue (variant, &value);\n'
- ' g_object_set_property (G_OBJECT (stub), info->hyphen_name, &value);\n'
+ ' g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);\n'
' g_value_unset (&value);\n'
' ret = TRUE;\n'
' }\n'
%(i.name_lower))
- self.c.write('static const GDBusInterfaceVTable _%s_stub_vtable =\n'
+ self.c.write('static const GDBusInterfaceVTable _%s_skeleton_vtable =\n'
'{\n'
- ' _%s_stub_handle_method_call,\n'
- ' _%s_stub_handle_get_property,\n'
- ' _%s_stub_handle_set_property\n'
+ ' _%s_skeleton_handle_method_call,\n'
+ ' _%s_skeleton_handle_get_property,\n'
+ ' _%s_skeleton_handle_set_property\n'
'};\n'
'\n'%(i.name_lower, i.name_lower, i.name_lower, i.name_lower))
self.c.write('static GDBusInterfaceInfo *\n'
- '%s_stub_dbus_interface_get_info (GDBusInterfaceStub *stub)\n'
+ '%s_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)\n'
'{\n'
' return %s_interface_info ();\n'
%(i.name_lower, i.name_lower))
'\n')
self.c.write('static GDBusInterfaceVTable *\n'
- '%s_stub_dbus_interface_get_vtable (GDBusInterfaceStub *stub)\n'
+ '%s_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)\n'
'{\n'
- ' return (GDBusInterfaceVTable *) &_%s_stub_vtable;\n'
+ ' return (GDBusInterfaceVTable *) &_%s_skeleton_vtable;\n'
%(i.name_lower, i.name_lower))
self.c.write('}\n'
'\n')
self.c.write('static GVariant *\n'
- '%s_stub_dbus_interface_get_properties (GDBusInterfaceStub *_stub)\n'
+ '%s_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (_stub);\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);\n'
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper))
self.c.write('\n'
' GVariantBuilder builder;\n'
' if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)\n'
' {\n'
' GVariant *value;\n'
- ' value = _%s_stub_handle_get_property (g_dbus_interface_stub_get_connection (G_DBUS_INTERFACE_STUB (stub)), NULL, g_dbus_interface_stub_get_object_path (G_DBUS_INTERFACE_STUB (stub)), "%s", info->name, NULL, stub);\n'
+ ' value = _%s_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", info->name, NULL, skeleton);\n'
' if (value != NULL)\n'
' {\n'
' if (g_variant_is_floating (value))\n'
%(i.name_lower))
self.c.write('static void\n'
- '%s_stub_dbus_interface_flush (GDBusInterfaceStub *_stub)\n'
+ '%s_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)\n'
'{\n'
%(i.name_lower))
if len(i.properties) > 0:
- self.c.write(' %sStub *stub = %s%s_STUB (_stub);\n'
- ' if (stub->priv->changed_properties_idle_source != NULL)\n'
+ self.c.write(' %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);\n'
+ ' if (skeleton->priv->changed_properties_idle_source != NULL)\n'
' {\n'
- ' g_source_destroy (stub->priv->changed_properties_idle_source);\n'
- ' stub->priv->changed_properties_idle_source = NULL;\n'
- ' _%s_emit_changed (stub);\n'
+ ' g_source_destroy (skeleton->priv->changed_properties_idle_source);\n'
+ ' skeleton->priv->changed_properties_idle_source = NULL;\n'
+ ' _%s_emit_changed (skeleton);\n'
' }\n'
%(i.camel_name, i.ns_upper, i.name_upper, i.name_lower))
self.c.write('}\n'
self.c.write(',\n %s%s'%(a.ctype_in, a.name))
self.c.write(')\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (object);\n'
- ' GDBusConnection *connection = g_dbus_interface_stub_get_connection (G_DBUS_INTERFACE_STUB (stub));\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (object);\n'
+ ' GDBusConnection *connection = g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton));\n'
%(i.camel_name, i.ns_upper, i.name_upper))
self.c.write(' if (connection == NULL)\n'
' return;\n'
' g_dbus_connection_emit_signal (connection,\n'
- ' NULL, g_dbus_interface_stub_get_object_path (G_DBUS_INTERFACE_STUB (stub)), "%s", "%s",\n'
+ ' NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", "%s",\n'
' g_variant_new ("('
%(i.name, s.name))
for a in s.args:
'\n')
self.c.write('static void\n'
- '%s_stub_iface_init (%sIface *iface)\n'
+ '%s_skeleton_iface_init (%sIface *iface)\n'
'{\n'
%(i.name_lower, i.camel_name))
for s in i.signals:
%(s.name_lower, i.name_lower, s.name_lower))
self.c.write('}\n'
'\n')
- self.c.write('#define %s_stub_get_type %s_stub_get_gtype\n'%(i.name_lower, i.name_lower))
- self.c.write('G_DEFINE_TYPE_WITH_CODE (%sStub, %s_stub, G_TYPE_DBUS_INTERFACE_STUB,\n'%(i.camel_name, i.name_lower))
- self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_stub_iface_init));\n'%(i.ns_upper, i.name_upper, i.name_lower))
- self.c.write('#undef %s_stub_get_type\n'
+ self.c.write('#define %s_skeleton_get_type %s_skeleton_get_gtype\n'%(i.name_lower, i.name_lower))
+ self.c.write('G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n'%(i.camel_name, i.name_lower))
+ self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init));\n'%(i.ns_upper, i.name_upper, i.name_lower))
+ self.c.write('#undef %s_skeleton_get_type\n'
'\n'%(i.name_lower))
# finalize
self.c.write('static void\n'
- '%s_stub_finalize (GObject *object)\n'
+ '%s_skeleton_finalize (GObject *object)\n'
'{\n'%(i.name_lower))
- self.c.write(' %sStub *stub = %s%s_STUB (object);\n'%(i.camel_name, i.ns_upper, i.name_upper))
+ self.c.write(' %sSkeleton *skeleton = %s%s_SKELETON (object);\n'%(i.camel_name, i.ns_upper, i.name_upper))
if len(i.properties) > 0:
- self.c.write(' g_value_array_free (stub->priv->properties);\n')
- self.c.write(' g_list_foreach (stub->priv->changed_properties, (GFunc) _changed_property_free, NULL);\n')
- self.c.write(' g_list_free (stub->priv->changed_properties);\n')
- self.c.write(' if (stub->priv->changed_properties_idle_source != NULL)\n')
- self.c.write(' g_source_destroy (stub->priv->changed_properties_idle_source);\n')
- self.c.write(' if (stub->priv->context != NULL)\n')
- self.c.write(' g_main_context_unref (stub->priv->context);\n')
- self.c.write(' G_OBJECT_CLASS (%s_stub_parent_class)->finalize (object);\n'
+ self.c.write(' g_value_array_free (skeleton->priv->properties);\n')
+ self.c.write(' g_list_foreach (skeleton->priv->changed_properties, (GFunc) _changed_property_free, NULL);\n')
+ self.c.write(' g_list_free (skeleton->priv->changed_properties);\n')
+ self.c.write(' if (skeleton->priv->changed_properties_idle_source != NULL)\n')
+ self.c.write(' g_source_destroy (skeleton->priv->changed_properties_idle_source);\n')
+ self.c.write(' if (skeleton->priv->context != NULL)\n')
+ self.c.write(' g_main_context_unref (skeleton->priv->context);\n')
+ self.c.write(' G_OBJECT_CLASS (%s_skeleton_parent_class)->finalize (object);\n'
'}\n'
'\n'%(i.name_lower))
# property accessors (TODO: generate PropertiesChanged signals in setter)
self.c.write('static void\n'
- '%s_stub_get_property (GObject *object,\n'
+ '%s_skeleton_get_property (GObject *object,\n'
' guint prop_id,\n'
' GValue *value,\n'
' GParamSpec *pspec)\n'
'{\n'%(i.name_lower))
- self.c.write(' %sStub *stub = %s%s_STUB (object);\n'
+ self.c.write(' %sSkeleton *skeleton = %s%s_SKELETON (object);\n'
' g_assert (prop_id - 1 >= 0 && prop_id - 1 < %d);\n'
- ' g_value_copy (&stub->priv->properties->values[prop_id - 1], value);\n'
+ ' g_value_copy (&skeleton->priv->properties->values[prop_id - 1], value);\n'
%(i.camel_name, i.ns_upper, i.name_upper, len(i.properties)))
self.c.write('}\n'
'\n')
self.c.write('static gboolean\n'
'_%s_emit_changed (gpointer user_data)\n'
'{\n'
- ' %sStub *stub = %s%s_STUB (user_data);\n'
+ ' %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n'
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper))
self.c.write(' GList *l;\n'
' GVariantBuilder builder;\n'
' GVariantBuilder invalidated_builder;\n'
' g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));\n'
' g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));\n'
- ' for (l = stub->priv->changed_properties; l != NULL; l = l->next)\n'
+ ' for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)\n'
' {\n'
' ChangedProperty *cp = l->data;\n'
' GVariant *variant;\n'
' g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);\n'
' g_variant_unref (variant);\n'
' }\n'
- ' g_dbus_connection_emit_signal (g_dbus_interface_stub_get_connection (G_DBUS_INTERFACE_STUB (stub)),\n'
- ' NULL, g_dbus_interface_stub_get_object_path (G_DBUS_INTERFACE_STUB (stub)),\n'
+ ' g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)),\n'
+ ' NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),\n'
' "org.freedesktop.DBus.Properties",\n'
' "PropertiesChanged",\n'
' g_variant_new ("(sa{sv}as)",\n'
' &builder, &invalidated_builder),\n'
' NULL);\n'
%(i.name))
- self.c.write(' g_list_foreach (stub->priv->changed_properties, (GFunc) _changed_property_free, NULL);\n')
- self.c.write(' g_list_free (stub->priv->changed_properties);\n')
- self.c.write(' stub->priv->changed_properties = NULL;\n')
- self.c.write(' stub->priv->changed_properties_idle_source = NULL;\n')
+ self.c.write(' g_list_foreach (skeleton->priv->changed_properties, (GFunc) _changed_property_free, NULL);\n')
+ self.c.write(' g_list_free (skeleton->priv->changed_properties);\n')
+ self.c.write(' skeleton->priv->changed_properties = NULL;\n')
+ self.c.write(' skeleton->priv->changed_properties_idle_source = NULL;\n')
self.c.write(' return FALSE;\n'
'}\n'
'\n')
# if property is already scheduled then re-use entry
self.c.write('static void\n'
- '_%s_schedule_emit_changed (%sStub *stub, const _ExtendedGDBusPropertyInfo *info, GParamSpec *pspec, const GValue *value)\n'
+ '_%s_schedule_emit_changed (%sSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, GParamSpec *pspec, const GValue *value)\n'
'{\n'
' ChangedProperty *cp;\n'
' GList *l;\n'
' cp = NULL;\n'
- ' for (l = stub->priv->changed_properties; l != NULL; l = l->next)\n'
+ ' for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)\n'
' {\n'
' ChangedProperty *i_cp = l->data;\n'
' if (i_cp->info == info)\n'
' cp = g_new0 (ChangedProperty, 1);\n'
' cp->pspec = pspec;\n'
' cp->info = info;\n'
- ' stub->priv->changed_properties = g_list_prepend (stub->priv->changed_properties, cp);\n'
+ ' skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);\n'
' }\n'
' g_value_init (&cp->value, G_VALUE_TYPE (value));\n'
' g_value_copy (value, &cp->value);\n'
- ' if (stub->priv->changed_properties_idle_source == NULL)\n'
+ ' if (skeleton->priv->changed_properties_idle_source == NULL)\n'
' {\n'
- ' stub->priv->changed_properties_idle_source = g_idle_source_new ();\n'
- ' g_source_set_priority (stub->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);\n'
- ' g_source_set_callback (stub->priv->changed_properties_idle_source, _%s_emit_changed, g_object_ref (stub), (GDestroyNotify) g_object_unref);\n'
- ' g_source_attach (stub->priv->changed_properties_idle_source, stub->priv->context);\n'
- ' g_source_unref (stub->priv->changed_properties_idle_source);\n'
+ ' skeleton->priv->changed_properties_idle_source = g_idle_source_new ();\n'
+ ' g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);\n'
+ ' g_source_set_callback (skeleton->priv->changed_properties_idle_source, _%s_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);\n'
+ ' g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);\n'
+ ' g_source_unref (skeleton->priv->changed_properties_idle_source);\n'
' }\n'
'}\n'
'\n'
%(i.name_lower, i.camel_name, i.name_lower))
self.c.write('static void\n'
- '%s_stub_set_property (GObject *object,\n'
+ '%s_skeleton_set_property (GObject *object,\n'
' guint prop_id,\n'
' const GValue *value,\n'
' GParamSpec *pspec)\n'
'{\n'%(i.name_lower))
if len(i.properties) > 0:
- self.c.write(' %sStub *stub = %s%s_STUB (object);\n'
+ self.c.write(' %sSkeleton *skeleton = %s%s_SKELETON (object);\n'
' g_assert (prop_id - 1 >= 0 && prop_id - 1 < %d);\n'
- ' if (!_g_value_equal (value, &stub->priv->properties->values[prop_id - 1]))\n'
+ ' if (!_g_value_equal (value, &skeleton->priv->properties->values[prop_id - 1]))\n'
' {\n'
- ' g_value_copy (value, &stub->priv->properties->values[prop_id - 1]);\n'
+ ' g_value_copy (value, &skeleton->priv->properties->values[prop_id - 1]);\n'
' g_object_notify_by_pspec (object, pspec);\n'
- ' if (g_dbus_interface_stub_get_connection (G_DBUS_INTERFACE_STUB (stub)) != NULL)\n'
- ' _%s_schedule_emit_changed (stub, _%s_property_info_pointers[prop_id - 1], pspec, value);\n'
+ ' if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)\n'
+ ' _%s_schedule_emit_changed (skeleton, _%s_property_info_pointers[prop_id - 1], pspec, value);\n'
' }\n'
%(i.camel_name, i.ns_upper, i.name_upper, len(i.properties), i.name_lower, i.name_lower))
self.c.write('}\n'
'\n')
self.c.write('static void\n'
- '%s_stub_init (%sStub *stub)\n'
+ '%s_skeleton_init (%sSkeleton *skeleton)\n'
'{\n'
- ' stub->priv = G_TYPE_INSTANCE_GET_PRIVATE (stub, %sTYPE_%s_STUB, %sStubPrivate);\n'
+ ' skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, %sTYPE_%s_SKELETON, %sSkeletonPrivate);\n'
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper, i.camel_name))
- self.c.write(' stub->priv->context = g_main_context_get_thread_default ();\n')
- self.c.write(' if (stub->priv->context != NULL)\n')
- self.c.write(' g_main_context_ref (stub->priv->context);\n')
+ self.c.write(' skeleton->priv->context = g_main_context_get_thread_default ();\n')
+ self.c.write(' if (skeleton->priv->context != NULL)\n')
+ self.c.write(' g_main_context_ref (skeleton->priv->context);\n')
if len(i.properties) > 0:
- self.c.write(' stub->priv->properties = g_value_array_new (%d);\n'%(len(i.properties)))
+ self.c.write(' skeleton->priv->properties = g_value_array_new (%d);\n'%(len(i.properties)))
n = 0
for p in i.properties:
- self.c.write(' g_value_array_append (stub->priv->properties, NULL);\n')
- self.c.write(' g_value_init (&stub->priv->properties->values[%d], %s);\n'%(n, p.arg.gtype))
+ self.c.write(' g_value_array_append (skeleton->priv->properties, NULL);\n')
+ self.c.write(' g_value_init (&skeleton->priv->properties->values[%d], %s);\n'%(n, p.arg.gtype))
n += 1
self.c.write('}\n'
'\n')
self.c.write('static void\n'
- '%s_stub_class_init (%sStubClass *klass)\n'
+ '%s_skeleton_class_init (%sSkeletonClass *klass)\n'
'{\n'
' GObjectClass *gobject_class;\n'
- ' GDBusInterfaceStubClass *stub_class;\n'
+ ' GDBusInterfaceSkeletonClass *skeleton_class;\n'
'\n'
- ' g_type_class_add_private (klass, sizeof (%sStubPrivate));\n'
+ ' g_type_class_add_private (klass, sizeof (%sSkeletonPrivate));\n'
'\n'
' gobject_class = G_OBJECT_CLASS (klass);\n'
- ' gobject_class->finalize = %s_stub_finalize;\n'
- ' gobject_class->get_property = %s_stub_get_property;\n'
- ' gobject_class->set_property = %s_stub_set_property;\n'
+ ' gobject_class->finalize = %s_skeleton_finalize;\n'
+ ' gobject_class->get_property = %s_skeleton_get_property;\n'
+ ' gobject_class->set_property = %s_skeleton_set_property;\n'
'\n'%(i.name_lower, i.camel_name, i.camel_name, i.name_lower, i.name_lower, i.name_lower))
if len(i.properties) > 0:
self.c.write('\n'
' %s_override_properties (gobject_class, 1);\n'%(i.name_lower))
self.c.write('\n'
- ' stub_class = G_DBUS_INTERFACE_STUB_CLASS (klass);\n');
- self.c.write(' stub_class->get_info = %s_stub_dbus_interface_get_info;\n'%(i.name_lower))
- self.c.write(' stub_class->get_properties = %s_stub_dbus_interface_get_properties;\n'%(i.name_lower))
- self.c.write(' stub_class->flush = %s_stub_dbus_interface_flush;\n'%(i.name_lower))
- self.c.write(' stub_class->get_vtable = %s_stub_dbus_interface_get_vtable;\n'%(i.name_lower))
+ ' skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);\n');
+ self.c.write(' skeleton_class->get_info = %s_skeleton_dbus_interface_get_info;\n'%(i.name_lower))
+ self.c.write(' skeleton_class->get_properties = %s_skeleton_dbus_interface_get_properties;\n'%(i.name_lower))
+ self.c.write(' skeleton_class->flush = %s_skeleton_dbus_interface_flush;\n'%(i.name_lower))
+ self.c.write(' skeleton_class->get_vtable = %s_skeleton_dbus_interface_get_vtable;\n'%(i.name_lower))
self.c.write('}\n'
'\n')
# constructors
self.c.write('%s *\n'
- '%s_stub_new (void)\n'
+ '%s_skeleton_new (void)\n'
'{\n'
- ' return %s%s (g_object_new (%sTYPE_%s_STUB, NULL));\n'
+ ' return %s%s (g_object_new (%sTYPE_%s_SKELETON, NULL));\n'
'}\n'
'\n'%(i.camel_name, i.name_lower, i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
self.generate_method_calls(i)
self.generate_method_completers(i)
self.generate_proxy(i)
- self.generate_stub(i)
+ self.generate_skeleton(i)
if self.generate_objmanager:
self.generate_object_manager_client()
self.generate_outro()
* @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;
#include "config.h"
#include "gdbusinterface.h"
-#include "gdbusinterfacestub.h"
-#include "gdbusobjectstub.h"
+#include "gdbusinterfaceskeleton.h"
+#include "gdbusobjectskeleton.h"
#include "gio-marshal.h"
#include "gioenumtypes.h"
#include "gdbusprivate.h"
#include "glibintl.h"
/**
- * SECTION:gdbusinterfacestub
+ * SECTION:gdbusinterfaceskeleton
* @short_description: Service-side D-Bus interface
* @include: gio/gio.h
*
* Abstract base class for D-Bus interfaces on the service side.
*/
-struct _GDBusInterfaceStubPrivate
+struct _GDBusInterfaceSkeletonPrivate
{
GDBusObject *object;
- GDBusInterfaceStubFlags flags;
+ GDBusInterfaceSkeletonFlags flags;
guint registration_id;
GDBusConnection *connection;
static void dbus_interface_interface_init (GDBusInterfaceIface *iface);
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GDBusInterfaceStub, g_dbus_interface_stub, G_TYPE_OBJECT,
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GDBusInterfaceSkeleton, g_dbus_interface_skeleton, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_INTERFACE, dbus_interface_interface_init));
static void
-g_dbus_interface_stub_finalize (GObject *object)
+g_dbus_interface_skeleton_finalize (GObject *object)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (object);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (object);
/* unexport if already exported */
if (interface->priv->registration_id > 0)
- g_dbus_interface_stub_unexport (interface);
+ g_dbus_interface_skeleton_unexport (interface);
g_assert (interface->priv->connection == NULL);
g_assert (interface->priv->object_path == NULL);
if (interface->priv->object != NULL)
g_object_remove_weak_pointer (G_OBJECT (interface->priv->object), (gpointer *) &interface->priv->object);
- G_OBJECT_CLASS (g_dbus_interface_stub_parent_class)->finalize (object);
+ G_OBJECT_CLASS (g_dbus_interface_skeleton_parent_class)->finalize (object);
}
static void
-g_dbus_interface_stub_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+g_dbus_interface_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (object);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (object);
switch (prop_id)
{
case PROP_G_FLAGS:
- g_value_set_flags (value, g_dbus_interface_stub_get_flags (interface));
+ g_value_set_flags (value, g_dbus_interface_skeleton_get_flags (interface));
break;
default:
}
static void
-g_dbus_interface_stub_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_dbus_interface_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (object);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (object);
switch (prop_id)
{
case PROP_G_FLAGS:
- g_dbus_interface_stub_set_flags (interface, g_value_get_flags (value));
+ g_dbus_interface_skeleton_set_flags (interface, g_value_get_flags (value));
break;
default:
}
static gboolean
-g_dbus_interface_stub_g_authorize_method_default (GDBusInterfaceStub *interface,
- GDBusMethodInvocation *invocation)
+g_dbus_interface_skeleton_g_authorize_method_default (GDBusInterfaceSkeleton *interface,
+ GDBusMethodInvocation *invocation)
{
return TRUE;
}
static void
-g_dbus_interface_stub_class_init (GDBusInterfaceStubClass *klass)
+g_dbus_interface_skeleton_class_init (GDBusInterfaceSkeletonClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = g_dbus_interface_stub_finalize;
- gobject_class->set_property = g_dbus_interface_stub_set_property;
- gobject_class->get_property = g_dbus_interface_stub_get_property;
+ gobject_class->finalize = g_dbus_interface_skeleton_finalize;
+ gobject_class->set_property = g_dbus_interface_skeleton_set_property;
+ gobject_class->get_property = g_dbus_interface_skeleton_get_property;
- klass->g_authorize_method = g_dbus_interface_stub_g_authorize_method_default;
+ klass->g_authorize_method = g_dbus_interface_skeleton_g_authorize_method_default;
/**
- * GDBusInterfaceStub:g-flags:
+ * GDBusInterfaceSkeleton:g-flags:
*
- * Flags from the #GDBusInterfaceStubFlags enumeration.
+ * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
*
* Since: 2.30
*/
PROP_G_FLAGS,
g_param_spec_flags ("g-flags",
"g-flags",
- "Flags for the interface stub",
- G_TYPE_DBUS_INTERFACE_STUB_FLAGS,
- G_DBUS_INTERFACE_STUB_FLAGS_NONE,
+ "Flags for the interface skeleton",
+ G_TYPE_DBUS_INTERFACE_SKELETON_FLAGS,
+ G_DBUS_INTERFACE_SKELETON_FLAGS_NONE,
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_STATIC_STRINGS));
/**
- * GDBusInterfaceStub::g-authorize-method:
- * @interface: The #GDBusInterfaceStub emitting the signal.
+ * GDBusInterfaceSkeleton::g-authorize-method:
+ * @interface: The #GDBusInterfaceSkeleton emitting the signal.
* @invocation: A #GDBusMethodInvocation.
*
* Emitted when a method is invoked by a remote caller and used to
*
* Otherwise, if %TRUE is returned, signal emission continues. If no
* handlers return %FALSE, then the method is dispatched. If
- * @interface has an enclosing #GDBusObjectStub, then the
- * #GDBusObjectStub::authorize-method signal handlers run before the
- * handlers for this signal.
+ * @interface has an enclosing #GDBusObjectSkeleton, then the
+ * #GDBusObjectSkeleton::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
- * #GDBusObjectStub, if any) and #GDBusInterfaceStub:g-flags does
+ * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
* not have the
- * %G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
+ * %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.
*/
signals[G_AUTHORIZE_METHOD_SIGNAL] =
g_signal_new ("g-authorize-method",
- G_TYPE_DBUS_INTERFACE_STUB,
+ G_TYPE_DBUS_INTERFACE_SKELETON,
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GDBusInterfaceStubClass, g_authorize_method),
+ G_STRUCT_OFFSET (GDBusInterfaceSkeletonClass, g_authorize_method),
_g_signal_accumulator_false_handled,
NULL,
_gio_marshal_BOOLEAN__OBJECT,
1,
G_TYPE_DBUS_METHOD_INVOCATION);
- g_type_class_add_private (klass, sizeof (GDBusInterfaceStubPrivate));
+ g_type_class_add_private (klass, sizeof (GDBusInterfaceSkeletonPrivate));
}
static void
-g_dbus_interface_stub_init (GDBusInterfaceStub *interface)
+g_dbus_interface_skeleton_init (GDBusInterfaceSkeleton *interface)
{
- interface->priv = G_TYPE_INSTANCE_GET_PRIVATE (interface, G_TYPE_DBUS_INTERFACE_STUB, GDBusInterfaceStubPrivate);
+ interface->priv = G_TYPE_INSTANCE_GET_PRIVATE (interface, G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonPrivate);
}
/* ---------------------------------------------------------------------------------------------------- */
/**
- * g_dbus_interface_stub_get_flags:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_flags:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
- * Gets the #GDBusInterfaceStubFlags that describes what the behavior
+ * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
* of @interface_
*
- * Returns: One or more flags from the #GDBusInterfaceStubFlags enumeration.
+ * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
*
* Since: 2.30
*/
-GDBusInterfaceStubFlags
-g_dbus_interface_stub_get_flags (GDBusInterfaceStub *interface_)
+GDBusInterfaceSkeletonFlags
+g_dbus_interface_skeleton_get_flags (GDBusInterfaceSkeleton *interface_)
{
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), G_DBUS_INTERFACE_STUB_FLAGS_NONE);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), G_DBUS_INTERFACE_SKELETON_FLAGS_NONE);
return interface_->priv->flags;
}
/**
- * g_dbus_interface_stub_set_flags:
- * @interface_: A #GDBusInterfaceStub.
- * @flags: Flags from the #GDBusInterfaceStubFlags enumeration.
+ * g_dbus_interface_skeleton_set_flags:
+ * @interface_: A #GDBusInterfaceSkeleton.
+ * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
*
- * Sets flags describing what the behavior of @stub should be.
+ * Sets flags describing what the behavior of @skeleton should be.
*
* Since: 2.30
*/
void
-g_dbus_interface_stub_set_flags (GDBusInterfaceStub *interface_,
- GDBusInterfaceStubFlags flags)
+g_dbus_interface_skeleton_set_flags (GDBusInterfaceSkeleton *interface_,
+ GDBusInterfaceSkeletonFlags flags)
{
- g_return_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_));
+ g_return_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_));
if (interface_->priv->flags != flags)
{
interface_->priv->flags = flags;
}
/**
- * g_dbus_interface_stub_get_info:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_info:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Gets D-Bus introspection information for the D-Bus interface
* implemented by @interface_.
* Since: 2.30
*/
GDBusInterfaceInfo *
-g_dbus_interface_stub_get_info (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_get_info (GDBusInterfaceSkeleton *interface_)
{
GDBusInterfaceInfo *ret;
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), NULL);
- ret = G_DBUS_INTERFACE_STUB_GET_CLASS (interface_)->get_info (interface_);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), NULL);
+ ret = G_DBUS_INTERFACE_SKELETON_GET_CLASS (interface_)->get_info (interface_);
g_warn_if_fail (ret != NULL);
return ret;
}
/**
- * g_dbus_interface_stub_get_vtable:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_vtable:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Gets the interface vtable for the D-Bus interface implemented by
* @interface_. The returned function pointers should expect @interface_
* Since: 2.30
*/
GDBusInterfaceVTable *
-g_dbus_interface_stub_get_vtable (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_get_vtable (GDBusInterfaceSkeleton *interface_)
{
GDBusInterfaceVTable *ret;
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), NULL);
- ret = G_DBUS_INTERFACE_STUB_GET_CLASS (interface_)->get_vtable (interface_);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), NULL);
+ ret = G_DBUS_INTERFACE_SKELETON_GET_CLASS (interface_)->get_vtable (interface_);
g_warn_if_fail (ret != NULL);
return ret;
}
/**
- * g_dbus_interface_stub_get_properties:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_properties:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Gets all D-Bus properties for @interface_.
*
* Since: 2.30
*/
GVariant *
-g_dbus_interface_stub_get_properties (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_get_properties (GDBusInterfaceSkeleton *interface_)
{
GVariant *ret;
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), NULL);
- ret = G_DBUS_INTERFACE_STUB_GET_CLASS (interface_)->get_properties (interface_);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), NULL);
+ ret = G_DBUS_INTERFACE_SKELETON_GET_CLASS (interface_)->get_properties (interface_);
g_warn_if_fail (g_variant_is_floating (ret));
return ret;
}
/**
- * g_dbus_interface_stub_flush:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_flush:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* If @interface_ has outstanding changes, request for these changes to be
* emitted immediately.
* Since: 2.30
*/
void
-g_dbus_interface_stub_flush (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_flush (GDBusInterfaceSkeleton *interface_)
{
- g_return_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_));
- G_DBUS_INTERFACE_STUB_GET_CLASS (interface_)->flush (interface_);
+ g_return_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_));
+ G_DBUS_INTERFACE_SKELETON_GET_CLASS (interface_)->flush (interface_);
}
/* ---------------------------------------------------------------------------------------------------- */
static GDBusInterfaceInfo *
-_g_dbus_interface_stub_get_info (GDBusInterface *interface_)
+_g_dbus_interface_skeleton_get_info (GDBusInterface *interface_)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (interface_);
- return g_dbus_interface_stub_get_info (interface);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (interface_);
+ return g_dbus_interface_skeleton_get_info (interface);
}
static GDBusObject *
-g_dbus_interface_stub_get_object (GDBusInterface *interface_)
+g_dbus_interface_skeleton_get_object (GDBusInterface *interface_)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (interface_);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (interface_);
return interface->priv->object;
}
static void
-g_dbus_interface_stub_set_object (GDBusInterface *interface_,
- GDBusObject *object)
+g_dbus_interface_skeleton_set_object (GDBusInterface *interface_,
+ GDBusObject *object)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (interface_);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (interface_);
if (interface->priv->object != NULL)
g_object_remove_weak_pointer (G_OBJECT (interface->priv->object), (gpointer *) &interface->priv->object);
interface->priv->object = object;
static void
dbus_interface_interface_init (GDBusInterfaceIface *iface)
{
- iface->get_info = _g_dbus_interface_stub_get_info;
- iface->get_object = g_dbus_interface_stub_get_object;
- iface->set_object = g_dbus_interface_stub_set_object;
+ iface->get_info = _g_dbus_interface_skeleton_get_info;
+ iface->get_object = g_dbus_interface_skeleton_get_object;
+ iface->set_object = g_dbus_interface_skeleton_set_object;
}
/* ---------------------------------------------------------------------------------------------------- */
typedef struct
{
volatile gint ref_count;
- GDBusInterfaceStub *interface;
+ GDBusInterfaceSkeleton *interface;
GDBusInterfaceMethodCallFunc method_call_func;
GDBusMethodInvocation *invocation;
GMainContext *context;
if (authorized)
{
gboolean run_in_thread;
- run_in_thread = (data->interface->priv->flags & G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
+ run_in_thread = (data->interface->priv->flags & G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
if (run_in_thread)
{
/* might as well just re-use the existing thread */
}
static void
-g_dbus_interface_method_dispatch_helper (GDBusInterfaceStub *interface,
+g_dbus_interface_method_dispatch_helper (GDBusInterfaceSkeleton *interface,
GDBusInterfaceMethodCallFunc method_call_func,
GDBusMethodInvocation *invocation)
{
gboolean emit_authorized_signal;
gboolean run_in_thread;
- g_return_if_fail (G_IS_DBUS_INTERFACE_STUB (interface));
+ g_return_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface));
g_return_if_fail (method_call_func != NULL);
g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation));
signals[G_AUTHORIZE_METHOD_SIGNAL],
0,
TRUE);
- has_default_class_handler = (G_DBUS_INTERFACE_STUB_GET_CLASS (interface)->g_authorize_method ==
- g_dbus_interface_stub_g_authorize_method_default);
+ has_default_class_handler = (G_DBUS_INTERFACE_SKELETON_GET_CLASS (interface)->g_authorize_method ==
+ g_dbus_interface_skeleton_g_authorize_method_default);
emit_authorized_signal = (has_handlers || !has_default_class_handler);
if (!emit_authorized_signal)
{
if (interface->priv->object != NULL)
- emit_authorized_signal = _g_dbus_object_stub_has_authorize_method_handlers (G_DBUS_OBJECT_STUB (interface->priv->object));
+ emit_authorized_signal = _g_dbus_object_skeleton_has_authorize_method_handlers (G_DBUS_OBJECT_SKELETON (interface->priv->object));
}
- run_in_thread = (interface->priv->flags & G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
+ run_in_thread = (interface->priv->flags & G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
if (!emit_authorized_signal && !run_in_thread)
{
method_call_func (g_dbus_method_invocation_get_connection (invocation),
}
static void
-stub_intercept_handle_method_call(GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *method_name,
- GVariant *parameters,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+skeleton_intercept_handle_method_call (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- GDBusInterfaceStub *interface = G_DBUS_INTERFACE_STUB (user_data);
+ GDBusInterfaceSkeleton *interface = G_DBUS_INTERFACE_SKELETON (user_data);
g_dbus_interface_method_dispatch_helper (interface,
- g_dbus_interface_stub_get_vtable (interface)->method_call,
+ g_dbus_interface_skeleton_get_vtable (interface)->method_call,
invocation);
}
/* ---------------------------------------------------------------------------------------------------- */
/**
- * g_dbus_interface_stub_get_connection:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_connection:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Gets the connection that @interface_ is exported on, if any.
*
* Since: 2.30
*/
GDBusConnection *
-g_dbus_interface_stub_get_connection (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_get_connection (GDBusInterfaceSkeleton *interface_)
{
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), NULL);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), NULL);
return interface_->priv->connection;
}
/**
- * g_dbus_interface_stub_get_object_path:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_get_object_path:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Gets the object path that @interface_ is exported on, if any.
*
* Since: 2.30
*/
const gchar *
-g_dbus_interface_stub_get_object_path (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_get_object_path (GDBusInterfaceSkeleton *interface_)
{
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), NULL);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), NULL);
return interface_->priv->object_path;
}
/**
- * g_dbus_interface_stub_export:
+ * g_dbus_interface_skeleton_export:
* @interface_: The D-Bus interface to export.
* @connection: A #GDBusConnection to export @interface_ on.
* @object_path: The path to export the interface at.
*
* Exports @interface_ at @object_path on @connection.
*
- * Use g_dbus_interface_stub_unexport() to unexport the object.
+ * Use g_dbus_interface_skeleton_unexport() to unexport the object.
*
* Returns: %TRUE if the interface was exported, other %FALSE with
* @error set.
* Since: 2.30
*/
gboolean
-g_dbus_interface_stub_export (GDBusInterfaceStub *interface_,
- GDBusConnection *connection,
- const gchar *object_path,
- GError **error)
+g_dbus_interface_skeleton_export (GDBusInterfaceSkeleton *interface_,
+ GDBusConnection *connection,
+ const gchar *object_path,
+ GError **error)
{
gboolean ret;
- g_return_val_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_), 0);
+ g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), 0);
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0);
g_return_val_if_fail (g_variant_is_object_path (object_path), 0);
g_return_val_if_fail (error == NULL || *error == NULL, 0);
* ::g-authorize-method and for dispatching in thread vs
* context
*/
- interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_stub_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
- interface_->priv->hooked_vtable->method_call = stub_intercept_handle_method_call;
+ interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
+ interface_->priv->hooked_vtable->method_call = skeleton_intercept_handle_method_call;
interface_->priv->connection = g_object_ref (connection);
interface_->priv->object_path = g_strdup (object_path);
interface_->priv->registration_id = g_dbus_connection_register_object (connection,
object_path,
- g_dbus_interface_stub_get_info (interface_),
+ g_dbus_interface_skeleton_get_info (interface_),
interface_->priv->hooked_vtable,
interface_,
NULL, /* user_data_free_func */
}
/**
- * g_dbus_interface_stub_unexport:
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_interface_skeleton_unexport:
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Stops exporting an interface previously exported with
- * g_dbus_interface_stub_export().
+ * g_dbus_interface_skeleton_export().
*
* Since: 2.30
*/
void
-g_dbus_interface_stub_unexport (GDBusInterfaceStub *interface_)
+g_dbus_interface_skeleton_unexport (GDBusInterfaceSkeleton *interface_)
{
- g_return_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_));
+ g_return_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_));
g_return_if_fail (interface_->priv->registration_id > 0);
g_assert (interface_->priv->connection != NULL);
--- /dev/null
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_INTERFACE_SKELETON_H__
+#define __G_DBUS_INTERFACE_SKELETON_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#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 _GDBusInterfaceSkeletonClass GDBusInterfaceSkeletonClass;
+typedef struct _GDBusInterfaceSkeletonPrivate GDBusInterfaceSkeletonPrivate;
+
+/**
+ * GDBusInterfaceSkeleton:
+ *
+ * The #GDBusInterfaceSkeleton structure contains private data and should
+ * only be accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusInterfaceSkeleton
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusInterfaceSkeletonPrivate *priv;
+};
+
+/**
+ * GDBusInterfaceSkeletonClass:
+ * @parent_class: The parent class.
+ * @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 #GDBusInterfaceSkeleton.
+ *
+ * Since: 2.30
+ */
+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_);
+
+ /*< private >*/
+ gpointer vfunc_padding[8];
+ /*< public >*/
+
+ /* Signals */
+ gboolean (*g_authorize_method) (GDBusInterfaceSkeleton *interface_,
+ GDBusMethodInvocation *invocation);
+
+ /*< private >*/
+ gpointer signal_padding[8];
+};
+
+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_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_SKELETON_H */
+++ /dev/null
-/* GDBus - GLib D-Bus Library
- *
- * Copyright (C) 2008-2010 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: David Zeuthen <davidz@redhat.com>
- */
-
-#ifndef __G_DBUS_INTERFACE_STUB_H__
-#define __G_DBUS_INTERFACE_STUB_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))
-
-typedef struct _GDBusInterfaceStubClass GDBusInterfaceStubClass;
-typedef struct _GDBusInterfaceStubPrivate GDBusInterfaceStubPrivate;
-
-/**
- * GDBusInterfaceStub:
- *
- * The #GDBusInterfaceStub structure contains private data and should
- * only be accessed using the provided API.
- *
- * Since: 2.30
- */
-struct _GDBusInterfaceStub
-{
- /*< private >*/
- GObject parent_instance;
- GDBusInterfaceStubPrivate *priv;
-};
-
-/**
- * GDBusInterfaceStubClass:
- * @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.
- *
- * Class structure for #GDBusInterfaceStub.
- *
- * Since: 2.30
- */
-struct _GDBusInterfaceStubClass
-{
- GObjectClass parent_class;
-
- /* Virtual Functions */
- GDBusInterfaceInfo *(*get_info) (GDBusInterfaceStub *interface_);
- GDBusInterfaceVTable *(*get_vtable) (GDBusInterfaceStub *interface_);
- GVariant *(*get_properties) (GDBusInterfaceStub *interface_);
- void (*flush) (GDBusInterfaceStub *interface_);
-
- /*< private >*/
- gpointer vfunc_padding[8];
- /*< public >*/
-
- /* Signals */
- gboolean (*g_authorize_method) (GDBusInterfaceStub *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_);
-
-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_);
-
-G_END_DECLS
-
-#endif /* __G_DBUS_INTERFACE_STUB_H */
* @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.
*/
#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"
typedef struct
{
- GDBusObjectStub *object;
+ GDBusObjectSkeleton *object;
GDBusObjectManagerServer *manager;
GHashTable *map_iface_name_to_iface;
gboolean exported;
/* ---------------------------------------------------------------------------------------------------- */
static void
-registration_data_export_interface (RegistrationData *data,
- GDBusInterfaceStub *interface_stub)
+registration_data_export_interface (RegistrationData *data,
+ GDBusInterfaceSkeleton *interface_skeleton)
{
GDBusInterfaceInfo *info;
GError *error;
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",
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)
}
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));
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
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));
}
/* ---------------------------------------------------------------------------------------------------- */
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);
/**
* g_dbus_object_manager_server_export:
* @manager: A #GDBusObjectManagerServer.
- * @object: A #GDBusObjectStub.
+ * @object: A #GDBusObjectSkeleton.
*
* Exports @object on @manager.
*
*/
void
g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
- GDBusObjectStub *object)
+ GDBusObjectSkeleton *object)
{
RegistrationData *data;
GList *existing_interfaces;
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);
* 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;
}
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);
{
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}}"));
{
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,
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;
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);
#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"
#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;
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)
{
}
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:
}
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.
*
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.
*
* Emitted when a method is invoked by a remote caller and used to
* determine if the method call is authorized.
*
- * This signal is like #GDBusInterfaceStub<!-- -->'s
- * #GDBusInterfaceStub::g-authorize-method signal, except that it is
+ * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
+ * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
* for the enclosing object.
*
* The default class handler just returns %TRUE.
*/
signals[AUTHORIZE_METHOD_SIGNAL] =
g_signal_new ("authorize-method",
- G_TYPE_DBUS_OBJECT_STUB,
+ G_TYPE_DBUS_OBJECT_SKELETON,
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GDBusObjectStubClass, authorize_method),
+ G_STRUCT_OFFSET (GDBusObjectSkeletonClass, authorize_method),
_g_signal_accumulator_false_handled,
NULL,
_gio_marshal_BOOLEAN__OBJECT_OBJECT,
G_TYPE_BOOLEAN,
2,
- G_TYPE_DBUS_INTERFACE_STUB,
+ G_TYPE_DBUS_INTERFACE_SKELETON,
G_TYPE_DBUS_METHOD_INVOCATION);
- g_type_class_add_private (klass, sizeof (GDBusObjectStubPrivate));
+ g_type_class_add_private (klass, sizeof (GDBusObjectSkeletonPrivate));
}
static void
-g_dbus_object_stub_init (GDBusObjectStub *object)
+g_dbus_object_skeleton_init (GDBusObjectSkeleton *object)
{
- object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, G_TYPE_DBUS_OBJECT_STUB, GDBusObjectStubPrivate);
+ object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonPrivate);
object->priv->map_name_to_iface = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
}
/**
- * g_dbus_object_stub_new:
+ * g_dbus_object_skeleton_new:
* @object_path: An object path.
*
- * Creates a new #GDBusObjectStub.
+ * Creates a new #GDBusObjectSkeleton.
*
- * Returns: A #GDBusObjectStub. Free with g_object_unref().
+ * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
*
* Since: 2.30
*/
-GDBusObjectStub *
-g_dbus_object_stub_new (const gchar *object_path)
+GDBusObjectSkeleton *
+g_dbus_object_skeleton_new (const gchar *object_path)
{
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
- return G_DBUS_OBJECT_STUB (g_object_new (G_TYPE_DBUS_OBJECT_STUB,
- "object-path", object_path,
- NULL));
+ return G_DBUS_OBJECT_SKELETON (g_object_new (G_TYPE_DBUS_OBJECT_SKELETON,
+ "object-path", object_path,
+ NULL));
}
/**
- * g_dbus_object_stub_set_object_path:
- * @object: A #GDBusObjectStub.
+ * g_dbus_object_skeleton_set_object_path:
+ * @object: A #GDBusObjectSkeleton.
* @object_path: A valid D-Bus object path.
*
* Sets the object path for @object.
* Since: 2.30
*/
void
-g_dbus_object_stub_set_object_path (GDBusObjectStub *object,
- const gchar *object_path)
+g_dbus_object_skeleton_set_object_path (GDBusObjectSkeleton *object,
+ const gchar *object_path)
{
- g_return_if_fail (G_IS_DBUS_OBJECT_STUB (object));
+ g_return_if_fail (G_IS_DBUS_OBJECT_SKELETON (object));
g_return_if_fail (object_path == NULL || g_variant_is_object_path (object_path));
/* TODO: fail if object is currently exported */
if (g_strcmp0 (object->priv->object_path, object_path) != 0)
}
static const gchar *
-g_dbus_object_stub_get_object_path (GDBusObject *_object)
+g_dbus_object_skeleton_get_object_path (GDBusObject *_object)
{
- GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
+ GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
return object->priv->object_path;
}
/**
- * g_dbus_object_stub_add_interface:
- * @object: A #GDBusObjectStub.
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_object_skeleton_add_interface:
+ * @object: A #GDBusObjectSkeleton.
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Adds @interface_ to @object.
*
- * If @object already contains a #GDBusInterfaceStub with the same
+ * If @object already contains a #GDBusInterfaceSkeleton with the same
* interface name, it is removed before @interface_ is added.
*
* Note that @object takes its own reference on @interface_ and holds
* Since: 2.30
*/
void
-g_dbus_object_stub_add_interface (GDBusObjectStub *object,
- GDBusInterfaceStub *interface_)
+g_dbus_object_skeleton_add_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_)
{
GDBusInterfaceInfo *info;
- g_return_if_fail (G_IS_DBUS_OBJECT_STUB (object));
- g_return_if_fail (G_IS_DBUS_INTERFACE_STUB (interface_));
+ g_return_if_fail (G_IS_DBUS_OBJECT_SKELETON (object));
+ g_return_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_));
- info = g_dbus_interface_stub_get_info (interface_);
+ info = g_dbus_interface_skeleton_get_info (interface_);
g_object_ref (interface_);
- g_dbus_object_stub_remove_interface_by_name (object, info->name);
+ g_dbus_object_skeleton_remove_interface_by_name (object, info->name);
g_hash_table_insert (object->priv->map_name_to_iface,
g_strdup (info->name),
interface_);
}
/**
- * g_dbus_object_stub_remove_interface:
- * @object: A #GDBusObjectStub.
- * @interface_: A #GDBusInterfaceStub.
+ * g_dbus_object_skeleton_remove_interface:
+ * @object: A #GDBusObjectSkeleton.
+ * @interface_: A #GDBusInterfaceSkeleton.
*
* Removes @interface_ from @object.
*
* Since: 2.30
*/
void
-g_dbus_object_stub_remove_interface (GDBusObjectStub *object,
- GDBusInterfaceStub *interface_)
+g_dbus_object_skeleton_remove_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_)
{
- GDBusInterfaceStub *other_interface;
+ GDBusInterfaceSkeleton *other_interface;
GDBusInterfaceInfo *info;
- g_return_if_fail (G_IS_DBUS_OBJECT_STUB (object));
+ g_return_if_fail (G_IS_DBUS_OBJECT_SKELETON (object));
g_return_if_fail (G_IS_DBUS_INTERFACE (interface_));
- info = g_dbus_interface_stub_get_info (interface_);
+ info = g_dbus_interface_skeleton_get_info (interface_);
other_interface = g_hash_table_lookup (object->priv->map_name_to_iface, info->name);
if (other_interface == NULL)
/**
- * g_dbus_object_stub_remove_interface_by_name:
- * @object: A #GDBusObjectStub.
+ * g_dbus_object_skeleton_remove_interface_by_name:
+ * @object: A #GDBusObjectSkeleton.
* @interface_name: A D-Bus interface name.
*
* Removes the #GDBusInterface with @interface_name from @object.
* Since: 2.30
*/
void
-g_dbus_object_stub_remove_interface_by_name (GDBusObjectStub *object,
- const gchar *interface_name)
+g_dbus_object_skeleton_remove_interface_by_name (GDBusObjectSkeleton *object,
+ const gchar *interface_name)
{
GDBusInterface *interface;
- g_return_if_fail (G_IS_DBUS_OBJECT_STUB (object));
+ g_return_if_fail (G_IS_DBUS_OBJECT_SKELETON (object));
g_return_if_fail (g_dbus_is_interface_name (interface_name));
interface = g_hash_table_lookup (object->priv->map_name_to_iface, interface_name);
}
static GDBusInterface *
-g_dbus_object_stub_get_interface (GDBusObject *_object,
- const gchar *interface_name)
+g_dbus_object_skeleton_get_interface (GDBusObject *_object,
+ const gchar *interface_name)
{
- GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
+ GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
GDBusInterface *ret;
- g_return_val_if_fail (G_IS_DBUS_OBJECT_STUB (object), NULL);
+ g_return_val_if_fail (G_IS_DBUS_OBJECT_SKELETON (object), NULL);
g_return_val_if_fail (g_dbus_is_interface_name (interface_name), NULL);
ret = g_hash_table_lookup (object->priv->map_name_to_iface, interface_name);
}
static GList *
-g_dbus_object_stub_get_interfaces (GDBusObject *_object)
+g_dbus_object_skeleton_get_interfaces (GDBusObject *_object)
{
- GDBusObjectStub *object = G_DBUS_OBJECT_STUB (_object);
+ GDBusObjectSkeleton *object = G_DBUS_OBJECT_SKELETON (_object);
GList *ret;
GHashTableIter iter;
GDBusInterface *interface;
- g_return_val_if_fail (G_IS_DBUS_OBJECT_STUB (object), NULL);
+ g_return_val_if_fail (G_IS_DBUS_OBJECT_SKELETON (object), NULL);
ret = NULL;
}
/**
- * g_dbus_object_stub_flush:
- * @object: A #GDBusObjectStub.
+ * g_dbus_object_skeleton_flush:
+ * @object: A #GDBusObjectSkeleton.
*
- * This method simply calls g_dbus_interface_stub_flush() on all
- * interfaces stubs belonging to @object. See that method for when
- * flushing is useful.
+ * This method simply calls g_dbus_interface_skeleton_flush() on all
+ * interfaces belonging to @object. See that method for when flushing
+ * is useful.
*
* Since: 2.30
*/
void
-g_dbus_object_stub_flush (GDBusObjectStub *object)
+g_dbus_object_skeleton_flush (GDBusObjectSkeleton *object)
{
GHashTableIter iter;
- GDBusInterfaceStub *interface_stub;
+ GDBusInterfaceSkeleton *interface_skeleton;
g_hash_table_iter_init (&iter, object->priv->map_name_to_iface);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer) &interface_stub))
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer) &interface_skeleton))
{
- g_dbus_interface_stub_flush (interface_stub);
+ g_dbus_interface_skeleton_flush (interface_skeleton);
}
}
static gpointer
-g_dbus_object_stub_lookup_with_typecheck (GDBusObject *object,
- const gchar *interface_name,
- GType type)
+g_dbus_object_skeleton_lookup_with_typecheck (GDBusObject *object,
+ const gchar *interface_name,
+ GType type)
{
- GDBusObjectStub *stub = G_DBUS_OBJECT_STUB (object);
+ GDBusObjectSkeleton *skeleton = G_DBUS_OBJECT_SKELETON (object);
GDBusProxy *ret;
- ret = g_hash_table_lookup (stub->priv->map_name_to_iface, interface_name);
+ ret = g_hash_table_lookup (skeleton->priv->map_name_to_iface, interface_name);
if (ret != NULL)
{
g_warn_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ret, type));
}
static gpointer
-g_dbus_object_stub_peek_with_typecheck (GDBusObject *object,
- const gchar *interface_name,
- GType type)
+g_dbus_object_skeleton_peek_with_typecheck (GDBusObject *object,
+ const gchar *interface_name,
+ GType type)
{
- GDBusInterfaceStub *ret;
- ret = g_dbus_object_stub_lookup_with_typecheck (object, interface_name, type);
+ GDBusInterfaceSkeleton *ret;
+ ret = g_dbus_object_skeleton_lookup_with_typecheck (object, interface_name, type);
if (ret != NULL)
g_object_unref (ret);
return ret;
static void
dbus_object_interface_init (GDBusObjectIface *iface)
{
- iface->get_object_path = g_dbus_object_stub_get_object_path;
- iface->get_interfaces = g_dbus_object_stub_get_interfaces;
- iface->get_interface = g_dbus_object_stub_get_interface;
- iface->lookup_with_typecheck = g_dbus_object_stub_lookup_with_typecheck;
- iface->peek_with_typecheck = g_dbus_object_stub_peek_with_typecheck;
+ iface->get_object_path = g_dbus_object_skeleton_get_object_path;
+ iface->get_interfaces = g_dbus_object_skeleton_get_interfaces;
+ iface->get_interface = g_dbus_object_skeleton_get_interface;
+ iface->lookup_with_typecheck = g_dbus_object_skeleton_lookup_with_typecheck;
+ iface->peek_with_typecheck = g_dbus_object_skeleton_peek_with_typecheck;
}
gboolean
-_g_dbus_object_stub_has_authorize_method_handlers (GDBusObjectStub *stub)
+_g_dbus_object_skeleton_has_authorize_method_handlers (GDBusObjectSkeleton *object)
{
gboolean has_handlers;
gboolean has_default_class_handler;
- has_handlers = g_signal_has_handler_pending (stub,
+ has_handlers = g_signal_has_handler_pending (object,
signals[AUTHORIZE_METHOD_SIGNAL],
0,
TRUE);
- has_default_class_handler = (G_DBUS_OBJECT_STUB_GET_CLASS (stub)->authorize_method ==
- g_dbus_object_stub_authorize_method_default);
+ has_default_class_handler = (G_DBUS_OBJECT_SKELETON_GET_CLASS (object)->authorize_method ==
+ g_dbus_object_skeleton_authorize_method_default);
return has_handlers || !has_default_class_handler;
}
--- /dev/null
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_SKELETON_H__
+#define __G_DBUS_OBJECT_SKELETON_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_SKELETON (g_dbus_object_skeleton_get_type ())
+#define G_DBUS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeleton))
+#define G_DBUS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonClass))
+#define G_DBUS_OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonClass))
+#define G_IS_DBUS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_SKELETON))
+#define G_IS_DBUS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_SKELETON))
+
+typedef struct _GDBusObjectSkeletonClass GDBusObjectSkeletonClass;
+typedef struct _GDBusObjectSkeletonPrivate GDBusObjectSkeletonPrivate;
+
+/**
+ * GDBusObjectSkeleton:
+ *
+ * The #GDBusObjectSkeleton structure contains private data and should only be
+ * accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectSkeleton
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusObjectSkeletonPrivate *priv;
+};
+
+/**
+ * GDBusObjectSkeletonClass:
+ * @parent_class: The parent class.
+ * @authorize_method: Signal class handler for the #GDBusObjectSkeleton::authorize-method signal.
+ *
+ * Class structure for #GDBusObjectSkeleton.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectSkeletonClass
+{
+ GObjectClass parent_class;
+
+ /* Signals */
+ gboolean (*authorize_method) (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_,
+ GDBusMethodInvocation *invocation);
+
+ /*< private >*/
+ gpointer padding[8];
+};
+
+GType g_dbus_object_skeleton_get_type (void) G_GNUC_CONST;
+GDBusObjectSkeleton *g_dbus_object_skeleton_new (const gchar *object_path);
+void g_dbus_object_skeleton_flush (GDBusObjectSkeleton *object);
+void g_dbus_object_skeleton_add_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_);
+void g_dbus_object_skeleton_remove_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_);
+void g_dbus_object_skeleton_remove_interface_by_name (GDBusObjectSkeleton *object,
+ const gchar *interface_name);
+void g_dbus_object_skeleton_set_object_path (GDBusObjectSkeleton *object,
+ const gchar *object_path);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_SKELETON_H */
+++ /dev/null
-/* GDBus - GLib D-Bus Library
- *
- * Copyright (C) 2008-2010 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: David Zeuthen <davidz@redhat.com>
- */
-
-#ifndef __G_DBUS_OBJECT_STUB_H__
-#define __G_DBUS_OBJECT_STUB_H__
-
-#include <gio/giotypes.h>
-
-G_BEGIN_DECLS
-
-#define G_TYPE_DBUS_OBJECT_STUB (g_dbus_object_stub_get_type ())
-#define G_DBUS_OBJECT_STUB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_STUB, GDBusObjectStub))
-#define G_DBUS_OBJECT_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_STUB, GDBusObjectStubClass))
-#define G_DBUS_OBJECT_STUB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_STUB, GDBusObjectStubClass))
-#define G_IS_DBUS_OBJECT_STUB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_STUB))
-#define G_IS_DBUS_OBJECT_STUB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_STUB))
-
-typedef struct _GDBusObjectStubClass GDBusObjectStubClass;
-typedef struct _GDBusObjectStubPrivate GDBusObjectStubPrivate;
-
-/**
- * GDBusObjectStub:
- *
- * The #GDBusObjectStub structure contains private data and should only be
- * accessed using the provided API.
- *
- * Since: 2.30
- */
-struct _GDBusObjectStub
-{
- /*< private >*/
- GObject parent_instance;
- GDBusObjectStubPrivate *priv;
-};
-
-/**
- * GDBusObjectStubClass:
- * @parent_class: The parent class.
- * @authorize_method: Signal class handler for the #GDBusObjectStub::authorize-method signal.
- *
- * Class structure for #GDBusObjectStub.
- *
- * Since: 2.30
- */
-struct _GDBusObjectStubClass
-{
- GObjectClass parent_class;
-
- /* Signals */
- gboolean (*authorize_method) (GDBusObjectStub *stub,
- GDBusInterfaceStub *interface_stub,
- GDBusMethodInvocation *invocation);
-
- /*< private >*/
- gpointer padding[8];
-};
-
-GType g_dbus_object_stub_get_type (void) G_GNUC_CONST;
-GDBusObjectStub *g_dbus_object_stub_new (const gchar *object_path);
-void g_dbus_object_stub_flush (GDBusObjectStub *object);
-void g_dbus_object_stub_add_interface (GDBusObjectStub *object,
- GDBusInterfaceStub *interface_);
-void g_dbus_object_stub_remove_interface (GDBusObjectStub *object,
- GDBusInterfaceStub *interface_);
-void g_dbus_object_stub_remove_interface_by_name (GDBusObjectStub *object,
- const gchar *interface_name);
-void g_dbus_object_stub_set_object_path (GDBusObjectStub *object,
- const gchar *object_path);
-
-G_END_DECLS
-
-#endif /* __G_DBUS_OBJECT_STUB_H */
const GValue *handler_return,
gpointer dummy);
-gboolean _g_dbus_object_stub_has_authorize_method_handlers (GDBusObjectStub *stub);
+gboolean _g_dbus_object_skeleton_has_authorize_method_handlers (GDBusObjectSkeleton *object);
GDBusObjectProxy *_g_dbus_object_proxy_new (GDBusConnection *connection,
const gchar *object_path);
#include <gio/gzlibcompressor.h>
#include <gio/gzlibdecompressor.h>
#include <gio/gdbusinterface.h>
-#include <gio/gdbusinterfacestub.h>
+#include <gio/gdbusinterfaceskeleton.h>
#include <gio/gdbusobject.h>
-#include <gio/gdbusobjectstub.h>
+#include <gio/gdbusobjectskeleton.h>
#include <gio/gdbusobjectproxy.h>
#include <gio/gdbusobjectmanager.h>
#include <gio/gdbusobjectmanagerclient.h>
#endif
#endif
-#if IN_HEADER(__G_DBUS_INTERFACE_STUB_H__)
-#if IN_FILE(__G_DBUS_INTERFACE_STUB_C__)
-g_dbus_interface_stub_export
-g_dbus_interface_stub_flags_get_type
-g_dbus_interface_stub_flush
-g_dbus_interface_stub_get_connection
-g_dbus_interface_stub_get_flags
-g_dbus_interface_stub_get_info
-g_dbus_interface_stub_get_object_path
-g_dbus_interface_stub_get_properties
-g_dbus_interface_stub_get_type
-g_dbus_interface_stub_get_vtable
-g_dbus_interface_stub_set_flags
-g_dbus_interface_stub_unexport
+#if IN_HEADER(__G_DBUS_INTERFACE_SKELETON_H__)
+#if IN_FILE(__G_DBUS_INTERFACE_SKELETON_C__)
+g_dbus_interface_skeleton_export
+g_dbus_interface_skeleton_flags_get_type
+g_dbus_interface_skeleton_flush
+g_dbus_interface_skeleton_get_connection
+g_dbus_interface_skeleton_get_flags
+g_dbus_interface_skeleton_get_info
+g_dbus_interface_skeleton_get_object_path
+g_dbus_interface_skeleton_get_properties
+g_dbus_interface_skeleton_get_type
+g_dbus_interface_skeleton_get_vtable
+g_dbus_interface_skeleton_set_flags
+g_dbus_interface_skeleton_unexport
#endif
#endif
#endif
#endif
-#if IN_HEADER(__G_DBUS_OBJECT_STUB_H__)
-#if IN_FILE(__G_DBUS_OBJECT_STUB_C__)
-g_dbus_object_stub_add_interface
-g_dbus_object_stub_flush
-g_dbus_object_stub_get_type
-g_dbus_object_stub_new
-g_dbus_object_stub_remove_interface
-g_dbus_object_stub_remove_interface_by_name
-g_dbus_object_stub_set_object_path
+#if IN_HEADER(__G_DBUS_OBJECT_SKELETON_H__)
+#if IN_FILE(__G_DBUS_OBJECT_SKELETON_C__)
+g_dbus_object_skeleton_add_interface
+g_dbus_object_skeleton_flush
+g_dbus_object_skeleton_get_type
+g_dbus_object_skeleton_new
+g_dbus_object_skeleton_remove_interface
+g_dbus_object_skeleton_remove_interface_by_name
+g_dbus_object_skeleton_set_object_path
#endif
#endif
} GTlsRehandshakeMode;
/**
- * GDBusInterfaceStubFlags:
- * @G_DBUS_INTERFACE_STUB_FLAGS_NONE: No flags set.
- * @G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD: Each method invocation is handled in
+ * GDBusInterfaceSkeletonFlags:
+ * @G_DBUS_INTERFACE_SKELETON_FLAGS_NONE: No flags set.
+ * @G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD: Each method invocation is handled in
* a thread dedicated to the invocation. This means that the method implementation can use blocking IO
* without blocking any other part of the process. It also means that the method implementation must
* use locking to access data structures used by other threads.
*
- * Flags describing the behavior of a #GDBusInterfaceStub class.
+ * Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
*
* Since: 2.30
*/
typedef enum
{
- G_DBUS_INTERFACE_STUB_FLAGS_NONE = 0,
- G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD = (1<<0)
-} GDBusInterfaceStubFlags;
+ G_DBUS_INTERFACE_SKELETON_FLAGS_NONE = 0,
+ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD = (1<<0)
+} GDBusInterfaceSkeletonFlags;
/**
* GDBusObjectManagerClientFlags:
gpointer user_data);
typedef struct _GDBusInterface GDBusInterface; /* Dummy typedef */
-typedef struct _GDBusInterfaceStub GDBusInterfaceStub;
+typedef struct _GDBusInterfaceSkeleton GDBusInterfaceSkeleton;
typedef struct _GDBusObject GDBusObject; /* Dummy typedef */
-typedef struct _GDBusObjectStub GDBusObjectStub;
+typedef struct _GDBusObjectSkeleton GDBusObjectSkeleton;
typedef struct _GDBusObjectProxy GDBusObjectProxy;
typedef struct _GDBusObjectManager GDBusObjectManager; /* Dummy typedef */
typedef struct _GDBusObjectManagerClient GDBusObjectManagerClient;
const gchar *name,
gpointer user_data)
{
- GDBusObjectStub *object;
+ GDBusObjectSkeleton *object;
guint n;
g_print ("Acquired a message bus connection\n");
/* Create a new D-Bus object at the path /example/Animals/N where N is 000..009 */
s = g_strdup_printf ("/example/Animals/%03d", n);
- object = g_dbus_object_stub_new (s);
+ object = g_dbus_object_skeleton_new (s);
g_free (s);
/* Make the newly created object export the interface
* org.gtk.GDBus.Example.ObjectManager.Animal (note
* that @object takes its own reference to @animal).
*/
- animal = example_animal_stub_new ();
+ animal = example_animal_skeleton_new ();
example_animal_set_mood (animal, "Happy");
- g_dbus_object_stub_add_interface (object, G_DBUS_INTERFACE_STUB (animal));
+ g_dbus_object_skeleton_add_interface (object, G_DBUS_INTERFACE_SKELETON (animal));
g_object_unref (animal);
/* Cats are odd animals - so some of our objects implement the
if (n % 2 == 1)
{
ExampleCat *cat;
- cat = example_cat_stub_new ();
- g_dbus_object_stub_add_interface (object, G_DBUS_INTERFACE_STUB (cat));
+ cat = example_cat_skeleton_new ();
+ g_dbus_object_skeleton_add_interface (object, G_DBUS_INTERFACE_SKELETON (cat));
g_object_unref (cat);
}
gpointer user_data)
{
gchar *response;
- response = g_strdup_printf ("Word! You said `%s'. I'm Stub, btw!", greeting);
+ response = g_strdup_printf ("Word! You said `%s'. I'm Skeleton, btw!", greeting);
foo_bar_complete_hello_world (object, invocation, response);
g_free (response);
return TRUE;
foo_bar_set_i (object, foo_bar_get_i (object) + 1);
foo_bar_set_y (object, foo_bar_get_y (object) + 1);
foo_bar_set_i (object, foo_bar_get_i (object) + 1);
- g_dbus_interface_stub_flush (G_DBUS_INTERFACE_STUB (object));
+ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (object));
foo_bar_set_y (object, foo_bar_get_y (object) + 1);
foo_bar_set_i (object, foo_bar_get_i (object) + 1);
foo_bar_complete_request_multi_property_mods (object, invocation);
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-my_g_authorize_method_handler (GDBusInterfaceStub *interface,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+my_g_authorize_method_handler (GDBusInterfaceSkeleton *interface,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
const gchar *method_name;
gboolean authorized;
}
static gboolean
-my_object_authorize_method_handler (GDBusObjectStub *object,
- GDBusInterfaceStub *interface,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+my_object_authorize_method_handler (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
const gchar *method_name;
gboolean authorized;
static FooBar *exported_bar_object = NULL;
static FooBat *exported_bat_object = NULL;
static FooAuthorize *exported_authorize_object = NULL;
-static GDBusObjectStub *authorize_enclosing_object = NULL;
+static GDBusObjectSkeleton *authorize_enclosing_object = NULL;
static FooMethodThreads *exported_thread_object_1 = NULL;
static FooMethodThreads *exported_thread_object_2 = NULL;
GError *error;
/* Test that we can export an object using the generated
- * FooBarStub subclass. Notes:
+ * FooBarSkeleton subclass. Notes:
*
* 1. We handle methods by simply connecting to the appropriate
* GObject signal.
* C bindings at will)
*/
error = NULL;
- exported_bar_object = foo_bar_stub_new ();
+ exported_bar_object = foo_bar_skeleton_new ();
foo_bar_set_ay (exported_bar_object, "ABCabc");
foo_bar_set_y (exported_bar_object, 42);
foo_bar_set_d (exported_bar_object, 43.0);
foo_bar_set_finally_normal_name (exported_bar_object, "There aint no place like home");
foo_bar_set_writeonly_property (exported_bar_object, "Mr. Burns");
- /* The following works because it's on the Stub object - it will
+ /* The following works because it's on the Skeleton object - it will
* fail (at run-time) on a Proxy (see on_proxy_appeared() below)
*/
foo_bar_set_readonly_property (exported_bar_object, "blah");
g_assert_cmpstr (foo_bar_get_writeonly_property (exported_bar_object), ==, "Mr. Burns");
- g_dbus_interface_stub_export (G_DBUS_INTERFACE_STUB (exported_bar_object),
- connection,
- "/bar",
- &error);
+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (exported_bar_object),
+ connection,
+ "/bar",
+ &error);
g_assert_no_error (error);
g_signal_connect (exported_bar_object,
"handle-hello-world",
G_CALLBACK (on_handle_request_multi_property_mods),
NULL);
- exported_bat_object = foo_bat_stub_new ();
- g_dbus_interface_stub_export (G_DBUS_INTERFACE_STUB (exported_bat_object),
- connection,
- "/bat",
- &error);
+ exported_bat_object = foo_bat_skeleton_new ();
+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (exported_bat_object),
+ connection,
+ "/bat",
+ &error);
g_assert_no_error (error);
g_signal_connect (exported_bat_object,
"handle-force-method",
"force-struct", g_variant_new ("(i)", 4300),
NULL);
- authorize_enclosing_object = g_dbus_object_stub_new ("/authorize");
+ authorize_enclosing_object = g_dbus_object_skeleton_new ("/authorize");
g_signal_connect (authorize_enclosing_object,
"authorize-method",
G_CALLBACK (my_object_authorize_method_handler),
NULL);
- exported_authorize_object = foo_authorize_stub_new ();
- g_dbus_object_stub_add_interface (authorize_enclosing_object,
- G_DBUS_INTERFACE_STUB (exported_authorize_object));
- g_dbus_interface_stub_export (G_DBUS_INTERFACE_STUB (exported_authorize_object),
- connection,
- "/authorize",
- &error);
+ exported_authorize_object = foo_authorize_skeleton_new ();
+ g_dbus_object_skeleton_add_interface (authorize_enclosing_object,
+ G_DBUS_INTERFACE_SKELETON (exported_authorize_object));
+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (exported_authorize_object),
+ connection,
+ "/authorize",
+ &error);
g_assert_no_error (error);
g_signal_connect (exported_authorize_object,
"g-authorize-method",
NULL);
- /* only object 1 has the G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD flag set */
- exported_thread_object_1 = foo_method_threads_stub_new ();
- g_dbus_interface_stub_set_flags (G_DBUS_INTERFACE_STUB (exported_thread_object_1),
- G_DBUS_INTERFACE_STUB_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
- g_dbus_interface_stub_export (G_DBUS_INTERFACE_STUB (exported_thread_object_1),
- connection,
- "/method_threads_1",
- &error);
+ /* only object 1 has the G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD flag set */
+ exported_thread_object_1 = foo_method_threads_skeleton_new ();
+ g_dbus_interface_skeleton_set_flags (G_DBUS_INTERFACE_SKELETON (exported_thread_object_1),
+ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (exported_thread_object_1),
+ connection,
+ "/method_threads_1",
+ &error);
g_assert_no_error (error);
g_signal_connect (exported_thread_object_1,
"handle-get-self",
G_CALLBACK (on_handle_get_self),
NULL);
- exported_thread_object_2 = foo_method_threads_stub_new ();
- g_dbus_interface_stub_export (G_DBUS_INTERFACE_STUB (exported_thread_object_2),
- connection,
- "/method_threads_2",
- &error);
+ exported_thread_object_2 = foo_method_threads_skeleton_new ();
+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (exported_thread_object_2),
+ connection,
+ "/method_threads_2",
+ &error);
g_assert_no_error (error);
g_signal_connect (exported_thread_object_2,
"handle-get-self",
static void
om_check_property_and_signal_emission (GMainLoop *loop,
- FooBar *stub,
+ FooBar *skeleton,
FooBar *proxy)
{
/* First PropertiesChanged */
- g_assert_cmpint (foo_bar_get_i (stub), ==, 0);
+ g_assert_cmpint (foo_bar_get_i (skeleton), ==, 0);
g_assert_cmpint (foo_bar_get_i (proxy), ==, 0);
- foo_bar_set_i (stub, 1);
+ foo_bar_set_i (skeleton, 1);
_g_assert_property_notify (proxy, "i");
- g_assert_cmpint (foo_bar_get_i (stub), ==, 1);
+ g_assert_cmpint (foo_bar_get_i (skeleton), ==, 1);
g_assert_cmpint (foo_bar_get_i (proxy), ==, 1);
/* Then just a regular signal */
- foo_bar_emit_another_signal (stub, "word");
+ foo_bar_emit_another_signal (skeleton, "word");
_g_assert_signal_received (proxy, "another-signal");
}
static void
check_object_manager (void)
{
- GDBusObjectStub *o;
- GDBusObjectStub *o2;
- GDBusInterfaceStub *i;
- GDBusInterfaceStub *i2;
+ GDBusObjectSkeleton *o;
+ GDBusObjectSkeleton *o2;
+ GDBusInterfaceSkeleton *i;
+ GDBusInterfaceSkeleton *i2;
GDBusConnection *c;
GDBusObjectManagerServer *manager;
GDBusNodeInfo *info;
GList *proxies;
GDBusObject *op;
GDBusProxy *p;
- FooBar *bar_stub;
+ FooBar *bar_skeleton;
FooBar *bar_p;
FooBar *bar_p2;
FooComAcmeCoyote *coyote_p;
/* First, export an object with a single interface (also check that
* g_dbus_interface_get_object() works and that the object isn't reffed)
*/
- o = g_dbus_object_stub_new ("/managed/first");
- i = G_DBUS_INTERFACE_STUB (foo_bar_stub_new ());
+ o = g_dbus_object_skeleton_new ("/managed/first");
+ i = G_DBUS_INTERFACE_SKELETON (foo_bar_skeleton_new ());
g_assert (g_dbus_interface_get_object (G_DBUS_INTERFACE (i)) == NULL);
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
- g_dbus_object_stub_add_interface (o, i);
+ g_dbus_object_skeleton_add_interface (o, i);
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
g_assert (g_dbus_interface_get_object (G_DBUS_INTERFACE (i)) == G_DBUS_OBJECT (o));
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
- g_dbus_object_stub_remove_interface (o, i);
+ g_dbus_object_skeleton_remove_interface (o, i);
g_assert (g_dbus_interface_get_object (G_DBUS_INTERFACE (i)) == NULL);
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
- g_dbus_object_stub_add_interface (o, i);
+ g_dbus_object_skeleton_add_interface (o, i);
g_assert (g_dbus_interface_get_object (G_DBUS_INTERFACE (i)) == G_DBUS_OBJECT (o));
g_assert_cmpint (G_OBJECT (o)->ref_count, ==, 1);
g_dbus_object_manager_server_export (manager, o);
g_dbus_node_info_unref (info);
/* Now, check adding the same interface replaces the existing one */
- g_dbus_object_stub_add_interface (o, i);
+ g_dbus_object_skeleton_add_interface (o, i);
/* ... check we get the InterfacesRemoved */
om_data->state = 3;
g_main_loop_run (om_data->loop);
g_object_unref (i);
/* check adding an interface of same type (but not same object) replaces the existing one */
- i = G_DBUS_INTERFACE_STUB (foo_bar_stub_new ());
- g_dbus_object_stub_add_interface (o, i);
+ i = G_DBUS_INTERFACE_SKELETON (foo_bar_skeleton_new ());
+ g_dbus_object_skeleton_add_interface (o, i);
/* ... check we get the InterfacesRemoved and then InterfacesAdded */
om_data->state = 7;
g_main_loop_run (om_data->loop);
g_object_unref (i);
/* check adding an interface of another type doesn't replace the existing one */
- i = G_DBUS_INTERFACE_STUB (foo_bat_stub_new ());
- g_dbus_object_stub_add_interface (o, i);
+ i = G_DBUS_INTERFACE_SKELETON (foo_bat_skeleton_new ());
+ g_dbus_object_skeleton_add_interface (o, i);
g_object_unref (i);
/* ... check we get the InterfacesAdded */
om_data->state = 11;
g_dbus_node_info_unref (info);
/* check we can remove an interface */
- g_dbus_object_stub_remove_interface_by_name (o, "org.project.Bar");
+ g_dbus_object_skeleton_remove_interface_by_name (o, "org.project.Bar");
/* ... check we get the InterfacesRemoved */
om_data->state = 13;
g_main_loop_run (om_data->loop);
* (Note: if a signal was emitted we'd assert in the signal handler
* because we're in state 14)
*/
- g_dbus_object_stub_remove_interface_by_name (o, "org.project.Bar");
+ g_dbus_object_skeleton_remove_interface_by_name (o, "org.project.Bar");
/* ... check introspection data */
info = introspect (c, g_dbus_connection_get_unique_name (c), "/managed/first", loop);
g_assert_cmpint (count_interfaces (info), ==, 4); /* Bat + Properties,Introspectable,Peer */
g_dbus_node_info_unref (info);
/* remove the last interface */
- g_dbus_object_stub_remove_interface_by_name (o, "org.project.Bat");
+ g_dbus_object_skeleton_remove_interface_by_name (o, "org.project.Bat");
/* ... check we get the InterfacesRemoved */
om_data->state = 15;
g_main_loop_run (om_data->loop);
g_dbus_node_info_unref (info);
/* and add an interface again */
- i = G_DBUS_INTERFACE_STUB (foo_com_acme_coyote_stub_new ());
- g_dbus_object_stub_add_interface (o, i);
+ i = G_DBUS_INTERFACE_SKELETON (foo_com_acme_coyote_skeleton_new ());
+ g_dbus_object_skeleton_add_interface (o, i);
g_object_unref (i);
/* ... check we get the InterfacesAdded */
om_data->state = 17;
/* -------------------------------------------------- */
/* create a new object with two interfaces */
- o2 = g_dbus_object_stub_new ("/managed/second");
- i = G_DBUS_INTERFACE_STUB (foo_bar_stub_new ());
- bar_stub = FOO_BAR (i); /* save for later test */
- g_dbus_object_stub_add_interface (o2, i);
+ o2 = g_dbus_object_skeleton_new ("/managed/second");
+ i = G_DBUS_INTERFACE_SKELETON (foo_bar_skeleton_new ());
+ bar_skeleton = FOO_BAR (i); /* save for later test */
+ g_dbus_object_skeleton_add_interface (o2, i);
g_object_unref (i);
- i = G_DBUS_INTERFACE_STUB (foo_bat_stub_new ());
- g_dbus_object_stub_add_interface (o2, i);
+ i = G_DBUS_INTERFACE_SKELETON (foo_bat_skeleton_new ());
+ g_dbus_object_skeleton_add_interface (o2, i);
g_object_unref (i);
/* ... add it */
g_dbus_object_manager_server_export (manager, o2);
g_assert (i == NULL);
i = FOO_PEEK_COM_ACME_COYOTE (o);
g_assert (i != NULL);
- g_assert (g_type_is_a (G_TYPE_FROM_INSTANCE (i), G_TYPE_DBUS_INTERFACE_STUB));
+ g_assert (g_type_is_a (G_TYPE_FROM_INSTANCE (i), G_TYPE_DBUS_INTERFACE_SKELETON));
g_assert (g_type_is_a (G_TYPE_FROM_INSTANCE (i), FOO_TYPE_COM_ACME_COYOTE));
- g_assert (g_type_is_a (G_TYPE_FROM_INSTANCE (i), FOO_TYPE_COM_ACME_COYOTE_STUB));
+ g_assert (g_type_is_a (G_TYPE_FROM_INSTANCE (i), FOO_TYPE_COM_ACME_COYOTE_SKELETON));
/* ... and that PEEK doesn't increase the ref_count but GET does */
g_assert_cmpint (G_OBJECT (i)->ref_count, ==, 2);
i2 = FOO_PEEK_COM_ACME_COYOTE (o);
/* ... now that we have a Bar instance around, also check that we get signals
* and property changes...
*/
- om_check_property_and_signal_emission (loop, bar_stub, FOO_BAR (p));
+ om_check_property_and_signal_emission (loop, bar_skeleton, FOO_BAR (p));
g_object_unref (p);
p = (GDBusProxy *) g_dbus_object_get_interface (op, "org.project.NonExisting");
g_assert (p == NULL);