GNOME Bugzilla – Bug 703676
GDBusObjectProxy: Add a public way to assign interfaces to the object proxy
Last modified: 2018-05-24 15:29:17 UTC
While it is commmon to have DBus object implementing multiple interfaces it often happen that they are not managed by an ObjectManager, either because the ObjectManager interface requirement of exporting the whole hierarchy make it unsuitable for the scope (eg. it would cause massive traffic if used for org.gnome.UPnP.MediaContainer2) or because there is only one object with multiple interfaces. Unfortunately GDBusObjectProxy currently requires a GDBusObjectManagerClient to call the private methods that adds and remove the interface proxies. I've made those functions public and added a way to load the proxies by name to try to make GDBusObjectProxy more useful for other users. I've yet to add documentation to the public functions, but I'd like to have some feedback on the general approach. An example of code that would benefit from this stuff is https://git.gnome.org/browse/gnome-photos/tree/src/photos-dlna-renderer.c, which exports multiple interfaces (com.intel.dLeynaRenderer.RendererDevice, com.intel.dLeynaRenderer.PushHost and org.mpris.MediaPlayer2.Player) but does not use ObjectManager but a similar ad-hoc interface.
Created attachment 248475 [details] [review] GDBusObjectProxy: Call _interface_set_object() in _add_interface() It seems quite appropriate to set the reverse relation from the setter.
Created attachment 248476 [details] [review] GDBusObjectProxy: Add a public way to assign interfaces to the object proxy While it is commmon to have DBus object implementing multiple interfaces it often happen that they are not managed by an ObjectManager. Unfortunately GDBusObjectProxy requires a GDBusObjectManagerClient to call the private methods that adds and remove the interface proxies. Make those functions public to make GDBusObjectProxy more useful to other users.
Created attachment 248477 [details] [review] GDBusObjectProxy: Add a way to load interface proxies by name By keeping track of the remote client unique name we would have all that's needed to asynchronously load interface proxies by name, using the appropriate GDBusProxy subclasses. Add the GDBusObjectProxy::g-name property and the _add_interface()/_add_interface_finish() functions to async load the proxies and then call _add_interface_proxy().
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/724.