Changeset View
Changeset View
Standalone View
Standalone View
src/client/fakeinput.cpp
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "fakeinput.h" | 20 | #include "fakeinput.h" | ||
21 | #include "event_queue.h" | 21 | #include "event_queue.h" | ||
22 | #include "seat.h" | 22 | #include "seat.h" | ||
23 | #include "wayland_pointer_p.h" | 23 | #include "wayland_pointer_p.h" | ||
24 | 24 | #include <QPointF> | |||
25 | #include <QSizeF> | 25 | #include <QSizeF> | ||
26 | 26 | | |||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> | ||
28 | 28 | | |||
29 | #include <wayland-fake-input-client-protocol.h> | 29 | #include <wayland-fake-input-client-protocol.h> | ||
30 | 30 | | |||
31 | namespace KWayland | 31 | namespace KWayland | ||
32 | { | 32 | { | ||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 164 | case Qt::Vertical: | |||
166 | break; | 166 | break; | ||
167 | default: | 167 | default: | ||
168 | Q_UNREACHABLE(); | 168 | Q_UNREACHABLE(); | ||
169 | break; | 169 | break; | ||
170 | } | 170 | } | ||
171 | org_kde_kwin_fake_input_axis(d->manager, a, wl_fixed_from_double(delta)); | 171 | org_kde_kwin_fake_input_axis(d->manager, a, wl_fixed_from_double(delta)); | ||
172 | } | 172 | } | ||
173 | 173 | | |||
174 | void FakeInput::requestTouchDown(quint32 id, const QPointF &pos) | ||||
175 | { | ||||
176 | Q_ASSERT(d->manager.isValid()); | ||||
177 | org_kde_kwin_fake_input_touch_down(d->manager, id, wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | ||||
178 | } | ||||
179 | | ||||
180 | void FakeInput::requestTouchMotion(quint32 id, const QPointF &pos) | ||||
181 | { | ||||
182 | Q_ASSERT(d->manager.isValid()); | ||||
183 | org_kde_kwin_fake_input_touch_motion(d->manager, id, wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); | ||||
184 | } | ||||
185 | | ||||
186 | void FakeInput::requestTouchUp(quint32 id) | ||||
187 | { | ||||
188 | Q_ASSERT(d->manager.isValid()); | ||||
189 | org_kde_kwin_fake_input_touch_up(d->manager, id); | ||||
190 | } | ||||
191 | | ||||
192 | void FakeInput::requestTouchCancel() | ||||
193 | { | ||||
194 | Q_ASSERT(d->manager.isValid()); | ||||
195 | org_kde_kwin_fake_input_touch_cancel(d->manager); | ||||
196 | } | ||||
197 | | ||||
198 | void FakeInput::requestTouchFrame() | ||||
199 | { | ||||
200 | Q_ASSERT(d->manager.isValid()); | ||||
201 | org_kde_kwin_fake_input_touch_frame(d->manager); | ||||
202 | } | ||||
203 | | ||||
174 | FakeInput::operator org_kde_kwin_fake_input*() const | 204 | FakeInput::operator org_kde_kwin_fake_input*() const | ||
175 | { | 205 | { | ||
176 | return d->manager; | 206 | return d->manager; | ||
177 | } | 207 | } | ||
178 | 208 | | |||
179 | FakeInput::operator org_kde_kwin_fake_input*() | 209 | FakeInput::operator org_kde_kwin_fake_input*() | ||
180 | { | 210 | { | ||
181 | return d->manager; | 211 | return d->manager; | ||
182 | } | 212 | } | ||
183 | 213 | | |||
184 | } | 214 | } | ||
185 | } | 215 | } |