Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix methods returning tuples #147

Merged
merged 7 commits into from
Aug 12, 2021

Conversation

poeschel
Copy link
Contributor

This fixes a number of things were neccessary to make methods that return Tuples work in InterfaceCodeGenerator.
It also fixes method args, that do not have an direction element, see third bullet here: https://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format

poeschel and others added 7 commits August 12, 2021 12:52
DBus specification does allow methods that do not have the "direction"
attribute on their args. These are threatened as "in".
The InferfaceCodeGenerator did ignore method args that do not have a
direction set and no arguments where created on the java interface.
With this commit now method args without a direction attribute are also
threatened as if they'd had direction="in" set. Other values than "in"
or "out" are still ignored.
Generated methods that have multiple "out" args solve this by having a
*Tuple container class in java.
This did not work. The generated return type of the method was the type
of the first "out" arg in dbus.
This is now fixed now the *Tuple class is the return type of a methode
with multiple return values.
The generated extra Tuple classes were missing their member variables.
The generated Tuple classes were missing its constructor.
When generating a method and during this we have to generate an
additional class, like when generating *Tuple classes, the @position
annotation inside this additional class was not right. Every member had
@position0 as its annotation.
This is now fixed. We count the annotations upwards.
This import is used for Postion annotation and is included in generated
classes. The wrong Position was imported. Now it uses the right one:
org.freedesktop.dbus.annotations.Position
The arguments on Tuples constructor do not have to have the Position
annotation. This does not compile.
To achieve this we have to use new instances of the MemberOrArgument
class for the constructor.
@hypfvieh hypfvieh merged commit 23f3e6b into hypfvieh:master Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants