Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandpointer_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4// Qt-Security score:critical reason:network-protocol
5
6#ifndef QWAYLANDPOINTER_P_H
7#define QWAYLANDPOINTER_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
21#include <QtWaylandCompositor/QWaylandDestroyListener>
22#include <QtWaylandCompositor/QWaylandPointer>
23
24#include <QtCore/QList>
25#include <QtCore/QPoint>
26#include <QtCore/QObject>
27#include <QtCore/private/qobject_p.h>
28
29#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
30#include <QtWaylandCompositor/QWaylandView>
31#include <QtWaylandCompositor/QWaylandSurface>
32#include <QtWaylandCompositor/QWaylandSeat>
33
34#include <QtCore/qpointer.h>
35
36#include <stdint.h>
37
38QT_BEGIN_NAMESPACE
39
40class QWaylandView;
41
42class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandPointerPrivate : public QObjectPrivate
43 , public QtWaylandServer::wl_pointer
44{
45 Q_DECLARE_PUBLIC(QWaylandPointer)
46public:
47 QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandSeat *seat);
48
49 QWaylandCompositor *compositor() const { return seat->compositor(); }
50
51protected:
52 void pointer_set_cursor(Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) override;
53 void pointer_release(Resource *resource) override;
54
55private:
56 uint sendButton(Qt::MouseButton button, uint32_t state);
57 void sendMotion();
58 void sendEnter(QWaylandSurface *surface);
59 void sendLeave();
60 void ensureEntered(QWaylandSurface *surface);
61
62 QWaylandSeat *seat = nullptr;
63 QWaylandOutput *output = nullptr;
64 QPointer<QWaylandSurface> enteredSurface;
65
66 QPointF localPosition;
67 QPointF spacePosition;
68
69 uint enterSerial = 0;
70
71 int buttonCount = 0;
72
73 QWaylandDestroyListener enteredSurfaceDestroyListener;
74
75 static QWaylandSurfaceRole s_role;
76};
77
78QT_END_NAMESPACE
79
80#endif // QWAYLANDPOINTER_P_H
\inmodule QtWaylandCompositor
Combined button and popup list for selecting options.