KWayland

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 <KWayland/Server/kwaylandserver_export.h>
10 
11 #include "resource.h"
12 
13 namespace KWayland
14 {
15 namespace Server
16 {
17 
18 class Cursor;
19 class PointerGesturesUnstableV1Interface;
20 class RelativePointerManagerUnstableV1Interface;
21 class SeatInterface;
22 class SurfaceInterface;
23 
24 enum class PointerAxisSource;
25 
31 class KWAYLANDSERVER_EXPORT PointerInterface : public Resource
32 {
33  Q_OBJECT
34 public:
35  virtual ~PointerInterface();
36 
40  SurfaceInterface *focusedSurface() const;
41 
46  Cursor *cursor() const;
47 
52  static PointerInterface *get(wl_resource *native);
53 
54 Q_SIGNALS:
58  void cursorChanged();
59 
60 private:
61  void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
62  void buttonPressed(quint32 button, quint32 serial);
63  void buttonReleased(quint32 button, quint32 serial);
64  void axis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source);
65  void axis(Qt::Orientation orientation, quint32 delta);
66  void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds);
67  friend class SeatInterface;
68  friend class RelativePointerManagerUnstableV1Interface;
69  friend class PointerGesturesUnstableV1Interface;
70  explicit PointerInterface(SeatInterface *parent, wl_resource *parentResource);
71  class Private;
72  Private *d_func() const;
73 };
74 
80 class KWAYLANDSERVER_EXPORT Cursor : public QObject
81 {
82  Q_OBJECT
83 public:
84  virtual ~Cursor();
88  QPoint hotspot() const;
92  quint32 enteredSerial() const;
96  PointerInterface *pointer() const;
100  QPointer<SurfaceInterface> surface() const;
101 
102 Q_SIGNALS:
103  void hotspotChanged();
104  void enteredSerialChanged();
105  void surfaceChanged();
106  void changed();
107 
108 private:
109  friend class PointerInterface;
110  Cursor(PointerInterface *parent);
111  class Private;
112  const QScopedPointer<Private> d;
113 };
114 
115 }
116 }
117 
118 Q_DECLARE_METATYPE(KWayland::Server::PointerInterface*)
119 
120 #endif
PointerAxisSource
Describes the source types for axis events.
Represents a Seat on the Wayland Display.
Class encapsulating a Cursor image.
Resource representing a wl_surface.
Represents a bound Resource.
Definition: resource.h:32
Orientation
Resource for the wl_pointer interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 3 2020 22:49:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.