Fighting the glib bindings

John (J5) Palmieri johnp at redhat.com
Tue Nov 1 10:19:34 PST 2005


I would think having something more generic than just for replys.  What
I envisioned was being able to get an iterator for any type of message
and append from there.  I'm not sure.  Havoc, can you get Colin to sit
down for a few minutes and give his opinion on this?

On Tue, 2005-11-01 at 10:14 +0000, Rob Taylor wrote:
> The last few days I've been fighting the glib bindings to try and
> implement a method of returning arbitary types (i.e. those that are
> currently unencodable as a GType of some description).
> 
> One example in point is returning an empty a(so). This is encoded as a
> GPtrArray+GValueArray, and so if there are no elements, the mashalling
> code has no way of determining the subtype of the array, and we error out.
> 
> I *think* the correct solution would be to make the marshalling code
> aware of what type the user had requested in the typedata blobs, but
> this would be quite an invasive change, not only requiring changing the
> marshaller, but also dbus-binding-tool (currently the blobs dont store
> dbus type information for signals or parameters). A different solution
> would be to go the path of Colin Walters' DBUS_TYPE_G_VALUE, but I can't
> find any information on what this is...
> 
> Hence I have come up with a simple, if brutish, solution for allowing
> those that care to exactly specify their return types by building their
> own return message using the low-level bindings. This is only usable if
> your methods are annotated as org.freedesktop.DBus.GLib.Async, and is
> only exposed in <dbus/dbus-glib-lowlevel.h>.
> 
> A patch is attached, feedback is appreciated :)
> 
> Thanks,
> 
> Rob Taylor
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list