diff options
Diffstat (limited to 'tests/auto/client/shared/coreprotocol.h')
-rw-r--r-- | tests/auto/client/shared/coreprotocol.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h index e43451cea..0f59441a3 100644 --- a/tests/auto/client/shared/coreprotocol.h +++ b/tests/auto/client/shared/coreprotocol.h @@ -1,11 +1,13 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef MOCKCOMPOSITOR_COREPROTOCOL_H #define MOCKCOMPOSITOR_COREPROTOCOL_H #include "corecompositor.h" +#include <QtCore/qpointer.h> + #include <qwayland-server-wayland.h> namespace MockCompositor { @@ -288,6 +290,9 @@ public: OutputData m_data; int m_version = 1; // TODO: remove on libwayland upgrade +Q_SIGNALS: + void outputBound(Resource *resource); + protected: void output_bind_resource(Resource *resource) override; }; @@ -296,7 +301,7 @@ class Seat : public Global, public QtWaylandServer::wl_seat { Q_OBJECT public: - explicit Seat(CoreCompositor *compositor, uint capabilities = Seat::capability_pointer | Seat::capability_keyboard | Seat::capability_touch, int version = 7); + explicit Seat(CoreCompositor *compositor, uint capabilities = Seat::capability_pointer | Seat::capability_keyboard | Seat::capability_touch, int version = 9); ~Seat() override; void send_capabilities(Resource *resource, uint capabilities) = delete; // Use wrapper instead void send_capabilities(uint capabilities) = delete; // Use wrapper instead @@ -334,7 +339,7 @@ class Pointer : public QObject, public QtWaylandServer::wl_pointer public: explicit Pointer(Seat *seat) : m_seat(seat) {} Surface *cursorSurface(); - CursorRole* m_cursorRole = nullptr; //TODO: cleanup + QPointer<CursorRole> m_cursorRole; void send_enter() = delete; uint sendEnter(Surface *surface, const QPointF &position); void send_leave() = delete; @@ -346,6 +351,8 @@ public: void sendAxisSource(wl_client *client, axis_source source); void sendAxisStop(wl_client *client, axis axis); void sendFrame(wl_client *client); + void sendAxisValue120(wl_client *client, axis axis, int value120); + void sendAxisRelativeDirection(wl_client *client, axis axis, axis_relative_direction direction); Seat *m_seat = nullptr; QList<uint> m_enterSerials; @@ -365,6 +372,7 @@ public: explicit CursorRole(Surface *surface) // TODO: needs some more args : m_surface(surface) { + connect(m_surface, &QObject::destroyed, this, &QObject::deleteLater); } static CursorRole *fromSurface(Surface *surface) { return qobject_cast<CursorRole *>(surface->m_role); } Surface *m_surface = nullptr; @@ -379,6 +387,7 @@ public: uint sendUp(wl_client *client, int id); void sendMotion(wl_client *client, const QPointF &position, int id); void sendFrame(wl_client *client); + void sendCancel(wl_client *client); Seat *m_seat = nullptr; }; @@ -410,7 +419,7 @@ protected: void shm_create_pool(Resource *resource, uint32_t id, int32_t fd, int32_t size) override; void shm_bind_resource(Resource *resource) override { - for (auto format : qAsConst(m_formats)) + for (auto format : std::as_const(m_formats)) send_format(resource->handle, format); } }; |