diff options
author | Erik Larsson <erik@ortogonal.com> | 2016-01-03 15:51:27 +0100 |
---|---|---|
committer | Erik Larsson <erik@ortogonal.com> | 2016-03-18 07:38:55 +0000 |
commit | 47202ee55978d12e27efb0e3ebbe841fb1af043f (patch) | |
tree | 2b85fde7db285b9a85323c74ba5d2d09549a1e61 /src/qtwaylandscanner/qtwaylandscanner.cpp | |
parent | c7aa6bae0cf827d5a6bbfebea947d557b56a2bfb (diff) | |
download | qtwayland-47202ee55978d12e27efb0e3ebbe841fb1af043f.tar.gz |
Simplify client-side API for Wayland extensions
This simplifies the client-side API for Wayland extensions by
introducing QWaylandClientExtension/QWaylandClientExtensionTemplate
classes. These classes takes care of the initialization of the extension
if it matches the interface name.
Change-Id: I7c4fb34563563af4be072cdebda54954b79cddbe
Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/qtwaylandscanner/qtwaylandscanner.cpp')
-rw-r--r-- | src/qtwaylandscanner/qtwaylandscanner.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index afe3b80e..b609523b 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -878,6 +878,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf(" const struct ::%s *object() const { return m_%s; }\n", interfaceName, interfaceName); printf("\n"); printf(" bool isInitialized() const;\n"); + printf("\n"); + printf(" static const struct ::wl_interface *interface();\n"); printEnums(interface.enums); @@ -1003,6 +1005,12 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf(" {\n"); printf(" return m_%s != 0;\n", interfaceName); printf(" }\n"); + printf("\n"); + + printf(" const struct wl_interface *%s::interface()\n", interfaceName); + printf(" {\n"); + printf(" return &::%s_interface;\n", interfaceName); + printf(" }\n"); for (int i = 0; i < interface.requests.size(); ++i) { printf("\n"); |