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
qvxtouchhandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QVXTOUCHHANDLER_P_H
5#define QVXTOUCHHANDLER_P_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#include <QString>
21#include <QList>
22#include <QHash>
23#include <QThread>
24#include <QLoggingCategory>
25#include <QtCore/private/qthread_p.h>
26#include <qpa/qwindowsysteminterface.h>
27#include <QtInputSupport/private/qtouchfilter_p.h>
28
30
32
33class QSocketNotifier;
34class QPointingDevice;
35class QVxTouchScreenData;
37
39{
41
42public:
43 explicit QVxTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
45
46 QPointingDevice *touchDevice() const;
47
48 bool isFiltered() const;
49
50 void readData();
51
54
55private:
56 friend class QVxTouchScreenData;
58
59 void registerPointingDevice();
60 void unregisterPointingDevice();
61
62 QSocketNotifier *m_notify;
63 int m_fd;
64 QVxTouchScreenData *d;
65 QPointingDevice *m_device;
66};
67
69{
71public:
72 explicit QVxTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
74 void run() override;
75
76 bool isPointingDeviceRegistered() const;
77
78 bool eventFilter(QObject *object, QEvent *event) override;
79
81
84
85private:
86 Q_INVOKABLE void notifyTouchDeviceRegistered();
87
88 void filterAndSendTouchPoints();
89 QRect targetScreenGeometry() const;
90
91 QString m_device;
92 QString m_spec;
93 QVxTouchScreenHandler *m_handler;
94 bool m_touchDeviceRegistered;
95
96 bool m_touchUpdatePending;
97 QWindow *m_filterWindow;
98
99 struct FilteredTouchPoint {
100 QTouchFilter x;
101 QTouchFilter y;
102 QWindowSystemInterface::TouchPoint touchPoint;
103 };
104 QHash<int, FilteredTouchPoint> m_filteredPoints;
105
106 float m_touchRate;
107};
108
109QT_END_NAMESPACE
110
111#endif // QVXTOUCHHANDLER_P_H
static QOutputMapping * get()
virtual bool load()
bool eventFilter(QObject *object, QEvent *event) override
QPointingDevice * touchDevice() const
#define ABS_MT_POSITION_X
#define LONG_BITS
#define ABS_MT_POSITION_Y
#define input_event_usec
#define input_event_sec
#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 ABS_MAX
#define EV_KEY
#define ABS_X
EV_DEV_EVENT input_event
#define EV_SYN