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
89 struct ::wl_seat *
wl_seat() {
return QtWayland::wl_seat::object(); }
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;
154 int fallbackOutputScale = 1;
160#if QT_CONFIG(wayland_datadevice)
164#if QT_CONFIG(wayland_client_primary_selection)
176#if QT_CONFIG(tabletevent)
181 uint32_t mSerial = 0;
183 void seat_capabilities(uint32_t caps)
override;
214 uint32_t
size)
override;
216 struct wl_surface *surface,
217 struct wl_array *
keys)
override;
219 struct wl_surface *surface)
override;
221 uint32_t
key, uint32_t
state)
override;
223 uint32_t mods_depressed,
224 uint32_t mods_latched,
225 uint32_t mods_locked,
226 uint32_t
group)
override;
230 ::wl_surface *mFocus =
nullptr;
232 uint32_t mNativeModifiers = 0;
240 uint32_t nativeVirtualKey = 0;
241 uint32_t nativeModifiers = 0;
245 int mRepeatRate = 25;
246 int mRepeatDelay = 400;
248 uint32_t mKeymapFormat = WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1;
252 struct ::wl_keyboard *
wl_keyboard() {
return QtWayland::wl_keyboard::object(); }
254#if QT_CONFIG(xkbcommon)
255 virtual int keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers
modifiers, xkb_state *
state, xkb_keycode_t code) {
261 void handleFocusDestroyed();
262 void handleFocusLost();
265#if QT_CONFIG(xkbcommon)
266 bool createDefaultKeymap();
272#if QT_CONFIG(xkbcommon)
287 int idealCursorScale()
const;
288 void updateCursorTheme();
290 void cursorTimerCallback();
291 void cursorFrameCallback();
292 CursorSurface *getOrCreateCursorSurface();
296 struct ::wl_pointer *
wl_pointer() {
return QtWayland::wl_pointer::object(); }
300 wl_fixed_t sx, wl_fixed_t sy)
override;
303 wl_fixed_t sx, wl_fixed_t sy)
override;
308 wl_fixed_t
value)
override;
316 void handleFocusDestroyed() { invalidateFocus(); }
319 void invalidateFocus();
326 uint32_t mEnterSerial = 0;
330 QWaylandCursorTheme *theme =
nullptr;
331 int themeBufferScale = 0;
334 bool gotFrameCallback =
false;
335 bool gotTimerCallback =
false;
343 wl_buffer *mCursorBuffer =
nullptr;
352 axis_source axisSource = axis_source_wheel;
362 bool mScrollBeginSent =
false;
369 bool isDefinitelyTerminated(axis_source
source)
const;
380 struct wl_surface *surface,
383 wl_fixed_t
y)
override;
386 int32_t
id)
override;
390 wl_fixed_t
y)
override;
397 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
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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)
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]