| 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 | |
| 23 | struct udev; |
| 24 | struct libinput; |
| 25 | struct libinput_event; |
| 26 | |
| 27 | QT_BEGIN_NAMESPACE |
| 28 | |
| 29 | class QSocketNotifier; |
| 30 | class QLibInputPointer; |
| 31 | class QLibInputKeyboard; |
| 32 | class QLibInputTouch; |
| 33 | |
| 34 | class QLibInputHandler : public QObject |
| 35 | { |
| 36 | public: |
| 37 | QLibInputHandler(const QString &key, const QString &spec); |
| 38 | ~QLibInputHandler(); |
| 39 | |
| 40 | void onReadyRead(); |
| 41 | |
| 42 | private: |
| 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 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif |
| 58 | |