diff options
author | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-06-30 13:18:57 +0200 |
---|---|---|
committer | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-10-13 22:57:12 +0000 |
commit | b63c3d4d9a8917a84cf24439a0f75a17df0aafee (patch) | |
tree | 51503e1d3fa91bf9772f3ddea12bf26702f0fbe4 /src/platformsupport/eventdispatchers | |
parent | 967e4f258cd39991fd2d0ac3753544900d51fbc2 (diff) |
Make the CoreFoundation event dispatcher depend on QtCore only
In anticipation of moving it to QtCore.
The call to QWindowSystemInterface::sendWindowSystemEvents() has been
moved to QIOSEventDispatcher by making processPostedEvents() virtual.
Change-Id: I9e03be4153a9f5f34e9a0ac942cdff572a44c318
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eventdispatchers')
-rw-r--r-- | src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm | 12 | ||||
-rw-r--r-- | src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h | 30 |
2 files changed, 20 insertions, 22 deletions
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm index 13b7dc4358..0273fe5ed4 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm @@ -41,8 +41,6 @@ #include <QtCore/private/qcore_mac_p.h> #include <QtCore/private/qthread_p.h> -#include <qpa/qwindowsysteminterface.h> - #include <limits> #include <UIKit/UIApplication.h> @@ -169,6 +167,7 @@ static const CFTimeInterval kCFTimeIntervalDistantFuture = std::numeric_limits<C QEventDispatcherCoreFoundation::QEventDispatcherCoreFoundation(QObject *parent) : QAbstractEventDispatcher(parent) + , m_processEvents(QEventLoop::EventLoopExec) , m_postedEventsRunLoopSource(this, &QEventDispatcherCoreFoundation::processPostedEvents) , m_runLoopActivityObserver(this, &QEventDispatcherCoreFoundation::handleRunLoopActivity, #if DEBUG_EVENT_DISPATCHER @@ -181,7 +180,6 @@ QEventDispatcherCoreFoundation::QEventDispatcherCoreFoundation(QObject *parent) , m_runLoopTimer(0) , m_blockedRunLoopTimer(0) , m_overdueTimerScheduled(false) - , m_processEvents(QEventLoop::EventLoopExec) { m_cfSocketNotifier.setHostEventDispatcher(this); @@ -371,11 +369,11 @@ bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlag return eventsProcessed; } -void QEventDispatcherCoreFoundation::processPostedEvents() +bool QEventDispatcherCoreFoundation::processPostedEvents() { if (m_processEvents.processedPostedEvents && !(m_processEvents.flags & QEventLoop::EventLoopExec)) { qEventDispatcherDebug() << "Already processed events this pass"; - return; + return false; } m_processEvents.processedPostedEvents = true; @@ -384,9 +382,7 @@ void QEventDispatcherCoreFoundation::processPostedEvents() QCoreApplication::sendPostedEvents(); qUnIndent(); - qEventDispatcherDebug() << "Sending window system events for " << m_processEvents.flags; qIndent(); - QWindowSystemInterface::sendWindowSystemEvents(m_processEvents.flags); - qUnIndent(); + return true; } void QEventDispatcherCoreFoundation::processTimers(CFRunLoopTimerRef timer) diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h index 1cd9ae4ebf..2fe5dea3d8 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h @@ -101,7 +101,7 @@ template <class T = QEventDispatcherCoreFoundation> class RunLoopSource { public: - typedef void (T::*CallbackFunction) (); + typedef bool (T::*CallbackFunction)(); enum { kHighestPriority = 0 } RunLoopSourcePriority; @@ -221,18 +221,8 @@ public: void interrupt(); void flush(); -private: - RunLoopSource<> m_postedEventsRunLoopSource; - RunLoopObserver<> m_runLoopActivityObserver; - - RunLoopModeTracker *m_runLoopModeTracker; - - QTimerInfoList m_timerInfoList; - CFRunLoopTimerRef m_runLoopTimer; - CFRunLoopTimerRef m_blockedRunLoopTimer; - bool m_overdueTimerScheduled; - - QCFSocketNotifier m_cfSocketNotifier; +protected: + virtual bool processPostedEvents(); struct ProcessEventsState { @@ -251,7 +241,19 @@ private: ProcessEventsState m_processEvents; - void processPostedEvents(); +private: + RunLoopSource<> m_postedEventsRunLoopSource; + RunLoopObserver<> m_runLoopActivityObserver; + + RunLoopModeTracker *m_runLoopModeTracker; + + QTimerInfoList m_timerInfoList; + CFRunLoopTimerRef m_runLoopTimer; + CFRunLoopTimerRef m_blockedRunLoopTimer; + bool m_overdueTimerScheduled; + + QCFSocketNotifier m_cfSocketNotifier; + void processTimers(CFRunLoopTimerRef); void handleRunLoopActivity(CFRunLoopActivity activity); |