1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13class wxEventLoopBase /Abstract/ 14{ 15 %Docstring 16 Base class for all event loop implementations. 17 %End 18 %TypeHeaderCode 19 #include <wx/evtloop.h> 20 %End 21 22public: 23 virtual 24 int Run() = 0; 25 %Docstring 26 Run() -> int 27 28 Start the event loop, return the exit code when it is finished. 29 %End 30 31 bool IsRunning() const; 32 %Docstring 33 IsRunning() -> bool 34 35 Return true if this event loop is currently running. 36 %End 37 38 virtual 39 bool IsOk() const; 40 %Docstring 41 IsOk() -> bool 42 43 Use this to check whether the event loop was successfully created 44 before using it. 45 %End 46 47 virtual 48 void Exit( 49 int rc = 0 50 ); 51 %Docstring 52 Exit(rc=0) 53 54 Exit the currently running loop with the given exit code. 55 %End 56 57 virtual 58 void ScheduleExit( 59 int rc = 0 60 ) = 0; 61 %Docstring 62 ScheduleExit(rc=0) 63 64 Schedule an exit from the loop with the given exit code. 65 %End 66 67 virtual 68 bool Pending() const = 0; 69 %Docstring 70 Pending() -> bool 71 72 Return true if any events are available. 73 %End 74 75 virtual 76 bool Dispatch() = 0; 77 %Docstring 78 Dispatch() -> bool 79 80 Dispatches the next event in the windowing system event queue. 81 %End 82 83 virtual 84 int DispatchTimeout( 85 unsigned long timeout 86 ) = 0; 87 %Docstring 88 DispatchTimeout(timeout) -> int 89 90 Dispatch an event but not wait longer than the specified timeout for 91 it. 92 %End 93 94 virtual 95 void WakeUp() = 0; 96 %Docstring 97 WakeUp() 98 99 Called by wxWidgets to wake up the event loop even if it is currently 100 blocked inside Dispatch(). 101 %End 102 103 virtual 104 void WakeUpIdle(); 105 %Docstring 106 WakeUpIdle() 107 108 Makes sure that idle events are sent again. 109 %End 110 111 virtual 112 bool ProcessIdle(); 113 %Docstring 114 ProcessIdle() -> bool 115 116 This virtual function is called when the application becomes idle and 117 normally just sends wxIdleEvent to all interested parties. 118 %End 119 120 virtual 121 bool IsYielding() const; 122 %Docstring 123 IsYielding() -> bool 124 125 Returns true if called from inside Yield() or from inside YieldFor(). 126 %End 127 128 bool Yield( 129 bool onlyIfNeeded = false 130 ) /ReleaseGIL/; 131 %Docstring 132 Yield(onlyIfNeeded=False) -> bool 133 134 Yields control to pending messages in the windowing system. 135 %End 136 137 bool YieldFor( 138 long eventsToProcess 139 ) /ReleaseGIL/; 140 %Docstring 141 YieldFor(eventsToProcess) -> bool 142 143 Works like Yield() with onlyIfNeeded == true, except that it allows 144 the caller to specify a mask of the wxEventCategory values which 145 indicates which events should be processed and which should instead be 146 "delayed" (i.e. 147 %End 148 149 virtual 150 bool IsEventAllowedInsideYield( 151 wxEventCategory cat 152 ) const; 153 %Docstring 154 IsEventAllowedInsideYield(cat) -> bool 155 156 Returns true if the given event category is allowed inside a 157 YieldFor() call (i.e. 158 %End 159 160 static 161 wxEventLoopBase * GetActive(); 162 %Docstring 163 GetActive() -> EventLoopBase 164 165 Return the currently active (running) event loop. 166 %End 167 168 static 169 void SetActive( 170 wxEventLoopBase * loop 171 ); 172 %Docstring 173 SetActive(loop) 174 175 Set currently active (running) event loop. 176 %End 177 178 bool IsMain() const; 179 %Docstring 180 IsMain() -> bool 181 182 Returns true if this is the main loop executed by wxApp::OnRun(). 183 %End 184 185 186protected: 187 virtual 188 void OnExit(); 189 %Docstring 190 OnExit() 191 192 This function is called before the event loop terminates, whether this 193 happens normally (because of Exit() call) or abnormally (because of an 194 exception thrown from inside the loop). 195 %End 196 197}; // end of class wxEventLoopBase 198 199 200class wxEventLoopActivator 201{ 202 %Docstring 203 EventLoopActivator(loop) 204 205 Makes an event loop temporarily active. 206 %End 207 %TypeHeaderCode 208 #include <wx/evtloop.h> 209 %End 210 211public: 212 wxEventLoopActivator( 213 wxEventLoopBase * loop 214 ); 215 216 ~wxEventLoopActivator(); 217 218 private: 219 wxEventLoopActivator& operator=(const wxEventLoopActivator&); 220 221 222 private: 223 wxEventLoopActivator(const wxEventLoopActivator&); 224 225 226}; // end of class wxEventLoopActivator 227 228 229%Extract(id=pycode_core) 230def _EventLoopActivator___enter__(self): 231 return self 232EventLoopActivator.__enter__ = _EventLoopActivator___enter__ 233del _EventLoopActivator___enter__ 234%End 235 236%Extract(id=pycode_core) 237def _EventLoopActivator___exit__(self, exc_type, exc_val, exc_tb): 238 return False 239EventLoopActivator.__exit__ = _EventLoopActivator___exit__ 240del _EventLoopActivator___exit__ 241%End 242 243class wxGUIEventLoop : wxEventLoopBase 244{ 245 %Docstring 246 GUIEventLoop() 247 248 A generic implementation of the GUI event loop. 249 %End 250 %TypeHeaderCode 251 #include <wx/evtloop.h> 252 %End 253 254public: 255 wxGUIEventLoop(); 256 257 virtual 258 ~wxGUIEventLoop(); 259 260 private: 261 wxGUIEventLoop(const wxGUIEventLoop&); 262 263 264 public: 265 virtual int Run(); 266 virtual void Exit(int rc = 0); 267 virtual void ScheduleExit(int rc = 0); 268 virtual bool Pending() const; 269 virtual bool Dispatch(); 270 virtual int DispatchTimeout(unsigned long timeout); 271 virtual void WakeUp(); 272 virtual bool YieldFor(long eventsToProcess); 273 274 275}; // end of class wxGUIEventLoop 276 277 278%Extract(id=pycode_core) 279@wx.deprecatedMsg('Use GUIEventLoop instead.') 280class EventLoop(GUIEventLoop): 281 '''A class using the old name for compatibility.''' 282 def __init__(self): 283 GUIEventLoop.__init__(self) 284 285%End 286 287 288//--------------------------------------------------------------------------- 289 290