KWin
Loading...
Searching...
No Matches
x11_standalone_xinputintegration.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#pragma once
10
11#include <QObject>
12#include <QPointer>
13#include <memory>
14typedef struct _XDisplay Display;
15
16namespace KWin
17{
18
19class XInputEventFilter;
20class XKeyPressReleaseEventFilter;
21class X11Cursor;
22
23class XInputIntegration : public QObject
24{
25 Q_OBJECT
26public:
27 explicit XInputIntegration(::Display *display, QObject *parent);
29
30 void init();
31 void startListening();
32
33 bool hasXinput() const
34 {
35 return m_hasXInput;
36 }
37 void setCursor(X11Cursor *cursor);
38
39private:
40 ::Display *display() const
41 {
42 return m_x11Display;
43 }
44
45 bool m_hasXInput = false;
46 int m_xiOpcode = 0;
47 int m_majorVersion = 0;
48 int m_minorVersion = 0;
49 QPointer<X11Cursor> m_x11Cursor;
50 ::Display *m_x11Display;
51
52 std::unique_ptr<XInputEventFilter> m_xiEventFilter;
53 std::unique_ptr<XKeyPressReleaseEventFilter> m_keyPressFilter;
54 std::unique_ptr<XKeyPressReleaseEventFilter> m_keyReleaseFilter;
55};
56
57}
~XInputIntegration() override
XInputIntegration(::Display *display, QObject *parent)
struct _XDisplay Display