[patch] glib bindings: annotating collections and maps with signatures

Robert McQueen robert.mcqueen at collabora.co.uk
Sat Jan 21 17:06:04 PST 2006


I made this patch a few days ago, but I'm not quite sure what to think
of it. It does the job and lets me get on with my coding, but it's
ultimately not right. It provides a pair of methods which use a dataset
to annotate a GPtrArray and a GHashTable with the D-Bus signature of the
values they contain within. This is necessary when you want to marshal
to a type like a{s(...)} or a(...), because given the GType for a
GValueArray, it's unable to work out the D-Bus signature to open the
array with.

This isn't really the right way to fix it, but I'm proposing the patch
as a straw man so that hopefully someone will decide to implement the
correct fix which I don't have time for at the moment. In my opinion,
this would be to allow registering specialisation types for structs in
the same way that you can do currently for maps and collections, where
it stores the GTypes of the stuff held within. This would boil down to
allowing you to call a varargs method like dbus_g_type_get_struct
("GValueArray", G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, NULL), and the
rest would be obvious... :)

Anyone keen to attempt a real fix? We could probably afford to put a
bounty on getting this fixed, or contract someone to fix it if anyone
has the time & expertise.

Regards,
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-g-content-signature-hack.patch
Type: text/x-patch
Size: 3547 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060122/8dad3241/dbus-g-content-signature-hack.bin


More information about the dbus mailing list