4#ifndef QWAYLANDINPUTDEVICE_H
5#define QWAYLANDINPUTDEVICE_H
18#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
19#include <QtWaylandClient/private/qwaylandwindow_p.h>
21#include <QtCore/QScopedPointer>
22#include <QSocketNotifier>
25#include <qpa/qplatformintegration.h>
26#include <qpa/qplatformscreen.h>
27#include <qpa/qwindowsysteminterface.h>
29#include <QtWaylandClient/private/qwayland-wayland.h>
30#include <QtWaylandClient/private/qwayland-pointer-gestures-unstable-v1.h>
32#if QT_CONFIG(xkbcommon)
33#include <QtGui/private/qxkbcommon_p.h>
36#include <QtCore/QDebug>
37#include <QtCore/QElapsedTimer>
38#include <QtCore/QPointer>
41struct wl_cursor_image;
47class zwp_primary_selection_device_v1;
52class QWaylandDataDevice;
54#if QT_CONFIG(wayland_client_primary_selection)
55class QWaylandPrimarySelectionDeviceV1;
57#if QT_CONFIG(tabletevent)
58class QWaylandTabletSeatV2;
60class QWaylandPointerGestures;
61class QWaylandPointerGestureSwipe;
62class QWaylandPointerGesturePinch;
63class QWaylandTextInputInterface;
64class QWaylandTextInputMethod;
66class QWaylandCursorTheme;
67class QWaylandCursorShape;
75 ,
public QtWayland::wl_seat
90 struct ::wl_seat *
wl_seat() {
return QtWayland::wl_seat::object(); }
93 void setCursor(
const QCursor *
cursor,
const QSharedPointer<QWaylandBuffer> &cachedBuffer = {},
int fallbackOutputScale = 1);
97#if QT_CONFIG(wayland_datadevice)
98 void setDataDevice(QWaylandDataDevice *
device);
99 QWaylandDataDevice *dataDevice()
const;
102#if QT_CONFIG(wayland_client_primary_selection)
103 void setPrimarySelectionDevice(QWaylandPrimarySelectionDeviceV1 *primarySelectionDevice);
104 QWaylandPrimarySelectionDeviceV1 *primarySelectionDevice()
const;
107#if QT_CONFIG(tabletevent)
108 void setTabletSeat(QWaylandTabletSeatV2 *tabletSeat);
109 QWaylandTabletSeatV2* tabletSeat()
const;
112 void setTextInput(QWaylandTextInputInterface *textInput);
113 QWaylandTextInputInterface *textInput()
const;
115 void setTextInputMethod(QWaylandTextInputMethod *textInputMethod);
116 QWaylandTextInputMethod *textInputMethod()
const;
120 QWaylandWindow *pointerFocus()
const;
121 QWaylandWindow *keyboardFocus()
const;
122 QWaylandWindow *touchFocus()
const;
126 QPointF pointerSurfacePosition()
const;
130 uint32_t serial()
const;
133 virtual Pointer *createPointer(QWaylandInputDevice *
device);
134 virtual Touch *createTouch(QWaylandInputDevice *
device);
138 QWaylandPointerGestureSwipe *pointerGestureSwipe()
const;
139 QWaylandPointerGesturePinch *pointerGesturePinch()
const;
140 Touch *touch()
const;
144 struct wl_display *mDisplay =
nullptr;
151 QSharedPointer<QWaylandBuffer> bitmapBuffer;
154 int fallbackOutputScale = 1;
160#if QT_CONFIG(wayland_datadevice)
164#if QT_CONFIG(wayland_client_primary_selection)
165 QScopedPointer<QWaylandPrimarySelectionDeviceV1> mPrimarySelectionDevice;
176#if QT_CONFIG(tabletevent)
177 QScopedPointer<QWaylandTabletSeatV2> mTabletSeat;
181 uint32_t mSerial = 0;
183 void seat_capabilities(uint32_t caps)
override;
215 uint32_t
size)
override;
217 struct wl_surface *surface,
218 struct wl_array *
keys)
override;
220 struct wl_surface *surface)
override;
222 uint32_t
key, uint32_t
state)
override;
224 uint32_t mods_depressed,
225 uint32_t mods_latched,
226 uint32_t mods_locked,
227 uint32_t
group)
override;
233 uint32_t mNativeModifiers = 0;
240 uint32_t nativeVirtualKey = 0;
244 int mRepeatRate = 25;
245 int mRepeatDelay = 400;
247 uint32_t mKeymapFormat = WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1;
251 struct ::wl_keyboard *
wl_keyboard() {
return QtWayland::wl_keyboard::object(); }
253#if QT_CONFIG(xkbcommon)
254 virtual int keysymToQtKey(xkb_keysym_t
keysym, Qt::KeyboardModifiers
modifiers, xkb_state *
state, xkb_keycode_t code) {
260 void handleFocusDestroyed();
261 void handleFocusLost();
264#if QT_CONFIG(xkbcommon)
265 bool createDefaultKeymap();
271#if QT_CONFIG(xkbcommon)
286 int idealCursorScale()
const;
287 void updateCursorTheme();
289 void cursorTimerCallback();
290 void cursorFrameCallback();
291 CursorSurface *getOrCreateCursorSurface();
295 struct ::wl_pointer *
wl_pointer() {
return QtWayland::wl_pointer::object(); }
299 wl_fixed_t sx, wl_fixed_t sy)
override;
302 wl_fixed_t sx, wl_fixed_t sy)
override;
307 wl_fixed_t
value)
override;
316 void handleFocusDestroyed() { invalidateFocus(); }
319 void invalidateFocus();
325 QPointer<QWaylandSurface> mFocus;
326 uint32_t mEnterSerial = 0;
329 QScopedPointer<QWaylandCursorShape> shape;
330 QWaylandCursorTheme *theme =
nullptr;
331 int themeBufferScale = 0;
332 QScopedPointer<CursorSurface> surface;
334 bool gotFrameCallback =
false;
335 bool gotTimerCallback =
false;
348 axis_source axisSource = axis_source_wheel;
349 bool verticalAxisInverted =
false;
350 bool horizontalAxisInverted =
false;
360 bool mScrollBeginSent =
false;
367 bool isDefinitelyTerminated(axis_source
source)
const;
378 struct wl_surface *surface,
381 wl_fixed_t
y)
override;
384 int32_t
id)
override;
388 wl_fixed_t
y)
override;
395 struct ::wl_touch *
wl_touch() {
return QtWayland::wl_touch::object(); }
453#ifndef QT_NO_GESTURES
IOBluetoothDevice * device
The QCursor class provides a mouse cursor with an arbitrary shape.
State
Specifies the state of this event point.
Type
This enum type defines the valid event types in Qt.
The QKeyEvent class describes a key event.
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
\macro QT_RESTRICTED_CAST_FROM_ASCII
std::unique_ptr< struct xkb_keymap, XKBKeymapDeleter > ScopedXKBKeymap
std::unique_ptr< struct xkb_state, XKBStateDeleter > ScopedXKBState
static int keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers modifiers)
QPointer< QWaylandWindow > surface
Qt::KeyboardModifiers modifiers
QWaylandPointerEvent(QEvent::Type type, Qt::ScrollPhase phase, QWaylandWindow *surface, ulong timestamp, const QPointF &local, const QPointF &global, const QPoint &pixelDelta, const QPoint &angleDelta, Qt::MouseEventSource source, Qt::KeyboardModifiers modifiers, bool inverted)
QWaylandPointerEvent(QEvent::Type type, Qt::ScrollPhase phase, QWaylandWindow *surface, ulong timestamp, const QPointF &localPos, const QPointF &globalPos, Qt::MouseButtons buttons, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
QWaylandPointerGesturePinchEvent(QWaylandWindow *surface, Qt::GestureState state, ulong timestamp, const QPointF &local, const QPointF &global, uint fingers, const QPointF &delta, qreal scale_delta, qreal rotation_delta)
QPointer< QWaylandWindow > surface
QWaylandPointerGestureSwipeEvent(QWaylandWindow *surface, Qt::GestureState state, ulong timestamp, const QPointF &local, const QPointF &global, uint fingers, const QPointF &delta)
QPointer< QWaylandWindow > surface
EGLImageKHR int int EGLuint64KHR * modifiers
struct wl_display * display
Combined button and popup list for selecting options.
@ MouseEventNotSynthesized
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
GLsizei const void * pointer
static QT_BEGIN_NAMESPACE QElapsedTimer frameTimer
item setCursor(Qt::IBeamCursor)
[1]