summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-20 23:20:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-20 23:28:53 (GMT)
commit1642d13e5e8d593a36ef1945387794e0d13247be (patch)
treedae6568c7b3d67ff374ddbeea4e99f6a588aa386 /Swiften/EventLoop/Cocoa/CocoaEvent.mm
parentcc03d5aab20bde58d700b329f5fa7388698d9e68 (diff)
downloadswift-1642d13e5e8d593a36ef1945387794e0d13247be.zip
swift-1642d13e5e8d593a36ef1945387794e0d13247be.tar.bz2
Added Cocoa event loop.
Diffstat (limited to 'Swiften/EventLoop/Cocoa/CocoaEvent.mm')
-rw-r--r--Swiften/EventLoop/Cocoa/CocoaEvent.mm25
1 files changed, 25 insertions, 0 deletions
diff --git a/Swiften/EventLoop/Cocoa/CocoaEvent.mm b/Swiften/EventLoop/Cocoa/CocoaEvent.mm
new file mode 100644
index 0000000..8a90983
--- /dev/null
+++ b/Swiften/EventLoop/Cocoa/CocoaEvent.mm
@@ -0,0 +1,25 @@
+#include "Swiften/EventLoop/Cocoa/CocoaEvent.h"
+#include "Swiften/EventLoop/Event.h"
+#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+
+@implementation CocoaEvent
+
+- (id) initWithEvent: (Swift::Event*) e eventLoop: (Swift::CocoaEventLoop*) el {
+ self = [super init];
+ if (self != nil) {
+ event = e;
+ eventLoop = el;
+ }
+ return self;
+}
+
+- (void) process {
+ eventLoop->handleEvent(*event);
+}
+
+- (void) dealloc {
+ delete event;
+ [super dealloc];
+}
+
+@end