File indexing completed on 2024-06-09 05:26:09
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2009 Michael Zanetti <michael_zanetti@gmx.net> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 // Include with base class for effects. 0013 #include "effect/effect.h" 0014 #include "plugins/slideback/motionmanager.h" 0015 0016 namespace KWin 0017 { 0018 0019 class SlideBackEffect 0020 : public Effect 0021 { 0022 Q_OBJECT 0023 public: 0024 SlideBackEffect(); 0025 0026 void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) override; 0027 void paintWindow(const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; 0028 void postPaintWindow(EffectWindow *w) override; 0029 0030 void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override; 0031 void postPaintScreen() override; 0032 bool isActive() const override; 0033 0034 int requestedEffectChainPosition() const override 0035 { 0036 return 50; 0037 } 0038 0039 public Q_SLOTS: 0040 void slotWindowAdded(KWin::EffectWindow *w); 0041 void slotWindowDeleted(KWin::EffectWindow *w); 0042 void slotWindowUnminimized(KWin::EffectWindow *w); 0043 void slotStackingOrderChanged(); 0044 void slotTabBoxAdded(); 0045 void slotTabBoxClosed(); 0046 0047 private: 0048 WindowMotionManager motionManager; 0049 QList<EffectWindow *> usableOldStackingOrder; 0050 QList<EffectWindow *> oldStackingOrder; 0051 QList<EffectWindow *> coveringWindows; 0052 QList<EffectWindow *> elevatedList; 0053 EffectWindow *m_justMapped, *m_upmostWindow; 0054 QHash<EffectWindow *, QRect> destinationList; 0055 int m_tabboxActive; 0056 QList<QRegion> clippedRegions; 0057 std::chrono::milliseconds m_lastPresentTime = std::chrono::milliseconds::zero(); 0058 0059 QRect getSlideDestination(const QRect &windowUnderGeometry, const QRect &windowOverGeometry); 0060 bool isWindowUsable(EffectWindow *w); 0061 bool intersects(EffectWindow *windowUnder, const QRect &windowOverGeometry); 0062 QList<EffectWindow *> usableWindows(const QList<EffectWindow *> &allWindows); 0063 QRect getModalGroupGeometry(EffectWindow *w); 0064 void windowRaised(EffectWindow *w); 0065 }; 0066 0067 } // namespace