Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
)
32
struct
mtdev;
33
#
endif
34
35
QT_BEGIN_NAMESPACE
36
37
Q_DECLARE_LOGGING_CATEGORY
(
qLcEvdevTouch
)
38
39
class
QSocketNotifier;
40
class
QEvdevTouchScreenData;
41
class
QPointingDevice;
42
43
class
QEvdevTouchScreenHandler
:
public
QObject
44
{
45
Q_OBJECT
46
47
public
:
48
explicit
QEvdevTouchScreenHandler
(
const
QString
&
device
,
const
QString
&
spec
=
QString
(),
QObject
*
parent
=
nullptr
);
49
~
QEvdevTouchScreenHandler
();
50
51
QPointingDevice *
touchDevice
()
const
;
52
53
bool
isFiltered
()
const
;
54
55
void
readData
();
56
57
signals
:
58
void
touchPointsUpdated
();
59
60
private
:
61
friend
class
QEvdevTouchScreenData;
62
friend
class
QEvdevTouchScreenHandlerThread
;
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
)
72
mtdev
*
m_mtdev
;
73
#
endif
74
};
75
76
class
QEvdevTouchScreenHandlerThread
:
public
QDaemonThread
77
{
78
Q_OBJECT
79
public
:
80
explicit
QEvdevTouchScreenHandlerThread
(
const
QString
&
device
,
const
QString
&
spec
,
QObject
*
parent
=
nullptr
);
81
~
QEvdevTouchScreenHandlerThread
();
82
void
run
()
override
;
83
84
bool
isPointingDeviceRegistered
()
const
;
85
86
bool
eventFilter
(QObject *object, QEvent *event)
override
;
87
88
void
scheduleTouchPointUpdate
();
89
90
signals
:
91
void
touchDeviceRegistered
();
92
93
private
:
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
117
QT_END_NAMESPACE
118
119
#
endif
// QEVDEVTOUCH_P_H
QEvdevTouchScreenHandlerThread
Definition
qevdevtouchhandler_p.h:77
QEvdevTouchScreenHandlerThread::eventFilter
bool eventFilter(QObject *object, QEvent *event) override
Definition
qevdevtouchhandler.cpp:1042
QEvdevTouchScreenHandlerThread::run
void run() override
Definition
qevdevtouchhandler.cpp:999
QEvdevTouchScreenHandlerThread::scheduleTouchPointUpdate
void scheduleTouchPointUpdate()
Definition
qevdevtouchhandler.cpp:1026
QEvdevTouchScreenHandlerThread::isPointingDeviceRegistered
bool isPointingDeviceRegistered() const
Definition
qevdevtouchhandler.cpp:1015
QEvdevTouchScreenHandlerThread::~QEvdevTouchScreenHandlerThread
~QEvdevTouchScreenHandlerThread()
Definition
qevdevtouchhandler.cpp:993
QEvdevTouchScreenHandler
Definition
qevdevtouchhandler_p.h:44
QEvdevTouchScreenHandler::touchDevice
QPointingDevice * touchDevice() const
Definition
qevdevtouchhandler.cpp:364
QEvdevTouchScreenHandler::isFiltered
bool isFiltered() const
Definition
qevdevtouchhandler.cpp:359
QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler
~QEvdevTouchScreenHandler()
Definition
qevdevtouchhandler.cpp:342
QEvdevTouchScreenHandler::readData
void readData()
Definition
qevdevtouchhandler.cpp:369
QOutputMapping
Definition
qoutputmapping_p.h:27
QOutputMapping::get
static QOutputMapping * get()
Definition
qoutputmapping.cpp:18
QOutputMapping::load
virtual bool load()
Definition
qoutputmapping.cpp:26
ABS_CNT
#define ABS_CNT
Definition
qdevicediscovery_static.cpp:31
ABS_MT_POSITION_X
#define ABS_MT_POSITION_X
Definition
qdevicediscovery_static.cpp:34
LONG_BITS
#define LONG_BITS
Definition
qdevicediscovery_static.cpp:40
ABS_MT_POSITION_Y
#define ABS_MT_POSITION_Y
Definition
qdevicediscovery_static.cpp:37
input_event_usec
#define input_event_usec
Definition
qevdevkeyboardhandler.cpp:31
input_event_sec
#define input_event_sec
Definition
qevdevkeyboardhandler.cpp:27
ABS_MT_PRESSURE
#define ABS_MT_PRESSURE
Definition
qevdevtouchhandler.cpp:73
NUM_LONGS
#define NUM_LONGS(bits)
Definition
qevdevtouchhandler.cpp:173
SYN_MT_REPORT
#define SYN_MT_REPORT
Definition
qevdevtouchhandler.cpp:76
ABS_MT_SLOT
#define ABS_MT_SLOT
Definition
qevdevtouchhandler.cpp:64
ABS_MT_TRACKING_ID
#define ABS_MT_TRACKING_ID
Definition
qevdevtouchhandler.cpp:70
ABS_MT_TOUCH_MAJOR
#define ABS_MT_TOUCH_MAJOR
Definition
qevdevtouchhandler.cpp:55
Q_LOGGING_CATEGORY
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
Q_DECLARE_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
SYN_REPORT
#define SYN_REPORT
Definition
qvxtouchhandler.cpp:23
BTN_TOUCH
#define BTN_TOUCH
Definition
qvxtouchhandler.cpp:29
EV_ABS
#define EV_ABS
Definition
qvxtouchhandler.cpp:26
ABS_Y
#define ABS_Y
Definition
qvxtouchhandler.cpp:28
EV_KEY
#define EV_KEY
Definition
qvxtouchhandler.cpp:25
ABS_X
#define ABS_X
Definition
qvxtouchhandler.cpp:27
EV_SYN
#define EV_SYN
Definition
qvxtouchhandler.cpp:24
qtbase
src
platformsupport
input
evdevtouch
qevdevtouchhandler_p.h
Generated on
for Qt by
1.18.0