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
qeventdispatcher_win_p.h
Go to the documentation of this file.
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QEVENTDISPATCHER_WIN_P_H
6
#
define
QEVENTDISPATCHER_WIN_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
"QtCore/qabstracteventdispatcher.h"
20
#
include
"QtCore/qt_windows.h"
21
#
include
"QtCore/qhash.h"
22
#
include
"QtCore/qatomic.h"
23
24
#
include
"qabstracteventdispatcher_p.h"
25
26
QT_BEGIN_NAMESPACE
27
28
class
QEventDispatcherWin32Private;
29
30
// forward declaration
31
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
32
33
class
Q_CORE_EXPORT
QEventDispatcherWin32
:
public
QAbstractEventDispatcherV2
34
{
35
Q_OBJECT
36
Q_DECLARE_PRIVATE(QEventDispatcherWin32)
37
38
public
:
39
explicit
QEventDispatcherWin32(QObject *parent =
nullptr
);
40
~QEventDispatcherWin32();
41
42
bool
QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override;
43
44
void
registerSocketNotifier(QSocketNotifier *notifier) override;
45
void
unregisterSocketNotifier(QSocketNotifier *notifier) override;
46
47
void
registerTimer(Qt::TimerId timerId, Duration interval, Qt::TimerType timerType,
48
QObject *object) final;
49
bool
unregisterTimer(Qt::TimerId timerId) final;
50
bool
unregisterTimers(QObject *object) final;
51
QList<TimerInfoV2> timersForObject(QObject *object)
const
final;
52
Duration remainingTime(Qt::TimerId timerId)
const
final;
53
54
void
wakeUp() override;
55
void
interrupt() override;
56
57
void
startingUp() override;
58
void
closingDown() override;
59
60
bool
event(QEvent *e) override;
61
62
HWND internalHwnd();
63
64
protected
:
65
QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent =
nullptr
);
66
virtual
void
sendPostedEvents();
67
void
doUnregisterSocketNotifier(QSocketNotifier *notifier);
68
69
private
:
70
friend
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
71
};
72
73
struct
QSockNot
{
74
QSocketNotifier
*
obj
;
75
qintptr
fd
;
76
};
77
typedef
QHash
<
qintptr
,
QSockNot
*>
QSNDict
;
78
79
struct
QSockFd
{
80
long
event
;
81
long
mask
;
82
bool
selected
;
83
84
explicit
inline
QSockFd
(
long
ev = 0,
long
ma = 0) :
event
(ev),
mask
(ma),
selected
(
false
) { }
85
};
86
typedef
QHash
<
qintptr
,
QSockFd
>
QSFDict
;
87
88
struct
WinTimerInfo
{
// internal timer info
89
qint64
interval
;
// - in milliseconds
90
quint64
timeout
;
// - when to actually fire
91
QObject
*
dispatcher
;
92
QObject
*
obj
;
// - object to receive events
93
int
timerId
;
94
Qt
::
TimerType
timerType
;
95
UINT
fastTimerId
;
96
bool
inTimerEvent
;
97
bool
usesExtendedInterval
;
98
bool
isSecondTimeout
;
99
};
100
101
class
QZeroTimerEvent
:
public
QTimerEvent
102
{
103
public
:
104
explicit
inline
QZeroTimerEvent
(
int
timerId)
105
:
QTimerEvent
(
timerId
)
106
{ t = QEvent::ZeroTimerEvent; }
107
};
108
109
typedef
QHash
<
int
,
WinTimerInfo
*>
WinTimerDict
;
// fast dict of timers
110
111
class
Q_CORE_EXPORT
QEventDispatcherWin32Private
:
public
QAbstractEventDispatcherPrivate
112
{
113
Q_DECLARE_PUBLIC(QEventDispatcherWin32)
114
public
:
115
QEventDispatcherWin32Private();
116
~QEventDispatcherWin32Private();
117
118
QAtomicInt interrupt;
119
120
// internal window handle used for socketnotifiers/timers/etc
121
HWND internalHwnd;
122
123
// for controlling when to send posted events
124
UINT_PTR sendPostedEventsTimerId;
125
QAtomicInt wakeUps;
126
void
startPostedEventsTimer();
127
128
// timers
129
WinTimerDict timerDict;
130
void
registerTimer(WinTimerInfo *t);
131
void
unregisterTimer(WinTimerInfo *t);
132
void
sendTimerEvent(
int
timerId);
133
134
// socket notifiers
135
QSNDict sn_read;
136
QSNDict sn_write;
137
QSNDict sn_except;
138
QSFDict active_fd;
139
bool
activateNotifiersPosted;
140
void
postActivateSocketNotifiers();
141
void
doWsaAsyncSelect(qintptr socket,
long
event);
142
143
bool
closingDown =
false
;
144
145
QList<MSG> queuedUserInputEvents;
146
QList<MSG> queuedSocketEvents;
147
};
148
149
QT_END_NAMESPACE
150
151
#
endif
// QEVENTDISPATCHER_WIN_P_H
QEventDispatcherWin32Private
Definition
qeventdispatcher_win_p.h:112
QEventDispatcherWin32
Definition
qeventdispatcher_win_p.h:34
QZeroTimerEvent
Definition
qeventdispatcher_win_p.h:102
QZeroTimerEvent::QZeroTimerEvent
QZeroTimerEvent(int timerId)
Definition
qeventdispatcher_win_p.h:104
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qt_create_internal_window
static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatcher)
Definition
qeventdispatcher_win.cpp:278
qt_msectime
static quint64 qt_msectime()
Definition
qeventdispatcher_win.cpp:61
TIME_KILL_SYNCHRONOUS
#define TIME_KILL_SYNCHRONOUS
Definition
qeventdispatcher_win.cpp:24
WM_GESTURE
#define WM_GESTURE
Definition
qeventdispatcher_win.cpp:36
SendPostedEventsTimerId
@ SendPostedEventsTimerId
Definition
qeventdispatcher_win.cpp:50
WM_GESTURENOTIFY
#define WM_GESTURENOTIFY
Definition
qeventdispatcher_win.cpp:39
DWORD_PTR
#define DWORD_PTR
Definition
qeventdispatcher_win.cpp:56
WM_QT_ACTIVATENOTIFIERS
@ WM_QT_ACTIVATENOTIFIERS
Definition
qeventdispatcher_win.cpp:46
WM_QT_SOCKETNOTIFIER
@ WM_QT_SOCKETNOTIFIER
Definition
qeventdispatcher_win.cpp:44
WM_QT_SENDPOSTEDEVENTS
@ WM_QT_SENDPOSTEDEVENTS
Definition
qeventdispatcher_win.cpp:45
WM_TOUCH
#define WM_TOUCH
Definition
qeventdispatcher_win.cpp:32
isUserInputMessage
static bool isUserInputMessage(UINT message)
Definition
qeventdispatcher_win.cpp:463
calculateNextTimeout
static ULONG calculateNextTimeout(WinTimerInfo *t, quint64 currentTime)
Definition
qeventdispatcher_win.cpp:302
QSFDict
QHash< qintptr, QSockFd > QSFDict
Definition
qeventdispatcher_win_p.h:86
WinTimerDict
QHash< int, WinTimerInfo * > WinTimerDict
Definition
qeventdispatcher_win_p.h:109
QSNDict
QHash< qintptr, QSockNot * > QSNDict
Definition
qeventdispatcher_win_p.h:77
QSockFd
Definition
qeventdispatcher_win_p.h:79
QSockFd::selected
bool selected
Definition
qeventdispatcher_win_p.h:82
QSockFd::event
long event
Definition
qeventdispatcher_win_p.h:80
QSockFd::mask
long mask
Definition
qeventdispatcher_win_p.h:81
QSockFd::QSockFd
QSockFd(long ev=0, long ma=0)
Definition
qeventdispatcher_win_p.h:84
QSockNot
Definition
qeventdispatcher_win_p.h:73
QSockNot::fd
qintptr fd
Definition
qeventdispatcher_win_p.h:75
QSockNot::obj
QSocketNotifier * obj
Definition
qeventdispatcher_win_p.h:74
QWindowsMessageWindowClassContext
Definition
qeventdispatcher_win.cpp:231
QWindowsMessageWindowClassContext::~QWindowsMessageWindowClassContext
~QWindowsMessageWindowClassContext()
Definition
qeventdispatcher_win.cpp:268
QWindowsMessageWindowClassContext::atom
ATOM atom
Definition
qeventdispatcher_win.cpp:235
QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext
QWindowsMessageWindowClassContext()
Definition
qeventdispatcher_win.cpp:239
QWindowsMessageWindowClassContext::className
wchar_t * className
Definition
qeventdispatcher_win.cpp:236
WinTimerInfo
Definition
qeventdispatcher_win_p.h:88
WinTimerInfo::inTimerEvent
bool inTimerEvent
Definition
qeventdispatcher_win_p.h:96
WinTimerInfo::interval
qint64 interval
Definition
qeventdispatcher_win_p.h:89
WinTimerInfo::timerType
Qt::TimerType timerType
Definition
qeventdispatcher_win_p.h:94
WinTimerInfo::timeout
quint64 timeout
Definition
qeventdispatcher_win_p.h:90
WinTimerInfo::isSecondTimeout
bool isSecondTimeout
Definition
qeventdispatcher_win_p.h:98
WinTimerInfo::obj
QObject * obj
Definition
qeventdispatcher_win_p.h:92
WinTimerInfo::timerId
int timerId
Definition
qeventdispatcher_win_p.h:93
WinTimerInfo::dispatcher
QObject * dispatcher
Definition
qeventdispatcher_win_p.h:91
WinTimerInfo::usesExtendedInterval
bool usesExtendedInterval
Definition
qeventdispatcher_win_p.h:97
WinTimerInfo::fastTimerId
UINT fastTimerId
Definition
qeventdispatcher_win_p.h:95
qtbase
src
corelib
kernel
qeventdispatcher_win_p.h
Generated on
for Qt by
1.18.0