KWaylandServer

pointer_interface.h
1 /*
2  SPDX-FileCopyrightText: 2014 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 WAYLAND_SERVER_POINTER_INTERFACE_H
7 #define WAYLAND_SERVER_POINTER_INTERFACE_H
8 
9 #include <KWaylandServer/kwaylandserver_export.h>
10 
11 #include "resource.h"
12 
13 namespace KWaylandServer
14 {
15 
16 class Cursor;
17 class SeatInterface;
18 class SurfaceInterface;
19 
20 enum class PointerAxisSource;
21 
27 class KWAYLANDSERVER_EXPORT PointerInterface : public Resource
28 {
29  Q_OBJECT
30 public:
31  virtual ~PointerInterface();
32 
36  SurfaceInterface *focusedSurface() const;
37 
42  Cursor *cursor() const;
43 
48  static PointerInterface *get(wl_resource *native);
49 
50 Q_SIGNALS:
54  void cursorChanged();
55 
56 private:
57  void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
58  void buttonPressed(quint32 button, quint32 serial);
59  void buttonReleased(quint32 button, quint32 serial);
60  void axis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source);
61  void axis(Qt::Orientation orientation, quint32 delta);
62  void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds);
63  friend class SeatInterface;
64  friend class RelativePointerV1Interface;
65  friend class PointerPinchGestureV1Interface;
66  friend class PointerSwipeGestureV1Interface;
67  explicit PointerInterface(SeatInterface *parent, wl_resource *parentResource);
68  class Private;
69  Private *d_func() const;
70 };
71 
77 class KWAYLANDSERVER_EXPORT Cursor : public QObject
78 {
79  Q_OBJECT
80 public:
81  virtual ~Cursor();
85  QPoint hotspot() const;
89  quint32 enteredSerial() const;
93  PointerInterface *pointer() const;
97  QPointer<SurfaceInterface> surface() const;
98 
99 Q_SIGNALS:
100  void hotspotChanged();
101  void enteredSerialChanged();
102  void surfaceChanged();
103  void changed();
104 
105 private:
106  friend class PointerInterface;
107  Cursor(PointerInterface *parent);
108  class Private;
109  const QScopedPointer<Private> d;
110 };
111 
112 }
113 
114 Q_DECLARE_METATYPE(KWaylandServer::PointerInterface*)
115 
116 #endif
Represents a Seat on the Wayland Display.
Represents a bound Resource.
Definition: resource.h:30
Class encapsulating a Cursor image.
Resource for the wl_pointer interface.
Resource representing a wl_surface.
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Nov 29 2020 23:07:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.