diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-02-15 11:25:39 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 23:56:10 +0100 |
commit | aa5528b050472d1d1097e2665fb346232cbfa7e5 (patch) | |
tree | e7c0b081141a808465b60077165adb2e60cd7bed /src/plugins/platforms/cocoa/qcocoaeventdispatcher.h | |
parent | 0c1ae5f8660941fed55c468487635c9a74846f7a (diff) |
iOS: Implement socket notifiers.
Create the QCFSocketNotifier class in platform support
which contains shared socket notifier support for
the Cocoa and iOS plugins. Remove the old code from
the Cocoa plugin.
The Cocoa code had one QCocoaEventDispatcher-specific
call: maybeCancelWaitForMoreEvents. Create a forwarding
function that is passed to QCFSocketNotifier.
Change-Id: Ibf9bd4745ba4f577a55f13d0cc00f5ae04447405
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaeventdispatcher.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h index f63ac0d205..93476ee1b4 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h @@ -93,6 +93,7 @@ #include <QtGui/qwindowdefs.h> #include <QtCore/private/qabstracteventdispatcher_p.h> #include <QtCore/private/qtimerinfo_unix_p.h> +#include <QtPlatformSupport/private/qcfsocketnotifier_p.h> #include <CoreFoundation/CoreFoundation.h> @@ -132,16 +133,9 @@ public: void wakeUp(); void interrupt(); void flush(); -}; -struct MacSocketInfo { - MacSocketInfo() : socket(0), runloop(0), readNotifier(0), writeNotifier(0) {} - CFSocketRef socket; - CFRunLoopSourceRef runloop; - QObject *readNotifier; - QObject *writeNotifier; + friend void qt_mac_maybeCancelWaitForMoreEventsForwarder(QAbstractEventDispatcher *eventDispatcher); }; -typedef QHash<int, MacSocketInfo *> MacSocketHash; class QCocoaEventDispatcherPrivate : public QAbstractEventDispatcherPrivate { @@ -183,7 +177,7 @@ public: void maybeCancelWaitForMoreEvents(); void ensureNSAppInitialized(); - MacSocketHash macSockets; + QCFSocketNotifier cfSocketNotifier; QList<void *> queuedUserInputEvents; // NSEvent * CFRunLoopSourceRef postedEventsSource; CFRunLoopObserverRef waitingObserver; |