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
qwaylandcursorsurface_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDCURSORSURFACE_H
6#define QWAYLANDCURSORSURFACE_H
7
10
11#include <memory>
12
14
15namespace QtWaylandClient {
16
17#if QT_CONFIG(cursor)
18template <typename InputDevice>
19class CursorSurface : public QWaylandSurface
20{
21public:
24 {
26 }
27
28 void reset()
29 {
30 m_setSerial = 0;
31 m_hotspot = QPoint();
32 }
33
34 // Size and hotspot are in surface coordinates
35 void update(wl_buffer *buffer, const QPoint &hotspot, const QSize &size, int bufferScale,
36 bool animated = false)
37 {
38 // Calling code needs to ensure buffer scale is supported if != 1
39 Q_ASSERT(bufferScale == 1 || version() >= 3);
40
46 }
47
48 if (version() >= 3)
50
51 attach(buffer, 0, 0);
52 damage(0, 0, size.width(), size.height());
54 if (animated) {
58 }));
59 }
60 commit();
61 }
62
63 int outputScale() const
64 {
65 int scale = 0;
66 for (auto *screen : m_screens)
68 return scale;
69 }
70
71private:
73 InputDevice *m_pointer = nullptr;
74 uint m_setSerial = 0;
76};
77
78#endif // QT_CONFIG(cursor)
79
80} // namespace QtWaylandClient
81
82QT_END_NAMESPACE
83
84#endif // QWAYLANDCURSORSURFACE_H
EnterEvent(QWaylandWindow *surface, const QPointF &local, const QPointF &global)
LeaveEvent(QWaylandWindow *surface, const QPointF &localPos, const QPointF &globalPos)
MotionEvent(QWaylandWindow *surface, ulong timestamp, const QPointF &localPos, const QPointF &globalPos, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
PressEvent(QWaylandWindow *surface, ulong timestamp, const QPointF &localPos, const QPointF &globalPos, Qt::MouseButtons buttons, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
ReleaseEvent(QWaylandWindow *surface, ulong timestamp, const QPointF &localPos, const QPointF &globalPos, Qt::MouseButtons buttons, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
WheelEvent(QWaylandWindow *surface, Qt::ScrollPhase phase, ulong timestamp, const QPointF &local, const QPointF &global, const QPoint &pixelDelta, const QPoint &angleDelta, Qt::MouseEventSource source, Qt::KeyboardModifiers modifiers, bool inverted)
void callback_done(uint32_t callback_data) override
WlCallback(::wl_callback *callback, std::function< void(uint32_t)> fn)
Combined button and popup list for selecting options.
Q_LOGGING_CATEGORY(lcQpaWayland, "qt.qpa.wayland")
static const int MaxTouchPoints
Q_DECLARE_LOGGING_CATEGORY(lcQpaWaylandInput)