2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
2021-02-12 22:29:45 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Adrien Faveraux <ad1rie3@hotmail.fr>
|
|
|
|
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2020-03-15 15:19:28 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2016-04-06 09:27:42 +00:00
|
|
|
#ifndef WAYLAND_SERVER_POINTER_INTERFACE_P_H
|
|
|
|
#define WAYLAND_SERVER_POINTER_INTERFACE_P_H
|
|
|
|
#include "pointer_interface.h"
|
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
#include <QPointF>
|
2016-04-06 09:27:42 +00:00
|
|
|
#include <QPointer>
|
2016-10-11 06:05:15 +00:00
|
|
|
#include <QVector>
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
#include "qwayland-server-wayland.h"
|
|
|
|
|
2020-04-29 14:56:38 +00:00
|
|
|
namespace KWaylandServer
|
2016-04-06 09:27:42 +00:00
|
|
|
{
|
2021-02-12 22:29:45 +00:00
|
|
|
|
|
|
|
class ClientConnection;
|
2020-11-03 17:24:57 +00:00
|
|
|
class PointerPinchGestureV1Interface;
|
|
|
|
class PointerSwipeGestureV1Interface;
|
2020-11-03 16:24:03 +00:00
|
|
|
class RelativePointerV1Interface;
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
class PointerInterfacePrivate : public QtWaylandServer::wl_pointer
|
2016-04-06 09:27:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-02-12 22:29:45 +00:00
|
|
|
static PointerInterfacePrivate *get(PointerInterface *pointer);
|
|
|
|
|
|
|
|
PointerInterfacePrivate(PointerInterface *q, SeatInterface *seat);
|
|
|
|
~PointerInterfacePrivate() override;
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
QList<Resource *> pointersForClient(ClientConnection *client) const;
|
|
|
|
|
|
|
|
PointerInterface *q;
|
2016-04-06 09:27:42 +00:00
|
|
|
SeatInterface *seat;
|
|
|
|
SurfaceInterface *focusedSurface = nullptr;
|
|
|
|
QMetaObject::Connection destroyConnection;
|
|
|
|
Cursor *cursor = nullptr;
|
2021-02-12 22:29:45 +00:00
|
|
|
QScopedPointer<RelativePointerV1Interface> relativePointersV1;
|
|
|
|
QScopedPointer<PointerSwipeGestureV1Interface> swipeGesturesV1;
|
|
|
|
QScopedPointer<PointerPinchGestureV1Interface> pinchGesturesV1;
|
|
|
|
QPointF lastPosition;
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
void sendLeave(quint32 serial);
|
|
|
|
void sendEnter(const QPointF &parentSurfacePosition, quint32 serial);
|
2018-02-01 16:46:53 +00:00
|
|
|
void sendFrame();
|
2016-04-06 09:27:42 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
protected:
|
|
|
|
void pointer_set_cursor(Resource *resource, uint32_t serial,
|
|
|
|
::wl_resource *surface_resource,
|
|
|
|
int32_t hotspot_x, int32_t hotspot_y) override;
|
|
|
|
void pointer_release(Resource *resource) override;
|
|
|
|
void pointer_bind_resource(Resource *resource) override;
|
2016-04-06 09:27:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|