2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2020-03-15 15:19:28 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2014-11-25 12:39:24 +00:00
|
|
|
#ifndef WAYLAND_SERVER_KEYBOARD_INTERFACE_H
|
|
|
|
#define WAYLAND_SERVER_KEYBOARD_INTERFACE_H
|
|
|
|
|
|
|
|
#include <KWayland/Server/kwaylandserver_export.h>
|
|
|
|
|
2014-11-26 14:28:47 +00:00
|
|
|
#include "resource.h"
|
2014-11-25 12:39:24 +00:00
|
|
|
|
|
|
|
namespace KWayland
|
|
|
|
{
|
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
|
|
|
|
class SeatInterface;
|
|
|
|
class SurfaceInterface;
|
|
|
|
|
2015-09-09 11:49:58 +00:00
|
|
|
/**
|
|
|
|
* @brief Resource for the wl_keyboard interface.
|
|
|
|
*
|
|
|
|
**/
|
2014-11-26 14:28:47 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT KeyboardInterface : public Resource
|
2014-11-25 12:39:24 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~KeyboardInterface();
|
|
|
|
|
2015-09-09 11:49:58 +00:00
|
|
|
/**
|
|
|
|
* @returns the focused SurfaceInterface on this keyboard resource, if any.
|
|
|
|
**/
|
2014-11-25 12:39:24 +00:00
|
|
|
SurfaceInterface *focusedSurface() const;
|
|
|
|
|
|
|
|
private:
|
2014-11-26 14:00:44 +00:00
|
|
|
void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
|
|
|
|
void setKeymap(int fd, quint32 size);
|
2020-03-19 13:58:52 +00:00
|
|
|
void setKeymap(const QByteArray &content);
|
2014-11-26 14:00:44 +00:00
|
|
|
void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial);
|
|
|
|
void keyPressed(quint32 key, quint32 serial);
|
|
|
|
void keyReleased(quint32 key, quint32 serial);
|
2015-09-02 14:00:11 +00:00
|
|
|
void repeatInfo(qint32 charactersPerSecond, qint32 delay);
|
2014-11-25 12:39:24 +00:00
|
|
|
friend class SeatInterface;
|
2014-11-26 14:28:47 +00:00
|
|
|
explicit KeyboardInterface(SeatInterface *parent, wl_resource *parentResource);
|
2014-11-25 12:39:24 +00:00
|
|
|
|
|
|
|
class Private;
|
2014-11-26 14:28:47 +00:00
|
|
|
Private *d_func() const;
|
2014-11-25 12:39:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-26 14:00:44 +00:00
|
|
|
Q_DECLARE_METATYPE(KWayland::Server::KeyboardInterface*)
|
|
|
|
|
2014-11-25 12:39:24 +00:00
|
|
|
#endif
|