2020-11-03 17:24:57 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "qwayland-server-pointer-gestures-unstable-v1.h"
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
namespace KWaylandServer
|
|
|
|
{
|
2021-02-12 22:29:45 +00:00
|
|
|
class ClientConnection;
|
2020-11-03 17:24:57 +00:00
|
|
|
class Display;
|
|
|
|
class PointerInterface;
|
2021-02-12 22:29:45 +00:00
|
|
|
class SurfaceInterface;
|
2020-11-03 17:24:57 +00:00
|
|
|
|
|
|
|
class PointerGesturesV1InterfacePrivate : public QtWaylandServer::zwp_pointer_gestures_v1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit PointerGesturesV1InterfacePrivate(Display *display);
|
|
|
|
|
|
|
|
protected:
|
2021-08-29 05:11:06 +00:00
|
|
|
void zwp_pointer_gestures_v1_get_swipe_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override;
|
|
|
|
void zwp_pointer_gestures_v1_get_pinch_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override;
|
2020-11-03 17:24:57 +00:00
|
|
|
void zwp_pointer_gestures_v1_release(Resource *resource) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PointerSwipeGestureV1Interface : public QtWaylandServer::zwp_pointer_gesture_swipe_v1
|
|
|
|
{
|
|
|
|
public:
|
2021-02-12 22:29:45 +00:00
|
|
|
explicit PointerSwipeGestureV1Interface(PointerInterface *pointer);
|
2020-11-03 17:24:57 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
static PointerSwipeGestureV1Interface *get(PointerInterface *pointer);
|
|
|
|
|
|
|
|
void sendBegin(quint32 serial, quint32 fingerCount);
|
|
|
|
void sendUpdate(const QSizeF &delta);
|
|
|
|
void sendEnd(quint32 serial);
|
|
|
|
void sendCancel(quint32 serial);
|
2020-11-03 17:24:57 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void zwp_pointer_gesture_swipe_v1_destroy(Resource *resource) override;
|
2021-02-12 22:29:45 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PointerInterface *pointer;
|
|
|
|
QPointer<ClientConnection> focusedClient;
|
2020-11-03 17:24:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class PointerPinchGestureV1Interface : public QtWaylandServer::zwp_pointer_gesture_pinch_v1
|
|
|
|
{
|
|
|
|
public:
|
2021-02-12 22:29:45 +00:00
|
|
|
explicit PointerPinchGestureV1Interface(PointerInterface *pointer);
|
2020-11-03 17:24:57 +00:00
|
|
|
|
2021-02-12 22:29:45 +00:00
|
|
|
static PointerPinchGestureV1Interface *get(PointerInterface *pointer);
|
|
|
|
|
|
|
|
void sendBegin(quint32 serial, quint32 fingerCount);
|
|
|
|
void sendUpdate(const QSizeF &delta, qreal scale, qreal rotation);
|
|
|
|
void sendEnd(quint32 serial);
|
|
|
|
void sendCancel(quint32 serial);
|
2020-11-03 17:24:57 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void zwp_pointer_gesture_pinch_v1_destroy(Resource *resource) override;
|
2021-02-12 22:29:45 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PointerInterface *pointer;
|
|
|
|
QPointer<ClientConnection> focusedClient;
|
2020-11-03 17:24:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWaylandServer
|