[Telepathy] Use of self created extensions in Telepathy-qt4

Olli Salli ollisal at gmail.com
Sun Jul 31 11:32:11 PDT 2011


On Thu, Jul 14, 2011 at 2:25 PM, Daniel Engelhardt
<daniel.engelhardt at esk.fraunhofer.de> wrote:
> With the help of this example, I was able to create a proxy code for this
> example and others (using qt4-client-gen.py). Now, I would love to implement
> the other stub, which implements the functionality (some people call this
> adaptor or skeleton, I guess), but I am failing at this task, because I
> could neither find a code generation tool for the QT4 binding to generate

Yes, unfortunately tp-qt4 doesn't have a code generator for the
service side adaptors, as except for the
Client.{Handler,Observer,Approver} interfaces and some fake services
in unit tests, which have hand-written adaptors, there is no service
side code at all. There are currently no plans to implement that
either; however the MethodInvocationContext class used for the Client
implementation classes was designed to be suitable for asynchronous
service-side usage in general.

> these stubs, nor could I use the native code generation tool from QT4, as
> qdbusxml2cpp fails with
>
> |Got unknown type `a(usua{sv})'
>
> |You should add <annotation name="com.trolltech.QtDBus.QtTypeName.Out0"
> value="<type>"/> to the XML description
>
>

Yes, the QDBus generator tools are rather limited in their
understanding of more complex types.

>
> If I had to annotate the XML all by myself, I could simply just annotate the
> DBus XML Introspection file (which I don’t want to do for other reasons).
>
>

Remember that the actual complex type definitions have been generated
already by tp-qt4's types-gen, though, so you don't need to write them
manually.

>
> So, my question is: how can I implement a proxy-adaptor pair using the QT4
> binding and the Telepathy XML description. What am I missing?
>
>

You can either hand-write the adaptor, using TpQt4 types-gen and
constants-gen generated complex types, or annotate the XML for
qdbusxml2cpp to digest, using the complex types generated by types-gen
and constants-gen.

Or you could implement the service-side counterpart to tp-qt4's
qt4-client-gen.py, automatically emitting abstract base classes for
each interface with the proper types for parameters, and
MethodInvocationContext for returning from methods. We'd love to
review that for inclusion - but I guess that might be out of scope for
you.

In any case, service side autogeneration support would mostly be
useful for your kind of non-Telepathy DBus interfaces - including DBus
services exported over Telepathy tubes, as even with the service side
adaptors autogenerated, implementing Telepathy services would be
really complicated without the support from tp-glib's high-level
service side base classes.

>
> I would appreciate an answer very much!
>
>
>
> Best regards,
>
> Daniel
>
> _______________________________________________
> telepathy mailing list
> telepathy at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/telepathy
>
>



-- 

Br,
Olli Salli
telepathy-qt4 upstream


More information about the telepathy mailing list