X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dde19c2180ef8d6415af7bb2492bfcb0a2d5c7e4..afc0db8ca0bcae488ed7efa8ee3bcd873873a8d9:/include/wx/evtloop.h diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h index 9ff5edbe64..8bea93090a 100644 --- a/include/wx/evtloop.h +++ b/include/wx/evtloop.h @@ -12,9 +12,9 @@ #ifndef _WX_EVTLOOP_H_ #define _WX_EVTLOOP_H_ +#include "wx/event.h" #include "wx/utils.h" - /* NOTE ABOUT wxEventLoopBase::YieldFor LOGIC ------------------------------------------ @@ -61,6 +61,9 @@ public: // using it virtual bool IsOk() const { return true; } + // returns true if this is the main loop + bool IsMain() const; + // dispatch&processing // ------------------- @@ -93,37 +96,6 @@ public: virtual void WakeUp() = 0; - // pending events - // -------------- - - // process all events in the wxHandlersWithPendingEvents list -- it is necessary - // to call this function to process posted events. This happens during each - // event loop iteration in GUI mode but if there is no main loop, it may be - // also called directly. - virtual void ProcessPendingEvents(); - - // check if there are pending events on global pending event list - bool HasPendingEvents() const; - - // temporary suspends processing of the pending events - void SuspendProcessingOfPendingEvents(); - - // resume processing of the pending events previously stopped because of a - // call to SuspendProcessingOfPendingEvents() - void ResumeProcessingOfPendingEvents(); - - // called by ~wxEvtHandler to (eventually) remove the handler from the list of - // the handlers with pending events - void RemovePendingEventHandler(wxEvtHandler* toRemove); - - // adds an event handler to the list of the handlers with pending events - void AppendPendingEventHandler(wxEvtHandler* toAppend); - - // moves the event handler from the list of the handlers with pending events - //to the list of the handlers with _delayed_ pending events - void DelayPendingEventHandler(wxEvtHandler* toDelay); - - // idle handling // ------------- @@ -173,31 +145,19 @@ public: static wxEventLoopBase *GetActive() { return ms_activeLoop; } // set currently active (running) event loop - static void SetActive(wxEventLoopBase* loop) { ms_activeLoop = loop; } + static void SetActive(wxEventLoopBase* loop); protected: // this function should be called before the event loop terminates, whether // this happens normally (because of Exit() call) or abnormally (because of // an exception thrown from inside the loop) - virtual void OnExit() { } + virtual void OnExit(); // the pointer to currently active loop static wxEventLoopBase *ms_activeLoop; - // the array of the handlers with pending events which needs to be processed - // inside ProcessPendingEvents() - wxEvtHandlerArray m_handlersWithPendingEvents; - - // helper array used by ProcessPendingEvents() - wxEvtHandlerArray m_handlersWithPendingDelayedEvents; - -#if wxUSE_THREADS - // this critical section protects both the lists above - wxCriticalSection m_handlersWithPendingEventsLocker; -#endif - - // Yield() helpers: + // YieldFor() helpers: bool m_isInsideYield; long m_eventsToProcessInsideYield;