Changeset View
Changeset View
Standalone View
Standalone View
effects/presentwindows/presentwindows.h
Show All 19 Lines | |||||
20 | *********************************************************************/ | 20 | *********************************************************************/ | ||
21 | 21 | | |||
22 | #ifndef KWIN_PRESENTWINDOWS_H | 22 | #ifndef KWIN_PRESENTWINDOWS_H | ||
23 | #define KWIN_PRESENTWINDOWS_H | 23 | #define KWIN_PRESENTWINDOWS_H | ||
24 | 24 | | |||
25 | #include "presentwindows_proxy.h" | 25 | #include "presentwindows_proxy.h" | ||
26 | 26 | | |||
27 | #include <kwineffects.h> | 27 | #include <kwineffects.h> | ||
28 | #include <kwineffectquickview.h> | ||||
28 | 29 | | |||
29 | class QMouseEvent; | 30 | class QMouseEvent; | ||
30 | class QElapsedTimer; | 31 | class QElapsedTimer; | ||
31 | class QQuickView; | 32 | class QQuickView; | ||
32 | 33 | | |||
33 | namespace KWin | 34 | namespace KWin | ||
34 | { | 35 | { | ||
35 | class CloseWindowView : public QObject | 36 | class CloseWindowView : public EffectQuickScene | ||
36 | { | 37 | { | ||
37 | Q_OBJECT | 38 | Q_OBJECT | ||
38 | public: | 39 | public: | ||
39 | explicit CloseWindowView(QObject *parent = nullptr); | 40 | explicit CloseWindowView(QObject *parent = nullptr); | ||
40 | void windowInputMouseEvent(QMouseEvent* e); | | |||
41 | void disarm(); | 41 | void disarm(); | ||
42 | | ||||
43 | void show(); | | |||
44 | void hide(); | | |||
45 | bool isVisible() const; | | |||
46 | | ||||
47 | // delegate to QWindow | | |||
48 | int width() const; | | |||
49 | int height() const; | | |||
50 | QSize size() const; | | |||
51 | QRect geometry() const; | | |||
52 | WId winId() const; | | |||
53 | void setGeometry(const QRect &geometry); | | |||
54 | QPoint mapFromGlobal(const QPoint &pos) const; | | |||
55 | | ||||
56 | Q_SIGNALS: | 42 | Q_SIGNALS: | ||
57 | void requestClose(); | 43 | void requestClose(); | ||
58 | 44 | private Q_SLOTS: | |||
45 | void clicked(); | ||||
59 | private: | 46 | private: | ||
60 | QScopedPointer<QElapsedTimer> m_armTimer; | 47 | QElapsedTimer *m_armTimer; | ||
61 | QScopedPointer<QQuickView> m_window; | | |||
62 | bool m_visible; | | |||
63 | QPoint m_pos; | | |||
64 | bool m_posIsValid; | | |||
65 | }; | 48 | }; | ||
66 | 49 | | |||
67 | /** | 50 | /** | ||
68 | * Expose-like effect which shows all windows on current desktop side-by-side, | 51 | * Expose-like effect which shows all windows on current desktop side-by-side, | ||
69 | * letting the user select active window. | 52 | * letting the user select active window. | ||
70 | */ | 53 | */ | ||
71 | class PresentWindowsEffect | 54 | class PresentWindowsEffect | ||
72 | : public Effect | 55 | : public Effect | ||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 191 | public Q_SLOTS: | |||
225 | void slotWindowClosed(KWin::EffectWindow *w); | 208 | void slotWindowClosed(KWin::EffectWindow *w); | ||
226 | void slotWindowDeleted(KWin::EffectWindow *w); | 209 | void slotWindowDeleted(KWin::EffectWindow *w); | ||
227 | void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old); | 210 | void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old); | ||
228 | // atoms | 211 | // atoms | ||
229 | void slotPropertyNotify(KWin::EffectWindow* w, long atom); | 212 | void slotPropertyNotify(KWin::EffectWindow* w, long atom); | ||
230 | 213 | | |||
231 | private Q_SLOTS: | 214 | private Q_SLOTS: | ||
232 | void closeWindow(); | 215 | void closeWindow(); | ||
233 | void elevateCloseWindow(); | | |||
234 | 216 | | |||
235 | protected: | 217 | protected: | ||
236 | // Window rearranging | 218 | // Window rearranging | ||
237 | void rearrangeWindows(); | 219 | void rearrangeWindows(); | ||
238 | void reCreateGrids(); | 220 | void reCreateGrids(); | ||
239 | void calculateWindowTransformations(EffectWindowList windowlist, int screen, | 221 | void calculateWindowTransformations(EffectWindowList windowlist, int screen, | ||
240 | WindowMotionManager& motionManager, bool external = false); | 222 | WindowMotionManager& motionManager, bool external = false); | ||
241 | void calculateWindowTransformationsClosest(EffectWindowList windowlist, int screen, | 223 | void calculateWindowTransformationsClosest(EffectWindowList windowlist, int screen, | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 258 | private: | |||
330 | WindowMouseAction m_leftButtonWindow; | 312 | WindowMouseAction m_leftButtonWindow; | ||
331 | WindowMouseAction m_middleButtonWindow; | 313 | WindowMouseAction m_middleButtonWindow; | ||
332 | WindowMouseAction m_rightButtonWindow; | 314 | WindowMouseAction m_rightButtonWindow; | ||
333 | DesktopMouseAction m_leftButtonDesktop; | 315 | DesktopMouseAction m_leftButtonDesktop; | ||
334 | DesktopMouseAction m_middleButtonDesktop; | 316 | DesktopMouseAction m_middleButtonDesktop; | ||
335 | DesktopMouseAction m_rightButtonDesktop; | 317 | DesktopMouseAction m_rightButtonDesktop; | ||
336 | 318 | | |||
337 | CloseWindowView* m_closeView; | 319 | CloseWindowView* m_closeView; | ||
338 | EffectWindow* m_closeWindow; | | |||
339 | Qt::Corner m_closeButtonCorner; | 320 | Qt::Corner m_closeButtonCorner; | ||
340 | struct { | 321 | struct { | ||
341 | qint32 id = 0; | 322 | qint32 id = 0; | ||
342 | bool active = false; | 323 | bool active = false; | ||
343 | } m_touch; | 324 | } m_touch; | ||
344 | 325 | | |||
345 | QAction *m_exposeAction; | 326 | QAction *m_exposeAction; | ||
346 | QAction *m_exposeAllAction; | 327 | QAction *m_exposeAllAction; | ||
347 | QAction *m_exposeClassAction; | 328 | QAction *m_exposeClassAction; | ||
348 | }; | 329 | }; | ||
349 | 330 | | |||
350 | } // namespace | 331 | } // namespace | ||
351 | 332 | | |||
352 | #endif | 333 | #endif |