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 QFBVTHANDLER_H |
5 | #define QFBVTHANDLER_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtGui/private/qtguiglobal_p.h> |
19 | #include <QObject> |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class QSocketNotifier; |
24 | |
25 | class QFbVtHandler : public QObject |
26 | { |
27 | Q_OBJECT |
28 | |
29 | public: |
30 | QFbVtHandler(QObject *parent = nullptr); |
31 | ~QFbVtHandler(); |
32 | |
33 | signals: |
34 | void interrupted(); |
35 | void aboutToSuspend(); |
36 | void resumed(); |
37 | |
38 | private slots: |
39 | void handleSignal(); |
40 | |
41 | private: |
42 | void setKeyboardEnabled(bool enable); |
43 | void handleInt(); |
44 | static void signalHandler(int sigNo); |
45 | |
46 | int m_tty; |
47 | int m_oldKbdMode; |
48 | int m_sigFd[2]; |
49 | QSocketNotifier *m_signalNotifier; |
50 | }; |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif |
55 | |