1 /* GDBus - GLib D-Bus Library
3 * Copyright (C) 2008-2010 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: David Zeuthen <davidz@redhat.com>
25 #include "gdbusobjectmanager.h"
26 #include "gdbusobjectmanagerclient.h"
27 #include "gdbusobject.h"
28 #include "gdbusprivate.h"
29 #include "gio-marshal.h"
30 #include "gioenumtypes.h"
31 #include "ginitable.h"
32 #include "gasyncresult.h"
33 #include "gsimpleasyncresult.h"
34 #include "gasyncinitable.h"
35 #include "gdbusconnection.h"
36 #include "gdbusutils.h"
37 #include "gdbusobject.h"
38 #include "gdbusobjectproxy.h"
39 #include "gdbusproxy.h"
40 #include "gdbusinterface.h"
45 * SECTION:gdbusobjectmanagerclient
46 * @short_description: Client-side object manager
49 * #GDBusObjectManagerClient is used to create, monitor and delete object
50 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
51 * code implementing the <ulink
52 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
55 * Once an instance of this type has been created, you can connect to
56 * the #GDBusObjectManager::object-added and
57 * #GDBusObjectManager::object-removed signals and inspect the
58 * #GDBusObjectProxy objects returned by
59 * g_dbus_object_manager_get_objects().
61 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
62 * object construction time, the default behavior is to request the
63 * message bus to launch an owner for the name. This behavior can be
64 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
65 * flag. It's also worth noting that this only works if the name of
66 * interest is activatable in the first place. E.g. in some cases it
67 * is not possible to launch an owner for the requested name. In this
68 * case, #GDBusObjectManagerClient object construction still succeeds but
69 * there will be no object proxies
70 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
71 * the #GDBusObjectManagerClient:name-owner property is %NULL.
73 * The owner of the requested name can come and go (for example
74 * consider a system service being restarted) – #GDBusObjectManagerClient
75 * handles this case too; simply connect to the #GObject::notify
76 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
77 * property. When the name owner vanishes, the behavior is that
78 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
79 * emission of the #GObject::notify signal) and then
80 * #GDBusObjectManager::object-removed signals are synthesized
81 * for all currently existing object proxies. Since
82 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
83 * use this information to disambiguate a synthesized signal from a
84 * genuine signal caused by object removal on the remote
85 * #GDBusObjectManager. Similarly, when a new name owner appears,
86 * #GDBusObjectManager::object-added signals are synthesized
87 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
88 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
89 * is set to the new name owner (this includes emission of the
90 * #GObject::notify signal). Furthermore, you are guaranteed that
91 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
92 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
93 * the name of interest is atomically replaced
95 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
96 * instances. All signals (including the
97 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
98 * signal) delivered to #GDBusProxy instances are guaranteed to
99 * originate from the name owner. This guarantee along with the
100 * behavior described above, means that certain race conditions
101 * including the <emphasis><quote>half the proxy is from the old owner
102 * and the other half is from the new owner</quote></emphasis> problem
105 * To avoid having the application connect to signals on the returned
106 * #GDBusObjectProxy and #GDBusProxy objects, the
107 * #GDBusObject::interface-added,
108 * #GDBusObject::interface-removed,
109 * #GDBusProxy::g-properties-changed and
110 * #GDBusProxy::g-signal signals
111 * are also emitted on the #GDBusObjectManagerClient instance managing these
112 * objects. The signals emitted are
113 * #GDBusObjectManager::interface-added,
114 * #GDBusObjectManager::interface-removed,
115 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
116 * #GDBusObjectManagerClient::interface-proxy-signal.
118 * Note that all callbacks and signals are emitted in the
119 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
120 * that the #GDBusObjectManagerClient object was constructed
121 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
122 * originating from the #GDBusObjectManagerClient object will be created in
123 * the same context and, consequently, will deliver signals in the
127 struct _GDBusObjectManagerClientPrivate
130 GDBusConnection *connection;
134 GDBusObjectManagerClientFlags flags;
136 GDBusProxy *control_proxy;
138 GHashTable *map_object_path_to_object_proxy;
140 guint signal_subscription_id;
143 GDBusProxyTypeFunc get_proxy_type_func;
144 gpointer get_proxy_type_user_data;
156 PROP_GET_PROXY_TYPE_FUNC,
157 PROP_GET_PROXY_TYPE_USER_DATA
162 INTERFACE_PROXY_SIGNAL_SIGNAL,
163 INTERFACE_PROXY_PROPERTIES_CHANGED_SIGNAL,
167 static guint signals[LAST_SIGNAL] = { 0 };
169 static void initable_iface_init (GInitableIface *initable_iface);
170 static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface);
171 static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface);
173 G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerClient, g_dbus_object_manager_client, G_TYPE_OBJECT,
174 G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
175 G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
176 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT_MANAGER, dbus_object_manager_interface_init));
178 static void maybe_unsubscribe_signals (GDBusObjectManagerClient *manager);
180 static void on_control_proxy_g_signal (GDBusProxy *proxy,
181 const gchar *sender_name,
182 const gchar *signal_name,
183 GVariant *parameters,
186 static void process_get_all_result (GDBusObjectManagerClient *manager,
188 const gchar *name_owner);
191 g_dbus_object_manager_client_finalize (GObject *object)
193 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (object);
195 maybe_unsubscribe_signals (manager);
197 g_hash_table_unref (manager->priv->map_object_path_to_object_proxy);
199 if (manager->priv->control_proxy != NULL)
201 g_warn_if_fail (g_signal_handlers_disconnect_by_func (manager->priv->control_proxy,
202 on_control_proxy_g_signal,
204 g_object_unref (manager->priv->control_proxy);
206 g_object_unref (manager->priv->connection);
207 g_free (manager->priv->object_path);
208 g_free (manager->priv->name);
209 g_free (manager->priv->name_owner);
211 if (G_OBJECT_CLASS (g_dbus_object_manager_client_parent_class)->finalize != NULL)
212 G_OBJECT_CLASS (g_dbus_object_manager_client_parent_class)->finalize (object);
216 g_dbus_object_manager_client_get_property (GObject *_object,
221 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (_object);
225 case PROP_CONNECTION:
226 g_value_set_object (value, g_dbus_object_manager_client_get_connection (manager));
229 case PROP_OBJECT_PATH:
230 g_value_set_string (value, g_dbus_object_manager_get_object_path (G_DBUS_OBJECT_MANAGER (manager)));
234 g_value_set_string (value, g_dbus_object_manager_client_get_name (manager));
238 g_value_set_flags (value, g_dbus_object_manager_client_get_flags (manager));
241 case PROP_NAME_OWNER:
242 g_value_take_string (value, g_dbus_object_manager_client_get_name_owner (manager));
246 G_OBJECT_WARN_INVALID_PROPERTY_ID (_object, prop_id, pspec);
252 g_dbus_object_manager_client_set_property (GObject *_object,
257 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (_object);
262 manager->priv->bus_type = g_value_get_enum (value);
265 case PROP_CONNECTION:
266 if (g_value_get_object (value) != NULL)
268 g_assert (manager->priv->connection == NULL);
269 g_assert (G_IS_DBUS_CONNECTION (g_value_get_object (value)));
270 manager->priv->connection = g_value_dup_object (value);
274 case PROP_OBJECT_PATH:
275 g_assert (manager->priv->object_path == NULL);
276 g_assert (g_variant_is_object_path (g_value_get_string (value)));
277 manager->priv->object_path = g_value_dup_string (value);
281 g_assert (manager->priv->name == NULL);
282 g_assert (g_dbus_is_name (g_value_get_string (value)));
283 manager->priv->name = g_value_dup_string (value);
287 manager->priv->flags = g_value_get_flags (value);
290 case PROP_GET_PROXY_TYPE_FUNC:
291 manager->priv->get_proxy_type_func = g_value_get_pointer (value);
294 case PROP_GET_PROXY_TYPE_USER_DATA:
295 manager->priv->get_proxy_type_user_data = g_value_get_pointer (value);
299 G_OBJECT_WARN_INVALID_PROPERTY_ID (_object, prop_id, pspec);
305 g_dbus_object_manager_client_class_init (GDBusObjectManagerClientClass *klass)
307 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
309 gobject_class->finalize = g_dbus_object_manager_client_finalize;
310 gobject_class->set_property = g_dbus_object_manager_client_set_property;
311 gobject_class->get_property = g_dbus_object_manager_client_get_property;
314 * GDBusObjectManagerClient:connection:
316 * The #GDBusConnection to use.
320 g_object_class_install_property (gobject_class,
322 g_param_spec_object ("connection",
324 "The connection to use",
325 G_TYPE_DBUS_CONNECTION,
328 G_PARAM_CONSTRUCT_ONLY |
329 G_PARAM_STATIC_STRINGS));
332 * GDBusObjectManagerClient:bus-type:
334 * If this property is not %G_BUS_TYPE_NONE, then
335 * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
336 * #GDBusConnection obtained by calling g_bus_get() with the value
341 g_object_class_install_property (gobject_class,
343 g_param_spec_enum ("bus-type",
345 "The bus to connect to, if any",
349 G_PARAM_CONSTRUCT_ONLY |
350 G_PARAM_STATIC_NAME |
351 G_PARAM_STATIC_BLURB |
352 G_PARAM_STATIC_NICK));
355 * GDBusObjectManagerClient:flags:
357 * Flags from the #GDBusObjectManagerClientFlags enumeration.
361 g_object_class_install_property (gobject_class,
363 g_param_spec_flags ("flags",
365 "Flags for the proxy manager",
366 G_TYPE_DBUS_OBJECT_MANAGER_CLIENT_FLAGS,
367 G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
370 G_PARAM_CONSTRUCT_ONLY |
371 G_PARAM_STATIC_NAME |
372 G_PARAM_STATIC_BLURB |
373 G_PARAM_STATIC_NICK));
376 * GDBusObjectManagerClient:object-path:
378 * The object path the manager is for.
382 g_object_class_install_property (gobject_class,
384 g_param_spec_string ("object-path",
386 "The object path of the control object",
390 G_PARAM_CONSTRUCT_ONLY |
391 G_PARAM_STATIC_STRINGS));
394 * GDBusObjectManagerClient:name:
396 * The well-known name or unique name that the manager is for.
400 g_object_class_install_property (gobject_class,
402 g_param_spec_string ("name",
404 "Name that the manager is for",
408 G_PARAM_CONSTRUCT_ONLY |
409 G_PARAM_STATIC_STRINGS));
412 * GDBusObjectManagerClient:name-owner:
414 * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
415 * no-one is currently owning the name. Connect to the
416 * #GObject::notify signal to track changes to this property.
420 g_object_class_install_property (gobject_class,
422 g_param_spec_string ("name-owner",
424 "The owner of the name we are watching",
427 G_PARAM_STATIC_STRINGS));
430 * GDBusObjectManagerClient:get-proxy-type-func:
432 * The #GDBusProxyTypeFunc to use when determining what #GType to
433 * use for interface proxies or %NULL.
437 g_object_class_install_property (gobject_class,
438 PROP_GET_PROXY_TYPE_FUNC,
439 g_param_spec_pointer ("get-proxy-type-func",
440 "GDBusProxyTypeFunc Function Pointer",
441 "The GDBusProxyTypeFunc pointer to use",
444 G_PARAM_CONSTRUCT_ONLY |
445 G_PARAM_STATIC_STRINGS));
448 * GDBusObjectManagerClient:get-proxy-type-user-data:
450 * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
454 g_object_class_install_property (gobject_class,
455 PROP_GET_PROXY_TYPE_USER_DATA,
456 g_param_spec_pointer ("get-proxy-type-user-data",
457 "GDBusProxyTypeFunc User Data",
458 "The GDBusProxyTypeFunc user_data",
461 G_PARAM_CONSTRUCT_ONLY |
462 G_PARAM_STATIC_STRINGS));
465 * GDBusObjectManagerClient::interface-proxy-signal:
466 * @manager: The #GDBusObjectManagerClient emitting the signal.
467 * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
468 * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
469 * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
470 * @signal_name: The signal name.
471 * @parameters: A #GVariant tuple with parameters for the signal.
473 * Emitted when a D-Bus signal is received on @interface_proxy.
475 * This signal exists purely as a convenience to avoid having to
476 * connect signals to all interface proxies managed by @manager.
478 * This signal is emitted in the
479 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
480 * that @manager was constructed in.
484 signals[INTERFACE_PROXY_SIGNAL_SIGNAL] =
485 g_signal_new ("interface-proxy-signal",
486 G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
488 G_STRUCT_OFFSET (GDBusObjectManagerClientClass, interface_proxy_signal),
491 _gio_marshal_VOID__OBJECT_OBJECT_STRING_STRING_VARIANT,
494 G_TYPE_DBUS_OBJECT_PROXY,
501 * GDBusObjectManagerClient::interface-proxy-properties-changed:
502 * @manager: The #GDBusObjectManagerClient emitting the signal.
503 * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
504 * @interface_proxy: The #GDBusProxy that has properties that are changing.
505 * @changed_properties: A #GVariant containing the properties that changed.
506 * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
508 * Emitted when one or more D-Bus properties on proxy changes. The
509 * local cache has already been updated when this signal fires. Note
510 * that both @changed_properties and @invalidated_properties are
511 * guaranteed to never be %NULL (either may be empty though).
513 * This signal exists purely as a convenience to avoid having to
514 * connect signals to all interface proxies managed by @manager.
516 * This signal is emitted in the
517 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
518 * that @manager was constructed in.
522 signals[INTERFACE_PROXY_PROPERTIES_CHANGED_SIGNAL] =
523 g_signal_new ("interface-proxy-properties-changed",
524 G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
526 G_STRUCT_OFFSET (GDBusObjectManagerClientClass, interface_proxy_properties_changed),
529 _gio_marshal_VOID__OBJECT_OBJECT_VARIANT_BOXED,
532 G_TYPE_DBUS_OBJECT_PROXY,
537 g_type_class_add_private (klass, sizeof (GDBusObjectManagerClientPrivate));
541 g_dbus_object_manager_client_init (GDBusObjectManagerClient *manager)
543 manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
544 G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
545 GDBusObjectManagerClientPrivate);
546 manager->priv->map_object_path_to_object_proxy = g_hash_table_new_full (g_str_hash,
549 (GDestroyNotify) g_object_unref);
552 /* ---------------------------------------------------------------------------------------------------- */
555 * g_dbus_object_manager_client_new_sync:
556 * @connection: A #GDBusConnection.
557 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
558 * @name: The owner of the control object (unique or well-known name).
559 * @object_path: The object path of the control object.
560 * @get_proxy_type_func: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
561 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
562 * @cancellable: A #GCancellable or %NULL
563 * @error: Return location for error or %NULL.
565 * Creates a new #GDBusObjectManagerClient object.
567 * This is a synchronous failable constructor - the calling thread is
568 * blocked until a reply is received. See g_dbus_object_manager_client_new()
569 * for the asynchronous version.
571 * Returns: A #GDBusObjectManagerClient object or %NULL if @error is
572 * set. Free with g_object_unref().
577 g_dbus_object_manager_client_new_sync (GDBusConnection *connection,
578 GDBusObjectManagerClientFlags flags,
580 const gchar *object_path,
581 GDBusProxyTypeFunc get_proxy_type_func,
582 gpointer get_proxy_type_user_data,
583 GCancellable *cancellable,
588 g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
589 g_return_val_if_fail ((name == NULL && g_dbus_connection_get_unique_name (connection) == NULL) ||
590 g_dbus_is_name (name), NULL);
591 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
592 g_return_val_if_fail (error == NULL || *error == NULL, NULL);
594 initable = g_initable_new (G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
597 "connection", connection,
600 "object-path", object_path,
601 "get-proxy-type-func", get_proxy_type_func,
602 "get-proxy-type-user-data", get_proxy_type_user_data,
604 if (initable != NULL)
605 return G_DBUS_OBJECT_MANAGER (initable);
611 * g_dbus_object_manager_client_new:
612 * @connection: A #GDBusConnection.
613 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
614 * @name: The owner of the control object (unique or well-known name).
615 * @object_path: The object path of the control object.
616 * @get_proxy_type_func: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
617 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
618 * @cancellable: A #GCancellable or %NULL
619 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
620 * @user_data: The data to pass to @callback.
622 * Asynchronously creates a new #GDBusObjectManagerClient object.
624 * This is an asynchronous failable constructor. When the result is
625 * ready, @callback will be invoked in the
626 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
627 * of the thread you are calling this method from. You can
628 * then call g_dbus_object_manager_client_new_finish() to get the result. See
629 * g_dbus_object_manager_client_new_sync() for the synchronous version.
634 g_dbus_object_manager_client_new (GDBusConnection *connection,
635 GDBusObjectManagerClientFlags flags,
637 const gchar *object_path,
638 GDBusProxyTypeFunc get_proxy_type_func,
639 gpointer get_proxy_type_user_data,
640 GCancellable *cancellable,
641 GAsyncReadyCallback callback,
644 g_return_if_fail (G_IS_DBUS_CONNECTION (connection));
645 g_return_if_fail ((name == NULL && g_dbus_connection_get_unique_name (connection) == NULL) ||
646 g_dbus_is_name (name));
647 g_return_if_fail (g_variant_is_object_path (object_path));
649 g_async_initable_new_async (G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
654 "connection", connection,
657 "object-path", object_path,
658 "get-proxy-type-func", get_proxy_type_func,
659 "get-proxy-type-user-data", get_proxy_type_user_data,
664 * g_dbus_object_manager_client_new_finish:
665 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
666 * @error: Return location for error or %NULL.
668 * Finishes an operation started with g_dbus_object_manager_client_new().
670 * Returns: A #GDBusObjectManagerClient object or %NULL if @error is
671 * set. Free with g_object_unref().
676 g_dbus_object_manager_client_new_finish (GAsyncResult *res,
680 GObject *source_object;
682 source_object = g_async_result_get_source_object (res);
683 g_assert (source_object != NULL);
685 object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
688 g_object_unref (source_object);
691 return G_DBUS_OBJECT_MANAGER (object);
696 /* ---------------------------------------------------------------------------------------------------- */
699 * g_dbus_object_manager_client_new_for_bus_sync:
700 * @bus_type: A #GBusType.
701 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
702 * @name: The owner of the control object (unique or well-known name).
703 * @object_path: The object path of the control object.
704 * @get_proxy_type_func: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
705 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
706 * @cancellable: A #GCancellable or %NULL
707 * @error: Return location for error or %NULL.
709 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
710 * of a #GDBusConnection.
712 * This is a synchronous failable constructor - the calling thread is
713 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
714 * for the asynchronous version.
716 * Returns: A #GDBusObjectManagerClient object or %NULL if @error is
717 * set. Free with g_object_unref().
722 g_dbus_object_manager_client_new_for_bus_sync (GBusType bus_type,
723 GDBusObjectManagerClientFlags flags,
725 const gchar *object_path,
726 GDBusProxyTypeFunc get_proxy_type_func,
727 gpointer get_proxy_type_user_data,
728 GCancellable *cancellable,
733 g_return_val_if_fail (bus_type != G_BUS_TYPE_NONE, NULL);
734 g_return_val_if_fail (g_dbus_is_name (name), NULL);
735 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
736 g_return_val_if_fail (error == NULL || *error == NULL, NULL);
738 initable = g_initable_new (G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
741 "bus-type", bus_type,
744 "object-path", object_path,
745 "get-proxy-type-func", get_proxy_type_func,
746 "get-proxy-type-user-data", get_proxy_type_user_data,
748 if (initable != NULL)
749 return G_DBUS_OBJECT_MANAGER (initable);
755 * g_dbus_object_manager_client_new_for_bus:
756 * @bus_type: A #GBusType.
757 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
758 * @name: The owner of the control object (unique or well-known name).
759 * @object_path: The object path of the control object.
760 * @get_proxy_type_func: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
761 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
762 * @cancellable: A #GCancellable or %NULL
763 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
764 * @user_data: The data to pass to @callback.
766 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
769 * This is an asynchronous failable constructor. When the result is
770 * ready, @callback will be invoked in the
771 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
772 * of the thread you are calling this method from. You can
773 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
774 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
779 g_dbus_object_manager_client_new_for_bus (GBusType bus_type,
780 GDBusObjectManagerClientFlags flags,
782 const gchar *object_path,
783 GDBusProxyTypeFunc get_proxy_type_func,
784 gpointer get_proxy_type_user_data,
785 GCancellable *cancellable,
786 GAsyncReadyCallback callback,
789 g_return_if_fail (bus_type != G_BUS_TYPE_NONE);
790 g_return_if_fail (g_dbus_is_name (name));
791 g_return_if_fail (g_variant_is_object_path (object_path));
793 g_async_initable_new_async (G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
798 "bus-type", bus_type,
801 "object-path", object_path,
802 "get-proxy-type-func", get_proxy_type_func,
803 "get-proxy-type-user-data", get_proxy_type_user_data,
808 * g_dbus_object_manager_client_new_for_bus_finish:
809 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
810 * @error: Return location for error or %NULL.
812 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
814 * Returns: A #GDBusObjectManagerClient object or %NULL if @error is
815 * set. Free with g_object_unref().
820 g_dbus_object_manager_client_new_for_bus_finish (GAsyncResult *res,
824 GObject *source_object;
826 source_object = g_async_result_get_source_object (res);
827 g_assert (source_object != NULL);
829 object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
832 g_object_unref (source_object);
835 return G_DBUS_OBJECT_MANAGER (object);
840 /* ---------------------------------------------------------------------------------------------------- */
843 * g_dbus_object_manager_client_get_connection:
844 * @manager: A #GDBusObjectManagerClient
846 * Gets the #GDBusConnection used by @manager.
848 * Returns: A #GDBusConnection object. Do not free, the object belongs
854 g_dbus_object_manager_client_get_connection (GDBusObjectManagerClient *manager)
856 g_return_val_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager), NULL);
857 return manager->priv->connection;
861 * g_dbus_object_manager_client_get_name:
862 * @manager: A #GDBusObjectManagerClient
864 * Gets the name that @manager is for.
866 * Returns: A unique or well-known name. Do not free, the string
867 * belongs to @manager.
872 g_dbus_object_manager_client_get_name (GDBusObjectManagerClient *manager)
874 g_return_val_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager), NULL);
875 return manager->priv->name;
879 * g_dbus_object_manager_client_get_flags:
880 * @manager: A #GDBusObjectManagerClient
882 * Gets the flags that @manager was constructed with.
884 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags
889 GDBusObjectManagerClientFlags
890 g_dbus_object_manager_client_get_flags (GDBusObjectManagerClient *manager)
892 g_return_val_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager), G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE);
893 return manager->priv->flags;
897 * g_dbus_object_manager_client_get_name_owner:
898 * @manager: A #GDBusObjectManagerClient.
900 * The unique name that owns the name that @manager is for or %NULL if
901 * no-one currently owns that name. You can connect to the
902 * #GObject::notify signal to track changes to the
903 * #GDBusObjectManagerClient:name-owner property.
905 * Returns: The name owner or %NULL if no name owner exists. Free with
911 g_dbus_object_manager_client_get_name_owner (GDBusObjectManagerClient *manager)
913 g_return_val_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager), NULL);
914 return g_strdup (manager->priv->name_owner);
917 /* ---------------------------------------------------------------------------------------------------- */
919 /* signal handler for all objects we manage - we dispatch signals
920 * from here to the objects
923 signal_cb (GDBusConnection *connection,
924 const gchar *sender_name,
925 const gchar *object_path,
926 const gchar *interface_name,
927 const gchar *signal_name,
928 GVariant *parameters,
931 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (user_data);
932 GDBusObjectProxy *object_proxy;
933 GDBusInterface *interface;
935 object_proxy = g_hash_table_lookup (manager->priv->map_object_path_to_object_proxy, object_path);
936 if (object_proxy == NULL)
939 //g_debug ("yay, signal_cb %s %s: %s\n", signal_name, object_path, g_variant_print (parameters, TRUE));
941 if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Properties") == 0)
943 if (g_strcmp0 (signal_name, "PropertiesChanged") == 0)
945 const gchar *interface_name;
946 GVariant *changed_properties;
947 const gchar **invalidated_properties;
949 g_variant_get (parameters,
953 &invalidated_properties);
955 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object_proxy), interface_name);
956 if (interface != NULL)
958 GVariantIter property_iter;
959 const gchar *property_name;
960 GVariant *property_value;
963 /* update caches... */
964 g_variant_iter_init (&property_iter, changed_properties);
965 while (g_variant_iter_next (&property_iter,
970 g_dbus_proxy_set_cached_property (G_DBUS_PROXY (interface),
973 g_variant_unref (property_value);
976 for (n = 0; invalidated_properties[n] != NULL; n++)
978 g_dbus_proxy_set_cached_property (G_DBUS_PROXY (interface),
979 invalidated_properties[n],
982 /* ... and then synthesize the signal */
983 g_signal_emit (manager,
984 signals[INTERFACE_PROXY_PROPERTIES_CHANGED_SIGNAL],
989 invalidated_properties);
990 g_signal_emit_by_name (interface,
991 "g-properties-changed",
993 invalidated_properties);
994 g_object_unref (interface);
996 g_variant_unref (changed_properties);
997 g_free (invalidated_properties);
1002 /* regular signal - just dispatch it */
1003 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object_proxy), interface_name);
1004 if (interface != NULL)
1006 g_signal_emit (manager,
1007 signals[INTERFACE_PROXY_SIGNAL_SIGNAL],
1014 g_signal_emit_by_name (interface,
1019 g_object_unref (interface);
1028 subscribe_signals (GDBusObjectManagerClient *manager,
1029 const gchar *name_owner)
1034 g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager));
1035 g_return_if_fail (manager->priv->signal_subscription_id == 0);
1036 g_return_if_fail (g_dbus_is_unique_name (name_owner));
1038 /* the bus daemon may not implement path_prefix so gracefully
1039 * handle this by using a fallback
1041 manager->priv->match_rule = g_strdup_printf ("type='signal',sender='%s',path_namespace='%s'",
1043 manager->priv->object_path);
1046 ret = g_dbus_connection_call_sync (manager->priv->connection,
1047 "org.freedesktop.DBus",
1048 "/org/freedeskop/DBus",
1049 "org.freedesktop.DBus",
1051 g_variant_new ("(s)",
1052 manager->priv->match_rule),
1053 NULL, /* reply_type */
1054 G_DBUS_CALL_FLAGS_NONE,
1055 -1, /* default timeout */
1056 NULL, /* TODO: Cancellable */
1060 /* yay, bus daemon supports path_namespace */
1061 g_variant_unref (ret);
1063 /* still need to ask GDBusConnection for the callbacks */
1064 manager->priv->signal_subscription_id =
1065 g_dbus_connection_signal_subscribe (manager->priv->connection,
1067 NULL, /* interface */
1069 NULL, /* path - TODO: really want wilcard support here */
1071 G_DBUS_SIGNAL_FLAGS_NONE |
1072 G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
1075 NULL); /* user_data_free_func */
1080 /* TODO: we could report this to the user
1081 g_warning ("Message bus daemon does not support path_namespace: %s (%s %d)",
1083 g_quark_to_string (error->domain),
1087 g_error_free (error);
1089 /* no need to call RemoveMatch when done since it didn't work */
1090 g_free (manager->priv->match_rule);
1091 manager->priv->match_rule = NULL;
1093 /* Fallback is to subscribe to *all* signals from the name owner which
1094 * is rather wasteful. It's probably not a big practical problem because
1095 * users typically want all objects that the name owner supplies.
1097 manager->priv->signal_subscription_id =
1098 g_dbus_connection_signal_subscribe (manager->priv->connection,
1100 NULL, /* interface */
1102 NULL, /* path - TODO: really want wilcard support here */
1104 G_DBUS_SIGNAL_FLAGS_NONE,
1107 NULL); /* user_data_free_func */
1112 maybe_unsubscribe_signals (GDBusObjectManagerClient *manager)
1114 g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager));
1116 if (manager->priv->signal_subscription_id > 0)
1118 g_dbus_connection_signal_unsubscribe (manager->priv->connection,
1119 manager->priv->signal_subscription_id);
1120 manager->priv->signal_subscription_id = 0;
1123 if (manager->priv->match_rule != NULL)
1125 /* Since the AddMatch call succeeded this is guaranteed to not
1126 * fail - therefore, don't bother checking the return value
1128 g_dbus_connection_call (manager->priv->connection,
1129 "org.freedesktop.DBus",
1130 "/org/freedeskop/DBus",
1131 "org.freedesktop.DBus",
1133 g_variant_new ("(s)",
1134 manager->priv->match_rule),
1135 NULL, /* reply_type */
1136 G_DBUS_CALL_FLAGS_NONE,
1137 -1, /* default timeout */
1138 NULL, /* GCancellable */
1139 NULL, /* GAsyncReadyCallback */
1140 NULL); /* user data */
1141 g_free (manager->priv->match_rule);
1142 manager->priv->match_rule = NULL;
1147 /* ---------------------------------------------------------------------------------------------------- */
1150 on_notify_g_name_owner (GObject *object,
1154 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (user_data);
1155 gchar *old_name_owner;
1156 gchar *new_name_owner;
1158 old_name_owner = manager->priv->name_owner;
1159 new_name_owner = g_dbus_proxy_get_name_owner (manager->priv->control_proxy);
1160 manager->priv->name_owner = NULL;
1162 if (g_strcmp0 (old_name_owner, new_name_owner) != 0)
1167 /* do the :name-owner notify with a NULL name - this way the user knows
1168 * the ::object-proxy-removed following is because the name owner went
1171 g_object_notify (G_OBJECT (manager), "name-owner");
1173 /* remote manager changed; nuke all local proxies */
1174 proxies = g_hash_table_get_values (manager->priv->map_object_path_to_object_proxy);
1175 g_list_foreach (proxies, (GFunc) g_object_ref, NULL);
1176 g_hash_table_remove_all (manager->priv->map_object_path_to_object_proxy);
1177 for (l = proxies; l != NULL; l = l->next)
1179 GDBusObjectProxy *object_proxy = G_DBUS_OBJECT_PROXY (l->data);
1180 g_signal_emit_by_name (manager, "object-removed", object_proxy);
1182 g_list_foreach (proxies, (GFunc) g_object_unref, NULL);
1183 g_list_free (proxies);
1185 /* nuke local filter */
1186 maybe_unsubscribe_signals (manager);
1189 if (new_name_owner != NULL)
1194 //g_debug ("repopulating for %s", new_name_owner);
1196 /* TODO: do this async! */
1197 subscribe_signals (manager,
1200 value = g_dbus_proxy_call_sync (manager->priv->control_proxy,
1201 "GetManagedObjects",
1202 NULL, /* parameters */
1203 G_DBUS_CALL_FLAGS_NONE,
1209 maybe_unsubscribe_signals (manager);
1210 g_warning ("Error calling GetManagedObjects() when name owner %s for name %s came back: %s",
1212 manager->priv->name,
1214 g_error_free (error);
1218 process_get_all_result (manager, value, new_name_owner);
1219 g_variant_unref (value);
1222 /* do the :name-owner notify *AFTER* emitting ::object-proxy-added signals - this
1223 * way the user knows that the signals were emitted because the name owner came back
1225 manager->priv->name_owner = new_name_owner;
1226 g_object_notify (G_OBJECT (manager), "name-owner");
1229 g_free (old_name_owner);
1233 initable_init (GInitable *initable,
1234 GCancellable *cancellable,
1237 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (initable);
1240 GDBusProxyFlags proxy_flags;
1244 if (manager->priv->bus_type != G_BUS_TYPE_NONE)
1246 g_assert (manager->priv->connection == NULL);
1247 manager->priv->connection = g_bus_get_sync (manager->priv->bus_type, cancellable, error);
1248 if (manager->priv->connection == NULL)
1252 proxy_flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES;
1253 if (manager->priv->flags & G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START)
1254 proxy_flags |= G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;;
1256 manager->priv->control_proxy = g_dbus_proxy_new_sync (manager->priv->connection,
1258 NULL, /* GDBusInterfaceInfo* */
1259 manager->priv->name,
1260 manager->priv->object_path,
1261 "org.freedesktop.DBus.ObjectManager",
1264 if (manager->priv->control_proxy == NULL)
1267 g_signal_connect (G_OBJECT (manager->priv->control_proxy),
1268 "notify::g-name-owner",
1269 G_CALLBACK (on_notify_g_name_owner),
1272 manager->priv->name_owner = g_dbus_proxy_get_name_owner (manager->priv->control_proxy);
1273 if (manager->priv->name_owner == NULL)
1275 /* it's perfectly fine if there's no name owner.. we're just going to
1276 * wait until one is ready
1281 /* yay, we have a name owner */
1282 g_signal_connect (manager->priv->control_proxy,
1284 G_CALLBACK (on_control_proxy_g_signal),
1286 subscribe_signals (manager,
1287 manager->priv->name_owner);
1288 value = g_dbus_proxy_call_sync (manager->priv->control_proxy,
1289 "GetManagedObjects",
1290 NULL, /* parameters */
1291 G_DBUS_CALL_FLAGS_NONE,
1297 maybe_unsubscribe_signals (manager);
1298 g_warn_if_fail (g_signal_handlers_disconnect_by_func (manager->priv->control_proxy,
1299 on_control_proxy_g_signal,
1301 g_object_unref (manager->priv->control_proxy);
1302 manager->priv->control_proxy = NULL;
1306 process_get_all_result (manager, value, manager->priv->name_owner);
1307 g_variant_unref (value);
1317 initable_iface_init (GInitableIface *initable_iface)
1319 initable_iface->init = initable_init;
1323 async_initable_iface_init (GAsyncInitableIface *async_initable_iface)
1325 /* for now, just use default: run GInitable code in thread */
1328 /* ---------------------------------------------------------------------------------------------------- */
1331 add_interfaces (GDBusObjectManagerClient *manager,
1332 const gchar *object_path,
1333 GVariant *ifaces_and_properties,
1334 const gchar *name_owner)
1336 GDBusObjectProxy *op;
1339 const gchar *interface_name;
1340 GVariant *properties;
1342 g_return_if_fail (g_dbus_is_unique_name (name_owner));
1345 op = g_hash_table_lookup (manager->priv->map_object_path_to_object_proxy, object_path);
1348 op = _g_dbus_object_proxy_new (manager->priv->connection, object_path);
1352 g_variant_iter_init (&iter, ifaces_and_properties);
1353 while (g_variant_iter_next (&iter,
1358 GDBusProxy *interface_proxy;
1360 GType interface_proxy_type;
1362 if (manager->priv->get_proxy_type_func != NULL)
1364 interface_proxy_type = manager->priv->get_proxy_type_func (manager,
1367 manager->priv->get_proxy_type_user_data);
1368 g_warn_if_fail (g_type_is_a (interface_proxy_type, G_TYPE_DBUS_PROXY));
1372 interface_proxy_type = G_TYPE_DBUS_PROXY;
1375 /* this is fine - there is no blocking IO because we pass DO_NOT_LOAD_PROPERTIES and
1376 * DO_NOT_CONNECT_SIGNALS and use a unique name
1379 interface_proxy = g_initable_new (interface_proxy_type,
1380 NULL, /* GCancellable */
1382 "g-connection", manager->priv->connection,
1383 "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
1384 G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
1385 "g-name", name_owner,
1386 "g-object-path", object_path,
1387 "g-interface-name", interface_name,
1389 if (interface_proxy == NULL)
1391 g_warning ("%s: Error constructing proxy for path %s and interface %s: %s",
1396 g_error_free (error);
1400 GVariantIter property_iter;
1401 const gchar *property_name;
1402 GVariant *property_value;
1404 /* associate the interface proxy with the object */
1405 g_dbus_interface_set_object (G_DBUS_INTERFACE (interface_proxy),
1406 G_DBUS_OBJECT (op));
1408 g_variant_iter_init (&property_iter, properties);
1409 while (g_variant_iter_next (&property_iter,
1414 g_dbus_proxy_set_cached_property (interface_proxy,
1417 g_variant_unref (property_value);
1420 _g_dbus_object_proxy_add_interface (op, interface_proxy);
1422 g_signal_emit_by_name (manager, "interface-added", op, interface_proxy);
1423 g_object_unref (interface_proxy);
1425 g_variant_unref (properties);
1430 g_hash_table_insert (manager->priv->map_object_path_to_object_proxy,
1431 g_strdup (object_path),
1433 g_signal_emit_by_name (manager, "object-added", op);
1438 remove_interfaces (GDBusObjectManagerClient *manager,
1439 const gchar *object_path,
1440 const gchar *const *interface_names)
1442 GDBusObjectProxy *op;
1445 guint num_interfaces;
1446 guint num_interfaces_to_remove;
1448 op = g_hash_table_lookup (manager->priv->map_object_path_to_object_proxy, object_path);
1451 g_warning ("%s: Processing InterfaceRemoved signal for path %s but no object proxy exists",
1457 interfaces = g_dbus_object_get_interfaces (G_DBUS_OBJECT (op));
1458 num_interfaces = g_list_length (interfaces);
1459 g_list_foreach (interfaces, (GFunc) g_object_unref, NULL);
1460 g_list_free (interfaces);
1462 num_interfaces_to_remove = g_strv_length ((gchar **) interface_names);
1464 /* see if we are going to completety remove the object */
1465 if (num_interfaces_to_remove == num_interfaces)
1468 g_warn_if_fail (g_hash_table_remove (manager->priv->map_object_path_to_object_proxy, object_path));
1469 g_signal_emit_by_name (manager, "object-removed", op);
1470 g_object_unref (op);
1474 for (n = 0; interface_names != NULL && interface_names[n] != NULL; n++)
1476 GDBusInterface *interface;
1477 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (op), interface_names[n]);
1478 _g_dbus_object_proxy_remove_interface (op, interface_names[n]);
1479 if (interface != NULL)
1481 g_signal_emit_by_name (manager, "interface-removed", op, interface);
1482 g_object_unref (interface);
1491 process_get_all_result (GDBusObjectManagerClient *manager,
1493 const gchar *name_owner)
1496 const gchar *object_path;
1497 GVariant *ifaces_and_properties;
1500 g_return_if_fail (g_dbus_is_unique_name (name_owner));
1502 arg0 = g_variant_get_child_value (value, 0);
1503 g_variant_iter_init (&iter, arg0);
1504 while (g_variant_iter_next (&iter,
1507 &ifaces_and_properties))
1509 add_interfaces (manager, object_path, ifaces_and_properties, name_owner);
1510 g_variant_unref (ifaces_and_properties);
1512 g_variant_unref (arg0);
1516 on_control_proxy_g_signal (GDBusProxy *proxy,
1517 const gchar *sender_name,
1518 const gchar *signal_name,
1519 GVariant *parameters,
1522 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (user_data);
1523 const gchar *object_path;
1525 //g_debug ("yay, g_signal %s: %s\n", signal_name, g_variant_print (parameters, TRUE));
1527 if (g_strcmp0 (signal_name, "InterfacesAdded") == 0)
1529 GVariant *ifaces_and_properties;
1530 g_variant_get (parameters,
1533 &ifaces_and_properties);
1534 add_interfaces (manager, object_path, ifaces_and_properties, manager->priv->name_owner);
1535 g_variant_unref (ifaces_and_properties);
1537 else if (g_strcmp0 (signal_name, "InterfacesRemoved") == 0)
1539 const gchar **ifaces;
1540 g_variant_get (parameters,
1544 remove_interfaces (manager, object_path, ifaces);
1549 /* ---------------------------------------------------------------------------------------------------- */
1551 static const gchar *
1552 g_dbus_object_manager_client_get_object_path (GDBusObjectManager *_manager)
1554 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (_manager);
1555 return manager->priv->object_path;
1558 static GDBusObject *
1559 g_dbus_object_manager_client_get_object (GDBusObjectManager *_manager,
1560 const gchar *object_path)
1562 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (_manager);
1565 ret = g_hash_table_lookup (manager->priv->map_object_path_to_object_proxy, object_path);
1571 static GDBusInterface *
1572 g_dbus_object_manager_client_get_interface (GDBusObjectManager *_manager,
1573 const gchar *object_path,
1574 const gchar *interface_name)
1576 GDBusInterface *ret;
1577 GDBusObject *object;
1581 object = g_dbus_object_manager_get_object (_manager, object_path);
1585 ret = g_dbus_object_get_interface (object, interface_name);
1586 g_object_unref (object);
1593 g_dbus_object_manager_client_get_objects (GDBusObjectManager *_manager)
1595 GDBusObjectManagerClient *manager = G_DBUS_OBJECT_MANAGER_CLIENT (_manager);
1598 g_return_val_if_fail (G_IS_DBUS_OBJECT_MANAGER_CLIENT (manager), NULL);
1600 ret = g_hash_table_get_values (manager->priv->map_object_path_to_object_proxy);
1601 g_list_foreach (ret, (GFunc) g_object_ref, NULL);
1607 dbus_object_manager_interface_init (GDBusObjectManagerIface *iface)
1609 iface->get_object_path = g_dbus_object_manager_client_get_object_path;
1610 iface->get_objects = g_dbus_object_manager_client_get_objects;
1611 iface->get_object = g_dbus_object_manager_client_get_object;
1612 iface->get_interface = g_dbus_object_manager_client_get_interface;
1615 /* ---------------------------------------------------------------------------------------------------- */