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
qwaylandseat_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:critical reason:network-protocol
4
5#ifndef QWAYLANDSEAT_P_H
6#define QWAYLANDSEAT_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <stdint.h>
20
21#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
22#include <QtWaylandCompositor/qwaylandseat.h>
23
24#include <QtCore/QList>
25#include <QtCore/QPoint>
26#include <QtCore/QScopedPointer>
27#include <QtCore/private/qobject_p.h>
28
29#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
30
31QT_BEGIN_NAMESPACE
32
33class QKeyEvent;
34class QTouchEvent;
35class QWaylandSeat;
36class QWaylandDrag;
37class QWaylandView;
38
39namespace QtWayland {
40
41class Compositor;
42class DataDevice;
43class Surface;
45class Pointer;
46class Keyboard;
47class Touch;
48class InputMethod;
49
50}
51
52class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandSeatPrivate : public QObjectPrivate, public QtWaylandServer::wl_seat
53{
54public:
55 Q_DECLARE_PUBLIC(QWaylandSeat)
56
57 QWaylandSeatPrivate(QWaylandSeat *seat);
58 ~QWaylandSeatPrivate() override;
59
60 void setCapabilities(QWaylandSeat::CapabilityFlags caps);
61
62 static QWaylandSeatPrivate *get(QWaylandSeat *device) { return device->d_func(); }
63
64#if QT_CONFIG(wayland_datadevice)
65 void clientRequestedDataDevice(QtWayland::DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id);
66 QtWayland::DataDevice *dataDevice() const { return data_device.data(); }
67#endif
68
69protected:
70 void seat_bind_resource(wl_seat::Resource *resource) override;
71
72 void seat_get_pointer(wl_seat::Resource *resource,
73 uint32_t id) override;
74 void seat_get_keyboard(wl_seat::Resource *resource,
75 uint32_t id) override;
76 void seat_get_touch(wl_seat::Resource *resource,
77 uint32_t id) override;
78
79 void seat_destroy_resource(wl_seat::Resource *resource) override;
80
81private:
82 bool isInitialized = false;
83 QWaylandCompositor *compositor = nullptr;
84 QWaylandView *mouseFocus = nullptr;
85 QWaylandSurface *keyboardFocus = nullptr;
86 QWaylandSeat::CapabilityFlags capabilities;
87
88 QScopedPointer<QWaylandPointer> pointer;
89 QScopedPointer<QWaylandKeyboard> keyboard;
90 QScopedPointer<QWaylandTouch> touch;
91#if QT_CONFIG(wayland_datadevice)
92 QScopedPointer<QtWayland::DataDevice> data_device;
93# if QT_CONFIG(draganddrop)
94 QScopedPointer<QWaylandDrag> drag_handle;
95# endif
96#endif
97 QScopedPointer<QWaylandKeymap> keymap;
98 int name = 0;
99 static int max_name;
100};
101
102QT_END_NAMESPACE
103
104#endif // QWAYLANDSEAT_P_H
Combined button and popup list for selecting options.