QEventDispatcherWin32: remove tailings of Windows CE code
It was automatically merged from 5.6 branch. Qt 5.8 does not support Windows CE. Change-Id: I6968f50ef568035c224851d595d6c057128491a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
dfd7a0e411
commit
3b8f3fb327
@ -96,9 +96,7 @@ QEventDispatcherWin32Private::QEventDispatcherWin32Private()
|
|||||||
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
|
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
|
||||||
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
|
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
|
||||||
wakeUps(0)
|
wakeUps(0)
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
, activateNotifiersPosted(false)
|
, activateNotifiersPosted(false)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,11 +177,9 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
|
|
||||||
QSockNot *sn = dict ? dict->value(wp) : 0;
|
QSockNot *sn = dict ? dict->value(wp) : 0;
|
||||||
if (sn) {
|
if (sn) {
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
d->doWsaAsyncSelect(sn->fd, 0);
|
d->doWsaAsyncSelect(sn->fd, 0);
|
||||||
d->active_fd[sn->fd].selected = false;
|
d->active_fd[sn->fd].selected = false;
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
#endif
|
|
||||||
if (type < 3) {
|
if (type < 3) {
|
||||||
QEvent event(QEvent::SockAct);
|
QEvent event(QEvent::SockAct);
|
||||||
QCoreApplication::sendEvent(sn->obj, &event);
|
QCoreApplication::sendEvent(sn->obj, &event);
|
||||||
@ -194,7 +190,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
} else if (message == WM_QT_ACTIVATENOTIFIERS) {
|
} else if (message == WM_QT_ACTIVATENOTIFIERS) {
|
||||||
Q_ASSERT(d != 0);
|
Q_ASSERT(d != 0);
|
||||||
|
|
||||||
@ -209,7 +204,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
}
|
}
|
||||||
d->activateNotifiersPosted = false;
|
d->activateNotifiersPosted = false;
|
||||||
return 0;
|
return 0;
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
} else if (message == WM_QT_SENDPOSTEDEVENTS
|
} else if (message == WM_QT_SENDPOSTEDEVENTS
|
||||||
// we also use a Windows timer to send posted events when the message queue is full
|
// we also use a Windows timer to send posted events when the message queue is full
|
||||||
|| (message == WM_TIMER
|
|| (message == WM_TIMER
|
||||||
@ -444,13 +438,11 @@ void QEventDispatcherWin32Private::doWsaAsyncSelect(int socket, long event)
|
|||||||
WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
|
WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
void QEventDispatcherWin32Private::postActivateSocketNotifiers()
|
void QEventDispatcherWin32Private::postActivateSocketNotifiers()
|
||||||
{
|
{
|
||||||
if (!activateNotifiersPosted)
|
if (!activateNotifiersPosted)
|
||||||
activateNotifiersPosted = PostMessage(internalHwnd, WM_QT_ACTIVATENOTIFIERS, 0, 0);
|
activateNotifiersPosted = PostMessage(internalHwnd, WM_QT_ACTIVATENOTIFIERS, 0, 0);
|
||||||
}
|
}
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
|
|
||||||
void QEventDispatcherWin32::createInternalHwnd()
|
void QEventDispatcherWin32::createInternalHwnd()
|
||||||
{
|
{
|
||||||
@ -704,22 +696,16 @@ void QEventDispatcherWin32::registerSocketNotifier(QSocketNotifier *notifier)
|
|||||||
QSFDict::iterator it = d->active_fd.find(sockfd);
|
QSFDict::iterator it = d->active_fd.find(sockfd);
|
||||||
if (it != d->active_fd.end()) {
|
if (it != d->active_fd.end()) {
|
||||||
QSockFd &sd = it.value();
|
QSockFd &sd = it.value();
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
if (sd.selected) {
|
if (sd.selected) {
|
||||||
d->doWsaAsyncSelect(sockfd, 0);
|
d->doWsaAsyncSelect(sockfd, 0);
|
||||||
sd.selected = false;
|
sd.selected = false;
|
||||||
}
|
}
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
sd.event |= event;
|
sd.event |= event;
|
||||||
} else {
|
} else {
|
||||||
d->active_fd.insert(sockfd, QSockFd(event));
|
d->active_fd.insert(sockfd, QSockFd(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
#else
|
|
||||||
d->doWsaAsyncSelect(sockfd, event);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
|
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
|
||||||
@ -748,7 +734,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
|
|||||||
QSFDict::iterator it = d->active_fd.find(sockfd);
|
QSFDict::iterator it = d->active_fd.find(sockfd);
|
||||||
if (it != d->active_fd.end()) {
|
if (it != d->active_fd.end()) {
|
||||||
QSockFd &sd = it.value();
|
QSockFd &sd = it.value();
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
if (sd.selected)
|
if (sd.selected)
|
||||||
d->doWsaAsyncSelect(sockfd, 0);
|
d->doWsaAsyncSelect(sockfd, 0);
|
||||||
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
||||||
@ -759,13 +744,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
|
|||||||
sd.selected = false;
|
sd.selected = false;
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
|
||||||
sd.event ^= event[type];
|
|
||||||
d->doWsaAsyncSelect(sockfd, sd.event);
|
|
||||||
if (sd.event == 0)
|
|
||||||
d->active_fd.erase(it);
|
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
|
QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
|
||||||
|
@ -185,10 +185,8 @@ public:
|
|||||||
QSNDict sn_write;
|
QSNDict sn_write;
|
||||||
QSNDict sn_except;
|
QSNDict sn_except;
|
||||||
QSFDict active_fd;
|
QSFDict active_fd;
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
bool activateNotifiersPosted;
|
bool activateNotifiersPosted;
|
||||||
void postActivateSocketNotifiers();
|
void postActivateSocketNotifiers();
|
||||||
#endif
|
|
||||||
void doWsaAsyncSelect(int socket, long event);
|
void doWsaAsyncSelect(int socket, long event);
|
||||||
|
|
||||||
QList<QWinEventNotifier *> winEventNotifierList;
|
QList<QWinEventNotifier *> winEventNotifierList;
|
||||||
|
Loading…
Reference in New Issue
Block a user