Move QEventDispatcherCoreFoundation to QtCore
Export it for use by the iOS platform plugin. Also move QCFSocketNotifier, and export for use by the Cocoa platform plugin. This is a pure code move with no intended behavior changes, in anticipation of using the Core Foundation event dispatcher as the default Qt Core event dispatcher on OS X. Change-Id: I43677d2f6f3c1d0ed0415c964225aa97d2f13078 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
40b4c305d8
commit
c751cef8d6
@ -100,9 +100,11 @@ winrt {
|
||||
|
||||
mac {
|
||||
HEADERS += \
|
||||
kernel/qcfsocketnotifier_p.h \
|
||||
kernel/qcore_mac_p.h
|
||||
|
||||
SOURCES += \
|
||||
kernel/qcfsocketnotifier.cpp \
|
||||
kernel/qcoreapplication_mac.cpp \
|
||||
kernel/qcore_mac.cpp
|
||||
|
||||
@ -113,8 +115,15 @@ mac {
|
||||
|
||||
osx: LIBS_PRIVATE += -framework CoreServices
|
||||
|
||||
# We need UIKit for UIDevice
|
||||
ios: LIBS_PRIVATE += -framework UIKit
|
||||
ios {
|
||||
OBJECTIVE_SOURCES += \
|
||||
kernel/qeventdispatcher_cf.mm
|
||||
HEADERS += \
|
||||
kernel/qeventdispatcher_cf_p.h
|
||||
|
||||
# We need UIKit for UIDevice
|
||||
LIBS_PRIVATE += -framework UIKit
|
||||
}
|
||||
}
|
||||
|
||||
nacl {
|
||||
|
@ -3,7 +3,7 @@
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
@ -32,7 +32,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qcfsocketnotifier_p.h"
|
||||
#include <QtGui/qguiapplication.h>
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
#include <QtCore/qsocketnotifier.h>
|
||||
#include <QtCore/qthread.h>
|
||||
|
||||
@ -57,12 +57,12 @@ void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CF
|
||||
if (callbackType == kCFSocketReadCallBack) {
|
||||
if (socketInfo->readNotifier && socketInfo->readEnabled) {
|
||||
socketInfo->readEnabled = false;
|
||||
QGuiApplication::sendEvent(socketInfo->readNotifier, ¬ifierEvent);
|
||||
QCoreApplication::sendEvent(socketInfo->readNotifier, ¬ifierEvent);
|
||||
}
|
||||
} else if (callbackType == kCFSocketWriteCallBack) {
|
||||
if (socketInfo->writeNotifier && socketInfo->writeEnabled) {
|
||||
socketInfo->writeEnabled = false;
|
||||
QGuiApplication::sendEvent(socketInfo->writeNotifier, ¬ifierEvent);
|
||||
QCoreApplication::sendEvent(socketInfo->writeNotifier, ¬ifierEvent);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
@ -75,7 +75,7 @@ typedef void (*MaybeCancelWaitForMoreEventsFn)(QAbstractEventDispatcher *hostEve
|
||||
// setHostEventDispatcher() should be called at startup.
|
||||
// removeSocketNotifiers() should be called at shutdown.
|
||||
//
|
||||
class QCFSocketNotifier
|
||||
class Q_CORE_EXPORT QCFSocketNotifier
|
||||
{
|
||||
public:
|
||||
QCFSocketNotifier();
|
@ -3,7 +3,7 @@
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
@ -3,7 +3,7 @@
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
@ -83,8 +83,8 @@
|
||||
|
||||
#include <QtCore/qabstracteventdispatcher.h>
|
||||
#include <QtCore/private/qtimerinfo_unix_p.h>
|
||||
#include <QtCore/private/qcfsocketnotifier_p.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#ifdef __OBJC__
|
||||
@ -196,7 +196,7 @@ private:
|
||||
CFRunLoopObserverRef m_observer;
|
||||
};
|
||||
|
||||
class QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
|
||||
class Q_CORE_EXPORT QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -1,4 +0,0 @@
|
||||
mac {
|
||||
HEADERS += $$PWD/qcfsocketnotifier_p.h
|
||||
SOURCES += $$PWD/qcfsocketnotifier.cpp
|
||||
}
|
@ -8,14 +8,6 @@ HEADERS +=\
|
||||
$$PWD/qgenericunixeventdispatcher_p.h\
|
||||
}
|
||||
|
||||
ios {
|
||||
OBJECTIVE_SOURCES +=\
|
||||
$$PWD/qeventdispatcher_cf.mm
|
||||
|
||||
HEADERS +=\
|
||||
$$PWD/qeventdispatcher_cf_p.h
|
||||
}
|
||||
|
||||
contains(QT_CONFIG, glib) {
|
||||
SOURCES +=$$PWD/qeventdispatcher_glib.cpp
|
||||
HEADERS +=$$PWD/qeventdispatcher_glib_p.h
|
||||
|
@ -7,7 +7,6 @@ mac:LIBS_PRIVATE += -lz
|
||||
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
|
||||
|
||||
include(cfsocketnotifier/cfsocketnotifier.pri)
|
||||
include(cglconvenience/cglconvenience.pri)
|
||||
include(eglconvenience/eglconvenience.pri)
|
||||
include(eventdispatchers/eventdispatchers.pri)
|
||||
|
@ -83,8 +83,8 @@
|
||||
#include <QtCore/qstack.h>
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
||||
#include <QtCore/private/qcfsocketnotifier_p.h>
|
||||
#include <QtCore/private/qtimerinfo_unix_p.h>
|
||||
#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#ifndef QIOSEVENTDISPATCHER_H
|
||||
#define QIOSEVENTDISPATCHER_H
|
||||
|
||||
#include <QtPlatformSupport/private/qeventdispatcher_cf_p.h>
|
||||
#include <QtCore/private/qeventdispatcher_cf_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user