After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703676 - GDBusObjectProxy: Add a public way to assign interfaces to the object proxy
GDBusObjectProxy: Add a public way to assign interfaces to the object proxy
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other All
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-07-05 18:43 UTC by Emanuele Aina
Modified: 2018-05-24 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDBusObjectProxy: Call _interface_set_object() in _add_interface() (1.75 KB, patch)
2013-07-05 18:43 UTC, Emanuele Aina
none Details | Review
GDBusObjectProxy: Add a public way to assign interfaces to the object proxy (4.54 KB, patch)
2013-07-05 18:43 UTC, Emanuele Aina
none Details | Review
GDBusObjectProxy: Add a way to load interface proxies by name (7.84 KB, patch)
2013-07-05 18:44 UTC, Emanuele Aina
none Details | Review

Description Emanuele Aina 2013-07-05 18:43:45 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.
Comment 1 Emanuele Aina 2013-07-05 18:43:48 UTC
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.
Comment 2 Emanuele Aina 2013-07-05 18:43:55 UTC
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.
Comment 3 Emanuele Aina 2013-07-05 18:44:01 UTC
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().
Comment 4 GNOME Infrastructure Team 2018-05-24 15:29:17 UTC
-- 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.