summaryrefslogtreecommitdiffstats
path: root/src/qtwaylandscanner
Commit message (Collapse)AuthorAgeFilesLines
* Don't use members of wl_resourceJohan Klokkhammer Helsing2018-09-181-2/+2
| | | | | | | | | When we switch to only including core wayland headers, wl_resource will be an opaque type. Use the getters and setter functions instead. Task-number: QTBUG-70553 Change-Id: I7d84d48a4ee3586f231a331cd15716686dcee775 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove ifdefs for unsupported libwayland versionsJohan Klokkhammer Helsing2018-09-171-3/+0
| | | | | | | The ifdefs were for version 1.2.0. Change-Id: Ie58745c7cf4c0fba45bc5203d24e9913d3a8b8ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Scanner: Don't crash when calling fromResource with nullptrJohan Klokkhammer Helsing2018-08-291-0/+2
| | | | | | Change-Id: I85c17e50cf917a51e74fa03fcdc647def6e4bdfd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Convert qtwaylandscanner into a classJohan Klokkhammer Helsing2018-08-091-128/+191
| | | | | | | | Encapsulate what the scanner needs of functions and state into a class, Scanner, instead of keeping everything in the global namespace. Change-Id: Idd4b412bb7f709f24c86abe82b135c09b7985878 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Disable the -Wmissing-field-initializers warning for Clang tooThiago Macieira2018-05-231-0/+1
| | | | | | | qwldatadevicemanager.cpp:277:1: warning: missing field 'finish' initializer [-Wmissing-field-initializers] Change-Id: I052407b777ec43f78378fffd15311263e7498287 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use nullptr instead of 0 or NULLJohan Klokkhammer Helsing2018-02-201-1/+1
| | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qtwaylandscanner: Remove globals when destroying wrappersJohan Klokkhammer Helsing2017-10-251-0/+23
| | | | | | | | | | | | | When globals are destroyed on the compositor side, send the "global_remove" event and set the resource implementation to nullptr so all further requests are ignored. This also adds a compositor test to see if outputs are removed when they are deleted. Change-Id: Ib77a4c3d4c2c93283a14ac20f5964e2ce08a1d38 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use nullptr instead of 0 in qtwaylandscannerJohan Klokkhammer Helsing2017-08-151-16/+16
| | | | | Change-Id: I5ffee26a4c0cd7726e007cc0692e403e15b5726e Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Disable the GCC warning about missing initializersThiago Macieira2017-06-221-0/+12
| | | | | | | | | New fields are appended to the structure, so we can't initialize them as we would lose compatibility with earlier versions of libwayland. So just disable the warning. Change-Id: Ia3e896da908f42939148fffd14c4806ce3468e56 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Add QWaylandShellSurface::fromResource()Giulio Camuffo2016-03-291-1/+8
| | | | | | | | | | Also make sure that the generated *::Resource::fromResource() code returns null if it doesn't own the resource or if the interface is wrong. Change-Id: I904e0dd49dd6e535ef8cab6687c6869e1000048d Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Simplify client-side API for Wayland extensionsErik Larsson2016-03-181-0/+8
| | | | | | | | | | | 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>
* Allow initializing the server protocol classes with a wl_resourceGiulio Camuffo2016-02-101-1/+25
| | | | | Change-Id: I3efd23284392e0ff587f86c7c163c0e4ffadb1f1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Updated license headersAntti Kokko2016-01-201-14/+20
| | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I76ae5d3e64f096eb3163d6163a38d68c7c1ca756 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge branch '5.6' into wip-compositor-apiLaszlo Agocs2015-10-271-4/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qwindow-compositor changes from 5.6 will be adapted separately. The traditional wayland-egl path is tested and is functional like before. The EGLStream support will be verified separately once the qwindow-compositor changes are ready. Conflicts: examples/wayland/qwindow-compositor/qwindowcompositor.cpp examples/wayland/qwindow-compositor/textureblitter.cpp examples/wayland/qwindow-compositor/textureblitter.h examples/wayland/server-buffer/client/client.pro examples/wayland/server-buffer/compositor/compositor.pro src/compositor/compositor_api/qwaylandbufferref.cpp src/compositor/compositor_api/qwaylandbufferref.h src/compositor/hardware_integration/qwlclientbufferintegration_p.h src/compositor/wayland_wrapper/qwlkeyboard.cpp src/compositor/wayland_wrapper/qwlkeyboard_p.h src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro Change-Id: Ic2e3a6e8f74606c35b1e27cd4016fa133527d7ba
| * Fix for QStringBuilderLaszlo Agocs2015-10-191-4/+23
| | | | | | | | | | Change-Id: I2a7b82bd2705919a91492edfccac02f4d8fc2c9b Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* | Fix % warning when using generated filesJørgen Lind2015-09-101-1/+1
| | | | | | | | | | Change-Id: Ib7857743140d9f2dfa5bf1ff2187af8f3e2478da Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Rename QtCompositor to QtWaylandCompositorJørgen Lind2015-09-101-5/+0
| | | | | | | | | | | | | | enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Add an assert in QtWaylandScanner for duplicate bindsJørgen Lind2015-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | Since Q_SIGNALS are a one -> many distribution we can end up signalling creation requests to many slots. Its then important that we verify that only one of these actually binds an object for the object id. Its a programming error to have this situation, hence its an assert, and not a runtime check that gives a warning. The bind will overwrite the object and the last bind will continue to work as normal in release mode. Change-Id: I1f469066cf5287789249763843e6cbaa545ee619
* | Improve QWaylandExtensionJørgen Lind2015-08-281-1/+1
| | | | | | | | | | | | | | | | By using curiously recurring template pattern we can generate a getter which is very convenient, and all QWaylandExtensions should have this casting operation Change-Id: Idb5a786655f2e106cf5388b11ed71e8b6ddddec0
* | Rework how we manage extensionsJørgen Lind2015-08-281-1/+16
|/ | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Reset wayland object pointer after destroyArnaud Vrac2015-05-071-0/+4
| | | | | | | This allows calling init() on the wayland object again after destroy() Change-Id: I7856cc8ec676eee7575e15a5d1f81cf1b89537c8 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Update copyright headersJani Heikkinen2015-02-171-22/+14
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* Fix the compositor's wayland versioningGiulio Camuffo2014-10-091-24/+27
| | | | | | | | | We cannot just assume all clients implement the same version of the various interfaces as the compositor does. Keep track of them, and react accordingly when creating a resource or sending an event. Change-Id: I9792433a14d49c5c4df0c892fc1349ce0dfb0d43 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Explicitly define the interface versionsGiulio Camuffo2014-08-231-6/+6
| | | | | | | | | | Currently a global is bound with the version the interface has in the xml file. This is a problem for apps that explicitly link to libwayland-client because they may link to a newer libwayland, so the version of some interface may be higher than the one that it is actually implemented. Change-Id: Id0dbe6c0f1e05fe91954b9d8d9472d42d2053cdc Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Bind the globals with the highest version availableGiulio Camuffo2014-08-051-1/+1
| | | | | Change-Id: I639b124f15416905c17665755b3288c905880f39 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix generated code for interface names not starting with qt_ or wl_Giulio Camuffo2014-06-121-5/+5
| | | | | | | | | The generated code for an interface without a qt_ or wl_ prefix was broken, and could not compile. This commit needs a 'make clean' to let qtwaylandscanner run again. Change-Id: Id9c7e3f87385f83eeffd1e8718c854a405f411f0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/dev' into stableOswald Buddenhagen2014-02-191-3/+3
|\ | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I3b6a4af41f272d3dc7fc920ba2542f2dd7978175
| * Fix compiler warnings because of deprecated apisJorgen Lind2014-01-171-3/+3
| | | | | | | | | | Change-Id: I60faee3fb4b9a74a13c8489a5dd1df7a2a5a4ae4 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Strip custom prefix from interface namePier Luigi Fiorini2014-02-091-9/+14
|/ | | | | | | | Interface names for some protocols might not start with wl_ or qt_, with this change users can specify a prefix of their liking. Change-Id: I70d40985165c49114b525bdec2a872aa5b0dad6d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* QtWaylandScanner: add server api for specifically creating new objectsJorgen Lind2013-12-271-0/+11
| | | | | | | | | | | | | Its no that obvious I think that setting the id == 0 when ading a resource is the right thing to do This commit can potentially break a CI build since it will not force a regeneration of the generated headers, but the "local" cpp files will use the updated header interface. To fix this clean the QtCompositor and the QtWaylandClient include directories in QtBase Change-Id: I32db799dfe338f38c3941eeeb22dd91ed0c7e77d Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Add a preprocessor protocol name variableJorgen Lind2013-12-271-16/+20
| | | | | | | | | | | We should convert - to _ in the preprocessor protocol name since - will lead to a new token, but we don't since it is better to fail early here and the official wayland-scanner doesn't do this either. The generated c++ header will give a compiler error when being used which gives the user a chance to change the protocol name. Change-Id: I049bdecacc8ed9a70c0879494d4d358ce53f3320 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Remove compiler warning qtwaylandscannerJorgen Lind2013-12-271-11/+11
| | | | | | | We don't need the interface name anymore Change-Id: I8b1d334a549adb388da083dd8f4261755a54ff20 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Make it possible to install the generated headersJorgen Lind2013-12-241-9/+52
| | | | | | | | | | Adding a header_path parameter. This will cause the scanner to generate header includes that look for corresponding files in that path. Also when we'r installing files, then c++ classes needs to be exported Change-Id: Ic539c0861143d7200b9cae85ca902a17ea0d0a8d Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Generate more useful methods for new_id requestsJan Arne Petersen2013-11-221-6/+1
| | | | | Change-Id: I3206bf7e0ffc99e9ec10d949f51ad043aca2548c Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix creating new objects (with id == 0)Jan Arne Petersen2013-11-221-1/+1
| | | | | | Change-Id: I2a6740d5e1a4367d2980e3fb17617c2f1cb95041 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Bind to version 1 of an interfaceJan Arne Petersen2013-11-221-1/+1
| | | | | | | | | Just require version 1 instead of the latest available version of an interface for now. Explicit support for requesting a higher version should be added still. Change-Id: Ib1b8303191e000227e27e07b1adf837993ac3497 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix scanner to support also hex values in enumsJan Arne Petersen2013-08-281-3/+3
| | | | | | | | | Read the value of an enum entry as a QByteArray. There is not any need to convert it into an int in between. Change-Id: Ie75d30dc22f7e81ddcff64990e3c6f030f31ef79 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Use QMultiMap instead of wl_list for resourcesJan Arne Petersen2013-08-281-19/+12
| | | | | | | | | | | | Change generated code in qtwaylandscanner to generate resourceMap() methods returning a QMultiMap<wl_client*, Resource*>. Adapt code using resource lists to use the map instead. Remove Compositor::resourceForSurface(). Change-Id: Id41a1712f9c2477c1a1af843bba2795dd90391e5 Reviewed-by: Andy Nichols <andy.nichols@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* qtwaylandscanner: fix binding delegate to track resourcesAndrew Knight2013-08-221-1/+1
| | | | | | | | | | Global extension objects created with qtwaylandscanner may need to track their child resource list. This ensures bound objects are added to that list. Change-Id: I2875d84d2108ddad664c52ed1a11173312ff1b04 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Do not create unused code with qtwaylandscannerJan Arne Petersen2013-08-221-53/+11
| | | | | | | | We do not use foreign wl_resource handles in the server code anymore. Remove support for it from the generated code in qtwaylandscanner. Change-Id: Id45235ceb4282db02858749c0bef04278be7322d Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Make qtwaylandscanner generate correct interface versions.Morten Johan Sorvig2013-08-221-1/+1
| | | | | Change-Id: I3e74b00c10a11fb60261e883cbcf25aa6d4589c2 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Fix uninitialized value in generated codeJan Arne Petersen2013-08-081-0/+5
| | | | | Change-Id: Ied932604de63072cc3b5614c84c8ec34fd94c891 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Fix double frees in Wayland 1.2Jan Arne Petersen2013-08-061-0/+17
| | | | | | | | | Remove double frees in destroy_func generated by qwaylandscanner. The wl_resource struct is already freed by wl_resource_destroy() in wayland-server in Wayland 1.2. Change-Id: Ibd42e42a23238ba9c665a7c918f9b547968f7146 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Wayland compositor: only include Qt's generated protocol headersAndrew Knight2013-06-281-1/+0
| | | | | | | The system may come with conflicting headers generated by wayland-scanner. Change-Id: I1aef7e32683ab02d0712ee65970f010a86854e43 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Adapted Surface and Region to use the qtwaylandscanner.Samuel Rødal2013-04-232-13/+44
| | | | | | | | This requires some slight additions to the qtwaylandscanner to handle the pattern of the wl_resource not being owned by the generated class. Change-Id: Ia49c8129cee3a203ca9a727e83fafd3dfc653e75 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Adapted code to use qtwaylandscanner.Samuel Rødal2013-04-171-4/+3
| | | | | | | | | | | | We include the wayland.xml since we need to generate bindings for the core protocol as well. Also, WAYLANDSOURCES has been split into WAYLANDSERVERSOURCES and WAYLANDCLIENTSOURCES since we need to produce different output in the server and client cases. Change-Id: I0bd493d41ca6b26dfd2d9b1463d4b762786537f9 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Introduced qtwaylandscanner.Samuel Rødal2013-04-172-0/+1041
Generates C++ headers with Qt types based on the Wayland XML protocol files, to reduce a lot of code duplication in all the places that interface between Qt and the wayland protocol headers. Change-Id: I34a4417d3d3d0238de2f2f74986855d097b50ec9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>