Changeset View
Changeset View
Standalone View
Standalone View
touch_input.h
Show All 13 Lines | |||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_TOUCH_INPUT_H | 20 | #ifndef KWIN_TOUCH_INPUT_H | ||
21 | #define KWIN_TOUCH_INPUT_H | 21 | #define KWIN_TOUCH_INPUT_H | ||
22 | #include "input.h" | ||||
22 | 23 | | |||
23 | #include <QHash> | 24 | #include <QHash> | ||
24 | #include <QObject> | 25 | #include <QObject> | ||
25 | #include <QPointer> | 26 | #include <QPointer> | ||
26 | #include <QPointF> | 27 | #include <QPointF> | ||
27 | 28 | | |||
28 | namespace KWin | 29 | namespace KWin | ||
29 | { | 30 | { | ||
30 | 31 | | |||
31 | class InputRedirection; | 32 | class InputRedirection; | ||
32 | class Toplevel; | 33 | class Toplevel; | ||
33 | 34 | | |||
34 | class TouchInputRedirection : public QObject | 35 | namespace Decoration | ||
36 | { | ||||
37 | class DecoratedClientImpl; | ||||
38 | } | ||||
39 | | ||||
40 | class TouchInputRedirection : public InputDeviceHandler | ||||
35 | { | 41 | { | ||
36 | Q_OBJECT | 42 | Q_OBJECT | ||
37 | public: | 43 | public: | ||
38 | explicit TouchInputRedirection(InputRedirection *parent); | 44 | explicit TouchInputRedirection(InputRedirection *parent); | ||
39 | virtual ~TouchInputRedirection(); | 45 | virtual ~TouchInputRedirection(); | ||
40 | 46 | | |||
41 | void update(const QPointF &pos = QPointF()); | 47 | void update(const QPointF &pos = QPointF()); | ||
42 | void init(); | 48 | void init(); | ||
43 | 49 | | |||
44 | void processDown(qint32 id, const QPointF &pos, quint32 time); | 50 | void processDown(qint32 id, const QPointF &pos, quint32 time); | ||
45 | void processUp(qint32 id, quint32 time); | 51 | void processUp(qint32 id, quint32 time); | ||
46 | void processMotion(qint32 id, const QPointF &pos, quint32 time); | 52 | void processMotion(qint32 id, const QPointF &pos, quint32 time); | ||
47 | void cancel(); | 53 | void cancel(); | ||
48 | void frame(); | 54 | void frame(); | ||
49 | 55 | | |||
50 | void insertId(quint32 internalId, qint32 kwaylandId); | 56 | void insertId(quint32 internalId, qint32 kwaylandId); | ||
51 | void removeId(quint32 internalId); | 57 | void removeId(quint32 internalId); | ||
52 | qint32 mappedId(quint32 internalId); | 58 | qint32 mappedId(quint32 internalId); | ||
53 | 59 | | |||
54 | /** | 60 | void setDecorationPressId(qint32 id) { | ||
55 | * @brief The Toplevel which currently receives touch events | 61 | m_decorationId = id; | ||
56 | */ | 62 | } | ||
57 | QPointer<Toplevel> window() const { | 63 | qint32 decorationPressId() const { | ||
58 | return m_window; | 64 | return m_decorationId; | ||
59 | } | 65 | } | ||
60 | 66 | | |||
61 | private: | 67 | private: | ||
62 | InputRedirection *m_input; | | |||
63 | bool m_inited = false; | 68 | bool m_inited = false; | ||
64 | /** | 69 | qint32 m_decorationId = -1; | ||
65 | * @brief The Toplevel which currently receives touch events | | |||
66 | */ | | |||
67 | QPointer<Toplevel> m_window; | | |||
68 | /** | 70 | /** | ||
69 | * external/kwayland | 71 | * external/kwayland | ||
70 | **/ | 72 | **/ | ||
71 | QHash<qint32, qint32> m_idMapper; | 73 | QHash<qint32, qint32> m_idMapper; | ||
72 | QMetaObject::Connection m_windowGeometryConnection; | 74 | QMetaObject::Connection m_windowGeometryConnection; | ||
73 | }; | 75 | }; | ||
74 | 76 | | |||
75 | } | 77 | } | ||
76 | 78 | | |||
77 | #endif | 79 | #endif |