Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qevdevtouchhandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QEVDEVTOUCHHANDLER_P_H
6#define QEVDEVTOUCHHANDLER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19//#include <QtGui/qpointingdevice.h>
20#include <QtGui/private/qtguiglobal_p.h>
21#include <QObject>
22#include <QString>
23#include <QList>
24#include <QHash>
25#include <QThread>
26#include <QLoggingCategory>
27#include <QtCore/private/qthread_p.h>
28#include <qpa/qwindowsysteminterface.h>
29#include <QtInputSupport/private/qtouchfilter_p.h>
30
31#if QT_CONFIG(mtdev)
32struct mtdev;
33#endif
34
36
38
39class QSocketNotifier;
40class QEvdevTouchScreenData;
41class QPointingDevice;
42
44{
46
47public:
48 explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
50
51 QPointingDevice *touchDevice() const;
52
53 bool isFiltered() const;
54
55 void readData();
56
59
60private:
61 friend class QEvdevTouchScreenData;
63
64 void registerPointingDevice();
65 void unregisterPointingDevice();
66
67 QSocketNotifier *m_notify;
68 int m_fd;
69 QEvdevTouchScreenData *d;
70 QPointingDevice *m_device;
71#if QT_CONFIG(mtdev)
73#endif
74};
75
77{
79public:
80 explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
82 void run() override;
83
84 bool isPointingDeviceRegistered() const;
85
86 bool eventFilter(QObject *object, QEvent *event) override;
87
89
92
93private:
94 Q_INVOKABLE void notifyTouchDeviceRegistered();
95
96 void filterAndSendTouchPoints();
97 QRect targetScreenGeometry() const;
98
99 QString m_device;
100 QString m_spec;
101 QEvdevTouchScreenHandler *m_handler;
102 bool m_touchDeviceRegistered;
103
104 bool m_touchUpdatePending;
105 QWindow *m_filterWindow;
106
107 struct FilteredTouchPoint {
108 QTouchFilter x;
109 QTouchFilter y;
110 QWindowSystemInterface::TouchPoint touchPoint;
111 };
112 QHash<int, FilteredTouchPoint> m_filteredPoints;
113
114 float m_touchRate;
115};
116
117QT_END_NAMESPACE
118
119#endif // QEVDEVTOUCH_P_H
bool eventFilter(QObject *object, QEvent *event) override
QPointingDevice * touchDevice() const
static QOutputMapping * get()
virtual bool load()
#define ABS_CNT
#define ABS_MT_POSITION_X
#define LONG_BITS
#define ABS_MT_POSITION_Y
#define input_event_usec
#define input_event_sec
#define ABS_MT_PRESSURE
#define NUM_LONGS(bits)
#define SYN_MT_REPORT
#define ABS_MT_SLOT
#define ABS_MT_TRACKING_ID
#define ABS_MT_TOUCH_MAJOR
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
#define SYN_REPORT
#define BTN_TOUCH
#define EV_ABS
#define ABS_Y
#define EV_KEY
#define ABS_X
#define EV_SYN