how many types would a 'g' type type if a 'g' type would GType?

Robert McQueen robert.mcqueen at
Sat Sep 23 17:26:59 PDT 2006

Havoc Pennington wrote:
> It is used for the signature header, so it is a multiple-type signature
> there.


> However, I think it isn't allowed to have multiple types when
> it's the signature of a variant. Don't remember for sure.

Well, a variant can only contain one type. Does this mean we could
assume/enforce that inside a message (but not in the signature header)
that 'g' is a single complete type?

> If so, it
> sounds like for your usage you can just assume the signature of a
> variant has only one type in it.

No I'm not sending the 'g' type alongside the 'v', it's for something
like this:

GetParameters () -> a{sg}
SetParameters (a{sv})

So the list of parameters is tells you what the type wants to be when
you set that parameter.

> For the glib bindings generically perhaps you could just marshal as a
> GType if only one type, and as an array of GType otherwise, and app
> authors can just handle both cases?

Mrrgh. Not really at the moment. Currently when *demarshalling* any
message off the bus, the GTypes you get are decided based on a fixed
mapping of the D-Bus type of the incoming stuff, rather than the type
that the app is expecting. If there's a mismatch between the decided
type and expected type, the demarshalling fails. And yes, this is a
fundamental flaw which we intend to fix.

> Havoc


Robert McQueen
Director, Collabora Ltd.

More information about the dbus mailing list