1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxEventLoop
7 // Created: 18-Sept-2004
9 // Copyright: (c) 2004 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
17 // TODO: wxPyEventLoop that virtualizes all the methods...
19 //---------------------------------------------------------------------------
23 #if 0 // #ifdef __WXMAC__
25 // A dummy class that raises an exception if used...
29 wxEventLoopBase() { wxPyRaiseNotImplemented(); }
30 bool IsOk() const { return false; }
31 int Run() { return 0; }
32 void Exit(int rc = 0) {}
33 bool Pending() const { return false; }
34 bool Dispatch() { return false; }
35 bool IsRunning() const { return false; }
37 static wxEventLoop *GetActive() { wxPyRaiseNotImplemented(); return NULL; }
38 static void SetActive(wxEventLoop* loop) { wxPyRaiseNotImplemented(); }
43 #include <wx/evtloop.h>
52 virtual ~wxEventLoop();
54 // use this to check whether the event loop was successfully created before
56 virtual bool IsOk() const;
58 // start the event loop, return the exit code when it is finished
61 // exit from the loop with the given exit code
62 virtual void Exit(int rc = 0);
64 // return true if any events are available
65 virtual bool Pending() const;
67 // dispatch a single event, return false if we should exit from the loop
68 virtual bool Dispatch();
70 // is the event loop running now?
71 virtual bool IsRunning() const;
73 virtual void WakeUp();
75 // return currently active (running) event loop, may be NULL
76 static wxEventLoop *GetActive();
78 // set currently active (running) event loop
79 static void SetActive(wxEventLoop* loop);
83 class wxEventLoopManual : public wxEventLoopBase
90 class wxGUIEventLoop : public wxEventLoopBase
98 class EventLoop(GUIEventLoop):
99 """Class using the old name for compatibility."""
104 class wxModalEventLoop : public wxGUIEventLoop
107 wxModalEventLoop(wxWindow *winModal)
112 // This object sets the wxEventLoop given to the ctor as the currently active
113 // one and unsets it in its dtor, this is especially useful in presence of
114 // exceptions but is more tidy even when we don't use them
115 class wxEventLoopActivator
118 wxEventLoopActivator(wxEventLoop *evtLoop);
119 ~wxEventLoopActivator();
124 //---------------------------------------------------------------------------