Changeset View
Changeset View
Standalone View
Standalone View
virtualdesktops.h
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Line(s) | 148 | public: | |||
---|---|---|---|---|---|
259 | } | 259 | } | ||
260 | 260 | | |||
261 | /** | 261 | /** | ||
262 | * @returns The VirtualDesktop for the x11 @p id, if no such VirtualDesktop @c null is returned | 262 | * @returns The VirtualDesktop for the x11 @p id, if no such VirtualDesktop @c null is returned | ||
263 | **/ | 263 | **/ | ||
264 | VirtualDesktop *desktopForX11Id(uint id) const; | 264 | VirtualDesktop *desktopForX11Id(uint id) const; | ||
265 | 265 | | |||
266 | /** | 266 | /** | ||
267 | * @returns The VirtualDesktop for the internal desktop string @p id, if no such VirtualDesktop @c null is returned | ||||
268 | **/ | ||||
269 | VirtualDesktop *desktopForId(const QByteArray &id) const; | ||||
270 | | ||||
271 | /** | ||||
272 | * Create a new virtual desktop at the requested position. | ||||
273 | * The difference with setCount is that setCount always adds new desktops at the end of the chain. The Id is automatically generated. | ||||
274 | * @param x11DesktopNumber number for the desktop. The desktop created will have an | ||||
275 | * x11DesktopNumber guaranteed to be between 1 and numberOfDesktops(). | ||||
276 | * @param name The name for the new desktop, if empty the default name will be used. | ||||
277 | * @returns the new VirtualDesktop, nullptr if we reached the maximum number of desktops | ||||
278 | */ | ||||
279 | VirtualDesktop *createVirtualDesktop(uint x11DesktopNumber, const QString &name = QString()); | ||||
280 | | ||||
281 | /** | ||||
282 | * Remove the virtual desktop identified by id, if it exists | ||||
283 | * difference with setCount is that is possible to remove an arbitrary desktop, | ||||
284 | * not only the last one. | ||||
285 | * @param id the string id of the desktop to remove | ||||
286 | */ | ||||
287 | void removeVirtualDesktop(const QByteArray &id); | ||||
288 | | ||||
289 | /** | ||||
267 | * Updates the net root info for new number of desktops | 290 | * Updates the net root info for new number of desktops | ||
268 | **/ | 291 | **/ | ||
269 | void updateRootInfo(); | 292 | void updateRootInfo(); | ||
270 | 293 | | |||
271 | /** | 294 | /** | ||
272 | * @returns The maximum number of desktops that KWin supports. | 295 | * @returns The maximum number of desktops that KWin supports. | ||
273 | */ | 296 | */ | ||
274 | static uint maximum(); | 297 | static uint maximum(); | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
329 | 352 | | |||
330 | Q_SIGNALS: | 353 | Q_SIGNALS: | ||
331 | /** | 354 | /** | ||
332 | * Signal emitted whenever the number of virtual desktops changes. | 355 | * Signal emitted whenever the number of virtual desktops changes. | ||
333 | * @param previousCount The number of desktops prior to the change | 356 | * @param previousCount The number of desktops prior to the change | ||
334 | * @param newCount The new current number of desktops | 357 | * @param newCount The new current number of desktops | ||
335 | **/ | 358 | **/ | ||
336 | void countChanged(uint previousCount, uint newCount); | 359 | void countChanged(uint previousCount, uint newCount); | ||
360 | | ||||
337 | /** | 361 | /** | ||
338 | * Signal emitted whenever the number of virtual desktops changes in a way | 362 | * A new desktop has been created | ||
339 | * that existing desktops are removed. | 363 | * @param desktop the new just crated desktop | ||
zzag: Typo: crated -> created. | |||||
340 | * | 364 | */ | ||
341 | * The signal is emitted after the @c count property has been updated but prior | 365 | void desktopCreated(KWin::VirtualDesktop *desktop); | ||
342 | * to the @link countChanged signal being emitted. | 366 | | ||
343 | * @param previousCount The number of desktops prior to the change. | 367 | /** | ||
344 | * @see countChanged | 368 | * A desktop has been removed and is about to be deleted | ||
345 | * @see setCount | 369 | * @param desktop the desktop that has been removed. | ||
346 | * @see count | 370 | * It's guaranteed to stil la valid pointer when the signal arrives, | ||
Typo: to stil la valid. I think what you've meant was "It's guaranteed to be a valid ..." zzag: Typo: to stil la valid. I think what you've meant was "It's guaranteed to be a valid ..." | |||||
347 | **/ | 371 | * but it's about to be deleted. | ||
348 | void desktopsRemoved(uint previousCount); | 372 | */ | ||
373 | void desktopRemoved(KWin::VirtualDesktop *desktop); | ||||
374 | | ||||
zzag: Would be great to follow "Signal emitted ..." convention. | |||||
349 | /** | 375 | /** | ||
350 | * Signal emitted whenever the current desktop changes. | 376 | * Signal emitted whenever the current desktop changes. | ||
351 | * @param previousDesktop The virtual desktop changed from | 377 | * @param previousDesktop The virtual desktop changed from | ||
352 | * @param newDesktop The virtual desktop changed to | 378 | * @param newDesktop The virtual desktop changed to | ||
353 | **/ | 379 | **/ | ||
354 | void currentChanged(uint previousDesktop, uint newDesktop); | 380 | void currentChanged(uint previousDesktop, uint newDesktop); | ||
355 | /** | 381 | /** | ||
356 | * Signal emitted whenever the desktop layout changes. | 382 | * Signal emitted whenever the desktop layout changes. | ||
Show All 35 Lines | 392 | private Q_SLOTS: | |||
392 | void slotUp(); | 418 | void slotUp(); | ||
393 | /** | 419 | /** | ||
394 | * Slot for switch to desktop below action. | 420 | * Slot for switch to desktop below action. | ||
395 | **/ | 421 | **/ | ||
396 | void slotDown(); | 422 | void slotDown(); | ||
397 | 423 | | |||
398 | private: | 424 | private: | ||
399 | /** | 425 | /** | ||
400 | * This method is called when the number of desktops is updated in a way that desktops | | |||
401 | * are removed. At the time when this method is invoked the count property is already | | |||
402 | * updated but the corresponding signal has not been emitted yet. | | |||
403 | * | | |||
404 | * Ensures that in case the current desktop is on one of the removed | | |||
405 | * desktops the last desktop after the change becomes the new desktop. | | |||
406 | * Emits the signal @link desktopsRemoved. | | |||
407 | * | | |||
408 | * @param previousCount The number of desktops prior to the change. | | |||
409 | * @param previousCurrent The number of the previously current desktop. | | |||
410 | * @see setCount | | |||
411 | * @see desktopsRemoved | | |||
412 | **/ | | |||
413 | void handleDesktopsRemoved(uint previousCount, uint previousCurrent); | | |||
414 | /** | | |||
415 | * Generate a desktop layout from EWMH _NET_DESKTOP_LAYOUT property parameters. | 426 | * Generate a desktop layout from EWMH _NET_DESKTOP_LAYOUT property parameters. | ||
416 | */ | 427 | */ | ||
417 | void setNETDesktopLayout(Qt::Orientation orientation, uint width, uint height, int startingCorner); | 428 | void setNETDesktopLayout(Qt::Orientation orientation, uint width, uint height, int startingCorner); | ||
418 | /** | 429 | /** | ||
419 | * @returns A default name for the given @p desktop | 430 | * @returns A default name for the given @p desktop | ||
420 | **/ | 431 | **/ | ||
421 | QString defaultName(int desktop) const; | 432 | QString defaultName(int desktop) const; | ||
422 | /** | 433 | /** | ||
Show All 23 Lines | |||||
446 | 457 | | |||
447 | QVector<VirtualDesktop*> m_desktops; | 458 | QVector<VirtualDesktop*> m_desktops; | ||
448 | QPointer<VirtualDesktop> m_current; | 459 | QPointer<VirtualDesktop> m_current; | ||
449 | bool m_navigationWrapsAround; | 460 | bool m_navigationWrapsAround; | ||
450 | VirtualDesktopGrid m_grid; | 461 | VirtualDesktopGrid m_grid; | ||
451 | // TODO: QPointer | 462 | // TODO: QPointer | ||
452 | NETRootInfo *m_rootInfo; | 463 | NETRootInfo *m_rootInfo; | ||
453 | KSharedConfig::Ptr m_config; | 464 | KSharedConfig::Ptr m_config; | ||
465 | bool m_isLoading = false; | ||||
454 | 466 | | |||
455 | KWIN_SINGLETON_VARIABLE(VirtualDesktopManager, s_manager) | 467 | KWIN_SINGLETON_VARIABLE(VirtualDesktopManager, s_manager) | ||
456 | }; | 468 | }; | ||
457 | 469 | | |||
458 | /** | 470 | /** | ||
459 | * Function object to select the desktop above in the layout. | 471 | * Function object to select the desktop above in the layout. | ||
460 | * Note: does not switch to the desktop! | 472 | * Note: does not switch to the desktop! | ||
461 | **/ | 473 | **/ | ||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |
Typo: crated -> created.