Changeset View
Changeset View
Standalone View
Standalone View
effects/slidingpopups/slidingpopups.h
Show All 21 Lines | |||||
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 | namespace KWin | 27 | namespace KWin | ||
28 | { | 28 | { | ||
29 | 29 | | |||
30 | class SlidingPopupsEffect | 30 | class SlidingPopupsEffect : public Effect | ||
31 | : public Effect | | |||
32 | { | 31 | { | ||
33 | Q_OBJECT | 32 | Q_OBJECT | ||
34 | Q_PROPERTY(int slideInDuration READ slideInDuration) | 33 | Q_PROPERTY(int slideInDuration READ slideInDuration) | ||
35 | Q_PROPERTY(int slideOutDuration READ slideOutDuration) | 34 | Q_PROPERTY(int slideOutDuration READ slideOutDuration) | ||
35 | | ||||
36 | public: | 36 | public: | ||
37 | SlidingPopupsEffect(); | 37 | SlidingPopupsEffect(); | ||
38 | ~SlidingPopupsEffect() override; | 38 | ~SlidingPopupsEffect() override; | ||
39 | 39 | | |||
40 | void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; | 40 | void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) override; | ||
41 | void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; | 41 | void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; | ||
42 | void postPaintWindow(EffectWindow* w) override; | 42 | void postPaintWindow(EffectWindow *w) override; | ||
43 | void reconfigure(ReconfigureFlags flags) override; | 43 | void reconfigure(ReconfigureFlags flags) override; | ||
44 | bool isActive() const override; | 44 | bool isActive() const override; | ||
45 | 45 | | |||
46 | int requestedEffectChainPosition() const override { | 46 | int requestedEffectChainPosition() const override { | ||
47 | return 40; | 47 | return 40; | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | static bool supported(); | 50 | static bool supported(); | ||
51 | 51 | | |||
52 | // TODO react also on virtual desktop changes | 52 | // TODO react also on virtual desktop changes | ||
53 | 53 | | |||
54 | int slideInDuration() const; | 54 | int slideInDuration() const; | ||
55 | int slideOutDuration() const; | 55 | int slideOutDuration() const; | ||
56 | 56 | | |||
57 | private Q_SLOTS: | 57 | private Q_SLOTS: | ||
58 | void slotWindowAdded(EffectWindow *w); | 58 | void slotWindowAdded(EffectWindow *w); | ||
59 | void slotWindowDeleted(EffectWindow *w); | 59 | void slotWindowDeleted(EffectWindow *w); | ||
60 | void slotPropertyNotify(EffectWindow *w, long a); | 60 | void slotPropertyNotify(EffectWindow *w, long a); | ||
61 | void slotWaylandSlideOnShowChanged(EffectWindow* w); | 61 | void slotWaylandSlideOnShowChanged(EffectWindow *w); | ||
62 | 62 | | |||
63 | void slideIn(EffectWindow *w); | 63 | void slideIn(EffectWindow *w); | ||
64 | void slideOut(EffectWindow *w); | 64 | void slideOut(EffectWindow *w); | ||
65 | 65 | | |||
66 | private: | 66 | private: | ||
67 | void setupAnimData(EffectWindow *w); | 67 | void setupAnimData(EffectWindow *w); | ||
68 | 68 | | |||
69 | long mAtom; | 69 | long m_atom; | ||
70 | 70 | | |||
71 | int mSlideLength; | 71 | int m_slideLength; | ||
72 | std::chrono::milliseconds m_slideInDuration; | 72 | std::chrono::milliseconds m_slideInDuration; | ||
73 | std::chrono::milliseconds m_slideOutDuration; | 73 | std::chrono::milliseconds m_slideOutDuration; | ||
74 | 74 | | |||
75 | enum class AnimationKind { | 75 | enum class AnimationKind { | ||
76 | In, | 76 | In, | ||
77 | Out | 77 | Out | ||
78 | }; | 78 | }; | ||
79 | 79 | | |||
Show All 36 Lines |