Changeset View
Changeset View
Standalone View
Standalone View
platform.h
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | 48 | public: | |||
---|---|---|---|---|---|
171 | * suited PlatformCursorImage. | 171 | * suited PlatformCursorImage. | ||
172 | * | 172 | * | ||
173 | * @see softwareCursor | 173 | * @see softwareCursor | ||
174 | * @see softwareCursorHotspot | 174 | * @see softwareCursorHotspot | ||
175 | * @since 5.9 | 175 | * @since 5.9 | ||
176 | **/ | 176 | **/ | ||
177 | virtual PlatformCursorImage cursorImage() const; | 177 | virtual PlatformCursorImage cursorImage() const; | ||
178 | 178 | | |||
179 | /** | ||||
180 | * The Platform cursor image should be hidden. | ||||
181 | * @see showCursor | ||||
182 | * @see doHideCursor | ||||
183 | * @see isCursorHidden | ||||
184 | * @since 5.9 | ||||
185 | **/ | ||||
186 | void hideCursor(); | ||||
187 | | ||||
188 | /** | ||||
189 | * The Platform cursor image should be shown again. | ||||
190 | * @see hideCursor | ||||
191 | * @see doShowCursor | ||||
192 | * @see isCursorHidden | ||||
193 | * @since 5.9 | ||||
194 | **/ | ||||
195 | void showCursor(); | ||||
196 | | ||||
197 | /** | ||||
198 | * Whether the cursor is currently hidden. | ||||
199 | * @see showCursor | ||||
200 | * @see hideCursor | ||||
201 | * @since 5.9 | ||||
202 | **/ | ||||
203 | bool isCursorHidden() const { | ||||
204 | return m_hideCursorCounter > 0; | ||||
205 | } | ||||
206 | | ||||
179 | bool handlesOutputs() const { | 207 | bool handlesOutputs() const { | ||
180 | return m_handlesOutputs; | 208 | return m_handlesOutputs; | ||
181 | } | 209 | } | ||
182 | bool isReady() const { | 210 | bool isReady() const { | ||
183 | return m_ready; | 211 | return m_ready; | ||
184 | } | 212 | } | ||
185 | void setInitialWindowSize(const QSize &size) { | 213 | void setInitialWindowSize(const QSize &size) { | ||
186 | m_initialWindowSize = size; | 214 | m_initialWindowSize = size; | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 261 | protected: | |||
243 | } | 271 | } | ||
244 | QByteArray deviceIdentifier() const { | 272 | QByteArray deviceIdentifier() const { | ||
245 | return m_deviceIdentifier; | 273 | return m_deviceIdentifier; | ||
246 | } | 274 | } | ||
247 | void setSupportsPointerWarping(bool set) { | 275 | void setSupportsPointerWarping(bool set) { | ||
248 | m_pointerWarping = set; | 276 | m_pointerWarping = set; | ||
249 | } | 277 | } | ||
250 | 278 | | |||
279 | /** | ||||
280 | * Actual platform specific way to hide the cursor. | ||||
281 | * Sub-classes need to implement if they support hiding the cursor. | ||||
282 | * | ||||
283 | * This method is invoked by hideCursor if the cursor needs to be hidden. | ||||
284 | * The default implementation does nothing. | ||||
285 | * | ||||
286 | * @see doShowCursor | ||||
287 | * @see hideCursor | ||||
288 | * @see showCursor | ||||
289 | **/ | ||||
290 | virtual void doHideCursor(); | ||||
291 | /** | ||||
292 | * Actual platform specific way to show the cursor. | ||||
293 | * Sub-classes need to implement if they support showing the cursor. | ||||
294 | * | ||||
295 | * This method is invoked by showCursor if the cursor needs to be shown again. | ||||
296 | * | ||||
297 | * @see doShowCursor | ||||
298 | * @see hideCursor | ||||
299 | * @see showCursor | ||||
300 | **/ | ||||
301 | virtual void doShowCursor(); | ||||
302 | | ||||
251 | private: | 303 | private: | ||
252 | void triggerCursorRepaint(); | 304 | void triggerCursorRepaint(); | ||
253 | bool m_softWareCursor = false; | 305 | bool m_softWareCursor = false; | ||
254 | struct { | 306 | struct { | ||
255 | QRect lastRenderedGeometry; | 307 | QRect lastRenderedGeometry; | ||
256 | } m_cursor; | 308 | } m_cursor; | ||
257 | bool m_handlesOutputs = false; | 309 | bool m_handlesOutputs = false; | ||
258 | bool m_ready = false; | 310 | bool m_ready = false; | ||
259 | QSize m_initialWindowSize; | 311 | QSize m_initialWindowSize; | ||
260 | QByteArray m_deviceIdentifier; | 312 | QByteArray m_deviceIdentifier; | ||
261 | bool m_pointerWarping = false; | 313 | bool m_pointerWarping = false; | ||
262 | bool m_outputsEnabled = true; | 314 | bool m_outputsEnabled = true; | ||
263 | int m_initialOutputCount = 1; | 315 | int m_initialOutputCount = 1; | ||
264 | EGLDisplay m_eglDisplay; | 316 | EGLDisplay m_eglDisplay; | ||
317 | int m_hideCursorCounter = 0; | ||||
265 | }; | 318 | }; | ||
266 | 319 | | |||
267 | } | 320 | } | ||
268 | 321 | | |||
269 | Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") | 322 | Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") | ||
270 | 323 | | |||
271 | #endif | 324 | #endif |