From 5e3f352db55ea418b89b94cb98d7353500e5711b Mon Sep 17 00:00:00 2001 From: Christopher Newton Date: Sat, 19 Mar 2016 12:23:45 +0100 Subject: [PATCH] Initial commmit --- .gitignore | 26 ++ Epoch Flip Clock.xcodeproj/project.pbxproj | 289 +++++++++++++++++++++ EpochFlipClock.h | 4 + EpochFlipClock.m | 43 +++ Info.plist | 30 +++ index.html | 261 +++++++++++++++++++ readme.md | 0 7 files changed, 653 insertions(+) create mode 100644 .gitignore create mode 100755 Epoch Flip Clock.xcodeproj/project.pbxproj create mode 100755 EpochFlipClock.h create mode 100755 EpochFlipClock.m create mode 100755 Info.plist create mode 100755 index.html create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7277177 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Xcode +.DS_Store +*/build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +*.hmap +xcuserdata/* + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 +*.xcuserstate +project.xcworkspace/ +xcuserdata/ diff --git a/Epoch Flip Clock.xcodeproj/project.pbxproj b/Epoch Flip Clock.xcodeproj/project.pbxproj new file mode 100755 index 0000000..69ed3d8 --- /dev/null +++ b/Epoch Flip Clock.xcodeproj/project.pbxproj @@ -0,0 +1,289 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 47; + objects = { + +/* Begin PBXBuildFile section */ + 3A40066E18B53113005F43A6 /* ScreenSaver.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A40066D18B53113005F43A6 /* ScreenSaver.framework */; }; + 3A40068318B53129005F43A6 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A40068218B53129005F43A6 /* WebKit.framework */; }; + 7713E3931C961B5D009075D4 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 7713E3921C961B5D009075D4 /* index.html */; }; + 77996CD71C94B804006B0FF7 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 77996CD61C94B804006B0FF7 /* Info.plist */; }; + 77996CD91C94B825006B0FF7 /* EpochFlipClock.m in Sources */ = {isa = PBXBuildFile; fileRef = 77996CD81C94B825006B0FF7 /* EpochFlipClock.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3A40066818B53112005F43A6 /* Epoch Flip Clock.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Epoch Flip Clock.saver"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3A40066D18B53113005F43A6 /* ScreenSaver.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScreenSaver.framework; path = System/Library/Frameworks/ScreenSaver.framework; sourceTree = SDKROOT; }; + 3A40068218B53129005F43A6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + 3A95A94B18EA12D30036779C /* EpochFlipClock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EpochFlipClock.h; sourceTree = SOURCE_ROOT; }; + 7713E3921C961B5D009075D4 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = SOURCE_ROOT; }; + 77996CD61C94B804006B0FF7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; + 77996CD81C94B825006B0FF7 /* EpochFlipClock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EpochFlipClock.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3A40066318B53112005F43A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A40068318B53129005F43A6 /* WebKit.framework in Frameworks */, + 3A40066E18B53113005F43A6 /* ScreenSaver.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3A40065D18B53112005F43A6 = { + isa = PBXGroup; + children = ( + 3A40067318B53113005F43A6 /* Source */, + 3A40066A18B53112005F43A6 /* Frameworks */, + 3A40066918B53112005F43A6 /* Products */, + ); + sourceTree = ""; + }; + 3A40066918B53112005F43A6 /* Products */ = { + isa = PBXGroup; + children = ( + 3A40066818B53112005F43A6 /* Epoch Flip Clock.saver */, + ); + name = Products; + sourceTree = ""; + }; + 3A40066A18B53112005F43A6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3A40068218B53129005F43A6 /* WebKit.framework */, + 3A40066D18B53113005F43A6 /* ScreenSaver.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3A40067318B53113005F43A6 /* Source */ = { + isa = PBXGroup; + children = ( + 7713E3921C961B5D009075D4 /* index.html */, + 3A95A94B18EA12D30036779C /* EpochFlipClock.h */, + 77996CD81C94B825006B0FF7 /* EpochFlipClock.m */, + 77996CD61C94B804006B0FF7 /* Info.plist */, + ); + name = Source; + path = "That Wednesday"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 3A40066418B53112005F43A6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 3A40066718B53112005F43A6 /* Epoch Flip Clock */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3A40067F18B53113005F43A6 /* Build configuration list for PBXNativeTarget "Epoch Flip Clock" */; + buildPhases = ( + 3A40066218B53112005F43A6 /* Sources */, + 3A40066318B53112005F43A6 /* Frameworks */, + 3A40066418B53112005F43A6 /* Headers */, + 3A40066518B53112005F43A6 /* Resources */, + 3A40066618B53112005F43A6 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Epoch Flip Clock"; + productName = "That Wednesday"; + productReference = 3A40066818B53112005F43A6 /* Epoch Flip Clock.saver */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3A40065E18B53112005F43A6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = chrstphrknwtn; + }; + buildConfigurationList = 3A40066118B53112005F43A6 /* Build configuration list for PBXProject "Epoch Flip Clock" */; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 3A40065D18B53112005F43A6; + productRefGroup = 3A40066918B53112005F43A6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3A40066718B53112005F43A6 /* Epoch Flip Clock */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3A40066518B53112005F43A6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 77996CD71C94B804006B0FF7 /* Info.plist in Resources */, + 7713E3931C961B5D009075D4 /* index.html in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 3A40066618B53112005F43A6 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3A40066218B53112005F43A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 77996CD91C94B825006B0FF7 /* EpochFlipClock.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3A40067D18B53113005F43A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_NS_ASSERTIONS = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = fast; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 3A40067E18B53113005F43A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_NS_ASSERTIONS = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = fast; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Release; + }; + 3A40068018B53113005F43A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Screen Savers"; + PRODUCT_NAME = $TARGET_NAME; + WRAPPER_EXTENSION = saver; + }; + name = Debug; + }; + 3A40068118B53113005F43A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Screen Savers"; + PRODUCT_NAME = $TARGET_NAME; + WRAPPER_EXTENSION = saver; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3A40066118B53112005F43A6 /* Build configuration list for PBXProject "Epoch Flip Clock" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A40067D18B53113005F43A6 /* Debug */, + 3A40067E18B53113005F43A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3A40067F18B53113005F43A6 /* Build configuration list for PBXNativeTarget "Epoch Flip Clock" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A40068018B53113005F43A6 /* Debug */, + 3A40068118B53113005F43A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3A40065E18B53112005F43A6 /* Project object */; +} diff --git a/EpochFlipClock.h b/EpochFlipClock.h new file mode 100755 index 0000000..0a71357 --- /dev/null +++ b/EpochFlipClock.h @@ -0,0 +1,4 @@ +#import + +@interface EpochFlipClock : ScreenSaverView +@end diff --git a/EpochFlipClock.m b/EpochFlipClock.m new file mode 100755 index 0000000..14e1084 --- /dev/null +++ b/EpochFlipClock.m @@ -0,0 +1,43 @@ +#import "EpochFlipClock.h" +#import + +@implementation EpochFlipClock + +- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview { + if (!(self = [super initWithFrame:frame isPreview:isPreview])) return nil; + + NSURL* indexHTMLDocumentURL = [NSURL URLWithString:[[[NSURL fileURLWithPath:[[NSBundle bundleForClass:self.class].resourcePath stringByAppendingString:@"/index.html"] isDirectory:NO] description] stringByAppendingFormat:@"?screensaver=1%@", self.isPreview ? @"&is_preview=1" : @""]]; + + WebView* webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)]; + webView.drawsBackground = NO; // Avoids a "white flash" just before the index.html file has loaded + [webView.mainFrame loadRequest:[NSURLRequest requestWithURL:indexHTMLDocumentURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0]]; + [self addSubview:webView]; + + return self; +} + +#pragma mark - ScreenSaverView + +- (void)animateOneFrame { [self stopAnimation]; } +- (BOOL)hasConfigureSheet { return NO; } + +#pragma mark - WebFrameLoadDelegate + +- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { + NSLog(@"%@ error=%@", NSStringFromSelector(_cmd), error); +} + +#pragma mark Focus Overrides + +- (NSView *)hitTest:(NSPoint)aPoint {return self;} +- (void)keyDown:(NSEvent *)theEvent {return;} +- (void)keyUp:(NSEvent *)theEvent {return;} +- (void)mouseDown:(NSEvent *)theEvent {return;} +- (void)mouseUp:(NSEvent *)theEvent {return;} +- (void)mouseDragged:(NSEvent *)theEvent {return;} +- (void)mouseEntered:(NSEvent *)theEvent {return;} +- (void)mouseExited:(NSEvent *)theEvent {return;} +- (BOOL)acceptsFirstResponder {return YES;} +- (BOOL)resignFirstResponder {return NO;} + +@end diff --git a/Info.plist b/Info.plist new file mode 100755 index 0000000..03cd887 --- /dev/null +++ b/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.chrstphrknwtn.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 0.0.1 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSHumanReadableCopyright + Copyright © 2016 Christopher Newton. All rights reserved. + NSPrincipalClass + EpochFlipClock + + diff --git a/index.html b/index.html new file mode 100755 index 0000000..110d4a8 --- /dev/null +++ b/index.html @@ -0,0 +1,261 @@ + + + + + + + + + + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29