Changeset View
Changeset View
Standalone View
Standalone View
utils.h
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | |||||
179 | int qtToX11Button(Qt::MouseButton button); | 179 | int qtToX11Button(Qt::MouseButton button); | ||
180 | Qt::MouseButton x11ToQtMouseButton(int button); | 180 | Qt::MouseButton x11ToQtMouseButton(int button); | ||
181 | int qtToX11State(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); | 181 | int qtToX11State(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); | ||
182 | Qt::MouseButtons KWIN_EXPORT x11ToQtMouseButtons(int state); | 182 | Qt::MouseButtons KWIN_EXPORT x11ToQtMouseButtons(int state); | ||
183 | Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state); | 183 | Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state); | ||
184 | 184 | | |||
185 | void checkNonExistentClients(); | 185 | void checkNonExistentClients(); | ||
186 | 186 | | |||
187 | static inline int bitCount(uint32_t mask) | | |||
188 | { | | |||
189 | #if defined(__GNUC__) | | |||
190 | return __builtin_popcount(mask); | | |||
191 | #else | | |||
192 | int count = 0; | | |||
193 | | ||||
194 | while (mask) { | | |||
195 | count += (mask & 1); | | |||
196 | mask >>= 1; | | |||
197 | } | | |||
198 | | ||||
199 | return count; | | |||
200 | #endif | | |||
201 | } | | |||
202 | | ||||
203 | | ||||
204 | /** | 187 | /** | ||
205 | * Separate the concept of an unet QPoint and 0,0 | 188 | * Separate the concept of an unet QPoint and 0,0 | ||
206 | */ | 189 | */ | ||
207 | class ClearablePoint | 190 | class ClearablePoint | ||
208 | { | 191 | { | ||
209 | public: | 192 | public: | ||
210 | inline bool isValid() const { | 193 | inline bool isValid() const { | ||
211 | return m_valid; | 194 | return m_valid; | ||
Show All 39 Lines |