Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 <QtCore/private/qthread_p.h>
27#include <qpa/qwindowsysteminterface.h>
28#include "qevdevtouchfilter_p.h"
29
30#if QT_CONFIG(mtdev)
31struct mtdev;
32#endif
33
35
36class QSocketNotifier;
38class QPointingDevice;
39
41{
43
44public:
45 explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
47
49
50 bool isFiltered() const;
51
52 void readData();
53
56
57private:
60
61 void registerPointingDevice();
62 void unregisterPointingDevice();
63
64 QSocketNotifier *m_notify;
65 int m_fd;
67 QPointingDevice *m_device;
68#if QT_CONFIG(mtdev)
69 mtdev *m_mtdev;
70#endif
71};
72
73class QEvdevTouchScreenHandlerThread : public QDaemonThread
74{
76public:
77 explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
79 void run() override;
80
81 bool isPointingDeviceRegistered() const;
82
83 bool eventFilter(QObject *object, QEvent *event) override;
84
86
89
90private:
91 Q_INVOKABLE void notifyTouchDeviceRegistered();
92
93 void filterAndSendTouchPoints();
94 QRect targetScreenGeometry() const;
95
96 QString m_device;
97 QString m_spec;
98 QEvdevTouchScreenHandler *m_handler;
99 bool m_touchDeviceRegistered;
100
101 bool m_touchUpdatePending;
102 QWindow *m_filterWindow;
103
104 struct FilteredTouchPoint {
108 };
109 QHash<int, FilteredTouchPoint> m_filteredPoints;
110
111 float m_touchRate;
112};
113
115
116#endif // QEVDEVTOUCH_P_H
IOBluetoothDevice * device
bool eventFilter(QObject *object, QEvent *event) override
QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent=nullptr)
QPointingDevice * touchDevice() const
QEvdevTouchScreenHandler(const QString &device, const QString &spec=QString(), QObject *parent=nullptr)
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint x
[0]
GLint y
struct _cl_event * event
#define Q_OBJECT
#define Q_INVOKABLE
#define signals