summaryrefslogtreecommitdiffstats
path: root/examples/wayland/custom-extension
Commit message (Collapse)AuthorAgeFilesLines
* Remove waylandclient-private dependency from custom-extension exampleJohan Klokkhammer Helsing2018-04-255-8/+5
| | | | | | | | We really only depend on gui-private. Change-Id: Ic774cf94d8d94194c26d3852206ecff488948196 Reviewed-by: Drew DeVault <qt@cmpwn.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use default member initialization for raw pointersJohan Klokkhammer Helsing2018-02-281-1/+1
| | | | | | | | Initialize to nullptr to prevent undefined behavior. Change-Id: I7753c0be77a886d62ecb1cd7b86fc8c98340b0b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-272-2/+1
| | | | | | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file \ -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \ -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \ -header-filter='qtwayland' \ -fix Afterwards I ran search and replace on the diff to clean up some whitespace errors: - Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: ' - Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, ' - Replaced '\n\+\s*\n' with '\n' I also had to do some manual edits, because for some reason, this particular clang-tidy check doesn't trigger for some files. Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b Reviewed-by: Shawn Rutledge <shawn.rutledge@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>
* Add non-global object to custom extension examplePaul Olav Tvete2017-10-057-11/+254
| | | | | | | | | | Show how to create non-global objects on the client side. Also fix error in the XML file: move the enum outside the event. Change-Id: I85b4cae115a57d60eda4a54d652ea98a8cd39548 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix licensingv5.9.0-beta4Jani Heikkinen2017-05-0410-23/+123
| | | | | | | | | | Currently tests are licensed under GPL-EXCEPT, examples under BSD and src under LGPL so replase old license headers with new & proper ones. Also remove old & unused license files Task-number: QTBUG-57147 Change-Id: Ia6a738798736c275dc309ccfa5b627dc2178d241 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-253-10/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/custom-extension/client-common/main.cpp src/client/qwaylandwlshellintegration_p.h src/client/qwaylandxdgshellintegration_p.h src/compositor/compositor_api/qwaylandquickoutput.h src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h Change-Id: Ic78c610ddf102b0a185294f625bbfcb9238b0f3c
| * Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-234-11/+11
| | | | | | | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Remove unused files from examplePaul Olav Tvete2017-01-023-103/+0
|/ | | | | Change-Id: I8ce9c4b284da2d3e7f88e8449be22f9a25b5a2e0 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Move qtwayland over to use the new configuration systemLars Knoll2016-11-234-33/+0
| | | | | | | | | | | | | Re-use configuration results from qtbase where possible and move all pkg-config handling over to be done at configuration time. Since waylandclient and waylandcompositor are two independent libs, this required some duplication of features and libraries used by both in the configure.json files. Change-Id: I1f3ec56c85cb780324cc7634a3ad7951125853a0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add mode support to QWaylandOutputPier Luigi Fiorini2016-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Outputs usually have more than one mode, add an API to support them. When sizeFollowsWindow is true, modes are replaced by one with the window size and refresh rate. In that circumstance the mode changes when the window is resized. The sizeFollowsWindow property default value is no longer true. The setGeometry() method is gone as it doesn't make sense now, the setWidth() and setHeight() methods are now private slots to resize the resolution as the window resizes (and sizeFollowsWindow is true). Refresh rate is expressed in mHz rather than Hz just like the Wayland protocol. A compositor implementation may choose to add modes if it has access to hardware information, it will call addMode() for each mode and then invoke the setCurrentMode() method that sends the modes list to the client. The preferred mode is indicated with a boolean parameter to the addMode() method. Change-Id: Iffed4784ccef695c276ebd800172957f4cff3324 Task-number: QTBUG-49814 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Make the custom extension example more interestingPaul Olav Tvete2016-09-3011-95/+470
| | | | | | | Define a protocol that does something visible. Change-Id: I29133eeffbb2c98a61ee59b241dcf6a6a0f543cb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Simplify custom-extension examplePaul Olav Tvete2016-09-0816-70/+50
| | | | | | | | | | | | | Don't confuse people by creating the extension inside a platform plugin. It's only necessary when modifying Qt's default behaviour, and we're not going to teach that in this example. Also remove the load/unload extension logic from the qml example. Don't make people believe that they have to use a loader. Change-Id: Id263bb7d77fba176bfb8b6843a6ece9a0a203754 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Compositor API: rename QWaylandInputDevice to QWaylandSeatJohan Klokkhammer Helsing2016-08-111-1/+1
| | | | | | | | | | | | The name QWaylandInputDevice could be confusing and misleading: - A QWaylandInputDevice was not one input device, but a collection of many. - Classes that sounded like they should inherit from it did not, i.e: QWaylandKeyboard, QWaylandPointer and QWaylandTouch. - The Wayland protocol already has another term for this, which is seat. Change-Id: I9d9690d5b378075d9dddaeb8cf18395c7f47603e Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Rename createSurface and similar signalsJohan Klokkhammer Helsing2016-08-031-1/+1
| | | | | | | | | | | * createSurface -> surfaceRequested * createXdgSurface -> xdgSurfaceRequested * createXdgPopup -> xdgPopupRequested * createShellSurface -> wlShellSurfaceRequested * shellSurfaceCreated -> wlShellSurfaceCreated Change-Id: I715a927242130d7504955002a6a64a2bac516d46 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Compositor: make the extensions property list optionalPaul Olav Tvete2016-07-121-16/+12
| | | | | | | | | | Extensions will now automatically add themselves to their parent if they are not inside an extensions [ ... ] array. Change-Id: I26c7f7c2ee023595eb4cd2496dd56e212f05329c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Adjust for hotspot position inside WaylandCursorItemJohan Klokkhammer Helsing2016-07-111-2/+2
| | | | | Change-Id: Ide6605b7bd05f739976ed603c19e030ec74d2a2a Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Rename enableWSCursor to windowSystemCursorEnabledJohan Klokkhammer Helsing2016-07-111-1/+1
| | | | | | | What WS stood for may not have been obvious. Change-Id: Ib2a3f566e4e49d8be0c14c4937e7356b51718e44 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* fix example installOswald Buddenhagen2016-05-251-0/+3
| | | | | | Change-Id: I3d7b995ecbe2e06d9c87aea743d59ee551e1fae4 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* load(qt_plugin) at the endOswald Buddenhagen2016-05-251-3/+2
| | | | | | | amends 5b3f207ed after the merge to 5.7. Change-Id: Iabf29cbf0e24b3b02f19f5fb0cd5feb624169428 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Create a general ShellSurfaceItem to avoid duplicationJohan Klokkhammer Helsing2016-05-201-1/+1
| | | | | | | | | | | | | | | | | | XdgSurfaceItem and WlShellSurfaceItem have been removed in favor of the more general ShellSurfaceItem. An XdgSurface or a WlShellSurface can be assigned to the shellSurface property of a ShellSurfaceItem and leaves open the possibility for additional shells. A shared base class for QWaylandXdgSurface and QWaylandWlShellSurface has been added which has a factory method for creating a QWaylandQuickShellIntegration for that shell implementation. The property "shellSurface" on the ShellSurfaceItem allows QML code to attach to signals regardless of whether it's a WlShell or XdgShell client. The pure-qml example has been updated to take advantage of this. Change-Id: I9d3427586e100d6c44a24f319dd8e1486ff062ee Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Fix buildJohan Klokkhammer Helsing2016-05-201-1/+1
| | | | | Change-Id: I8f1338fa6ed807ac309f2b6d7a8265c1bae144b8 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Move QWaylandClientExtension out of namespacePaul Olav Tvete2016-05-193-11/+0
| | | | | | | | The class name already has a QWaylandClient prefix. We don't need QtWaylandClient:: in addition. Change-Id: I42f16d43fe414e3388dfdb924e96d9fc2b0b4ba9 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Rename QWaylandExtension to QWaylandCompositorExtensionPaul Olav Tvete2016-05-182-3/+3
| | | | | | | | Since we have QWaylandClientExtension Change-Id: Ie8d60322c8e730bda651e06ed5db0fe1359d946e Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Fix example build dependencyPaul Olav Tvete2016-05-121-0/+2
| | | | | | Change-Id: I5efcfdbee1bcc60d88a693226d234ad585078edb Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Automatically initialize the quick extension objectsGiulio Camuffo2016-04-294-11/+9
| | | | | | | | | Instead of writing "Component.onCompleted: initialize()" for every extension the compositor has, let them call that automatically. Change-Id: I0b499a38c2b475dc9a7ef27cbacebef19b196dbf Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Add QML api for client side extension.Erik Larsson2016-04-215-1/+208
| | | | | | | | | | | This makes it simple to use client-side extensions in QML. The only thing that the user needs to do is register the extension class using qmlRegisterType() and the use the extension in QML. Also adds simple QML example which uses client-side extension. Change-Id: I2db99861d97c7bca5cfdbf86ba3a8ccc50fb24b0 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Simplify ShellSurfaceItem creationv5.7.0-beta1Johan Klokkhammer Helsing2016-04-111-3/+2
| | | | | | | | | | | Use onShellSurfaceCreated instead of onCreateShellSurface. A QWaylandWlShellSurface is no longer created in QWaylandWlShellSurfaceItem::componentComplete Change-Id: I7a0dbbacddc17ab32ed0e4d16e717fcefb221947 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com>
* Rename compositor Shell to WlShellJohan Klokkhammer Helsing2016-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | * QWaylandShell -> QWaylandWlShell * QWaylandShellSurface -> QWaylandWlShellSurface * QWaylandQuickShellSurfaceItem -> QWaylandQuickWlShellSurfaceItem * Shell -> WlShell (QML) * ShellSurface -> WlShellSurface (QML) * ShellSurfaceItem -> WlShellSurfaceItem (QML) This is done to avoid confusion with XdgShell and will hopefully help clarify that some of the examples only support wl_shell and not xdg_shell. Additionally, this makes "Shell" an available name in the compositor API, which may in turn enable the creation of a more general abstraction hiding the details of the shell backends (i.e. xdg_shell, wl_shell, and eventually ivi_shell). Change-Id: Iebac1f36505084bfaaea68838005d54db6c55e21 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Simplify client-side API for Wayland extensionsErik Larsson2016-03-183-27/+7
| | | | | | | | | | | 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>
* Add surface roles backGiulio Camuffo2016-02-111-1/+1
| | | | | | Task-number: QTBUG-49809 Change-Id: Id62ddea68c89b6999b66d3df8eeeffd858ae844f Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Link with the wayland-client libraryPaul Olav Tvete2016-01-141-0/+6
| | | | | Change-Id: I888f7289285a57a7c0a4a01054b4f691b178ad73 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Compile fix for namespaced Qt buildsPaul Olav Tvete2015-11-281-0/+4
| | | | | | Change-Id: Ie23f7c01331d5e52dcf30952d7ad9ade6ef5a5e0 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Fix copyright headersPaul Olav Tvete2015-11-095-15/+15
| | | | | | | | Old copyright headers were accidentally used for some new code. Change-Id: I0230d350e59701bc6b383c7c8151d52e34e8e75a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Add install targets for new examples.Paul Olav Tvete2015-11-043-1/+8
| | | | | Change-Id: Ibb4ae57d82a86d5fc74679c628a5c7a9b100f71d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* New custom extension examplePaul Olav Tvete2015-10-2319-0/+906
The example implements a simple Wayland extension that doesn't do anything useful. It contains a custom compositor and a wayland platform plugin. Change-Id: I88df4b20f328a32fca33b8d013d253611539526f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>