Changeset View
Changeset View
Standalone View
Standalone View
touch_input.cpp
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Line(s) | |||||
146 | 146 | | |||
147 | void TouchInputRedirection::processDown(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device) | 147 | void TouchInputRedirection::processDown(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device) | ||
148 | { | 148 | { | ||
149 | Q_UNUSED(device) | 149 | Q_UNUSED(device) | ||
150 | if (!m_inited) { | 150 | if (!m_inited) { | ||
151 | return; | 151 | return; | ||
152 | } | 152 | } | ||
153 | m_windowUpdatedInCycle = false; | 153 | m_windowUpdatedInCycle = false; | ||
154 | const auto &filters = m_input->filters(); | 154 | m_input->processFilters(std::bind(&InputEventFilter::touchDown, std::placeholders::_1, id, pos, time)); | ||
155 | for (auto it = filters.begin(), end = filters.end(); it != end; it++) { | | |||
156 | if ((*it)->touchDown(id, pos, time)) { | | |||
157 | return; | | |||
158 | } | | |||
159 | } | | |||
160 | m_windowUpdatedInCycle = false; | 155 | m_windowUpdatedInCycle = false; | ||
161 | } | 156 | } | ||
162 | 157 | | |||
163 | void TouchInputRedirection::processUp(qint32 id, quint32 time, LibInput::Device *device) | 158 | void TouchInputRedirection::processUp(qint32 id, quint32 time, LibInput::Device *device) | ||
164 | { | 159 | { | ||
165 | Q_UNUSED(device) | 160 | Q_UNUSED(device) | ||
166 | if (!m_inited) { | 161 | if (!m_inited) { | ||
167 | return; | 162 | return; | ||
168 | } | 163 | } | ||
169 | m_windowUpdatedInCycle = false; | 164 | m_windowUpdatedInCycle = false; | ||
170 | const auto &filters = m_input->filters(); | 165 | m_input->processFilters(std::bind(&InputEventFilter::touchUp, std::placeholders::_1, id, time)); | ||
171 | for (auto it = filters.begin(), end = filters.end(); it != end; it++) { | | |||
172 | if ((*it)->touchUp(id, time)) { | | |||
173 | return; | | |||
174 | } | | |||
175 | } | | |||
176 | m_windowUpdatedInCycle = false; | 166 | m_windowUpdatedInCycle = false; | ||
177 | } | 167 | } | ||
178 | 168 | | |||
179 | void TouchInputRedirection::processMotion(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device) | 169 | void TouchInputRedirection::processMotion(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device) | ||
180 | { | 170 | { | ||
181 | Q_UNUSED(device) | 171 | Q_UNUSED(device) | ||
182 | if (!m_inited) { | 172 | if (!m_inited) { | ||
183 | return; | 173 | return; | ||
184 | } | 174 | } | ||
185 | m_windowUpdatedInCycle = false; | 175 | m_windowUpdatedInCycle = false; | ||
186 | const auto &filters = m_input->filters(); | 176 | m_input->processFilters(std::bind(&InputEventFilter::touchMotion, std::placeholders::_1, id, pos, time)); | ||
187 | for (auto it = filters.begin(), end = filters.end(); it != end; it++) { | | |||
188 | if ((*it)->touchMotion(id, pos, time)) { | | |||
189 | return; | | |||
190 | } | | |||
191 | } | | |||
192 | m_windowUpdatedInCycle = false; | 177 | m_windowUpdatedInCycle = false; | ||
193 | } | 178 | } | ||
194 | 179 | | |||
195 | void TouchInputRedirection::cancel() | 180 | void TouchInputRedirection::cancel() | ||
196 | { | 181 | { | ||
197 | if (!m_inited) { | 182 | if (!m_inited) { | ||
198 | return; | 183 | return; | ||
199 | } | 184 | } | ||
Show All 13 Lines |