19 return touch->d.get();
30 wl_resource_destroy(resource->handle);
35 return resourceMap().values(client->
client());
40 return resourceMap().contains(client->
client());
54 return d->focusedSurface;
59 if (!d->focusedSurface) {
63 const auto touchResources = d->touchesForClient(d->focusedSurface->client());
64 for (TouchInterfacePrivate::Resource *resource : touchResources) {
65 d->send_cancel(resource->handle);
71 if (!d->focusedSurface) {
75 const auto touchResources = d->touchesForClient(d->focusedSurface->client());
76 for (TouchInterfacePrivate::Resource *resource : touchResources) {
77 d->send_frame(resource->handle);
83 if (!d->focusedSurface) {
87 QPointF pos = d->focusedSurface->toSurfaceLocal(localPos);
89 const auto touchResources = d->touchesForClient(d->focusedSurface->client());
90 for (TouchInterfacePrivate::Resource *resource : touchResources) {
91 d->send_motion(resource->handle, d->seat->timestamp().count(), id, wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()));
97 if (!d->focusedSurface) {
101 const auto touchResources = d->touchesForClient(d->focusedSurface->client());
102 for (TouchInterfacePrivate::Resource *resource : touchResources) {
103 d->send_up(resource->handle, serial, d->seat->timestamp().count(), id);
113 d->focusedSurface = surface;
115 QPointF pos = d->focusedSurface->toSurfaceLocal(localPos);
117 const auto touchResources = d->touchesForClient(d->focusedSurface->client());
118 for (TouchInterfacePrivate::Resource *resource : touchResources) {
119 d->send_down(resource->handle,
121 d->seat->timestamp().count(),
122 d->focusedSurface->resource(),
124 wl_fixed_from_double(pos.x()),
125 wl_fixed_from_double(pos.y()));
131#include "moc_touch.cpp"
Convenient Class which represents a wl_client.
wl_client * client() const
Represents a Seat on the Wayland Display.
Resource representing a wl_surface.
void sendMotion(qint32 id, const QPointF &localPos)
void sendUp(qint32 id, quint32 serial)
SurfaceInterface * focusedSurface() const
void sendDown(qint32 id, quint32 serial, const QPointF &localPos, SurfaceInterface *surface)
~TouchInterface() override
QList< Resource * > touchesForClient(ClientConnection *client) const
static TouchInterfacePrivate * get(TouchInterface *touch)
TouchInterfacePrivate(TouchInterface *q, SeatInterface *seat)
bool hasTouchesForClient(ClientConnection *client) const
void touch_release(Resource *resource) override