virtualdesktops: improve readability

Adds whitespace between documented members of the header file.

Currently the members are all bunched together, making it difficult to
read as one flows directly into the next. This change adds a newline
between each member, making it easier to read.
This commit is contained in:
Kristen McWilliam 2024-06-28 16:29:59 -04:00 committed by Vlad Zahorodnii
parent 172e26617c
commit 42eb6389e2

View file

@ -62,6 +62,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void nameChanged(); void nameChanged();
void x11DesktopNumberChanged(); void x11DesktopNumberChanged();
/** /**
* Emitted just before the desktop gets destroyed. * Emitted just before the desktop gets destroyed.
*/ */
@ -87,19 +88,23 @@ public:
VirtualDesktopGrid(); VirtualDesktopGrid();
~VirtualDesktopGrid(); ~VirtualDesktopGrid();
void update(const QSize &size, const QList<VirtualDesktop *> &desktops); void update(const QSize &size, const QList<VirtualDesktop *> &desktops);
/** /**
* @returns The coords of desktop @a id in grid units. * @returns The coords of desktop @a id in grid units.
*/ */
QPoint gridCoords(uint id) const; QPoint gridCoords(uint id) const;
/** /**
* @returns The coords of desktop @a vd in grid units. * @returns The coords of desktop @a vd in grid units.
*/ */
QPoint gridCoords(VirtualDesktop *vd) const; QPoint gridCoords(VirtualDesktop *vd) const;
/** /**
* @returns The desktop at the point @a coords or 0 if no desktop exists at that * @returns The desktop at the point @a coords or 0 if no desktop exists at that
* point. @a coords is to be in grid units. * point. @a coords is to be in grid units.
*/ */
VirtualDesktop *at(const QPoint &coords) const; VirtualDesktop *at(const QPoint &coords) const;
int width() const; int width() const;
int height() const; int height() const;
const QSize &size() const; const QSize &size() const;
@ -130,57 +135,68 @@ private:
class KWIN_EXPORT VirtualDesktopManager : public QObject class KWIN_EXPORT VirtualDesktopManager : public QObject
{ {
Q_OBJECT Q_OBJECT
/** /**
* The number of virtual desktops currently available. * The number of virtual desktops currently available.
* The ids of the virtual desktops are in the range [1, VirtualDesktopManager::maximum()]. * The ids of the virtual desktops are in the range [1, VirtualDesktopManager::maximum()].
*/ */
Q_PROPERTY(uint count READ count WRITE setCount NOTIFY countChanged) Q_PROPERTY(uint count READ count WRITE setCount NOTIFY countChanged)
/** /**
* The id of the virtual desktop which is currently in use. * The id of the virtual desktop which is currently in use.
*/ */
Q_PROPERTY(uint current READ current WRITE setCurrent NOTIFY currentChanged) Q_PROPERTY(uint current READ current WRITE setCurrent NOTIFY currentChanged)
/** /**
* Whether navigation in the desktop layout wraps around at the borders. * Whether navigation in the desktop layout wraps around at the borders.
*/ */
Q_PROPERTY(bool navigationWrappingAround READ isNavigationWrappingAround WRITE setNavigationWrappingAround NOTIFY navigationWrappingAroundChanged) Q_PROPERTY(bool navigationWrappingAround READ isNavigationWrappingAround WRITE setNavigationWrappingAround NOTIFY navigationWrappingAroundChanged)
public: public:
~VirtualDesktopManager() override; ~VirtualDesktopManager() override;
/** /**
* @internal, for X11 case * @internal, for X11 case
*/ */
void setRootInfo(NETRootInfo *info); void setRootInfo(NETRootInfo *info);
/** /**
* @internal, for Wayland case * @internal, for Wayland case
*/ */
void setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management); void setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management);
/** /**
* @internal * @internal
*/ */
void setConfig(KSharedConfig::Ptr config); void setConfig(KSharedConfig::Ptr config);
/** /**
* @returns Total number of desktops currently in existence. * @returns Total number of desktops currently in existence.
* @see setCount * @see setCount
* @see countChanged * @see countChanged
*/ */
uint count() const; uint count() const;
/** /**
* @returns the number of rows the layout has. * @returns the number of rows the layout has.
* @see setRows * @see setRows
* @see rowsChanged * @see rowsChanged
*/ */
uint rows() const; uint rows() const;
/** /**
* @returns The ID of the current desktop. * @returns The ID of the current desktop.
* @see setCurrent * @see setCurrent
* @see currentChanged * @see currentChanged
*/ */
uint current() const; uint current() const;
/** /**
* @returns The current desktop * @returns The current desktop
* @see setCurrent * @see setCurrent
* @see currentChanged * @see currentChanged
*/ */
VirtualDesktop *currentDesktop() const; VirtualDesktop *currentDesktop() const;
/** /**
* Moves to the desktop through the algorithm described by Direction. * Moves to the desktop through the algorithm described by Direction.
* @param wrap If @c true wraps around to the other side of the layout * @param wrap If @c true wraps around to the other side of the layout
@ -218,26 +234,31 @@ public:
* the layout if @a wrap is set. If @a desktop is @c null use the current one. * the layout if @a wrap is set. If @a desktop is @c null use the current one.
*/ */
VirtualDesktop *above(VirtualDesktop *desktop, bool wrap = true) const; VirtualDesktop *above(VirtualDesktop *desktop, bool wrap = true) const;
/** /**
* @returns The desktop to the right of desktop @a desktop. Wraps around to the * @returns The desktop to the right of desktop @a desktop. Wraps around to the
* left of the layout if @a wrap is set. If @a desktop is @c null use the current one. * left of the layout if @a wrap is set. If @a desktop is @c null use the current one.
*/ */
VirtualDesktop *toRight(VirtualDesktop *desktop, bool wrap = true) const; VirtualDesktop *toRight(VirtualDesktop *desktop, bool wrap = true) const;
/** /**
* @returns The desktop below desktop @a desktop. Wraps around to the top of the * @returns The desktop below desktop @a desktop. Wraps around to the top of the
* layout if @a wrap is set. If @a desktop is @c null use the current one. * layout if @a wrap is set. If @a desktop is @c null use the current one.
*/ */
VirtualDesktop *below(VirtualDesktop *desktop, bool wrap = true) const; VirtualDesktop *below(VirtualDesktop *desktop, bool wrap = true) const;
/** /**
* @returns The desktop to the left of desktop @a desktop. Wraps around to the * @returns The desktop to the left of desktop @a desktop. Wraps around to the
* right of the layout if @a wrap is set. If @a desktop is @c null use the current one. * right of the layout if @a wrap is set. If @a desktop is @c null use the current one.
*/ */
VirtualDesktop *toLeft(VirtualDesktop *desktop, bool wrap = true) const; VirtualDesktop *toLeft(VirtualDesktop *desktop, bool wrap = true) const;
/** /**
* @returns The desktop after the desktop @a desktop. Wraps around to the first * @returns The desktop after the desktop @a desktop. Wraps around to the first
* desktop if @a wrap is set. If @a desktop is @c null use the current desktop. * desktop if @a wrap is set. If @a desktop is @c null use the current desktop.
*/ */
VirtualDesktop *next(VirtualDesktop *desktop = nullptr, bool wrap = true) const; VirtualDesktop *next(VirtualDesktop *desktop = nullptr, bool wrap = true) const;
/** /**
* @returns The desktop in front of the desktop @a desktop. Wraps around to the * @returns The desktop in front of the desktop @a desktop. Wraps around to the
* last desktop if @a wrap is set. If @a desktop is @c null use the current desktop. * last desktop if @a wrap is set. If @a desktop is @c null use the current desktop.
@ -312,6 +333,7 @@ public Q_SLOTS:
* @see desktopRemoved * @see desktopRemoved
*/ */
void setCount(uint count); void setCount(uint count);
/** /**
* Set the current desktop to @a current. * Set the current desktop to @a current.
* @returns True on success, false otherwise. * @returns True on success, false otherwise.
@ -320,6 +342,7 @@ public Q_SLOTS:
* @see moveTo * @see moveTo
*/ */
bool setCurrent(uint current); bool setCurrent(uint current);
/** /**
* Set the current desktop to @a current. * Set the current desktop to @a current.
* @returns True on success, false otherwise. * @returns True on success, false otherwise.
@ -328,24 +351,29 @@ public Q_SLOTS:
* @see moveTo * @see moveTo
*/ */
bool setCurrent(VirtualDesktop *current); bool setCurrent(VirtualDesktop *current);
/** /**
* Updates the layout to a new number of rows. The number of columns will be calculated accordingly * Updates the layout to a new number of rows. The number of columns will be calculated accordingly
*/ */
void setRows(uint rows); void setRows(uint rows);
/** /**
* Called from within setCount() to ensure the desktop layout is still valid. * Called from within setCount() to ensure the desktop layout is still valid.
*/ */
void updateLayout(); void updateLayout();
/** /**
* @param enabled wrapping around borders for navigation in desktop layout * @param enabled wrapping around borders for navigation in desktop layout
* @see isNavigationWrappingAround * @see isNavigationWrappingAround
* @see navigationWrappingAroundChanged * @see navigationWrappingAroundChanged
*/ */
void setNavigationWrappingAround(bool enabled); void setNavigationWrappingAround(bool enabled);
/** /**
* Loads number of desktops and names from configuration file * Loads number of desktops and names from configuration file
*/ */
void load(); void load();
/** /**
* Saves number of desktops and names to configuration file * Saves number of desktops and names to configuration file
*/ */
@ -402,6 +430,7 @@ Q_SIGNALS:
* @param rows The new number of rows in the layout * @param rows The new number of rows in the layout
*/ */
void layoutChanged(int columns, int rows); void layoutChanged(int columns, int rows);
/** /**
* Signal emitted whenever the navigationWrappingAround property changes. * Signal emitted whenever the navigationWrappingAround property changes.
*/ */
@ -414,26 +443,32 @@ private Q_SLOTS:
* DO NOT CALL DIRECTLY! ONLY TO BE USED FROM AN ACTION! * DO NOT CALL DIRECTLY! ONLY TO BE USED FROM AN ACTION!
*/ */
void slotSwitchTo(); void slotSwitchTo();
/** /**
* Slot for switch to next desktop action. * Slot for switch to next desktop action.
*/ */
void slotNext(); void slotNext();
/** /**
* Slot for switch to previous desktop action. * Slot for switch to previous desktop action.
*/ */
void slotPrevious(); void slotPrevious();
/** /**
* Slot for switch to right desktop action. * Slot for switch to right desktop action.
*/ */
void slotRight(); void slotRight();
/** /**
* Slot for switch to left desktop action. * Slot for switch to left desktop action.
*/ */
void slotLeft(); void slotLeft();
/** /**
* Slot for switch to desktop above action. * Slot for switch to desktop above action.
*/ */
void slotUp(); void slotUp();
/** /**
* Slot for switch to desktop below action. * Slot for switch to desktop below action.
*/ */
@ -450,10 +485,12 @@ private:
* @returns A default name for the given @p desktop * @returns A default name for the given @p desktop
*/ */
QString defaultName(int desktop) const; QString defaultName(int desktop) const;
/** /**
* Creates all the global keyboard shortcuts for "Switch To Desktop n" actions. * Creates all the global keyboard shortcuts for "Switch To Desktop n" actions.
*/ */
void initSwitchToShortcuts(); void initSwitchToShortcuts();
/** /**
* Creates an action and connects it to the @p slot in this Manager. This method is * Creates an action and connects it to the @p slot in this Manager. This method is
* meant to be used for the case that an additional information needs to be stored in * meant to be used for the case that an additional information needs to be stored in
@ -465,6 +502,7 @@ private:
* @param slot The slot to invoke when the action is triggered * @param slot The slot to invoke when the action is triggered
*/ */
QAction *addAction(const QString &name, const KLocalizedString &label, uint value, const QKeySequence &key, void (VirtualDesktopManager::*slot)()); QAction *addAction(const QString &name, const KLocalizedString &label, uint value, const QKeySequence &key, void (VirtualDesktopManager::*slot)());
/** /**
* Creates an action and connects it to the @p slot in this Manager. * Creates an action and connects it to the @p slot in this Manager.
* Overloaded method for the case that no additional value needs to be passed to the action. * Overloaded method for the case that no additional value needs to be passed to the action.