GDBusConnection: allow async property handling
authorRyan Lortie <desrt@desrt.ca>
Wed, 17 Apr 2013 13:30:15 +0000 (09:30 -0400)
committerRyan Lortie <desrt@desrt.ca>
Sat, 22 Jun 2013 17:38:31 +0000 (13:38 -0400)
commitf754c4e85b666686a374aa31f7d05fff739e9cde
treec41d3287efa4cbc200002b9596414a0c8f75dff3
parentc691f7b6ca664fc33100b29d1d920c2a94779a6e
GDBusConnection: allow async property handling

The existing advice in the documentation to "simply" register the
"org.freedesktop.DBus.Properties" interface if you want to handle
properties asynchronously is pretty unreasonable.  If you want to handle
this interface you have to deal with all properties for all interfaces
on the path, and you have to do all of the checking for yourself.  You
also have to provide your own introspection data.

Introduce a new convention for dealing with properties asynchronously.

If the user provides NULL for their get_property() or set_property()
functions in the vtable and has properties registered then the
properties are sent to the method_call() handler.  We get lucky here
that this function takes an "interface_name" parameter that we can set
to "org.freedesktop.DBus.Properties".

We also do the user the favour of setting the GDBusPropertyInfo on the
GDBusMethodInvocation for their convenience (for much the same reasons
as they might want the already-available GDBusMethodInfo).

Add a testcase as well as a bunch of documentation about this new
feature.

https://bugzilla.gnome.org/show_bug.cgi?id=698375
gio/gdbusconnection.c
gio/gdbusconnection.h
gio/gdbusmethodinvocation.c
gio/tests/gdbus-export.c