File indexing completed on 2024-04-21 16:17:21

0001 /*
0002 *  Copyright 2016  Smith AR <audoban@openmailbox.org>
0003 *                  Michail Vourlakos <mvourlakos@gmail.com>
0004 *
0005 *  This file is part of Latte-Dock
0006 *
0007 *  Latte-Dock is free software; you can redistribute it and/or
0008 *  modify it under the terms of the GNU General Public License as
0009 *  published by the Free Software Foundation; either version 2 of
0010 *  the License, or (at your option) any later version.
0011 *
0012 *  Latte-Dock is distributed in the hope that it will be useful,
0013 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 *  GNU General Public License for more details.
0016 *
0017 *  You should have received a copy of the GNU General Public License
0018 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0019 */
0020 
0021 #ifndef WINDOWINFOWRAP_H
0022 #define WINDOWINFOWRAP_H
0023 
0024 // Qt
0025 #include <QWindow>
0026 #include <QIcon>
0027 #include <QRect>
0028 #include <QVariant>
0029 
0030 namespace Latte {
0031 namespace WindowSystem {
0032 
0033 using WindowId = QVariant;
0034 
0035 class WindowInfoWrap
0036 {
0037 
0038 public:
0039     WindowInfoWrap() noexcept
0040         : m_isValid(false)
0041         , m_isActive(false)
0042         , m_isMinimized(false)
0043         , m_isMaxVert(false)
0044         , m_isMaxHoriz(false)
0045         , m_isFullscreen(false)
0046         , m_isShaded(false)
0047         , m_isPlasmaDesktop(false)
0048         , m_isKeepAbove(false)
0049         , m_hasSkipTaskbar(false)
0050         , m_isOnAllDesktops(false)
0051         , m_isOnAllActivities(false)
0052         , m_isClosable(false)
0053         , m_isFullScreenable(false)
0054         , m_isGroupable(false)
0055         , m_isMaximizable(false)
0056         , m_isMinimizable(false)
0057         , m_isMovable(false)
0058         , m_isResizable(false)
0059         , m_isShadeable(false)
0060         , m_isVirtualDesktopsChangeable(false)
0061     {
0062     }
0063 
0064     WindowInfoWrap(const WindowInfoWrap &o) noexcept
0065         : m_wid(o.m_wid)
0066         , m_parentId(o.m_parentId)
0067         , m_geometry(o.m_geometry)
0068         , m_isValid(o.m_isValid)
0069         , m_isActive(o.m_isActive)
0070         , m_isMinimized(o.m_isMinimized)
0071         , m_isMaxVert(o.m_isMaxVert)
0072         , m_isMaxHoriz(o.m_isMaxHoriz)
0073         , m_isFullscreen(o.m_isFullscreen)
0074         , m_isShaded(o.m_isShaded)
0075         , m_isPlasmaDesktop(o.m_isPlasmaDesktop)
0076         , m_isKeepAbove(o.m_isKeepAbove)
0077         , m_hasSkipTaskbar(o.m_hasSkipTaskbar)
0078         , m_isOnAllDesktops(o.m_isOnAllDesktops)
0079         , m_isOnAllActivities(o.m_isOnAllActivities)
0080         , m_isClosable(o.m_isClosable)
0081         , m_isFullScreenable(o.m_isFullScreenable)
0082         , m_isGroupable(o.m_isGroupable)
0083         , m_isMaximizable(o.m_isMaximizable)
0084         , m_isMinimizable(o.m_isMinimizable)
0085         , m_isMovable(o.m_isMovable)
0086         , m_isResizable(o.m_isResizable)
0087         , m_isShadeable(o.m_isShadeable)
0088         , m_isVirtualDesktopsChangeable(o.m_isVirtualDesktopsChangeable)
0089         , m_desktops(o.m_desktops)
0090         , m_activities(o.m_activities)
0091         , m_display(o.m_display) {
0092     }
0093 
0094     WindowInfoWrap(WindowInfoWrap &&o) noexcept
0095         : m_wid(o.m_wid)
0096         , m_parentId(o.m_parentId)
0097         , m_geometry(o.m_geometry)
0098         , m_isValid(o.m_isValid)
0099         , m_isActive(o.m_isActive)
0100         , m_isMinimized(o.m_isMinimized)
0101         , m_isMaxVert(o.m_isMaxVert)
0102         , m_isMaxHoriz(o.m_isMaxHoriz)
0103         , m_isFullscreen(o.m_isFullscreen)
0104         , m_isShaded(o.m_isShaded)
0105         , m_isPlasmaDesktop(o.m_isPlasmaDesktop)
0106         , m_isKeepAbove(o.m_isKeepAbove)
0107         , m_hasSkipTaskbar(o.m_hasSkipTaskbar)
0108         , m_isOnAllDesktops(o.m_isOnAllDesktops)
0109         , m_isOnAllActivities(o.m_isOnAllActivities)
0110         , m_isClosable(o.m_isClosable)
0111         , m_isFullScreenable(o.m_isFullScreenable)
0112         , m_isGroupable(o.m_isGroupable)
0113         , m_isMaximizable(o.m_isMaximizable)
0114         , m_isMinimizable(o.m_isMinimizable)
0115         , m_isMovable(o.m_isMovable)
0116         , m_isResizable(o.m_isResizable)
0117         , m_isShadeable(o.m_isShadeable)
0118         , m_isVirtualDesktopsChangeable(o.m_isVirtualDesktopsChangeable)
0119         , m_desktops(o.m_desktops)
0120         , m_activities(o.m_activities)
0121         , m_display(o.m_display) {
0122     }
0123 
0124     inline WindowInfoWrap &operator=(WindowInfoWrap &&rhs) noexcept;
0125     inline WindowInfoWrap &operator=(const WindowInfoWrap &rhs) noexcept;
0126     inline bool operator==(const WindowInfoWrap &rhs) const noexcept;
0127     inline bool operator<(const WindowInfoWrap &rhs) const noexcept;
0128     inline bool operator>(const WindowInfoWrap &rhs) const noexcept;
0129 
0130     inline bool isValid() const noexcept;
0131     inline void setIsValid(bool isValid) noexcept;
0132 
0133     inline bool isActive() const noexcept;
0134     inline void setIsActive(bool isActive) noexcept;
0135 
0136     inline bool isMinimized() const noexcept;
0137     inline void setIsMinimized(bool isMinimized) noexcept;
0138 
0139     inline bool isMaximized() const noexcept;
0140 
0141     inline bool isMaxVert() const noexcept;
0142     inline void setIsMaxVert(bool isMaxVert) noexcept;
0143 
0144     inline bool isMaxHoriz() const noexcept;
0145     inline void setIsMaxHoriz(bool isMaxHoriz) noexcept;
0146 
0147     inline bool isFullscreen() const noexcept;
0148     inline void setIsFullscreen(bool isFullscreen) noexcept;
0149 
0150     inline bool isShaded() const noexcept;
0151     inline void setIsShaded(bool isShaded) noexcept;
0152 
0153     inline bool isPlasmaDesktop() const noexcept;
0154     inline void setIsPlasmaDesktop(bool isPlasmaDesktop) noexcept;
0155 
0156     inline bool isKeepAbove() const noexcept;
0157     inline void setIsKeepAbove(bool isKeepAbove) noexcept;
0158 
0159     inline bool hasSkipTaskbar() const noexcept;
0160     inline void setHasSkipTaskbar(bool skipTaskbar) noexcept;
0161 
0162     inline bool isOnAllDesktops() const noexcept;
0163     inline void setIsOnAllDesktops(bool alldesktops) noexcept;
0164 
0165     inline bool isOnAllActivities() const noexcept;
0166     inline void setIsOnAllActivities(bool allactivities) noexcept;
0167 
0168     //!BEGIN: Window Abilities
0169     inline bool isCloseable() const noexcept;
0170     inline void setIsClosable(bool closable) noexcept;
0171 
0172     inline bool isFullScreenable() const noexcept;
0173     inline void setIsFullScreenable(bool fullscreenable) noexcept;
0174 
0175     inline bool isGroupable() const noexcept;
0176     inline void setIsGroupable(bool groupable) noexcept;
0177 
0178     inline bool isMaximizable() const noexcept;
0179     inline void setIsMaximizable(bool maximizable) noexcept;
0180 
0181     inline bool isMinimizable() const noexcept;
0182     inline void setIsMinimizable(bool minimizable) noexcept;
0183 
0184     inline bool isMovable() const noexcept;
0185     inline void setIsMovable(bool movable) noexcept;
0186 
0187     inline bool isResizable() const noexcept;
0188     inline void setIsResizable(bool resizable) noexcept;
0189 
0190     inline bool isShadeable() const noexcept;
0191     inline void setIsShadeable(bool shadeble) noexcept;
0192 
0193     inline bool isVirtualDesktopsChangeable() const noexcept;
0194     inline void setIsVirtualDesktopsChangeable(bool virtualdesktopchangeable) noexcept;
0195     //!END: Window Abilities
0196 
0197     inline bool isMainWindow() const noexcept;
0198     inline bool isChildWindow() const noexcept;
0199 
0200     inline QRect geometry() const noexcept;
0201     inline void setGeometry(const QRect &geometry) noexcept;
0202 
0203     inline QString appName() const noexcept;
0204     inline void setAppName(const QString &appName) noexcept;
0205 
0206     inline QString display() const noexcept;
0207     inline void setDisplay(const QString &display) noexcept;
0208 
0209     inline QIcon icon() const noexcept;
0210     inline void setIcon(const QIcon &icon) noexcept;
0211 
0212     inline WindowId wid() const noexcept;
0213     inline void setWid(const WindowId &wid) noexcept;
0214 
0215     inline WindowId parentId() const noexcept;
0216     inline void setParentId(const WindowId &parentId) noexcept;
0217 
0218     inline QStringList desktops() const noexcept;
0219     inline void setDesktops(const QStringList &desktops) noexcept;
0220 
0221     inline QStringList activities() const noexcept;
0222     inline void setActivities(const QStringList &activities) noexcept;
0223 
0224     inline bool isOnDesktop(const QString &desktop) const noexcept;
0225     inline bool isOnActivity(const QString &activity) const noexcept;
0226 
0227 private:
0228     WindowId m_wid{0};
0229     WindowId m_parentId{0};
0230 
0231     QRect m_geometry;
0232 
0233     bool m_isValid : 1;
0234     bool m_isActive : 1;
0235     bool m_isMinimized : 1;
0236     bool m_isMaxVert : 1;
0237     bool m_isMaxHoriz : 1;
0238     bool m_isFullscreen : 1;
0239     bool m_isShaded : 1;
0240     bool m_isPlasmaDesktop : 1;
0241     bool m_isKeepAbove: 1;
0242     bool m_hasSkipTaskbar: 1;
0243     bool m_isOnAllDesktops: 1;
0244     bool m_isOnAllActivities: 1;
0245 
0246     //!BEGIN: Window Abilities
0247     bool m_isClosable : 1;
0248     bool m_isFullScreenable : 1;
0249     bool m_isGroupable : 1;
0250     bool m_isMaximizable : 1;
0251     bool m_isMinimizable : 1;
0252     bool m_isMovable : 1;
0253     bool m_isResizable : 1;
0254     bool m_isShadeable : 1;
0255     bool m_isVirtualDesktopsChangeable : 1;
0256     //!END: Window Abilities
0257 
0258     QString m_appName;
0259     QString m_display;
0260 
0261     QIcon m_icon;
0262 
0263     QStringList m_desktops;
0264     QStringList m_activities;
0265 };
0266 
0267 // BEGIN: definitions
0268 inline WindowInfoWrap &WindowInfoWrap::operator=(WindowInfoWrap &&rhs) noexcept
0269 {
0270     m_wid = rhs.m_wid;
0271     m_parentId = rhs.m_parentId;
0272     m_geometry = rhs.m_geometry;
0273     m_isValid = rhs.m_isValid;
0274     m_isActive = rhs.m_isActive;
0275     m_isMinimized = rhs.m_isMinimized;
0276     m_isMaxVert = rhs.m_isMaxVert;
0277     m_isMaxHoriz = rhs.m_isMaxHoriz;
0278     m_isFullscreen = rhs.m_isFullscreen;
0279     m_isShaded = rhs.m_isShaded;
0280     m_isPlasmaDesktop = rhs.m_isPlasmaDesktop;
0281     m_isKeepAbove = rhs.m_isKeepAbove;
0282     m_hasSkipTaskbar = rhs.m_hasSkipTaskbar;
0283     m_isOnAllDesktops = rhs.m_isOnAllDesktops;
0284     m_isOnAllActivities = rhs.m_isOnAllActivities;
0285     m_isClosable = rhs.m_isClosable;
0286     m_isFullScreenable = rhs.m_isFullScreenable;
0287     m_isGroupable = rhs.m_isGroupable;
0288     m_isMaximizable = rhs.m_isMaximizable;
0289     m_isMinimizable = rhs.m_isMinimizable;
0290     m_isMovable = rhs.m_isMovable;
0291     m_isResizable = rhs.m_isResizable;
0292     m_isShadeable = rhs.m_isShadeable;
0293     m_isVirtualDesktopsChangeable = rhs.m_isVirtualDesktopsChangeable;
0294 
0295     m_display = rhs.m_display;
0296     m_desktops = rhs.m_desktops;
0297     m_activities = rhs.m_activities;
0298     return *this;
0299 }
0300 
0301 inline WindowInfoWrap &WindowInfoWrap::operator=(const WindowInfoWrap &rhs) noexcept
0302 {
0303     m_wid = rhs.m_wid;
0304     m_parentId = rhs.m_parentId;
0305     m_geometry = std::move(rhs.m_geometry);
0306     m_isValid = rhs.m_isValid;
0307     m_isActive = rhs.m_isActive;
0308     m_isMinimized = rhs.m_isMinimized;
0309     m_isMaxVert = rhs.m_isMaxVert;
0310     m_isMaxHoriz = rhs.m_isMaxHoriz;
0311     m_isFullscreen = rhs.m_isFullscreen;
0312     m_isShaded = rhs.m_isShaded;
0313     m_isPlasmaDesktop = rhs.m_isPlasmaDesktop;
0314     m_isKeepAbove = rhs.m_isKeepAbove;
0315     m_hasSkipTaskbar = rhs.m_hasSkipTaskbar;
0316     m_isOnAllDesktops = rhs.m_isOnAllDesktops;
0317     m_isOnAllActivities = rhs.m_isOnAllActivities;
0318     m_isClosable = rhs.m_isClosable;
0319     m_isFullScreenable = rhs.m_isFullScreenable;
0320     m_isGroupable = rhs.m_isGroupable;
0321     m_isMaximizable = rhs.m_isMaximizable;
0322     m_isMinimizable = rhs.m_isMinimizable;
0323     m_isMovable = rhs.m_isMovable;
0324     m_isResizable = rhs.m_isResizable;
0325     m_isShadeable = rhs.m_isShadeable;
0326     m_isVirtualDesktopsChangeable = rhs.m_isVirtualDesktopsChangeable;;
0327 
0328     m_display = rhs.m_display;
0329     m_desktops = rhs.m_desktops;
0330     m_activities = rhs.m_activities;
0331     return *this;
0332 }
0333 
0334 inline bool WindowInfoWrap::operator==(const WindowInfoWrap &rhs) const noexcept
0335 {
0336     return m_wid == rhs.m_wid;
0337 }
0338 
0339 inline bool WindowInfoWrap::operator<(const WindowInfoWrap &rhs) const noexcept
0340 {
0341     return m_wid < rhs.m_wid;
0342 }
0343 
0344 inline bool WindowInfoWrap::operator>(const WindowInfoWrap &rhs) const noexcept
0345 {
0346     return m_wid > rhs.m_wid;
0347 }
0348 
0349 inline bool WindowInfoWrap::isValid() const noexcept
0350 {
0351     return m_isValid;
0352 }
0353 
0354 inline void WindowInfoWrap::setIsValid(bool isValid) noexcept
0355 {
0356     m_isValid = isValid;
0357 }
0358 
0359 inline bool WindowInfoWrap::isActive() const noexcept
0360 {
0361     return m_isActive;
0362 }
0363 
0364 inline void WindowInfoWrap::setIsActive(bool isActive) noexcept
0365 {
0366     m_isActive = isActive;
0367 }
0368 
0369 inline bool WindowInfoWrap::isMinimized() const noexcept
0370 {
0371     return m_isMinimized;
0372 }
0373 
0374 inline void WindowInfoWrap::setIsMinimized(bool isMinimized) noexcept
0375 {
0376     m_isMinimized = isMinimized;
0377 }
0378 
0379 inline bool WindowInfoWrap::isMaximized() const noexcept
0380 {
0381     return m_isMaxVert && m_isMaxHoriz;
0382 }
0383 
0384 inline bool WindowInfoWrap::isMaxVert() const noexcept
0385 {
0386     return m_isMaxVert;
0387 }
0388 
0389 inline void WindowInfoWrap::setIsMaxVert(bool isMaxVert) noexcept
0390 {
0391     m_isMaxVert = isMaxVert;
0392 }
0393 
0394 inline bool WindowInfoWrap::isMaxHoriz() const noexcept
0395 {
0396     return m_isMaxHoriz;
0397 }
0398 
0399 inline void WindowInfoWrap::setIsMaxHoriz(bool isMaxHoriz) noexcept
0400 {
0401     m_isMaxHoriz = isMaxHoriz;
0402 }
0403 
0404 inline bool WindowInfoWrap::isFullscreen() const noexcept
0405 {
0406     return m_isFullscreen;
0407 }
0408 
0409 inline void WindowInfoWrap::setIsFullscreen(bool isFullscreen) noexcept
0410 {
0411     m_isFullscreen = isFullscreen;
0412 }
0413 
0414 inline bool WindowInfoWrap::isShaded() const noexcept
0415 {
0416     return m_isShaded;
0417 }
0418 
0419 inline void WindowInfoWrap::setIsShaded(bool isShaded) noexcept
0420 {
0421     m_isShaded = isShaded;
0422 }
0423 
0424 inline bool WindowInfoWrap::isPlasmaDesktop() const noexcept
0425 {
0426     return m_isPlasmaDesktop;
0427 }
0428 
0429 inline void WindowInfoWrap::setIsPlasmaDesktop(bool isPlasmaDesktop) noexcept
0430 {
0431     m_isPlasmaDesktop = isPlasmaDesktop;
0432 }
0433 
0434 inline bool WindowInfoWrap::isKeepAbove() const noexcept
0435 {
0436     return m_isKeepAbove;
0437 }
0438 
0439 inline void WindowInfoWrap::setIsKeepAbove(bool isKeepAbove) noexcept
0440 {
0441     m_isKeepAbove = isKeepAbove;
0442 }
0443 
0444 inline bool WindowInfoWrap::hasSkipTaskbar() const noexcept
0445 {
0446     return m_hasSkipTaskbar;
0447 }
0448 
0449 inline void WindowInfoWrap::setHasSkipTaskbar(bool skipTaskbar) noexcept
0450 {
0451     m_hasSkipTaskbar = skipTaskbar;
0452 }
0453 
0454 inline bool WindowInfoWrap::isOnAllDesktops() const noexcept
0455 {
0456     return m_isOnAllDesktops;
0457 }
0458 
0459 inline void WindowInfoWrap::setIsOnAllDesktops(bool alldesktops) noexcept
0460 {
0461     m_isOnAllDesktops = alldesktops;
0462 }
0463 
0464 inline bool WindowInfoWrap::isOnAllActivities() const noexcept
0465 {
0466     return m_isOnAllActivities;
0467 }
0468 
0469 inline void WindowInfoWrap::setIsOnAllActivities(bool allactivities) noexcept
0470 {
0471     m_isOnAllActivities = allactivities;
0472 }
0473 
0474 //!BEGIN: Window Abilities
0475 inline bool WindowInfoWrap::isCloseable() const noexcept
0476 {
0477     return m_isClosable;
0478 }
0479 inline void WindowInfoWrap::setIsClosable(bool closable) noexcept
0480 {
0481     m_isClosable = closable;
0482 }
0483 
0484 inline bool WindowInfoWrap::isFullScreenable() const noexcept
0485 {
0486     return m_isFullScreenable;
0487 }
0488 inline void WindowInfoWrap::setIsFullScreenable(bool fullscreenable) noexcept
0489 {
0490     m_isFullScreenable = fullscreenable;
0491 }
0492 
0493 inline bool WindowInfoWrap::isGroupable() const noexcept
0494 {
0495     return m_isGroupable;
0496 }
0497 inline void WindowInfoWrap::setIsGroupable(bool groupable) noexcept
0498 {
0499     m_isGroupable = groupable;
0500 }
0501 
0502 inline bool WindowInfoWrap::isMaximizable() const noexcept
0503 {
0504     return m_isMaximizable;
0505 }
0506 inline void WindowInfoWrap::setIsMaximizable(bool maximizable) noexcept
0507 {
0508     m_isMaximizable = maximizable;
0509 }
0510 
0511 inline bool WindowInfoWrap::isMinimizable() const noexcept
0512 {
0513     return m_isMinimizable;
0514 }
0515 inline void WindowInfoWrap::setIsMinimizable(bool minimizable) noexcept
0516 {
0517     m_isMinimizable = minimizable;
0518 }
0519 
0520 inline bool WindowInfoWrap::isMovable() const noexcept
0521 {
0522     return m_isMovable;
0523 }
0524 inline void WindowInfoWrap::setIsMovable(bool movable) noexcept
0525 {
0526     m_isMovable = movable;
0527 }
0528 
0529 inline bool WindowInfoWrap::isResizable() const noexcept
0530 {
0531     return m_isResizable;
0532 }
0533 inline void WindowInfoWrap::setIsResizable(bool resizable) noexcept
0534 {
0535     m_isResizable = resizable;
0536 }
0537 
0538 inline bool WindowInfoWrap::isShadeable() const noexcept
0539 {
0540     return m_isShadeable;
0541 }
0542 inline void WindowInfoWrap::setIsShadeable(bool shadeble) noexcept
0543 {
0544     m_isShadeable = shadeble;
0545 }
0546 
0547 inline bool WindowInfoWrap::isVirtualDesktopsChangeable() const noexcept
0548 {
0549     return m_isVirtualDesktopsChangeable;
0550 }
0551 inline void WindowInfoWrap::setIsVirtualDesktopsChangeable(bool virtualdesktopchangeable) noexcept
0552 {
0553     m_isVirtualDesktopsChangeable = virtualdesktopchangeable;
0554 }
0555 //!END: Window Abilities
0556 
0557 
0558 
0559 inline bool WindowInfoWrap::isMainWindow() const noexcept
0560 {
0561     return (m_parentId.toInt() <= 0);
0562 }
0563 
0564 inline bool WindowInfoWrap::isChildWindow() const noexcept
0565 {
0566     return (m_parentId.toInt() > 0);
0567 }
0568 
0569 
0570 inline QString WindowInfoWrap::appName() const noexcept
0571 {
0572     return m_appName;
0573 }
0574 
0575 inline void WindowInfoWrap::setAppName(const QString &appName) noexcept
0576 {
0577     m_appName = appName;
0578 }
0579 
0580 inline QString WindowInfoWrap::display() const noexcept
0581 {
0582     return m_display;
0583 }
0584 
0585 inline void WindowInfoWrap::setDisplay(const QString &display) noexcept
0586 {
0587     m_display = display;
0588 }
0589 
0590 inline QIcon WindowInfoWrap::icon() const noexcept
0591 {
0592     return m_icon;
0593 }
0594 
0595 inline void WindowInfoWrap::setIcon(const QIcon &icon) noexcept
0596 {
0597     m_icon = icon;
0598 }
0599 
0600 inline QRect WindowInfoWrap::geometry() const noexcept
0601 {
0602     return m_geometry;
0603 }
0604 
0605 inline void WindowInfoWrap::setGeometry(const QRect &geometry) noexcept
0606 {
0607     m_geometry = geometry;
0608 }
0609 
0610 inline WindowId WindowInfoWrap::wid() const noexcept
0611 {
0612     return m_wid;
0613 }
0614 
0615 inline void WindowInfoWrap::setWid(const WindowId &wid) noexcept
0616 {
0617     m_wid = wid;
0618 }
0619 
0620 inline WindowId WindowInfoWrap::parentId() const noexcept
0621 {
0622     return m_parentId;
0623 }
0624 
0625 inline void WindowInfoWrap::setParentId(const WindowId &parentId) noexcept
0626 {
0627     if (m_wid == parentId) {
0628         return;
0629     }
0630 
0631     m_parentId = parentId;
0632 }
0633 
0634 inline QStringList WindowInfoWrap::desktops() const noexcept
0635 {
0636     return m_desktops;
0637 }
0638 
0639 inline void WindowInfoWrap::setDesktops(const QStringList &desktops) noexcept
0640 {
0641     m_desktops = desktops;
0642 }
0643 
0644 inline QStringList WindowInfoWrap::activities() const noexcept
0645 {
0646     return m_activities;
0647 }
0648 
0649 inline void WindowInfoWrap::setActivities(const QStringList &activities) noexcept
0650 {
0651     m_activities = activities;
0652 }
0653 // END: definitions
0654 
0655 inline bool WindowInfoWrap::isOnDesktop(const QString &desktop) const noexcept
0656 {
0657     return m_isOnAllDesktops || m_desktops.contains(desktop);
0658 }
0659 
0660 inline bool WindowInfoWrap::isOnActivity(const QString &activity) const noexcept
0661 {
0662     return m_isOnAllActivities || m_activities.contains(activity);
0663 }
0664 
0665 
0666 }
0667 }
0668 
0669 #endif // WINDOWINFOWRAP_H