Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_KEYBOARD_LAYOUT_H | 20 | #ifndef KWIN_KEYBOARD_LAYOUT_H | ||
21 | #define KWIN_KEYBOARD_LAYOUT_H | 21 | #define KWIN_KEYBOARD_LAYOUT_H | ||
22 | 22 | | |||
23 | #include "input_event_spy.h" | 23 | #include "input_event_spy.h" | ||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | typedef uint32_t xkb_layout_index_t; | 25 | typedef uint32_t xkb_layout_index_t; | ||
26 | 26 | | |||
27 | class KStatusNotifierItem; | ||||
28 | | ||||
27 | namespace KWin | 29 | namespace KWin | ||
28 | { | 30 | { | ||
29 | class Xkb; | 31 | class Xkb; | ||
30 | 32 | | |||
31 | class KeyboardLayout : public QObject, public InputEventSpy | 33 | class KeyboardLayout : public QObject, public InputEventSpy | ||
32 | { | 34 | { | ||
33 | Q_OBJECT | 35 | Q_OBJECT | ||
34 | public: | 36 | public: | ||
35 | explicit KeyboardLayout(Xkb *xkb); | 37 | explicit KeyboardLayout(Xkb *xkb); | ||
36 | ~KeyboardLayout() override; | 38 | ~KeyboardLayout() override; | ||
37 | 39 | | |||
38 | void init(); | 40 | void init(); | ||
39 | 41 | | |||
40 | void checkLayoutChange(); | 42 | void checkLayoutChange(); | ||
41 | void resetLayout(); | 43 | void resetLayout(); | ||
42 | 44 | | |||
43 | void keyEvent(KeyEvent *event) override; | 45 | void keyEvent(KeyEvent *event) override; | ||
44 | 46 | | |||
45 | private Q_SLOTS: | 47 | private Q_SLOTS: | ||
46 | void reconfigure(); | 48 | void reconfigure(); | ||
47 | 49 | | |||
48 | private: | 50 | private: | ||
49 | void notifyLayoutChange(); | 51 | void notifyLayoutChange(); | ||
52 | void initNotifierItem(); | ||||
53 | void switchToNextLayout(); | ||||
54 | void updateNotifier(); | ||||
55 | void reinitNotifierMenu(); | ||||
50 | Xkb *m_xkb; | 56 | Xkb *m_xkb; | ||
51 | xkb_layout_index_t m_layout = 0; | 57 | xkb_layout_index_t m_layout = 0; | ||
58 | KStatusNotifierItem *m_notifierItem; | ||||
52 | }; | 59 | }; | ||
53 | 60 | | |||
54 | } | 61 | } | ||
55 | 62 | | |||
56 | #endif | 63 | #endif |