Sending complex parameters via signals in dbus-glib

Simon McVittie simon.mcvittie at collabora.co.uk
Sun Aug 12 16:37:02 PDT 2007


On Sun, 12 Aug 2007 at 19:24:49 +0200, Steve Kreyer wrote:
> I'm using the dbus-glib-binding. I want to send signals on the bus which 
> should have parameters with complex types, such as "ai" or "a(yyysssi)". Is 
> it possible to send such parameters over signals? I've tried it in several 
> ways, but none of them worked.
> For example trying to register the signal on the object side with a 
> G_TYPE_BOXED parameter with the appropriate marshaller, I get the following 
> error during "signal register time":
> -----
> (process:15926): GLib-GObject-WARNING **: gsignal.c:1270: parameter 2 of 
> type `GBoxed' for signal "AuxinPlayer::time_position__status" is not a 
> value type

Here's an example from telepathy-glib, for a signal with signature a(uu):

      signals[SIGNAL_PropertyFlagsChanged] =
      g_signal_new ("property-flags-changed",
                    G_OBJECT_CLASS_TYPE (klass),
                    G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
                    0,
                    NULL, NULL,
                    g_cclosure_marshal_VOID__BOXED,
                    G_TYPE_NONE, 1, dbus_g_type_get_collection ("GPtrArray",
                        dbus_g_type_get_struct ("GValueArray",
                            G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID)));

Hope this helps,
	Simon


More information about the dbus mailing list