glib bindings with glib signals

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Jun 29 05:34:57 PDT 2007


On Wed, 27 Jun 2007 at 16:27:37 -0500, Gary Kramlich wrote:
> Simon McVittie wrote:
> >On Tue, 26 Jun 2007 at 20:12:39 -0500, Gary Kramlich wrote:
> >>I'm trying to emit a glib signal on an object that's exported over dbus, 
> >>which in glib has a marshal signature of VOID:OBJECT.
> >
> >Objects aren't handled like that by dbus-glib. You need to extract the 
> >object's
> >object-path (as a const gchar*) and use a signal of signature VOID:STRING.
> >
> >Regards,
> >	Simon
> 
> Ok, that makes sense, but some sort of warning or something when trying 
> to use 'o' as the arg type might be desired.

File a bug? I'm not a dbus-glib developer (or entirely clear on whether
such a warning is possible).

> I also assume that this
> means I have to re-emit the signal on the client side as a pure glib 
> signal, that I'll need to handle it in the dbus code, grab the proxy 
> object, and then emit it off of that.

You can't emit signals from an object that aren't appropriate for that object's
class, as far as I'm aware. On the client side, where you would have
bound a callback to a GLib signal, just bind a similar callback to the
D-Bus signal (but in your callback, you'll probably need to expect an
object-path string rather than a proxy, and get a proxy for that object
by calling appropriate functions).

	Simon


More information about the dbus mailing list