X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/233f573883834b6c86ad5a9d72fdb6a260f74f81..b02dd12239c8a59b9a545d9fcb04974f8ad02c6b:/include/wx/osx/evtloop.h?ds=sidebyside diff --git a/include/wx/osx/evtloop.h b/include/wx/osx/evtloop.h index 35768078ad..00a5258fce 100644 --- a/include/wx/osx/evtloop.h +++ b/include/wx/osx/evtloop.h @@ -26,17 +26,17 @@ public: // enters a loop calling OnNextIteration(), Pending() and Dispatch() and // terminating when Exit() is called virtual int Run(); - + // sets the "should exit" flag and wakes up the loop so that it terminates // soon virtual void Exit(int rc = 0); - + // return true if any events are available virtual bool Pending() const; - + // dispatch a single event, return false if we should exit from the loop virtual bool Dispatch(); - + // same as Dispatch() but doesn't wait for longer than the specified (in // ms) timeout, return true if an event was processed, false if we should // exit the loop or -1 if timeout expired @@ -45,7 +45,7 @@ public: // implement this to wake up the loop: usually done by posting a dummy event // to it (can be called from non main thread) virtual void WakeUp(); - + virtual bool YieldFor(long eventsToProcess); #if wxUSE_EVENTLOOP_SOURCE @@ -53,30 +53,38 @@ public: AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); #endif // wxUSE_EVENTLOOP_SOURCE - void ObserverCallBack(CFRunLoopObserverRef observer, int activity); protected: + void CommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity); + void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity); + + static void OSXCommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info); + static void OSXDefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info); + // get the currently executing CFRunLoop virtual CFRunLoopRef CFGetCurrentRunLoop() const; virtual int DoDispatchTimeout(unsigned long timeout); - + virtual void DoRun(); virtual void DoStop(); - + // should we exit the loop? bool m_shouldExit; // the loop exit code int m_exitcode; - + // cfrunloop CFRunLoopRef m_runLoop; - - // runloop observer - CFRunLoopObserverRef m_runLoopObserver; - + + // common modes runloop observer + CFRunLoopObserverRef m_commonModeRunLoopObserver; + + // default mode runloop observer + CFRunLoopObserverRef m_defaultModeRunLoopObserver; + private: // process all already pending events and dispatch a new one (blocking // until it appears in the event queue if necessary) @@ -101,12 +109,12 @@ class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop public: wxModalEventLoop(wxWindow *modalWindow); wxModalEventLoop(WXWindow modalNativeWindow); - + protected: virtual void DoRun(); - + virtual void DoStop(); - + // (in case) the modal window for this event loop wxNonOwnedWindow* m_modalWindow; WXWindow m_modalNativeWindow;