kwin/src/wayland/keyboard_interface.h

54 lines
1.4 KiB
C
Raw Normal View History

/*
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef WAYLAND_SERVER_KEYBOARD_INTERFACE_H
#define WAYLAND_SERVER_KEYBOARD_INTERFACE_H
2020-04-29 14:56:38 +00:00
#include <KWaylandServer/kwaylandserver_export.h>
2014-11-26 14:28:47 +00:00
#include "resource.h"
2020-04-29 14:56:38 +00:00
namespace KWaylandServer
{
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
{
Q_OBJECT
public:
virtual ~KeyboardInterface();
2015-09-09 11:49:58 +00:00
/**
* @returns the focused SurfaceInterface on this keyboard resource, if any.
**/
SurfaceInterface *focusedSurface() const;
private:
void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
void setKeymap(int fd, quint32 size);
void setKeymap(const QByteArray &content);
void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial);
void keyPressed(quint32 key, quint32 serial);
void keyReleased(quint32 key, quint32 serial);
void repeatInfo(qint32 charactersPerSecond, qint32 delay);
friend class SeatInterface;
2014-11-26 14:28:47 +00:00
explicit KeyboardInterface(SeatInterface *parent, wl_resource *parentResource);
class Private;
2014-11-26 14:28:47 +00:00
Private *d_func() const;
};
}
2020-04-29 14:56:38 +00:00
Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface*)
#endif