Changeset View
Changeset View
Standalone View
Standalone View
utils.h
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Line(s) | |||||
191 | int qtToX11Button(Qt::MouseButton button); | 191 | int qtToX11Button(Qt::MouseButton button); | ||
192 | Qt::MouseButton x11ToQtMouseButton(int button); | 192 | Qt::MouseButton x11ToQtMouseButton(int button); | ||
193 | int qtToX11State(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); | 193 | int qtToX11State(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); | ||
194 | Qt::MouseButtons KWIN_EXPORT x11ToQtMouseButtons(int state); | 194 | Qt::MouseButtons KWIN_EXPORT x11ToQtMouseButtons(int state); | ||
195 | Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state); | 195 | Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state); | ||
196 | 196 | | |||
197 | void checkNonExistentClients(); | 197 | void checkNonExistentClients(); | ||
198 | 198 | | |||
199 | static inline int bitCount(uint32_t mask) | | |||
200 | { | | |||
201 | #if defined(__GNUC__) | | |||
202 | return __builtin_popcount(mask); | | |||
203 | #else | | |||
204 | int count = 0; | | |||
205 | | ||||
206 | while (mask) { | | |||
207 | count += (mask & 1); | | |||
208 | mask >>= 1; | | |||
209 | } | | |||
210 | | ||||
211 | return count; | | |||
212 | #endif | | |||
213 | } | | |||
214 | | ||||
215 | | ||||
216 | /** | 199 | /** | ||
217 | * Separate the concept of an unet QPoint and 0,0 | 200 | * Separate the concept of an unet QPoint and 0,0 | ||
218 | */ | 201 | */ | ||
219 | class ClearablePoint | 202 | class ClearablePoint | ||
220 | { | 203 | { | ||
221 | public: | 204 | public: | ||
222 | inline bool isValid() const { | 205 | inline bool isValid() const { | ||
223 | return m_valid; | 206 | return m_valid; | ||
Show All 40 Lines |