X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e04d2bf54dcb336e20a27e906dcebdca368790b..cbeda384e51acb82e13994cb67ac1714669cae10:/include/wx/evtloop.h diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h index 82d81c331a..8bea93090a 100644 --- a/include/wx/evtloop.h +++ b/include/wx/evtloop.h @@ -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;