+ virtual void Exit(int rc = 0) = 0;
+
+ // return true if any events are available
+ virtual bool Pending() const = 0;
+
+ // dispatch a single event, return false if we should exit from the loop
+ virtual bool Dispatch() = 0;
+
+ // return currently active (running) event loop, may be NULL
+ static wxEventLoop *GetActive() { return ms_activeLoop; }
+
+ // set currently active (running) event loop
+ static void SetActive(wxEventLoop* loop) { ms_activeLoop = loop; }
+
+ // is this event loop running now?
+ //
+ // notice that even if this event loop hasn't terminated yet but has just
+ // spawned a nested (e.g. modal) event loop, this would return false
+ bool IsRunning() const;
+
+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() { }
+
+
+ // the pointer to currently active loop
+ static wxEventLoop *ms_activeLoop;
+
+ DECLARE_NO_COPY_CLASS(wxEventLoopBase)
+};
+
+#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXDFB__)
+
+// this class can be used to implement a standard event loop logic using
+// Pending() and Dispatch()
+//
+// it also handles idle processing automatically
+class WXDLLEXPORT wxEventLoopManual : public wxEventLoopBase
+{
+public:
+ wxEventLoopManual();
+
+ // 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