Sending complex parameters via signals in dbus-glib

Steve Kreyer steve.kreyer at web.de
Mon Aug 13 03:55:45 PDT 2007


Hi Simon!

Simon McVittie wrote:
> 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
Thanks for this hint, but that didn't work either.

I've tried it that way:

dbus_g_type_specialized_init ();

priv->time_position_status_sig_id =
g_signal_new ("time_position__status",
AUXIN_TYPE_PLAYER,
G_SIGNAL_RUN_LAST |
G_SIGNAL_NO_RECURSE |
G_SIGNAL_NO_HOOKS |
G_SIGNAL_DETAILED,
0,
NULL,
NULL,
g_cclosure_user_marshal_VOID__UINT_BOXED,
G_TYPE_NONE,
2,
G_TYPE_UINT,
dbus_g_type_get_collection ("GArray", G_TYPE_INT));

but this results in the following error:

** (process:4911): CRITICAL **: lookup_or_register_specialized: 
assertion `klass != NULL' failed

(process:4911): GLib-GObject-WARNING **: gsignal.c:1270: parameter 2 of 
type `<invalid>' for signal "AuxinPlayer::time_position__status" is not 
a value type

so after having a look at the location where the assertion occured, I've 
thought of registering my specialized type at dbus's specialized type 
system, but I've got no clue how :-(

dbus_g_type_specialized_init ();
dbus_g_type_register_collection ("GArray",
dbus_g_type_collection_peek_vtable (/* ??? Don't have a clue what gtype 
to insert here ??? */),
0);

priv->time_position_status_sig_id =
g_signal_new ("time_position__status",
...
g_cclosure_user_marshal_VOID__UINT_BOXED,
G_TYPE_NONE,
2,
G_TYPE_UINT,
dbus_g_type_get_collection ("GArray", G_TYPE_INT));


Btw. in which version of telepathy-glib have you found this piece of 
code? I searched all releases (up from 0.5.10 til 0.5.13), but without 
success.


Thanks,
Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070813/de6b96dc/attachment.bin 


More information about the dbus mailing list