summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Slimber/Cocoa')
-rw-r--r--Slimber/Cocoa/CocoaController.mm3
-rw-r--r--Slimber/Cocoa/main.h11
-rw-r--r--Slimber/Cocoa/main.mm9
3 files changed, 20 insertions, 3 deletions
diff --git a/Slimber/Cocoa/CocoaController.mm b/Slimber/Cocoa/CocoaController.mm
index 437d85a..a0c4ef4 100644
--- a/Slimber/Cocoa/CocoaController.mm
+++ b/Slimber/Cocoa/CocoaController.mm
@@ -2,6 +2,7 @@
#include "Slimber/MainController.h"
#include "Slimber/Cocoa/CocoaMenulet.h"
+#include "Slimber/Cocoa/main.h"
@implementation CocoaController
@@ -13,7 +14,7 @@
- (void) awakeFromNib {
menulet = new CocoaMenulet();
- main = new MainController(menulet);
+ main = new MainController(menulet, eventLoop);
}
@end
diff --git a/Slimber/Cocoa/main.h b/Slimber/Cocoa/main.h
new file mode 100644
index 0000000..681139d
--- /dev/null
+++ b/Slimber/Cocoa/main.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+
+extern Swift::CocoaEventLoop* eventLoop;
diff --git a/Slimber/Cocoa/main.mm b/Slimber/Cocoa/main.mm
index e267477..fc051e0 100644
--- a/Slimber/Cocoa/main.mm
+++ b/Slimber/Cocoa/main.mm
@@ -1,8 +1,13 @@
#include <Cocoa/Cocoa.h>
+#include "Slimber/Cocoa/main.h"
#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+Swift::CocoaEventLoop* eventLoop;
+
int main(int argc, char *argv[]) {
- Swift::CocoaEventLoop eventLoop;
- return NSApplicationMain(argc, const_cast<const char **>(argv));
+ eventLoop = new Swift::CocoaEventLoop();
+ int result = NSApplicationMain(argc, const_cast<const char **>(argv));
+ delete eventLoop;
+ return result;
}