summaryrefslogtreecommitdiffstats
blob: b90f3c6a1b82240d323bfde70b206e4ab496821c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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];
}

}