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
12
13namespace QtWaylandClient {
14
15#if QT_CONFIG(cursor)
16template <typename InputDevice>
17class CursorSurface : public QWaylandSurface
18{
19public:
22 {
24 }
25
26 void reset()
27 {
28 m_setSerial = 0;
29 m_hotspot = QPoint();
30 }
31
32 // Size and hotspot are in surface coordinates
33 void update(wl_buffer *buffer, const QPoint &hotspot, const QSize &size, int bufferScale,
34 bool animated = false)
35 {
36 // Calling code needs to ensure buffer scale is supported if != 1
37 Q_ASSERT(bufferScale == 1 || version() >= 3);
38
44 }
45
46 if (version() >= 3)
48
49 attach(buffer, 0, 0);
50 damage(0, 0, size.width(), size.height());
52 if (animated) {
56 }));
57 }
58 commit();
59 }
60
61 int outputScale() const
62 {
63 int scale = 0;
64 for (auto *screen : m_screens)
66 return scale;
67 }
68
69private:
71 InputDevice *m_pointer = nullptr;
72 uint m_setSerial = 0;
74};
75
76#endif // QT_CONFIG(cursor)
77
78} // namespace QtWaylandClient
79
80QT_END_NAMESPACE
81
82#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)