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     wxEventLoop() { wxPyRaiseNotImplemented(); }
 
  30     int Run() { return 0; }
 
  31     void Exit(int rc = 0) {}
 
  32     bool Pending() const { return false; }
 
  33     bool Dispatch() { return false; }
 
  34     bool IsRunning() const { return false; }
 
  35     static wxEventLoop *GetActive() { wxPyRaiseNotImplemented(); return NULL; }
 
  36     static void SetActive(wxEventLoop* loop) { wxPyRaiseNotImplemented(); }
 
  41 #include <wx/evtloop.h>
 
  50     virtual ~wxEventLoop();
 
  52     // start the event loop, return the exit code when it is finished
 
  55     // exit from the loop with the given exit code
 
  56     virtual void Exit(int rc = 0);
 
  58     // return true if any events are available
 
  59     virtual bool Pending() const;
 
  61     // dispatch a single event, return false if we should exit from the loop
 
  62     virtual bool Dispatch();
 
  64     // is the event loop running now?
 
  65     virtual bool IsRunning() const;
 
  67     // return currently active (running) event loop, may be NULL
 
  68     static wxEventLoop *GetActive();
 
  70     // set currently active (running) event loop
 
  71     static void SetActive(wxEventLoop* loop);
 
  76 // This object sets the wxEventLoop given to the ctor as the currently active
 
  77 // one and unsets it in its dtor, this is especially useful in presence of
 
  78 // exceptions but is more tidy even when we don't use them
 
  79 class wxEventLoopActivator
 
  82     wxEventLoopActivator(wxEventLoop *evtLoop);
 
  83     ~wxEventLoopActivator();
 
  88 //---------------------------------------------------------------------------