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
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
4#ifndef QEVENTDISPATCHER_WIN_P_H
5#define QEVENTDISPATCHER_WIN_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 "QtCore/qabstracteventdispatcher.h"
19#include "QtCore/qt_windows.h"
20#include "QtCore/qhash.h"
21#include "QtCore/qatomic.h"
22
24
26
28
29// forward declaration
30LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
31
33{
35 Q_DECLARE_PRIVATE(QEventDispatcherWin32)
36
37public:
38 explicit QEventDispatcherWin32(QObject *parent = nullptr);
40
41 bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override;
42
43 void registerSocketNotifier(QSocketNotifier *notifier) override;
44 void unregisterSocketNotifier(QSocketNotifier *notifier) override;
45
46 void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) override;
47 bool unregisterTimer(int timerId) override;
48 bool unregisterTimers(QObject *object) override;
49 QList<TimerInfo> registeredTimers(QObject *object) const override;
50
51 int remainingTime(int timerId) override;
52
53 void wakeUp() override;
54 void interrupt() override;
55
56 void startingUp() override;
57 void closingDown() override;
58
59 bool event(QEvent *e) override;
60
61 HWND internalHwnd();
62
63protected:
65 virtual void sendPostedEvents();
66 void doUnregisterSocketNotifier(QSocketNotifier *notifier);
67
68private:
69 friend LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
70};
71
76typedef QHash<qintptr, QSockNot *> QSNDict;
77
78struct QSockFd {
79 long event;
80 long mask;
82
83 explicit inline QSockFd(long ev = 0, long ma = 0) : event(ev), mask(ma), selected(false) { }
84};
85typedef QHash<qintptr, QSockFd> QSFDict;
86
87struct WinTimerInfo { // internal timer info
92 quint64 timeout; // - when to actually fire
93 QObject *obj; // - object to receive events
96};
97
99{
100public:
101 explicit inline QZeroTimerEvent(int timerId)
104};
105
106typedef QHash<int, WinTimerInfo*> WinTimerDict; // fast dict of timers
107
109{
110 Q_DECLARE_PUBLIC(QEventDispatcherWin32)
111public:
114
116
117 // internal window handle used for socketnotifiers/timers/etc
119
120 // for controlling when to send posted events
123 void startPostedEventsTimer();
124
125 // timers
127 void registerTimer(WinTimerInfo *t);
128 void unregisterTimer(WinTimerInfo *t);
129 void sendTimerEvent(int timerId);
130
131 // socket notifiers
137 void postActivateSocketNotifiers();
138 void doWsaAsyncSelect(qintptr socket, long event);
139
140 bool closingDown = false;
141
144};
145
147
148#endif // QEVENTDISPATCHER_WIN_P_H
DarwinBluetooth::LECBManagerNotifier * notifier
\inmodule QtCore
Definition qatomic.h:112
\inmodule QtCore
Definition qcoreevent.h:45
@ ZeroTimerEvent
Definition qcoreevent.h:187
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:366
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
Definition qcoreevent.h:370
Combined button and popup list for selecting options.
TimerType
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
QHash< qintptr, QSockFd > QSFDict
QHash< int, WinTimerInfo * > WinTimerDict
QHash< qintptr, QSockNot * > QSNDict
GLbitfield flags
GLuint GLsizei const GLchar * message
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
struct _cl_event * event
GLdouble GLdouble t
Definition qopenglext.h:243
#define Q_OBJECT
unsigned long long quint64
Definition qtypes.h:61
long long qint64
Definition qtypes.h:60
ptrdiff_t qintptr
Definition qtypes.h:166
QTcpSocket * socket
[1]
QSockFd(long ev=0, long ma=0)
QSocketNotifier * obj
Qt::TimerType timerType