]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/wx/MainThreadWx.cpp
JavaScriptCore-621.1.tar.gz
[apple/javascriptcore.git] / wtf / wx / MainThreadWx.cpp
index 31663311bd077a1c873ecd109c6c930fe9f53a1b..e1d15c96f6eb447904b52e95d0fd4dc07d2af598 100644 (file)
 #include "config.h"
 #include "MainThread.h"
 
+#include <wx/defs.h>
+#include <wx/app.h>
+#include <wx/event.h>
+
+const wxEventType wxEVT_CALL_AFTER = wxNewEventType();
+
+class wxCallAfter : public wxEvtHandler
+{
+public:
+    wxCallAfter() 
+        : wxEvtHandler()
+        {
+            wxTheApp->Connect(-1, -1, wxEVT_CALL_AFTER, wxCommandEventHandler(wxCallAfter::OnCallback));
+            wxCommandEvent event(wxEVT_CALL_AFTER);
+            wxPostEvent(wxTheApp, event);
+        }
+        
+    void OnCallback(wxCommandEvent& event)
+    {
+        WTF::dispatchFunctionsFromMainThread();
+    }
+};
+
 namespace WTF {
 
-void scheduleDispatchFunctionsOnMainThread()
+void initializeMainThreadPlatform()
 {
 }
 
+void scheduleDispatchFunctionsOnMainThread()
+{
+    wxCallAfter();
 }
+
+} // namespace WTF