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 710817 - Allow access to generated D-Bus proxy object
Allow access to generated D-Bus proxy object
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: D-Bus
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-24 15:41 UTC by Philip Withnall
Modified: 2018-05-22 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2013-10-24 15:41:09 UTC
At the moment, if I generate a D-Bus interface and proxy object using the ‘DBus’ attribute on an interface (let’s assume one called org.bluez.Device), the type org.bluez.Device gives me access to the generated GInterface, i.e. orgbluezDevice in C.

There is currently no way that I can find to also get easy access to the generated proxy object from Vala, i.e. orgbluezDeviceProxy in C.

The only way to do it at the moment is with the following code:

delegate Type TypeFunc ();
proxy = ((TypeFunc) (typeof (org.bluez.Device).get_qdata (Quark.from_string ("vala-dbus-proxy-type")))) ();

which is less than fun.

Could some accessor be added please? For example, org.bluez.Device.Proxy. Thanks.
Comment 1 Luca Bruno 2013-10-24 18:11:47 UTC
What's your use case for needing the proxy object?
Comment 2 Philip Withnall 2013-10-24 18:37:59 UTC
(In reply to comment #1)
> What's your use case for needing the proxy object?

A DBusProxyTypeFunc for use with DBusObjectManagerClient. See here: http://cgit.collabora.com/git/user/pwith/folks.git/tree/backends/bluez/bluez-backend.vala?h=685848-bluez-SQUASHED#n392
Comment 3 David Lechner 2014-10-24 03:52:37 UTC
Since vala is generating the proxy object types, it seems like the DBusProxyTypeFunc function should be automatically generated as well since it can be trivially generated since the vala compiler knows about all of the interfaces already.

Here is an updated link from the previous comment: http://cgit.collabora.com/git/user/pwith/folks.git/tree/backends/bluez/bluez-backend.vala#n575
Comment 4 Luca Bruno 2014-10-24 08:00:27 UTC
The current code is very fine in my opinion.
Additionally, I'm ok with autogenerating the callback if null is passed.
Comment 5 GNOME Infrastructure Team 2018-05-22 14:57:58 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/vala/issues/412.