Changeset View
Changeset View
Standalone View
Standalone View
effects/slidingpopups/slidingpopups.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 36 | public: | |||
---|---|---|---|---|---|
55 | int fadeInTime() const { | 55 | int fadeInTime() const { | ||
56 | return mFadeInTime.count(); | 56 | return mFadeInTime.count(); | ||
57 | } | 57 | } | ||
58 | int fadeOutTime() const { | 58 | int fadeOutTime() const { | ||
59 | return mFadeOutTime.count(); | 59 | return mFadeOutTime.count(); | ||
60 | } | 60 | } | ||
61 | public Q_SLOTS: | 61 | public Q_SLOTS: | ||
62 | void slotWindowAdded(KWin::EffectWindow *c); | 62 | void slotWindowAdded(KWin::EffectWindow *c); | ||
63 | void slotWindowClosed(KWin::EffectWindow *c); | | |||
64 | void slotWindowDeleted(KWin::EffectWindow *w); | 63 | void slotWindowDeleted(KWin::EffectWindow *w); | ||
65 | void slotPropertyNotify(KWin::EffectWindow *w, long a); | 64 | void slotPropertyNotify(KWin::EffectWindow *w, long a); | ||
66 | void slotWaylandSlideOnShowChanged(EffectWindow* w); | 65 | void slotWaylandSlideOnShowChanged(EffectWindow* w); | ||
66 | | ||||
67 | void slideIn(EffectWindow *w); | ||||
68 | void slideOut(EffectWindow *w); | ||||
69 | | ||||
67 | private: | 70 | private: | ||
68 | void setupAnimData(EffectWindow *w); | 71 | void setupAnimData(EffectWindow *w); | ||
69 | void startForShow(EffectWindow *w); | | |||
70 | 72 | | |||
71 | enum Position { | 73 | enum Position { | ||
72 | West = 0, | 74 | West = 0, | ||
73 | North = 1, | 75 | North = 1, | ||
74 | East = 2, | 76 | East = 2, | ||
75 | South = 3 | 77 | South = 3 | ||
76 | }; | 78 | }; | ||
77 | struct Data { | 79 | struct Data { | ||
78 | int start; //point in screen coordinates where the window starts | 80 | int start; //point in screen coordinates where the window starts | ||
79 | //to animate, from decides if this point is an x or an y | 81 | //to animate, from decides if this point is an x or an y | ||
80 | Position from; | 82 | Position from; | ||
81 | std::chrono::milliseconds fadeInDuration; | 83 | std::chrono::milliseconds fadeInDuration; | ||
82 | std::chrono::milliseconds fadeOutDuration; | 84 | std::chrono::milliseconds fadeOutDuration; | ||
83 | int slideLength; | 85 | int slideLength; | ||
84 | }; | 86 | }; | ||
85 | long mAtom; | 87 | long mAtom; | ||
86 | 88 | | |||
87 | QHash< const EffectWindow*, TimeLine > mAppearingWindows; | | |||
88 | QHash< const EffectWindow*, TimeLine > mDisappearingWindows; | | |||
89 | QHash< const EffectWindow*, Data > mWindowsData; | 89 | QHash< const EffectWindow*, Data > mWindowsData; | ||
90 | int mSlideLength; | 90 | int mSlideLength; | ||
91 | std::chrono::milliseconds mFadeInTime; | 91 | std::chrono::milliseconds mFadeInTime; | ||
92 | std::chrono::milliseconds mFadeOutTime; | 92 | std::chrono::milliseconds mFadeOutTime; | ||
93 | | ||||
94 | enum class AnimationKind { | ||||
95 | In, | ||||
96 | Out | ||||
97 | }; | ||||
98 | | ||||
99 | struct Animation { | ||||
100 | AnimationKind kind; | ||||
101 | TimeLine timeLine; | ||||
102 | }; | ||||
103 | QHash<const EffectWindow*, Animation> m_animations; | ||||
93 | }; | 104 | }; | ||
94 | 105 | | |||
95 | } // namespace | 106 | } // namespace | ||
96 | 107 | | |||
97 | #endif | 108 | #endif |