Permalink
Browse files

Mac Blink1Control works on 10.6 now by back-revving RoutingHTTPServer

  • Loading branch information...
1 parent 8088e4e commit ff785520e6162fcbeb6df82897bc712eca490e93 @todbot committed Dec 20, 2012
Showing with 8,759 additions and 126 deletions.
  1. +23 −6 mac/Blink1Control/Blink1Control.xcodeproj/project.pbxproj
  2. +12 −9 mac/Blink1Control/Blink1Control/B1SAppDelegate.m
  3. +632 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer.xcodeproj/project.pbxproj
  4. +7 −0 ...outingHTTPServer/Example/RoutingHTTPServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. +11 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/AppDelegate.h
  6. +67 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/AppDelegate.m
  7. +34 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/RoutingHTTPServer-Info.plist
  8. +29 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/en.lproj/Credits.rtf
  9. +2 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/en.lproj/InfoPlist.strings
  10. +4,582 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/en.lproj/MainMenu.xib
  11. +5 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServer/main.m
  12. +22 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServerTests/RoutingHTTPServerTests-Info.plist
  13. +8 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServerTests/RoutingHTTPServerTests.h
  14. +178 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServerTests/RoutingHTTPServerTests.m
  15. +2 −0 mac/Blink1Control/RoutingHTTPServer/Example/RoutingHTTPServerTests/en.lproj/InfoPlist.strings
  16. +1 −0 mac/Blink1Control/RoutingHTTPServer/External/CocoaHTTPServer
  17. +33 −0 mac/Blink1Control/RoutingHTTPServer/External/RegexKitLite/License.html
  18. +27 −0 mac/Blink1Control/RoutingHTTPServer/External/RegexKitLite/License.rtf
  19. +295 −0 mac/Blink1Control/RoutingHTTPServer/External/RegexKitLite/RegexKitLite.h
  20. +2,636 −0 mac/Blink1Control/RoutingHTTPServer/External/RegexKitLite/RegexKitLite.m
  21. +1 −1 mac/Blink1Control/RoutingHTTPServer/LICENSE.txt
  22. +4 −3 mac/Blink1Control/RoutingHTTPServer/README.md
  23. +5 −2 mac/Blink1Control/RoutingHTTPServer/Source/HTTPResponseProxy.h
  24. +6 −1 mac/Blink1Control/RoutingHTTPServer/Source/HTTPResponseProxy.m
  25. +10 −9 mac/Blink1Control/RoutingHTTPServer/Source/Route.h
  26. +9 −1 mac/Blink1Control/RoutingHTTPServer/Source/Route.m
  27. +5 −1 mac/Blink1Control/RoutingHTTPServer/Source/RouteRequest.h
  28. +11 −6 mac/Blink1Control/RoutingHTTPServer/Source/RouteRequest.m
  29. +8 −3 mac/Blink1Control/RoutingHTTPServer/Source/RouteResponse.h
  30. +11 −7 mac/Blink1Control/RoutingHTTPServer/Source/RouteResponse.m
  31. +5 −1 mac/Blink1Control/RoutingHTTPServer/Source/RoutingConnection.h
  32. +11 −7 mac/Blink1Control/RoutingHTTPServer/Source/RoutingConnection.m
  33. +8 −2 mac/Blink1Control/RoutingHTTPServer/Source/RoutingHTTPServer.h
  34. +59 −67 mac/Blink1Control/RoutingHTTPServer/Source/RoutingHTTPServer.m
