Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
Otherwise we run into problems in applications using multiple D-Bus
bindings, e.g. both eggdbus and dbus-glib.
|
|
|
|
|
|
Sorry about this Havoc.
|
|
|
|
|
|
To generate proper docs, and in the future to simplify the struct
handling, we introduce the concept of complete types. This means that
we now know, at binding generation, the complete type of an argument
or a property. Previously, we only knew the D-Bus signature.
This change breaks existing eggdbus users. The org.gtk.EggDBus.Type
annotation needs to be used for disamgiuation, e.g. if there are two
defined structures with signature (sa{sv}), use
<arg name="foo" type="(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Identity"/>
</arg>
<arg name="bar" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Array<Identity>"/>
</arg>
<arg name="baz" type="a{s(sa{sv})}">
<annotation name="org.gtk.EggDBus.Type" value="Dict<String,Subject>"/>
</arg>
where both Identity and Subject are structs with the signature (sa{sv}).
The format of org.gtk.EggDBus.Type is straightforward, it's roughly
like this
type = Byte | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 |
Double | Variant | String | ObjectPath | Signature |
Struct<type0,type1,...,typeN> |
Dict<type,type> |
Array<type> |
struct_type |
enum_type |
flag_type
With this change we can know generate proper docbook docs. Previously
we couldn't do that since we didn't know how to break down
e.g. a(sa{sv}). Thus, we could only generate docs like this
GetIdentities (OUT Array<Struct<String,Dict<String,Variant>>>)
Now we can do
GetIdentites (OUT Array<Identity>)
which is much nicer. In addition, this paves the way for getting rid
of the structural type equivalence mess in EggDBusStructure. The plan
for doing this is roughly like this
- Turn EggDBusStructure into a GInterface
- Create a EggDBusAnonymousStructure subclass that implements this
- Generated structure classes simply implement EggDBusStructure
and derive directly from GObject
- User provided structure wrappers just implement this interface
- notably existing classes can do this; e.g. if you want to
put some existing program on D-Bus just make the types you
want to use as structs implement EggDBusStructure.
- Make egg_dbus_message_extract_structure() take a GType for what
structure type to extract to. Ditto for egg_dbus_variant_get_structure().
- Provide versions egg_dbus_message_extract_structure() and
egg_dbus_message_append_structure() that takes function pointers
instead of a EggDBusStructure pointer.
- ditto for EggDBusVariant.
- With this change we should be able to generate Plain Old C structures
instead of GObject based ones. This may be desirable for some
structs passed over D-Bus.
Also use the proper type for enum/flag types in properties and
signals. Add test cases for this too.
|
|
|
|
|
|
Short explanation of how it works (needs to go into some docs)
- com.example.Foo() links to the Foo() method on com.example
- #com.example::Changed links to the Changed signal on com.example
- #com.example:SomeProperty links to the SomeProperty property on com.example
- #com.example links to the com.example interface
- %com.example.Error.Failed links to the com.example.Error.Failed error
- #com.example.Error links to the whole error enumeration com.example.*
- %Car.Volvo links to the Volvo constant in the Car enumeration (ditto flags)
- %Car links to the Car enumeration (ditto flags)
So, yeah, pretty much like gtk-doc.
Note that for generating gtk-doc comments, these things are translated
into the namespace used, e.g. com.example.Foo() will be translated to
my_namespace_example_foo if MyNamspaceExample is the GObject type for
the com.example interface. Ditto for signals, properties, errors and
enumerations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Right now it's very similar to spec-to-docbook.xsl written by Jon
McCann and David Zeuthen. Since EggDBus introspection XML is a lot
richer (flags, enums, error domains, structs etc.) there's still some
room for improvement.
|
|
|
|
|
|
|
|
Apparently the type is never checked for generated marshallers, only for
built-in GObject marshallers such as VOID__STRING. That's why this bug only
surfaced, for SessionAdded(ObjectPath path), when I started using eggdbus to
client-side ConsoleKit bindings.
|
|
Experienced this bug when generating code for ConsoleKit.
|
|
|
|
|
|
|
|
The test suite uses g_assert_no_error() which is new in 2.19.0.
|
|
Note, 0.1 was not really a release (e.g. no tarballs).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This makes it a bit easier to look at the generated gtk-doc output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|