KWayland

pointerconstraints.h
1 /*
2  SPDX-FileCopyrightText: 2016 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef KWAYLAND_CLIENT_POINTERCONSTRAINTS_H
7 #define KWAYLAND_CLIENT_POINTERCONSTRAINTS_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct zwp_pointer_constraints_v1;
14 struct zwp_locked_pointer_v1;
15 struct zwp_confined_pointer_v1;
16 
17 class QPointF;
18 
19 namespace KWayland
20 {
21 namespace Client
22 {
23 
24 class EventQueue;
25 class LockedPointer;
26 class Surface;
27 class Region;
28 class ConfinedPointer;
29 class Pointer;
30 
55 class KWAYLANDCLIENT_EXPORT PointerConstraints : public QObject
56 {
57  Q_OBJECT
58 public:
65  explicit PointerConstraints(QObject *parent = nullptr);
66  virtual ~PointerConstraints();
67 
73  void setup(zwp_pointer_constraints_v1 *pointerconstraints);
77  bool isValid() const;
83  void release();
100  void destroy();
101 
105  void setEventQueue(EventQueue *queue);
109  EventQueue *eventQueue();
110 
118  enum class LifeTime {
123  OneShot,
128  Persistent
129  };
130 
173  LockedPointer *lockPointer(Surface *surface, Pointer *pointer, Region *region, LifeTime lifetime, QObject *parent = nullptr);
174 
199  ConfinedPointer *confinePointer(Surface *surface, Pointer *pointer, Region *region, LifeTime lifetime, QObject *parent = nullptr);
200 
201  operator zwp_pointer_constraints_v1*();
202  operator zwp_pointer_constraints_v1*() const;
203 
204 Q_SIGNALS:
211  void removed();
212 
213 private:
214  class Private;
216 };
217 
247 class KWAYLANDCLIENT_EXPORT LockedPointer : public QObject
248 {
249  Q_OBJECT
250 public:
251  virtual ~LockedPointer();
252 
258  void setup(zwp_locked_pointer_v1 *lockedpointer);
262  bool isValid() const;
268  void release();
285  void destroy();
286 
302  void setCursorPositionHint(const QPointF &surfaceLocal);
303 
315  void setRegion(Region *region);
316 
317  operator zwp_locked_pointer_v1*();
318  operator zwp_locked_pointer_v1*() const;
319 
320 Q_SIGNALS:
325  void locked();
326 
336  void unlocked();
337 
338 private:
339  friend class PointerConstraints;
340  explicit LockedPointer(QObject *parent = nullptr);
341  class Private;
343 };
344 
365 class KWAYLANDCLIENT_EXPORT ConfinedPointer : public QObject
366 {
367  Q_OBJECT
368 public:
369  virtual ~ConfinedPointer();
370 
376  void setup(zwp_confined_pointer_v1 *confinedpointer);
380  bool isValid() const;
386  void release();
401  void destroy();
402 
423  void setRegion(Region *region);
424 
425  operator zwp_confined_pointer_v1*();
426  operator zwp_confined_pointer_v1*() const;
427 
428 Q_SIGNALS:
433  void confined();
434 
444  void unconfined();
445 
446 private:
447  friend class PointerConstraints;
448  explicit ConfinedPointer(QObject *parent = nullptr);
449  class Private;
451 };
452 
453 
454 }
455 }
456 
457 #endif
Wrapper for the zwp_pointer_constraints_v1 interface.
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the wl_pointer interface.
Definition: pointer.h:32
Wrapper for zwp_confined_pointer_v1 protocol The confine pointer interface represents a confined poin...
LifeTime
These values represent different lifetime semantics.
Wrapper for the wl_region interface.
Definition: region.h:32
Wrapper for the zwp_locked_pointer_v1 interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 13 2020 22:50:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.