diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-20 23:20:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-20 23:28:53 (GMT) |
commit | 1642d13e5e8d593a36ef1945387794e0d13247be (patch) | |
tree | dae6568c7b3d67ff374ddbeea4e99f6a588aa386 /Swiften/EventLoop/Cocoa/CocoaEventLoop.mm | |
parent | cc03d5aab20bde58d700b329f5fa7388698d9e68 (diff) | |
download | swift-contrib-1642d13e5e8d593a36ef1945387794e0d13247be.zip swift-contrib-1642d13e5e8d593a36ef1945387794e0d13247be.tar.bz2 |
Added Cocoa event loop.
Diffstat (limited to 'Swiften/EventLoop/Cocoa/CocoaEventLoop.mm')
-rw-r--r-- | Swiften/EventLoop/Cocoa/CocoaEventLoop.mm | 21 |
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]; +} + +} |