]> git.saurik.com Git - wxWidgets.git/commitdiff
move generic DispatchTimeout() implementation in the header as evtloopcmn.cpp is...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 00:04:57 +0000 (00:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 00:04:57 +0000 (00:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/evtloop.h
src/common/evtloopcmn.cpp

index 5d78a3bf56f983357128a998eddb0b32816b07c1..412fe4ea5155b6add159b9c5766de6cb72756c30 100644 (file)
@@ -128,7 +128,7 @@ protected:
     #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;
 
@@ -142,7 +142,20 @@ public:
     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:
index 808e82c972207a8a06979498d365d5a4181a3778..18f9967c57d887deb8d1dec265eb0a4da6563594 100644 (file)
@@ -28,7 +28,6 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/stopwatch.h"   // for wxMilliClock_t
 #endif //WX_PRECOMP
 
 // ----------------------------------------------------------------------------
@@ -155,22 +154,3 @@ void wxEventLoopManual::Exit(int rc)
 
 #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
-