Follows a useful change added in the kwaylandScanner tool the
s_version becomes part of the Private class.
Also fixes the related generation in the tool.
* fix initializer type -- was hardcoded, seems like an oversight
* add semicolons after class declarations -- one less thing to fix in the
resulting code
REVIEW:125110
In the header for each request a method is created, with following
features:
* ignores requests working as destructor
* adjusts return type for requests containing newId
* adds QObject *parent = nullptr for requests containing newId
* adds the arguements
* turns arguments from wayland into Qt types
In the cpp the same logic is applied. Methods are not properly
implemented and won't compile in the case of returning.
* parses the protocol
* can derive file name to generate from protocol name
* detects which interface is a global and which one is referenced
* generates client code for global and for resource
* comes with a mapping.txt file to translate wl -> KWayland
The small tool added here allows to automate the process of generating
the boiler plate for an interface. Currently it's able to generate the
Client side code representing a wl_global.
The tool does not get installed, so run it from build directory:
Example usage:
./kwaylandScanner -c Foo -f foo -g wl_foo
This will generate a wrapper for the wl_foo interface in files:
foo.h and foo.cpp
The class is called KWayland::Client::Foo.
The tool will be extended. Following things are on the TODO list:
* parse xml to get the Wayland names
* add listener (if needed)
* generate code for Wayland interfaces representing Resources
* generate the Server boiler plate
CCMAIL: mart@kde.org
CCMAIL: sebas@kde.org