Changeset View
Changeset View
Standalone View
Standalone View
effects/trackmouse/trackmouse.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | 5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | ||
6 | Copyright (C) 2010 Jorge Mata <matamax123@gmail.com> | 6 | Copyright (C) 2010 Jorge Mata <matamax123@gmail.com> | ||
7 | Copyright (C) 2018 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
7 | 8 | | |||
8 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | 11 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | 12 | (at your option) any later version. | ||
12 | 13 | | |||
13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 56 | private Q_SLOTS: | |||
56 | void toggle(); | 57 | void toggle(); | ||
57 | void slotMouseChanged(const QPoint& pos, const QPoint& old, | 58 | void slotMouseChanged(const QPoint& pos, const QPoint& old, | ||
58 | Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, | 59 | Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, | ||
59 | Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); | 60 | Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); | ||
60 | private: | 61 | private: | ||
61 | bool init(); | 62 | bool init(); | ||
62 | void loadTexture(); | 63 | void loadTexture(); | ||
63 | QRect m_lastRect[2]; | 64 | QRect m_lastRect[2]; | ||
64 | bool m_active, m_mousePolling; | 65 | bool m_mousePolling; | ||
65 | float m_angle; | 66 | float m_angle; | ||
66 | float m_angleBase; | 67 | float m_angleBase; | ||
67 | GLTexture* m_texture[2]; | 68 | GLTexture* m_texture[2]; | ||
68 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | 69 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | ||
69 | QSize m_size[2]; | 70 | QSize m_size[2]; | ||
70 | XRenderPicture *m_picture[2]; | 71 | XRenderPicture *m_picture[2]; | ||
71 | #endif | 72 | #endif | ||
72 | QAction* m_action; | 73 | QAction* m_action; | ||
73 | QImage m_image[2]; | 74 | QImage m_image[2]; | ||
74 | Qt::KeyboardModifiers m_modifiers; | 75 | Qt::KeyboardModifiers m_modifiers; | ||
76 | | ||||
77 | enum class State { | ||||
78 | ActivatedByModifiers, | ||||
79 | ActivatedByShortcut, | ||||
80 | Inactive | ||||
81 | }; | ||||
82 | State m_state = State::Inactive; | ||||
75 | }; | 83 | }; | ||
76 | 84 | | |||
77 | } // namespace | 85 | } // namespace | ||
78 | 86 | | |||
79 | #endif | 87 | #endif |