2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2019-12-01 17:51:15 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez <aleixpol@kde.org>
|
2019-12-01 17:51:15 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2019-12-01 17:51:15 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_TABLET_INPUT_H
|
|
|
|
#define KWIN_TABLET_INPUT_H
|
|
|
|
#include "input.h"
|
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
class Toplevel;
|
2020-11-20 01:28:05 +00:00
|
|
|
class TabletToolId;
|
2019-12-01 17:51:15 +00:00
|
|
|
|
|
|
|
namespace Decoration
|
|
|
|
{
|
|
|
|
class DecoratedClientImpl;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace LibInput
|
|
|
|
{
|
|
|
|
class Device;
|
|
|
|
}
|
|
|
|
|
|
|
|
class TabletInputRedirection : public InputDeviceHandler
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TabletInputRedirection(InputRedirection *parent);
|
|
|
|
~TabletInputRedirection() override;
|
|
|
|
|
|
|
|
void tabletPad();
|
2021-11-09 01:49:01 +00:00
|
|
|
bool focusUpdatesBlocked() override;
|
2019-12-01 17:51:15 +00:00
|
|
|
|
|
|
|
void tabletToolEvent(KWin::InputRedirection::TabletEventType type, const QPointF &pos,
|
|
|
|
qreal pressure, int xTilt, int yTilt, qreal rotation, bool tipDown,
|
2020-11-20 01:28:05 +00:00
|
|
|
bool tipNear, const TabletToolId &tabletToolId,
|
|
|
|
quint32 time);
|
|
|
|
void tabletToolButtonEvent(uint button, bool isPressed, const TabletToolId &tabletToolId);
|
2019-12-01 17:51:15 +00:00
|
|
|
|
2020-12-22 16:34:10 +00:00
|
|
|
void tabletPadButtonEvent(uint button, bool isPressed, const TabletPadId &tabletPadId);
|
|
|
|
void tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId);
|
|
|
|
void tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId);
|
2019-12-01 17:51:15 +00:00
|
|
|
|
|
|
|
bool positionValid() const override
|
|
|
|
{
|
|
|
|
return !m_lastPosition.isNull();
|
|
|
|
}
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
QPointF position() const override
|
|
|
|
{
|
|
|
|
return m_lastPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void cleanupDecoration(Decoration::DecoratedClientImpl *old,
|
|
|
|
Decoration::DecoratedClientImpl *now) override;
|
2021-11-09 01:49:01 +00:00
|
|
|
void focusUpdate(Toplevel *focusOld, Toplevel *focusNow) override;
|
2019-12-01 17:51:15 +00:00
|
|
|
|
|
|
|
bool m_tipDown = false;
|
|
|
|
bool m_tipNear = false;
|
|
|
|
|
|
|
|
QPointF m_lastPosition;
|
2021-11-09 01:49:01 +00:00
|
|
|
QMetaObject::Connection m_decorationGeometryConnection;
|
|
|
|
QMetaObject::Connection m_decorationDestroyedConnection;
|
2019-12-01 17:51:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|