KWayland

keyboard_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_KEYBOARD_INTERFACE_H
7 #define WAYLAND_SERVER_KEYBOARD_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 class SeatInterface;
18 class SurfaceInterface;
19 
20 /**
21  * @brief Resource for the wl_keyboard interface.
22  *
23  **/
24 class KWAYLANDSERVER_EXPORT KeyboardInterface : public Resource
25 {
26  Q_OBJECT
27 public:
28  ~KeyboardInterface() override;
29 
30  /**
31  * @returns the focused SurfaceInterface on this keyboard resource, if any.
32  **/
33  SurfaceInterface *focusedSurface() const;
34 
35 private:
36  void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
37  void setKeymap(int fd, quint32 size);
38  void setKeymap(const QByteArray &content);
39  void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial);
40  void keyPressed(quint32 key, quint32 serial);
41  void keyReleased(quint32 key, quint32 serial);
42  void repeatInfo(qint32 charactersPerSecond, qint32 delay);
43  friend class SeatInterface;
44  explicit KeyboardInterface(SeatInterface *parent, wl_resource *parentResource);
45 
46  class Private;
47  Private *d_func() const;
48 };
49 
50 }
51 }
52 
53 Q_DECLARE_METATYPE(KWayland::Server::KeyboardInterface *)
54 
55 #endif
Resource for the wl_keyboard interface.
Represents a Seat on the Wayland Display.
Represents a bound Resource.
Definition: resource.h:31
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:56:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.