summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/EventLoop/Cocoa/CocoaEventLoop.mm')
-rw-r--r--Swiften/EventLoop/Cocoa/CocoaEventLoop.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/EventLoop/Cocoa/CocoaEventLoop.mm b/Swiften/EventLoop/Cocoa/CocoaEventLoop.mm
new file mode 100644
index 0000000..b90f3c6
--- /dev/null
+++ b/Swiften/EventLoop/Cocoa/CocoaEventLoop.mm
@@ -0,0 +1,21 @@
+#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+#include "Swiften/EventLoop/Cocoa/CocoaEvent.h"
+
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+
+namespace Swift {
+
+CocoaEventLoop::CocoaEventLoop() {
+}
+
+void CocoaEventLoop::post(const Event& event) {
+ Event* eventCopy = new Event(event);
+ CocoaEvent* cocoaEvent = [[CocoaEvent alloc] initWithEvent: eventCopy eventLoop: this];
+ [cocoaEvent
+ performSelectorOnMainThread:@selector(process)
+ withObject: nil
+ waitUntilDone: NO];
+ [cocoaEvent release];
+}
+
+}