Changeset View
Changeset View
Standalone View
Standalone View
xkb.h
Show All 27 Lines | |||||
28 | #include <QLoggingCategory> | 28 | #include <QLoggingCategory> | ||
29 | Q_DECLARE_LOGGING_CATEGORY(KWIN_XKB) | 29 | Q_DECLARE_LOGGING_CATEGORY(KWIN_XKB) | ||
30 | 30 | | |||
31 | struct xkb_context; | 31 | struct xkb_context; | ||
32 | struct xkb_keymap; | 32 | struct xkb_keymap; | ||
33 | struct xkb_state; | 33 | struct xkb_state; | ||
34 | struct xkb_compose_table; | 34 | struct xkb_compose_table; | ||
35 | struct xkb_compose_state; | 35 | struct xkb_compose_state; | ||
36 | struct xkb_rule_names; | ||||
36 | typedef uint32_t xkb_mod_index_t; | 37 | typedef uint32_t xkb_mod_index_t; | ||
37 | typedef uint32_t xkb_led_index_t; | 38 | typedef uint32_t xkb_led_index_t; | ||
38 | typedef uint32_t xkb_keysym_t; | 39 | typedef uint32_t xkb_keysym_t; | ||
39 | typedef uint32_t xkb_layout_index_t; | 40 | typedef uint32_t xkb_layout_index_t; | ||
40 | 41 | | |||
41 | namespace KWayland | 42 | namespace KWayland | ||
42 | { | 43 | { | ||
43 | namespace Server | 44 | namespace Server | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 56 | public: | |||
112 | void setSeat(KWayland::Server::SeatInterface *seat); | 113 | void setSeat(KWayland::Server::SeatInterface *seat); | ||
113 | 114 | | |||
114 | Q_SIGNALS: | 115 | Q_SIGNALS: | ||
115 | void ledsChanged(const LEDs &leds); | 116 | void ledsChanged(const LEDs &leds); | ||
116 | 117 | | |||
117 | private: | 118 | private: | ||
118 | xkb_keymap *loadKeymapFromConfig(); | 119 | xkb_keymap *loadKeymapFromConfig(); | ||
119 | xkb_keymap *loadDefaultKeymap(); | 120 | xkb_keymap *loadDefaultKeymap(); | ||
121 | static bool stringIsEmptyOrNull(const char *str); | ||||
122 | /** | ||||
123 | * libxkbcommon uses secure_getenv to read the XKB_DEFAULT_* variables. | ||||
124 | * As kwin_wayland may have the CAP_SET_NICE capability, it returns nullptr | ||||
125 | * so we need to do it ourselves (see xkb_context_sanitize_rule_names). | ||||
126 | **/ | ||||
127 | static void applyEnvironmentRules(xkb_rule_names &ruleNames); | ||||
graesslin: as both do not operate on anything of the Xkb class I would move them out of the class and put… | |||||
Would just moving them outside of the class as static functions within xkb.cpp work for you as well? fvogt: Would just moving them outside of the class as `static` functions within xkb.cpp work for you… | |||||
120 | void updateKeymap(xkb_keymap *keymap); | 128 | void updateKeymap(xkb_keymap *keymap); | ||
121 | void createKeymapFile(); | 129 | void createKeymapFile(); | ||
122 | void updateModifiers(); | 130 | void updateModifiers(); | ||
123 | void updateConsumedModifiers(uint32_t key); | 131 | void updateConsumedModifiers(uint32_t key); | ||
124 | QString layoutName(xkb_layout_index_t layout) const; | 132 | QString layoutName(xkb_layout_index_t layout) const; | ||
125 | xkb_context *m_context; | 133 | xkb_context *m_context; | ||
126 | xkb_keymap *m_keymap; | 134 | xkb_keymap *m_keymap; | ||
127 | xkb_state *m_state; | 135 | xkb_state *m_state; | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
as both do not operate on anything of the Xkb class I would move them out of the class and put them into an anonymous namespace.