Changeset View
Changeset View
Standalone View
Standalone View
screens.h
Show All 29 Lines | |||||
30 | #include <QRect> | 30 | #include <QRect> | ||
31 | #include <QTimer> | 31 | #include <QTimer> | ||
32 | #include <QVector> | 32 | #include <QVector> | ||
33 | 33 | | |||
34 | namespace KWin | 34 | namespace KWin | ||
35 | { | 35 | { | ||
36 | class AbstractClient; | 36 | class AbstractClient; | ||
37 | class Platform; | 37 | class Platform; | ||
38 | class OrientationSensor; | | |||
39 | 38 | | |||
40 | class KWIN_EXPORT Screens : public QObject | 39 | class KWIN_EXPORT Screens : public QObject | ||
41 | { | 40 | { | ||
42 | Q_OBJECT | 41 | Q_OBJECT | ||
43 | Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged) | 42 | Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged) | ||
44 | Q_PROPERTY(int current READ current WRITE setCurrent NOTIFY currentChanged) | 43 | Q_PROPERTY(int current READ current WRITE setCurrent NOTIFY currentChanged) | ||
45 | Q_PROPERTY(bool currentFollowsMouse READ isCurrentFollowsMouse WRITE setCurrentFollowsMouse) | 44 | Q_PROPERTY(bool currentFollowsMouse READ isCurrentFollowsMouse WRITE setCurrentFollowsMouse) | ||
46 | 45 | | |||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 46 | public: | |||
142 | /** | 141 | /** | ||
143 | * @returns @c true if the @p screen can be rotated. | 142 | * @returns @c true if the @p screen can be rotated. | ||
144 | * Default implementation returns @c false | 143 | * Default implementation returns @c false | ||
145 | */ | 144 | */ | ||
146 | virtual bool supportsTransformations(int screen) const; | 145 | virtual bool supportsTransformations(int screen) const; | ||
147 | 146 | | |||
148 | virtual Qt::ScreenOrientation orientation(int screen) const; | 147 | virtual Qt::ScreenOrientation orientation(int screen) const; | ||
149 | 148 | | |||
150 | /** | | |||
151 | * Provides access to the OrientationSensor. The OrientationSensor is controlled by the | | |||
152 | * base implementation. The implementing subclass can use this to get notifications about | | |||
153 | * changes of the orientation and current orientation. There is no need to enable/disable it, | | |||
154 | * that is done by the base implementation | | |||
155 | */ | | |||
156 | OrientationSensor *orientationSensor() const { | | |||
157 | return m_orientationSensor; | | |||
158 | } | | |||
159 | | ||||
160 | public Q_SLOTS: | 149 | public Q_SLOTS: | ||
161 | void reconfigure(); | 150 | void reconfigure(); | ||
162 | 151 | | |||
163 | Q_SIGNALS: | 152 | Q_SIGNALS: | ||
164 | void countChanged(int previousCount, int newCount); | 153 | void countChanged(int previousCount, int newCount); | ||
165 | /** | 154 | /** | ||
166 | * Emitted whenever the screens are changed either count or geometry. | 155 | * Emitted whenever the screens are changed either count or geometry. | ||
167 | */ | 156 | */ | ||
Show All 35 Lines | |||||
203 | 192 | | |||
204 | private: | 193 | private: | ||
205 | int m_count; | 194 | int m_count; | ||
206 | int m_current; | 195 | int m_current; | ||
207 | bool m_currentFollowsMouse; | 196 | bool m_currentFollowsMouse; | ||
208 | QTimer *m_changedTimer; | 197 | QTimer *m_changedTimer; | ||
209 | KSharedConfig::Ptr m_config; | 198 | KSharedConfig::Ptr m_config; | ||
210 | QSize m_boundingSize; | 199 | QSize m_boundingSize; | ||
211 | OrientationSensor *m_orientationSensor; | | |||
212 | qreal m_maxScale; | 200 | qreal m_maxScale; | ||
213 | 201 | | |||
214 | KWIN_SINGLETON(Screens) | 202 | KWIN_SINGLETON(Screens) | ||
215 | }; | 203 | }; | ||
216 | 204 | | |||
217 | inline | 205 | inline | ||
218 | int Screens::count() const | 206 | int Screens::count() const | ||
219 | { | 207 | { | ||
Show All 36 Lines |