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 /Slimber
parentcc03d5aab20bde58d700b329f5fa7388698d9e68 (diff)
downloadswift-contrib-1642d13e5e8d593a36ef1945387794e0d13247be.zip
swift-contrib-1642d13e5e8d593a36ef1945387794e0d13247be.tar.bz2
Added Cocoa event loop.
Diffstat (limited to 'Slimber')
-rw-r--r--Slimber/Cocoa/Makefile.inc9
-rw-r--r--Slimber/Cocoa/main.mm14
2 files changed, 19 insertions, 4 deletions
diff --git a/Slimber/Cocoa/Makefile.inc b/Slimber/Cocoa/Makefile.inc
index d07e0d7..6f0aa13 100644
--- a/Slimber/Cocoa/Makefile.inc
+++ b/Slimber/Cocoa/Makefile.inc
@@ -2,6 +2,7 @@ SLIMBER_COCOA_TARGET = Slimber/Cocoa/Slimber.app
SLIMBER_COCOA_BINARY = \
Slimber/Cocoa/Slimber
SLIMBER_COCOA_SOURCES = \
+ Slimber/Server.cpp \
Slimber/Cocoa/main.m \
Slimber/Cocoa/Menulet.m
SLIMBER_COCOA_XIBS = \
@@ -13,15 +14,15 @@ SLIMBER_COCOA_RESOURCES = \
SLIMBER_COCOA_NIBS = \
$(SLIMBER_COCOA_XIBS:.xib=.nib)
SLIMBER_COCOA_OBJECTS = \
- $(SLIMBER_COCOA_SOURCES:.m=.o)
+ $(patsubst %.m,%.o,$(patsubst %.cpp,%.o, $(SLIMBER_COCOA_SOURCES)))
CLEANFILES += \
Slimber/Cocoa/PkgInfo \
$(SLIMBER_COCOA_OBJECTS) \
$(SLIMBER_COCOA_NIBS) \
$(SLIMBER_COCOA_TARGET) \
$(SLIMBER_COCOA_BINARY)
-DEPS += \
- $(SLIMBER_COCOA_SOURCES:.m=.dep) \
+//DEPS += \
+// $(SLIMBER_COCOA_SOURCES:.m=.dep) \
.PHONY: slimber-cocoa
slimber-cocoa: $(SLIMBER_COCOA_TARGET)
@@ -36,5 +37,5 @@ $(SLIMBER_COCOA_TARGET): $(SLIMBER_COCOA_BINARY) $(SLIMBER_COCOA_NIBS) Slimber/C
cp $(SLIMBER_COCOA_NIBS) $(SLIMBER_COCOA_TARGET)/Contents/Resources
cp $(SLIMBER_COCOA_RESOURCES) $(SLIMBER_COCOA_TARGET)/Contents/Resources
-$(SLIMBER_COCOA_BINARY): $(SLIMBER_COCOA_OBJECTS)
+$(SLIMBER_COCOA_BINARY): $(SLIMBER_COCOA_OBJECTS) $(SWIFTEN_TARGET)
$(QUIET_LINK)$(CXX) -o $@ $(SLIMBER_COCOA_OBJECTS) $(LDFLAGS) $(SWIFTEN_TARGET) $(LIBS) -framework Cocoa
diff --git a/Slimber/Cocoa/main.mm b/Slimber/Cocoa/main.mm
index b7266b5..e777e0d 100644
--- a/Slimber/Cocoa/main.mm
+++ b/Slimber/Cocoa/main.mm
@@ -1,5 +1,19 @@
#include <Cocoa/Cocoa.h>
+#include <string>
+#include <boost/bind.hpp>
+
+#include "Swiften/LinkLocal/AppleDNSSDService.h"
+#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+#include "Slimber/Server.h"
+
+using namespace Swift;
int main(int argc, char *argv[]) {
+ CocoaEventLoop eventLoop;
+
+ boost::shared_ptr<DNSSDService> dnsSDService=
+ boost::shared_ptr<AppleDNSSDService>(new AppleDNSSDService());
+ Server server(5222, 5562, dnsSDService);
+
return NSApplicationMain(argc, const_cast<const char **>(argv));
}