diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-01-05 12:41:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-07 10:55:54 +0100 |
commit | 9b19a69c89c07b02ab631c1ccfd4d89013b6ec45 (patch) | |
tree | 064473ca07e0876cf81c86741ba1e45091e67921 /src/corelib/kernel/qeventdispatcher_winrt_p.h | |
parent | 1f31c6c6b1f4b37806aa5c1c426efb31ac78ed5e (diff) |
WinRT: Clean up core event dispatcher
- Move private classes in the .cpp file (they aren't needed outside)
- Conform to Qt style, such as includes and braces
- Use ComPtr where appropriate
- Use foreach where appropriate
- Remove non-functional wake/interrupt leftovers
- Remove redundant timer list
- Make the timer callback a static method, so it won't crash if it
gets called on shutdown
Task-number: QTBUG-35945
Change-Id: I5426fba2735e908a04ea60287f9936f5abde6644
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_winrt_p.h')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_winrt_p.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_winrt_p.h b/src/corelib/kernel/qeventdispatcher_winrt_p.h index c5bd39c2a3..0631b2ea33 100644 --- a/src/corelib/kernel/qeventdispatcher_winrt_p.h +++ b/src/corelib/kernel/qeventdispatcher_winrt_p.h @@ -55,21 +55,8 @@ // #include "QtCore/qabstracteventdispatcher.h" -#include "private/qabstracteventdispatcher_p.h" #include <qt_windows.h> -#include <wrl.h> - -namespace ABI { - namespace Windows { - namespace System { - namespace Threading { - struct IThreadPoolTimer; - struct IThreadPoolTimerStatics; - } - } - } -} QT_BEGIN_NAMESPACE @@ -112,56 +99,10 @@ public: protected: QEventDispatcherWinRT(QEventDispatcherWinRTPrivate &dd, QObject *parent = 0); - bool event(QEvent *); int activateTimers(); }; -struct WinRTTimerInfo // internal timer info -{ - WinRTTimerInfo() : timer(0) {} - - QObject *dispatcher; - int timerId; - int interval; - Qt::TimerType timerType; - quint64 timeout; // - when to actually fire - QObject *obj; // - object to receive events - bool inTimerEvent; - ABI::Windows::System::Threading::IThreadPoolTimer *timer; -}; - -class QZeroTimerEvent : public QTimerEvent -{ -public: - explicit inline QZeroTimerEvent(int timerId) - : QTimerEvent(timerId) - { t = QEvent::ZeroTimerEvent; } -}; - -class Q_CORE_EXPORT QEventDispatcherWinRTPrivate : public QAbstractEventDispatcherPrivate -{ - Q_DECLARE_PUBLIC(QEventDispatcherWinRT) - -public: - QEventDispatcherWinRTPrivate(); - ~QEventDispatcherWinRTPrivate(); - - QList<WinRTTimerInfo*> timerVec; - QHash<int, WinRTTimerInfo*> timerDict; - QHash<ABI::Windows::System::Threading::IThreadPoolTimer*, WinRTTimerInfo*> threadPoolTimerDict; - - void registerTimer(WinRTTimerInfo *t); - void unregisterTimer(WinRTTimerInfo *t); - void sendTimerEvent(int timerId); - HRESULT timerExpiredCallback(ABI::Windows::System::Threading::IThreadPoolTimer *source); - - QAtomicInt wakeUps; - bool interrupt; - - ABI::Windows::System::Threading::IThreadPoolTimerStatics *timerFactory; -}; - QT_END_NAMESPACE #endif // QEVENTDISPATCHER_WINRT_P_H |