diff options
author | Paul Olav Tvete <paul.tvete@gmail.com> | 2016-09-07 10:15:28 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-09-30 13:56:36 +0000 |
commit | 5372ec5c131e23cccfbabc43d700ffbbbad973ec (patch) | |
tree | 270f29ece9b8c58dd0b22faf3006f6260b9bb488 /examples/wayland/custom-extension/compositor/customextension.h | |
parent | f7896fdc6505d8c6f3b3a239884dadab034e1fb5 (diff) |
Make the custom extension example more interesting
Define a protocol that does something visible.
Change-Id: I29133eeffbb2c98a61ee59b241dcf6a6a0f543cb
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples/wayland/custom-extension/compositor/customextension.h')
-rw-r--r-- | examples/wayland/custom-extension/compositor/customextension.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/examples/wayland/custom-extension/compositor/customextension.h b/examples/wayland/custom-extension/compositor/customextension.h index 8419eeea3..b1b00408b 100644 --- a/examples/wayland/custom-extension/compositor/customextension.h +++ b/examples/wayland/custom-extension/compositor/customextension.h @@ -48,24 +48,30 @@ #include <QtWaylandCompositor/QWaylandCompositor> #include "qwayland-server-custom.h" -namespace QtWayland { - -class CustomExtension : public QWaylandCompositorExtensionTemplate<CustomExtension>, public QtWaylandServer::qt_example_extension +class CustomExtension : public QWaylandCompositorExtensionTemplate<CustomExtension> + , public QtWaylandServer::qt_example_extension { Q_OBJECT public: - CustomExtension(); + CustomExtension(QWaylandCompositor *compositor = 0); void initialize() Q_DECL_OVERRIDE; - Q_INVOKABLE void sendEvent(QWaylandSurface *surface, uint time, const QString &text, uint value); signals: - void requestReceived(const QString &text, uint value); + void surfaceAdded(QWaylandSurface *surface); + void bounce(QWaylandSurface *surface, uint ms); + void spin(QWaylandSurface *surface, uint ms); + +public slots: + void setFontSize(QWaylandSurface *surface, uint pixelSize); + void showDecorations(QWaylandClient *client, bool); + void close(QWaylandSurface *surface); + protected: - virtual void example_extension_qtrequest(Resource *resource, const QString &text, int32_t value) Q_DECL_OVERRIDE; + void example_extension_bounce(Resource *resource, wl_resource *surface, uint32_t duration) Q_DECL_OVERRIDE; + void example_extension_spin(Resource *resource, wl_resource *surface, uint32_t duration) Q_DECL_OVERRIDE; + void example_extension_register_surface(Resource *resource, wl_resource *surface) Q_DECL_OVERRIDE; }; Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(CustomExtension) -} - #endif // CUSTOMEXTENSION_H |