Changeset View
Changeset View
Standalone View
Standalone View
effects/slidingpopups/slidingpopups.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef KWIN_SLIDINGPOPUPS_H | 21 | #ifndef KWIN_SLIDINGPOPUPS_H | ||
22 | #define KWIN_SLIDINGPOPUPS_H | 22 | #define KWIN_SLIDINGPOPUPS_H | ||
23 | 23 | | |||
24 | // Include with base class for effects. | 24 | // Include with base class for effects. | ||
25 | #include <kwineffects.h> | 25 | #include <kwineffects.h> | ||
26 | 26 | | |||
27 | class QTimeLine; | | |||
28 | | ||||
29 | namespace KWin | 27 | namespace KWin | ||
30 | { | 28 | { | ||
31 | 29 | | |||
32 | class SlidingPopupsEffect | 30 | class SlidingPopupsEffect | ||
33 | : public Effect | 31 | : public Effect | ||
34 | { | 32 | { | ||
35 | Q_OBJECT | 33 | Q_OBJECT | ||
36 | Q_PROPERTY(int fadeInTime READ fadeInTime) | 34 | Q_PROPERTY(int fadeInTime READ fadeInTime) | ||
Show All 13 Lines | 36 | public: | |||
50 | } | 48 | } | ||
51 | 49 | | |||
52 | static bool supported(); | 50 | static bool supported(); | ||
53 | 51 | | |||
54 | // TODO react also on virtual desktop changes | 52 | // TODO react also on virtual desktop changes | ||
55 | 53 | | |||
56 | // for properties | 54 | // for properties | ||
57 | int fadeInTime() const { | 55 | int fadeInTime() const { | ||
58 | return mFadeInTime; | 56 | return mFadeInTime.count(); | ||
59 | } | 57 | } | ||
60 | int fadeOutTime() const { | 58 | int fadeOutTime() const { | ||
61 | return mFadeOutTime; | 59 | return mFadeOutTime.count(); | ||
62 | } | 60 | } | ||
63 | public Q_SLOTS: | 61 | public Q_SLOTS: | ||
64 | void slotWindowAdded(KWin::EffectWindow *c); | 62 | void slotWindowAdded(KWin::EffectWindow *c); | ||
65 | void slotWindowClosed(KWin::EffectWindow *c); | 63 | void slotWindowClosed(KWin::EffectWindow *c); | ||
66 | void slotWindowDeleted(KWin::EffectWindow *w); | 64 | void slotWindowDeleted(KWin::EffectWindow *w); | ||
67 | void slotPropertyNotify(KWin::EffectWindow *w, long a); | 65 | void slotPropertyNotify(KWin::EffectWindow *w, long a); | ||
68 | void slotWaylandSlideOnShowChanged(EffectWindow* w); | 66 | void slotWaylandSlideOnShowChanged(EffectWindow* w); | ||
69 | private: | 67 | private: | ||
70 | void setupAnimData(EffectWindow *w); | 68 | void setupAnimData(EffectWindow *w); | ||
71 | void startForShow(EffectWindow *w); | 69 | void startForShow(EffectWindow *w); | ||
72 | 70 | | |||
73 | enum Position { | 71 | enum Position { | ||
74 | West = 0, | 72 | West = 0, | ||
75 | North = 1, | 73 | North = 1, | ||
76 | East = 2, | 74 | East = 2, | ||
77 | South = 3 | 75 | South = 3 | ||
78 | }; | 76 | }; | ||
79 | struct Data { | 77 | struct Data { | ||
80 | int start; //point in screen coordinates where the window starts | 78 | int start; //point in screen coordinates where the window starts | ||
81 | //to animate, from decides if this point is an x or an y | 79 | //to animate, from decides if this point is an x or an y | ||
82 | Position from; | 80 | Position from; | ||
83 | int fadeInDuration; | 81 | std::chrono::milliseconds fadeInDuration; | ||
84 | int fadeOutDuration; | 82 | std::chrono::milliseconds fadeOutDuration; | ||
85 | int slideLength; | 83 | int slideLength; | ||
86 | }; | 84 | }; | ||
87 | long mAtom; | 85 | long mAtom; | ||
88 | 86 | | |||
89 | // This list is only for appearing windows: we remember that we've enabled the | 87 | // This list is only for appearing windows: we remember that we've enabled the | ||
90 | // WindowBackgroundContrastForcedRole flag, so we can remove it later. | 88 | // WindowBackgroundContrastForcedRole flag, so we can remove it later. | ||
91 | // It doesn't matter for disappearing windows, they'll be deleted anyway. | 89 | // It doesn't matter for disappearing windows, they'll be deleted anyway. | ||
92 | QList< const EffectWindow* > m_backgroundContrastForced; | 90 | QList< const EffectWindow* > m_backgroundContrastForced; | ||
93 | QHash< const EffectWindow*, QTimeLine* > mAppearingWindows; | 91 | QHash< const EffectWindow*, TimeLine > mAppearingWindows; | ||
94 | QHash< const EffectWindow*, QTimeLine* > mDisappearingWindows; | 92 | QHash< const EffectWindow*, TimeLine > mDisappearingWindows; | ||
95 | QHash< const EffectWindow*, Data > mWindowsData; | 93 | QHash< const EffectWindow*, Data > mWindowsData; | ||
96 | int mSlideLength; | 94 | int mSlideLength; | ||
97 | int mFadeInTime; | 95 | std::chrono::milliseconds mFadeInTime; | ||
98 | int mFadeOutTime; | 96 | std::chrono::milliseconds mFadeOutTime; | ||
99 | }; | 97 | }; | ||
100 | 98 | | |||
101 | } // namespace | 99 | } // namespace | ||
102 | 100 | | |||
103 | #endif | 101 | #endif |