Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/backends/x11/x11_evdev_backend.h
- This file was copied from kcms/input/backends/x11/x11_backend.h.
Show All 11 Lines | |||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef X11BACKEND_H | 20 | #ifndef X11EVDEVBACKEND_H | ||
21 | #define X11BACKEND_H | 21 | #define X11EVDEVBACKEND_H | ||
22 | 22 | | |||
23 | #include "inputbackend.h" | 23 | #include "x11_backend.h" | ||
24 | #include "evdev_settings.h" | 24 | #include "evdev_settings.h" | ||
25 | 25 | | |||
26 | #include <QX11Info> | 26 | #include <QX11Info> | ||
27 | #include <X11/Xdefs.h> | 27 | #include <X11/Xdefs.h> | ||
28 | 28 | | |||
29 | class ConfigPlugin; | 29 | class X11EvdevBackend : public X11Backend | ||
30 | | ||||
31 | class X11Backend : public InputBackend | | |||
32 | { | 30 | { | ||
33 | Q_OBJECT | 31 | Q_OBJECT | ||
32 | | ||||
34 | public: | 33 | public: | ||
35 | X11Backend(QObject *parent = nullptr); | 34 | X11EvdevBackend(QObject *parent = nullptr); | ||
36 | ~X11Backend(); | 35 | ~X11EvdevBackend(); | ||
36 | | ||||
37 | void kcmInit() override; | ||||
37 | 38 | | |||
38 | bool isValid() const override { return m_dpy != nullptr; } | 39 | bool isValid() const override { return m_dpy != nullptr; } | ||
39 | 40 | | |||
40 | void load() override; | 41 | void load() override; | ||
41 | 42 | | |||
42 | void apply(bool force = false); | 43 | void apply(bool force = false); | ||
43 | 44 | | |||
44 | EvdevSettings* settings() { | 45 | EvdevSettings* settings() { | ||
45 | return m_settings; | 46 | return m_settings; | ||
46 | } | 47 | } | ||
47 | 48 | | |||
48 | bool supportScrollPolarity(); | 49 | bool supportScrollPolarity(); | ||
49 | QStringList supportedAccelerationProfiles(); | 50 | | ||
50 | QString accelerationProfile(); | | |||
51 | double accelRate(); | 51 | double accelRate(); | ||
52 | Handed handed(); | 52 | Handed handed(); | ||
53 | int threshold(); | 53 | int threshold(); | ||
54 | 54 | | |||
55 | QString currentCursorTheme(); | | |||
56 | void applyCursorTheme(const QString &name, int size); | | |||
57 | | ||||
58 | Q_SIGNALS: | 55 | Q_SIGNALS: | ||
59 | void mouseStateChanged(); | 56 | void mouseStateChanged(); | ||
60 | void mousesChanged(); | 57 | void mousesChanged(); | ||
61 | void mouseReset(); | 58 | void mouseReset(); | ||
62 | 59 | | |||
63 | private: | 60 | private: | ||
64 | void initAtom(); | 61 | void initAtom(); | ||
65 | bool evdevApplyReverseScroll(int deviceid, bool reverse); | 62 | bool evdevApplyReverseScroll(int deviceid, bool reverse); | ||
66 | bool libinputApplyReverseScroll(int deviceid, bool reverse); | | |||
67 | void libinputApplyAccelerationProfile(int deviceid, QString profile); | | |||
68 | 63 | | |||
69 | Atom m_libinputAccelProfileAvailableAtom; | | |||
70 | Atom m_libinputAccelProfileEnabledAtom; | | |||
71 | Atom m_libinputNaturalScrollAtom; | | |||
72 | 64 | | |||
73 | Atom m_evdevWheelEmulationAtom; | 65 | Atom m_evdevWheelEmulationAtom; | ||
74 | Atom m_evdevScrollDistanceAtom; | 66 | Atom m_evdevScrollDistanceAtom; | ||
75 | Atom m_evdevWheelEmulationAxesAtom; | 67 | Atom m_evdevWheelEmulationAxesAtom; | ||
76 | 68 | | |||
77 | Atom m_touchpadAtom; | 69 | Atom m_touchpadAtom; | ||
78 | // We may still need to do something on non-X11 platform due to Xwayland. | 70 | | ||
79 | Display* m_dpy; | | |||
80 | bool m_platformX11; | | |||
81 | EvdevSettings *m_settings = nullptr; | 71 | EvdevSettings *m_settings = nullptr; | ||
82 | int m_numButtons = 1; | 72 | int m_numButtons = 1; | ||
83 | Handed m_handed = Handed::NotSupported; | 73 | Handed m_handed = Handed::NotSupported; | ||
84 | double m_accelRate = 1.0; | 74 | double m_accelRate = 1.0; | ||
85 | int m_threshold = 0; | 75 | int m_threshold = 0; | ||
86 | int m_middleButton = -1; | 76 | int m_middleButton = -1; | ||
87 | QStringList m_supportedAccelerationProfiles; | | |||
88 | QString m_accelerationProfile; | | |||
89 | }; | 77 | }; | ||
90 | 78 | | |||
91 | #endif // X11BACKEND_H | 79 | #endif // X11EVDEVBACKEND_H |