Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2016, 2017 Martin Gräßlin <mgraesslin@kde.org> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | #ifndef KWIN_KEYBOARD_LAYOUT_H | ||||
21 | #define KWIN_KEYBOARD_LAYOUT_H | ||||
22 | | ||||
23 | #include "input_event_spy.h" | ||||
24 | #include <QObject> | ||||
25 | typedef uint32_t xkb_layout_index_t; | ||||
26 | | ||||
27 | namespace KWin | ||||
28 | { | ||||
29 | class Xkb; | ||||
30 | | ||||
31 | class KeyboardLayout : public QObject, public InputEventSpy | ||||
32 | { | ||||
33 | Q_OBJECT | ||||
34 | public: | ||||
35 | explicit KeyboardLayout(Xkb *xkb); | ||||
36 | ~KeyboardLayout() override; | ||||
37 | | ||||
38 | void init(); | ||||
39 | | ||||
40 | void checkLayoutChange(); | ||||
41 | void resetLayout(); | ||||
42 | | ||||
43 | void keyEvent(KeyEvent *event) override; | ||||
44 | | ||||
45 | private Q_SLOTS: | ||||
46 | void reconfigure(); | ||||
47 | | ||||
48 | private: | ||||
49 | void notifyLayoutChange(); | ||||
50 | Xkb *m_xkb; | ||||
51 | xkb_layout_index_t m_layout = 0; | ||||
52 | }; | ||||
53 | | ||||
54 | } | ||||
55 | | ||||
56 | #endif |