18static const int s_version = 3;
21 : QtWaylandServer::zwp_pointer_gestures_v1(*display, s_version)
29 wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid pointer");
34 swipeGesture->add(resource->client(),
id, resource->version());
41 wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid pointer");
46 pinchGesture->add(resource->client(),
id, resource->version());
53 wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT,
59 holdGesture->add(resource->client(),
id, resource->version());
64 wl_resource_destroy(resource->handle);
93 wl_resource_destroy(resource->handle);
106 focusedClient = focusedSurface->
client();
109 const QList<Resource *> swipeResources = resourceMap().values(focusedClient->client());
110 for (Resource *swipeResource : swipeResources) {
111 send_begin(swipeResource->handle, serial, seat->timestamp().count(), focusedSurface->
resource(), fingerCount);
117 if (!focusedClient) {
123 const QList<Resource *> swipeResources = resourceMap().values(focusedClient->client());
124 for (Resource *swipeResource : swipeResources) {
125 send_update(swipeResource->handle, seat->timestamp().count(), wl_fixed_from_double(delta.x()), wl_fixed_from_double(delta.y()));
131 if (!focusedClient) {
137 const QList<Resource *> swipeResources = resourceMap().values(focusedClient->client());
138 for (Resource *swipeResource : swipeResources) {
139 send_end(swipeResource->handle, serial, seat->timestamp().count(),
false);
143 focusedClient =
nullptr;
148 if (!focusedClient) {
154 const QList<Resource *> swipeResources = resourceMap().values(focusedClient->client());
155 for (Resource *swipeResource : swipeResources) {
156 send_end(swipeResource->handle, serial, seat->timestamp().count(),
true);
160 focusedClient =
nullptr;
179 wl_resource_destroy(resource->handle);
192 focusedClient = focusedSurface->
client();
195 const QList<Resource *> pinchResources = resourceMap().values(*focusedClient);
196 for (Resource *pinchResource : pinchResources) {
197 send_begin(pinchResource->handle, serial, seat->timestamp().count(), focusedSurface->
resource(), fingerCount);
203 if (!focusedClient) {
209 const QList<Resource *> pinchResources = resourceMap().values(*focusedClient);
210 for (Resource *pinchResource : pinchResources) {
211 send_update(pinchResource->handle,
212 seat->timestamp().count(),
213 wl_fixed_from_double(delta.x()),
214 wl_fixed_from_double(delta.y()),
215 wl_fixed_from_double(scale),
216 wl_fixed_from_double(rotation));
222 if (!focusedClient) {
228 const QList<Resource *> pinchResources = resourceMap().values(*focusedClient);
229 for (Resource *pinchResource : pinchResources) {
230 send_end(pinchResource->handle, serial, seat->timestamp().count(),
false);
234 focusedClient =
nullptr;
239 if (!focusedClient) {
245 const QList<Resource *> pinchResources = resourceMap().values(*focusedClient);
246 for (Resource *pinchResource : pinchResources) {
247 send_end(pinchResource->handle, serial, seat->timestamp().count(),
true);
251 focusedClient =
nullptr;
270 wl_resource_destroy(resource->handle);
283 focusedClient = focusedSurface->
client();
286 const QList<Resource *> holdResources = resourceMap().values(*focusedClient);
287 for (Resource *holdResource : holdResources) {
288 send_begin(holdResource->handle, serial, seat->timestamp().count(), focusedSurface->
resource(), fingerCount);
294 if (!focusedClient) {
300 const QList<Resource *> holdResources = resourceMap().values(*focusedClient);
301 for (Resource *holdResource : holdResources) {
302 send_end(holdResource->handle, serial, seat->timestamp().count(),
false);
306 focusedClient =
nullptr;
311 if (!focusedClient) {
317 const QList<Resource *> holdResources = resourceMap().values(*focusedClient);
318 for (Resource *holdResource : holdResources) {
319 send_end(holdResource->handle, serial, seat->timestamp().count(),
true);
323 focusedClient =
nullptr;
328#include "moc_pointergestures_v1.cpp"
Class holding the Wayland server display loop.
~PointerGesturesV1Interface() override
PointerGesturesV1Interface(Display *display, QObject *parent=nullptr)
PointerGesturesV1InterfacePrivate(Display *display)
void zwp_pointer_gestures_v1_get_pinch_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override
void zwp_pointer_gestures_v1_get_swipe_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override
void zwp_pointer_gestures_v1_release(Resource *resource) override
void zwp_pointer_gestures_v1_get_hold_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override
void sendBegin(quint32 serial, quint32 fingerCount)
void sendEnd(quint32 serial)
void sendCancel(quint32 serial)
static PointerHoldGestureV1Interface * get(PointerInterface *pointer)
void zwp_pointer_gesture_hold_v1_destroy(Resource *resource) override
PointerHoldGestureV1Interface(PointerInterface *pointer)
SeatInterface * seat() const
SurfaceInterface * focusedSurface() const
static PointerInterface * get(wl_resource *native)
std::unique_ptr< PointerHoldGestureV1Interface > holdGesturesV1
std::unique_ptr< PointerSwipeGestureV1Interface > swipeGesturesV1
std::unique_ptr< PointerPinchGestureV1Interface > pinchGesturesV1
static PointerInterfacePrivate * get(PointerInterface *pointer)
void sendEnd(quint32 serial)
static PointerPinchGestureV1Interface * get(PointerInterface *pointer)
void zwp_pointer_gesture_pinch_v1_destroy(Resource *resource) override
void sendCancel(quint32 serial)
PointerPinchGestureV1Interface(PointerInterface *pointer)
void sendUpdate(const QPointF &delta, qreal scale, qreal rotation)
void sendBegin(quint32 serial, quint32 fingerCount)
PointerSwipeGestureV1Interface(PointerInterface *pointer)
void sendCancel(quint32 serial)
void sendBegin(quint32 serial, quint32 fingerCount)
void sendUpdate(const QPointF &delta)
void sendEnd(quint32 serial)
static PointerSwipeGestureV1Interface * get(PointerInterface *pointer)
void zwp_pointer_gesture_swipe_v1_destroy(Resource *resource) override
Represents a Seat on the Wayland Display.
Resource representing a wl_surface.
ClientConnection * client() const
wl_resource * resource() const