1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QLIBINPUTHANDLER_P_H
5#define QLIBINPUTHANDLER_P_H
6
7#include <QtCore/QObject>
8#include <QtCore/QScopedPointer>
9#include <QtCore/QMap>
10#include <QtCore/private/qglobal_p.h>
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the Qt API. It exists purely as an
17// implementation detail. This header file may change from version to
18// version without notice, or even be removed.
19//
20// We mean it.
21//
22
23struct udev;
24struct libinput;
25struct libinput_event;
26
27QT_BEGIN_NAMESPACE
28
29class QSocketNotifier;
30class QLibInputPointer;
31class QLibInputKeyboard;
32class QLibInputTouch;
33
34class QLibInputHandler : public QObject
35{
36public:
37 QLibInputHandler(const QString &key, const QString &spec);
38 ~QLibInputHandler();
39
40 void onReadyRead();
41
42private:
43 void processEvent(libinput_event *ev);
44
45 udev *m_udev;
46 libinput *m_li;
47 int m_liFd;
48 QScopedPointer<QSocketNotifier> m_notifier;
49 QScopedPointer<QLibInputPointer> m_pointer;
50 QScopedPointer<QLibInputKeyboard> m_keyboard;
51 QScopedPointer<QLibInputTouch> m_touch;
52 QMap<int, int> m_devCount;
53};
54
55QT_END_NAMESPACE
56
57#endif
58

source code of qtbase/src/platformsupport/input/libinput/qlibinputhandler_p.h