#include "wx/dfb/evtloop.h"
#else // other platform
-#define wxNEEDS_GENERIC_DISPATCH_TIMEOUT
+#include "wx/stopwatch.h" // for wxMilliClock_t
class WXDLLIMPEXP_FWD_CORE wxEventLoopImpl;
virtual void Exit(int rc = 0);
virtual bool Pending() const;
virtual bool Dispatch();
- virtual int DispatchTimeout(unsigned long timeout);
+ virtual int DispatchTimeout(unsigned long timeout)
+ {
+ // TODO: this is, of course, horribly inefficient and a proper wait with
+ // timeout should be implemented for all ports natively...
+ const wxMilliClock_t timeEnd = wxGetLocalTimeMillis() + timeout;
+ for ( ;; )
+ {
+ if ( Pending() )
+ return Dispatch();
+
+ if ( wxGetLocalTimeMillis() >= timeEnd )
+ return -1;
+ }
+ }
virtual void WakeUp() { }
protected:
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/stopwatch.h" // for wxMilliClock_t
#endif //WX_PRECOMP
// ----------------------------------------------------------------------------
#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
-#ifdef wxNEEDS_GENERIC_DISPATCH_TIMEOUT
-
-int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
-{
- // TODO: this is, of course, horribly inefficient and a proper wait with
- // timeout should be implemented for all ports natively...
- const wxMilliClock_t timeEnd = wxGetLocalTimeMillis() + timeout;
- for ( ;; )
- {
- if ( Pending() )
- return Dispatch();
-
- if ( wxGetLocalTimeMillis() >= timeEnd )
- return -1;
- }
-}
-
-#endif // wxNEEDS_GENERIC_DISPATCH_TIMEOUT
-