Changeset View
Changeset View
Standalone View
Standalone View
effects/diminactive/diminactive.h
Show All 31 Lines | |||||
32 | class DimInactiveEffect : public Effect | 32 | class DimInactiveEffect : public Effect | ||
33 | { | 33 | { | ||
34 | Q_OBJECT | 34 | Q_OBJECT | ||
35 | Q_PROPERTY(int dimStrength READ dimStrength) | 35 | Q_PROPERTY(int dimStrength READ dimStrength) | ||
36 | Q_PROPERTY(bool dimPanels READ dimPanels) | 36 | Q_PROPERTY(bool dimPanels READ dimPanels) | ||
37 | Q_PROPERTY(bool dimDesktop READ dimDesktop) | 37 | Q_PROPERTY(bool dimDesktop READ dimDesktop) | ||
38 | Q_PROPERTY(bool dimKeepAbove READ dimKeepAbove) | 38 | Q_PROPERTY(bool dimKeepAbove READ dimKeepAbove) | ||
39 | Q_PROPERTY(bool dimByGroup READ dimByGroup) | 39 | Q_PROPERTY(bool dimByGroup READ dimByGroup) | ||
40 | Q_PROPERTY(bool dimFullScreen READ dimFullScreen) | ||||
40 | 41 | | |||
41 | public: | 42 | public: | ||
42 | DimInactiveEffect(); | 43 | DimInactiveEffect(); | ||
43 | ~DimInactiveEffect() override; | 44 | ~DimInactiveEffect() override; | ||
44 | 45 | | |||
45 | void reconfigure(ReconfigureFlags flags) override; | 46 | void reconfigure(ReconfigureFlags flags) override; | ||
46 | 47 | | |||
47 | void prePaintScreen(ScreenPrePaintData &data, int time) override; | 48 | void prePaintScreen(ScreenPrePaintData &data, int time) override; | ||
48 | void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; | 49 | void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; | ||
49 | void postPaintScreen() override; | 50 | void postPaintScreen() override; | ||
50 | 51 | | |||
51 | int requestedEffectChainPosition() const override; | 52 | int requestedEffectChainPosition() const override; | ||
52 | bool isActive() const override; | 53 | bool isActive() const override; | ||
53 | 54 | | |||
54 | int dimStrength() const; | 55 | int dimStrength() const; | ||
55 | bool dimPanels() const; | 56 | bool dimPanels() const; | ||
56 | bool dimDesktop() const; | 57 | bool dimDesktop() const; | ||
57 | bool dimKeepAbove() const; | 58 | bool dimKeepAbove() const; | ||
58 | bool dimByGroup() const; | 59 | bool dimByGroup() const; | ||
60 | bool dimFullScreen() const; | ||||
59 | 61 | | |||
60 | private Q_SLOTS: | 62 | private Q_SLOTS: | ||
61 | void windowActivated(EffectWindow *w); | 63 | void windowActivated(EffectWindow *w); | ||
62 | void windowClosed(EffectWindow *w); | 64 | void windowClosed(EffectWindow *w); | ||
63 | void windowDeleted(EffectWindow *w); | 65 | void windowDeleted(EffectWindow *w); | ||
64 | void activeFullScreenEffectChanged(); | 66 | void activeFullScreenEffectChanged(); | ||
65 | 67 | | |||
66 | private: | 68 | private: | ||
67 | void dimWindow(WindowPaintData &data, qreal strength); | 69 | void dimWindow(WindowPaintData &data, qreal strength); | ||
68 | bool canDimWindow(const EffectWindow *w) const; | 70 | bool canDimWindow(const EffectWindow *w) const; | ||
69 | void scheduleInTransition(EffectWindow *w); | 71 | void scheduleInTransition(EffectWindow *w); | ||
70 | void scheduleGroupInTransition(EffectWindow *w); | 72 | void scheduleGroupInTransition(EffectWindow *w); | ||
71 | void scheduleOutTransition(EffectWindow *w); | 73 | void scheduleOutTransition(EffectWindow *w); | ||
72 | void scheduleGroupOutTransition(EffectWindow *w); | 74 | void scheduleGroupOutTransition(EffectWindow *w); | ||
73 | void scheduleRepaint(EffectWindow *w); | 75 | void scheduleRepaint(EffectWindow *w); | ||
74 | 76 | | |||
75 | private: | 77 | private: | ||
76 | qreal m_dimStrength; | 78 | qreal m_dimStrength; | ||
77 | bool m_dimPanels; | 79 | bool m_dimPanels; | ||
78 | bool m_dimDesktop; | 80 | bool m_dimDesktop; | ||
79 | bool m_dimKeepAbove; | 81 | bool m_dimKeepAbove; | ||
80 | bool m_dimByGroup; | 82 | bool m_dimByGroup; | ||
83 | bool m_dimFullScreen; | ||||
81 | 84 | | |||
82 | EffectWindow *m_activeWindow; | 85 | EffectWindow *m_activeWindow; | ||
83 | const EffectWindowGroup *m_activeWindowGroup; | 86 | const EffectWindowGroup *m_activeWindowGroup; | ||
84 | QHash<EffectWindow*, TimeLine> m_transitions; | 87 | QHash<EffectWindow*, TimeLine> m_transitions; | ||
85 | QHash<EffectWindow*, qreal> m_forceDim; | 88 | QHash<EffectWindow*, qreal> m_forceDim; | ||
86 | 89 | | |||
87 | struct { | 90 | struct { | ||
88 | bool active = false; | 91 | bool active = false; | ||
Show All 31 Lines | 122 | { | |||
120 | return m_dimKeepAbove; | 123 | return m_dimKeepAbove; | ||
121 | } | 124 | } | ||
122 | 125 | | |||
123 | inline bool DimInactiveEffect::dimByGroup() const | 126 | inline bool DimInactiveEffect::dimByGroup() const | ||
124 | { | 127 | { | ||
125 | return m_dimByGroup; | 128 | return m_dimByGroup; | ||
126 | } | 129 | } | ||
127 | 130 | | |||
131 | inline bool DimInactiveEffect::dimFullScreen() const | ||||
132 | { | ||||
133 | return m_dimFullScreen; | ||||
134 | } | ||||
135 | | ||||
128 | } // namespace KWin | 136 | } // namespace KWin | ||
129 | 137 | | |||
130 | #endif | 138 | #endif |