@@ -37,12 +37,12 @@
DE30984C15F1CCD300B84287 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30982A15F1CCD300B84287 /* DDTTYLogger.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
DE30984D15F1CCD300B84287 /* ContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30982D15F1CCD300B84287 /* ContextFilterLogFormatter.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
DE30984E15F1CCD300B84287 /* DispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30982F15F1CCD300B84287 /* DispatchQueueLogFormatter.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30985E15F1CD1900B84287 /* HTTPResponseProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985315F1CD1900B84287 /* HTTPResponseProxy.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30985F15F1CD1900B84287 /* Route.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985515F1CD1900B84287 /* Route.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30986015F1CD1900B84287 /* RouteRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985715F1CD1900B84287 /* RouteRequest.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30986115F1CD1900B84287 /* RouteResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985915F1CD1900B84287 /* RouteResponse.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30986215F1CD1900B84287 /* RoutingConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985B15F1CD1900B84287 /* RoutingConnection.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
- DE30986315F1CD1900B84287 /* RoutingHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985D15F1CD1900B84287 /* RoutingHTTPServer.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
+ DE30985E15F1CD1900B84287 /* HTTPResponseProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985315F1CD1900B84287 /* HTTPResponseProxy.m */; };
+ DE30985F15F1CD1900B84287 /* Route.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985515F1CD1900B84287 /* Route.m */; };
+ DE30986015F1CD1900B84287 /* RouteRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985715F1CD1900B84287 /* RouteRequest.m */; };
+ DE30986115F1CD1900B84287 /* RouteResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985915F1CD1900B84287 /* RouteResponse.m */; };
+ DE30986215F1CD1900B84287 /* RoutingConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985B15F1CD1900B84287 /* RoutingConnection.m */; };
+ DE30986315F1CD1900B84287 /* RoutingHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = DE30985D15F1CD1900B84287 /* RoutingHTTPServer.m */; };
DE30986815F1DE8F00B84287 /* blink1-lib.c in Sources */ = {isa = PBXBuildFile; fileRef = DE30986615F1DE8F00B84287 /* blink1-lib.c */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
DE30986A15F1DEC400B84287 /* hid.c in Sources */ = {isa = PBXBuildFile; fileRef = DE30986915F1DEC400B84287 /* hid.c */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
DE30986E15F1DF8A00B84287 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE30986D15F1DF8A00B84287 /* IOKit.framework */; };
@@ -72,6 +72,7 @@
DEB0CB271630BA7C008B26D8 /* Blink1Input.m in Sources */ = {isa = PBXBuildFile; fileRef = DEB0CB261630BA7C008B26D8 /* Blink1Input.m */; };
DEB0CB2A16328E29008B26D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEB0CB2916328E29008B26D8 /* QuartzCore.framework */; };
DEB0CB2D16331C54008B26D8 /* Netuse.m in Sources */ = {isa = PBXBuildFile; fileRef = DEB0CB2C16331C54008B26D8 /* Netuse.m */; };
+ DED88D281683A25A001808BA /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = DED88D251683A25A001808BA /* RegexKitLite.m */; };
DEFABAE115F47F59006E4BB7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEFABAE015F47F59006E4BB7 /* WebKit.framework */; };
/* End PBXBuildFile section */
@@ -201,6 +202,8 @@
DEB0CB2916328E29008B26D8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
DEB0CB2B16331C54008B26D8 /* Netuse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Netuse.h; sourceTree = "<group>"; };
DEB0CB2C16331C54008B26D8 /* Netuse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = Netuse.m; sourceTree = "<group>"; };
+ DED88D241683A25A001808BA /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = "<group>"; };
+ DED88D251683A25A001808BA /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = "<group>"; };
DEFABAE015F47F59006E4BB7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -482,6 +485,7 @@
DE9CDD7915F862FE003F584C /* Utility Code */ = {
isa = PBXGroup;
children = (
+ DED88D211683A25A001808BA /* RegexKitLite */,
DE9CDDC515F9CA3C003F584C /* VDKQueue */,
DE9CDD8115F86D36003F584C /* PLWeakCompatibilityStubs.m */,
DE30985115F1CD1900B84287 /* RoutingHTTPServer */,
@@ -516,6 +520,16 @@
path = VDKQueue;
sourceTree = "<group>";
};
+ DED88D211683A25A001808BA /* RegexKitLite */ = {
+ isa = PBXGroup;
+ children = (
+ DED88D241683A25A001808BA /* RegexKitLite.h */,
+ DED88D251683A25A001808BA /* RegexKitLite.m */,
+ );
+ name = RegexKitLite;
+ path = RoutingHTTPServer/External/RegexKitLite;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -638,6 +652,7 @@
DE3C79DE1626787000104F4D /* Blink1Pattern.m in Sources */,
DEB0CB271630BA7C008B26D8 /* Blink1Input.m in Sources */,
DEB0CB2D16331C54008B26D8 /* Netuse.m in Sources */,
+ DED88D281683A25A001808BA /* RegexKitLite.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -696,6 +711,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-licucore";
SDKROOT = macosx10.7;
};
name = Debug;
@@ -719,6 +735,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-licucore";
SDKROOT = macosx10.7;
};
name = Release;
@@ -52,6 +52,7 @@ @implementation B1SAppDelegate
@synthesize http;
@synthesize blink1;
+const Boolean updateStatusbarIcon = false;
const NSInteger http_port_default = 8934;
@@ -448,7 +449,7 @@ - (void) loadPrefs
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSDictionary *inputspref = [prefs dictionaryForKey:@"inputs"];
NSData *patternspref = [prefs objectForKey:@"patterns"];
- NSString* blink1_id_prefs = [prefs stringForKey:@"blink1_id"];
+ //NSString* blink1_id_prefs = [prefs stringForKey:@"blink1_id"];
NSString* host_id_prefs = [prefs stringForKey:@"host_id"];
http_port = [prefs integerForKey:@"http_port"];
//BOOL first_run = [prefs boolForKey:@"first_run"];
@@ -500,14 +501,16 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
blink1 = [[Blink1 alloc] init]; // set up blink(1) library
[blink1 enumerate];
- __weak id weakSelf = self; // FIXME: hmm, http://stackoverflow.com/questions/4352561/retain-cycle-on-self-with-blocks
- blink1.updateHandler = ^(NSColor *lastColor, float lastTime)
- {
- NSString* lastcolorstr = [Blink1 hexStringFromColor:lastColor];
- [[weakSelf window] setTitle:[NSString stringWithFormat:@"blink(1) control - %@",lastcolorstr]];
- [weakSelf updateStatusImageHue:lastColor];
- };
-
+ if( updateStatusbarIcon ) {
+ __weak id weakSelf = self; // FIXME: hmm, http://stackoverflow.com/questions/4352561/retain-cycle-on-self-with-blocks
+ blink1.updateHandler = ^(NSColor *lastColor, float lastTime)
+ {
+ NSString* lastcolorstr = [Blink1 hexStringFromColor:lastColor];
+ [[weakSelf window] setTitle:[NSString stringWithFormat:@"blink(1) control - %@",lastcolorstr]];
+ [weakSelf updateStatusImageHue:lastColor];
+ };
+ }
+
// set up json parser
_jsonparser = [[SBJsonParser alloc] init];
_jsonwriter = [[SBJsonWriter alloc] init];
Oops, something went wrong.

0 comments on commit ff78552

Please sign in to comment.