Changeset View
Changeset View
Standalone View
Standalone View
colorcorrection/manager.h
Show All 26 Lines | |||||
27 | #include <QPair> | 27 | #include <QPair> | ||
28 | #include <QDateTime> | 28 | #include <QDateTime> | ||
29 | 29 | | |||
30 | class QTimer; | 30 | class QTimer; | ||
31 | 31 | | |||
32 | namespace KWin | 32 | namespace KWin | ||
33 | { | 33 | { | ||
34 | 34 | | |||
35 | class Platform; | 35 | class Workspace; | ||
36 | 36 | | |||
37 | namespace ColorCorrect | 37 | namespace ColorCorrect | ||
38 | { | 38 | { | ||
39 | 39 | | |||
40 | typedef QPair<QDateTime,QDateTime> DateTimes; | 40 | typedef QPair<QDateTime,QDateTime> DateTimes; | ||
41 | typedef QPair<QTime,QTime> Times; | 41 | typedef QPair<QTime,QTime> Times; | ||
42 | 42 | | |||
43 | class ColorCorrectDBusInterface; | 43 | class ColorCorrectDBusInterface; | ||
Show All 25 Lines | 59 | public: | |||
69 | /** | 69 | /** | ||
70 | * Change configuration | 70 | * Change configuration | ||
71 | * @see info | 71 | * @see info | ||
72 | * @since 5.12 | 72 | * @since 5.12 | ||
73 | **/ | 73 | **/ | ||
74 | bool changeConfiguration(QHash<QString, QVariant> data); | 74 | bool changeConfiguration(QHash<QString, QVariant> data); | ||
75 | void autoLocationUpdate(double latitude, double longitude); | 75 | void autoLocationUpdate(double latitude, double longitude); | ||
76 | 76 | | |||
77 | /** | ||||
78 | * Toggles the active state of the filter. | ||||
79 | * | ||||
80 | * A quick transition will be started if the difference between current screen | ||||
81 | * color temperature and target screen color temperature is too large. Target | ||||
82 | * temperature is defined in context of the new active state. | ||||
83 | * | ||||
84 | * If the filter becomes inactive after calling this method, the target color | ||||
85 | * temperature is 6500 K. | ||||
86 | * | ||||
87 | * If the filter becomes active after calling this method, the target screen | ||||
88 | * color temperature is defined by the current operation mode. | ||||
89 | * | ||||
90 | * Note that this method is a no-op if the underlying platform doesn't support | ||||
91 | * adjusting gamma ramps. | ||||
92 | **/ | ||||
93 | void toggle(); | ||||
94 | | ||||
77 | // for auto tests | 95 | // for auto tests | ||
78 | void reparseConfigAndReset(); | 96 | void reparseConfigAndReset(); | ||
79 | 97 | | |||
80 | public Q_SLOTS: | 98 | public Q_SLOTS: | ||
81 | void resetSlowUpdateStartTimer(); | 99 | void resetSlowUpdateStartTimer(); | ||
82 | void quickAdjust(); | 100 | void quickAdjust(); | ||
83 | 101 | | |||
84 | Q_SIGNALS: | 102 | Q_SIGNALS: | ||
85 | void configChange(QHash<QString, QVariant> data); | 103 | void configChange(QHash<QString, QVariant> data); | ||
86 | 104 | | |||
87 | private: | 105 | private: | ||
106 | void initShortcuts(); | ||||
88 | void readConfig(); | 107 | void readConfig(); | ||
89 | void hardReset(); | 108 | void hardReset(); | ||
90 | void slowUpdate(int targetTemp); | 109 | void slowUpdate(int targetTemp); | ||
91 | void resetAllTimers(); | 110 | void resetAllTimers(); | ||
92 | int currentTargetTemp() const; | 111 | int currentTargetTemp() const; | ||
93 | void cancelAllTimers(); | 112 | void cancelAllTimers(); | ||
94 | /** | 113 | /** | ||
95 | * Quick shift on manual change to current target Temperature | 114 | * Quick shift on manual change to current target Temperature | ||
Show All 38 Lines | |||||
134 | QTimer *m_slowUpdateTimer = nullptr; | 153 | QTimer *m_slowUpdateTimer = nullptr; | ||
135 | QTimer *m_quickAdjustTimer = nullptr; | 154 | QTimer *m_quickAdjustTimer = nullptr; | ||
136 | 155 | | |||
137 | int m_currentTemp = NEUTRAL_TEMPERATURE; | 156 | int m_currentTemp = NEUTRAL_TEMPERATURE; | ||
138 | int m_dayTargetTemp = NEUTRAL_TEMPERATURE; | 157 | int m_dayTargetTemp = NEUTRAL_TEMPERATURE; | ||
139 | int m_nightTargetTemp = DEFAULT_NIGHT_TEMPERATURE; | 158 | int m_nightTargetTemp = DEFAULT_NIGHT_TEMPERATURE; | ||
140 | 159 | | |||
141 | int m_failedCommitAttempts = 0; | 160 | int m_failedCommitAttempts = 0; | ||
161 | | ||||
162 | // The Workspace class needs to call initShortcuts during initialization. | ||||
163 | friend class KWin::Workspace; | ||||
142 | }; | 164 | }; | ||
143 | 165 | | |||
144 | } | 166 | } | ||
145 | } | 167 | } | ||
146 | 168 | | |||
147 | #endif // KWIN_COLORCORRECT_MANAGER_H | 169 | #endif // KWIN_COLORCORRECT_MANAGER_H |