KWin
Loading...
Searching...
No Matches
mock_libinput.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#ifndef MOCK_LIBINPUT_H
10#define MOCK_LIBINPUT_H
11#include <libinput.h>
12
13#include <QByteArray>
14#include <QList>
15#include <QPointF>
16#include <QSizeF>
17
18#include <array>
19#include <chrono>
20
22{
23 void *userData = nullptr;
24 bool keyboard = false;
25 bool pointer = false;
26 bool touch = false;
27 bool tabletTool = false;
28 bool gestureSupported = false;
29 bool switchDevice = false;
30 QByteArray name;
31 QByteArray sysName = QByteArrayLiteral("event0");
32 QByteArray outputName;
33 quint32 product = 0;
34 quint32 vendor = 0;
36 QSizeF deviceSize;
38 bool tapEnabledByDefault = false;
39 bool tapToClick = false;
41 bool tapAndDrag = false;
43 bool tapDragLock = false;
46 bool supportsLeftHanded = false;
54 bool middleEmulation = false;
55 enum libinput_config_tap_button_map defaultTapButtonMap = LIBINPUT_CONFIG_TAP_MAP_LRM;
56 enum libinput_config_tap_button_map tapButtonMap = LIBINPUT_CONFIG_TAP_MAP_LRM;
58 enum libinput_config_dwt_state disableWhileTypingEnabledByDefault = LIBINPUT_CONFIG_DWT_DISABLED;
59 enum libinput_config_dwt_state disableWhileTyping = LIBINPUT_CONFIG_DWT_DISABLED;
65 bool leftHanded = false;
68 bool naturalScroll = false;
70 enum libinput_config_scroll_method defaultScrollMethod = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
71 enum libinput_config_scroll_method scrollMethod = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
74 quint32 scrollButton = 0;
76 Qt::MouseButtons supportedButtons;
77 QList<quint32> keys;
78 bool enabled = true;
85 enum libinput_config_accel_profile defaultPointerAccelerationProfile = LIBINPUT_CONFIG_ACCEL_PROFILE_NONE;
86 enum libinput_config_accel_profile pointerAccelerationProfile = LIBINPUT_CONFIG_ACCEL_PROFILE_NONE;
88 std::array<float, 6> defaultCalibrationMatrix{{1.0f, 0.0f, 0.0f,
89 0.0f, 1.0f, 0.0f}};
90 std::array<float, 6> calibrationMatrix{{1.0f, 0.0f, 0.0f,
91 0.0f, 1.0f, 0.0f}};
94
95 bool lidSwitch = false;
96 bool tabletModeSwitch = false;
98 enum libinput_config_click_method defaultClickMethod = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
99 enum libinput_config_click_method clickMethod = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
101 uint32_t buttonCount = 0;
102 uint32_t stripCount = 0;
103 uint32_t ringCount = 0;
104};
105
107{
109 {
110 }
112 libinput_event_type type = LIBINPUT_EVENT_NONE;
113 std::chrono::microseconds time = std::chrono::microseconds::zero();
114};
115
117{
119 {
120 type = LIBINPUT_EVENT_KEYBOARD_KEY;
121 }
122 libinput_key_state state = LIBINPUT_KEY_STATE_RELEASED;
123 quint32 key = 0;
124};
125
127{
128 libinput_button_state buttonState = LIBINPUT_BUTTON_STATE_RELEASED;
129 quint32 button = 0;
130 bool verticalAxis = false;
131 bool horizontalAxis = false;
136 QPointF delta;
137 QPointF absolutePos;
138};
139
141{
142 qint32 slot = -1;
143 QPointF absolutePos;
144};
145
147{
148 int fingerCount = 0;
149 bool cancelled = false;
150 QPointF delta = QPointF(0, 0);
151 qreal scale = 0.0;
152 qreal angleDelta = 0.0;
153};
154
156{
157 enum class State {
158 Off,
159 On
160 };
162};
163
165{
166 int refCount = 1;
167 QByteArray seat;
169};
170
171#endif
int setScrollMethodReturnValue
quint32 supportedScrollMethods
bool tapDragLockEnabledByDefault
int setNaturalScrollReturnValue
int setScrollButtonReturnValue
bool setClickMethodReturnValue
std::array< float, 6 > defaultCalibrationMatrix
QByteArray outputName
enum libinput_config_dwt_state disableWhileTypingEnabledByDefault
quint32 supportedClickMethods
QList< quint32 > keys
bool supportsCalibrationMatrix
enum libinput_config_scroll_method defaultScrollMethod
int setPointerAccelerationReturnValue
int setMiddleEmulationReturnValue
bool supportsDisableWhileTyping
enum libinput_config_scroll_method scrollMethod
bool setPointerAccelerationProfileReturnValue
qreal pointerAcceleration
int setTapButtonMapReturnValue
enum libinput_config_accel_profile pointerAccelerationProfile
enum libinput_config_dwt_state disableWhileTyping
enum libinput_config_accel_profile defaultPointerAccelerationProfile
bool calibrationMatrixIsIdentity
bool leftHandedEnabledByDefault
std::array< float, 6 > calibrationMatrix
quint32 defaultScrollButton
qreal defaultPointerAcceleration
QByteArray name
enum libinput_config_tap_button_map tapButtonMap
enum libinput_config_click_method clickMethod
bool supportsPointerAcceleration
bool tapAndDragEnabledByDefault
enum libinput_config_tap_button_map defaultTapButtonMap
bool naturalScrollEnabledByDefault
bool supportsDisableEventsOnExternalMouse
bool middleEmulationEnabledByDefault
bool defaultCalibrationMatrixIsIdentity
int setDisableWhileTypingReturnValue
QByteArray sysName
bool supportsMiddleEmulation
enum libinput_config_click_method defaultClickMethod
int setTapDragLockReturnValue
quint32 supportedPointerAccelerationProfiles
Qt::MouseButtons supportedButtons
libinput_key_state state
libinput_button_state buttonState
libinput_device * device
virtual ~libinput_event()
std::chrono::microseconds time
libinput_event_type type
int assignSeatRetVal
QByteArray seat