// using it
virtual bool IsOk() const { return true; }
+ // returns true if this is the main loop
+ bool IsMain() const;
+
// dispatch&processing
// -------------------
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
// -------------
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;