From 7369c4a012292a6d34f36cf9ab910a885989739b Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Tue, 13 Oct 2009 00:58:34 -0700 Subject: [PATCH] Initial commit. --- .gitignore | 3 + English.lproj/InfoPlist.strings | Bin 0 -> 206 bytes Info.plist | 28 +++ README.md | 53 +++++ WebSaver.xcodeproj/project.pbxproj | 301 +++++++++++++++++++++++++++++ WebSaverView.h | 18 ++ WebSaverView.m | 31 +++ WebSaver_Prefix.pch | 8 + index.html | 12 ++ 9 files changed, 454 insertions(+) create mode 100644 .gitignore create mode 100644 English.lproj/InfoPlist.strings create mode 100644 Info.plist create mode 100644 README.md create mode 100644 WebSaver.xcodeproj/project.pbxproj create mode 100644 WebSaverView.h create mode 100644 WebSaverView.m create mode 100644 WebSaver_Prefix.pch create mode 100644 index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a0c164 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +*.mode1v3 +*.pbxuser diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..e9e79163f65e6ed0c6ae5167540a668282f17c50 GIT binary patch literal 206 zcmZvV!4APt5Jk`0S2UK5w9*w3D;pBA;0uZtL0{9BgpbEb*D}eQd3WwT^Zlg6M63xM z$hmRhO~Fy^X>Vv%0+l_om%b~1rE@~v`&&BItL|6tib)w*8+I&taF<)Lb)U=4*_$d@ kNT^LT@=u(5#$3+u? + + + + CFBundleName + ${PRODUCT_NAME} + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CFBundleShortVersionString + 1.0 + NSPrincipalClass + WebSaverView + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..60ac33f --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +WebSaver: A WebKit-based Mac OS X screensaver +============================================= + +A Mac OS X screensaver which simply embeds WebKit to display a webpage or JavaScript application. Perfect for Canvas animations. + +Instructions +------------ + +1. Open WebSaver.xcodeproj in Xcode. + +2. Modify or replace index.html. + +3. Build. + +4. Double-click the built Web.saver to install. + +Notes +----- + +* Change the "Product Name" in the "Web" target if you are distributing a screensaver to prevent conflicts with others. + +TODO +---- + +* Integrate preferences. + +License +------- + +Copyright (c) 2009, Thomas Robinson +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Thomas Robinson nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY Thomas Robinson ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL Thomas Robinson BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/WebSaver.xcodeproj/project.pbxproj b/WebSaver.xcodeproj/project.pbxproj new file mode 100644 index 0000000..851116e --- /dev/null +++ b/WebSaver.xcodeproj/project.pbxproj @@ -0,0 +1,301 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 4D856DCE10845D98006C781A /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D856DCD10845D98006C781A /* WebKit.framework */; }; + 4D856DF31084601E006C781A /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 4D856DF21084601E006C781A /* index.html */; }; + 8D255AC70486D3F9007BF209 /* WebSaver_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCFA80370C50100C91783 /* WebSaver_Prefix.pch */; }; + 8D255AC80486D3F9007BF209 /* WebSaverView.h in Headers */ = {isa = PBXBuildFile; fileRef = F50079790118B23001CA0E54 /* WebSaverView.h */; }; + 8D255ACA0486D3F9007BF209 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; + 8D255ACC0486D3F9007BF209 /* WebSaverView.m in Sources */ = {isa = PBXBuildFile; fileRef = F500797A0118B23001CA0E54 /* WebSaverView.m */; }; + 8D255ACE0486D3F9007BF209 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; + 8D255ACF0486D3F9007BF209 /* ScreenSaver.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06F27B2DFFEEEFEF11CA0E56 /* ScreenSaver.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 06F27B2DFFEEEFEF11CA0E56 /* ScreenSaver.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScreenSaver.framework; path = /System/Library/Frameworks/ScreenSaver.framework; sourceTree = ""; }; + 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 32DBCFA80370C50100C91783 /* WebSaver_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSaver_Prefix.pch; sourceTree = ""; }; + 4D856DCD10845D98006C781A /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 4D856DF21084601E006C781A /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; + 8D255AD20486D3F9007BF209 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 8D255AD30486D3F9007BF209 /* Web.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Web.saver; sourceTree = BUILT_PRODUCTS_DIR; }; + F50079790118B23001CA0E54 /* WebSaverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSaverView.h; sourceTree = ""; }; + F500797A0118B23001CA0E54 /* WebSaverView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSaverView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D255ACD0486D3F9007BF209 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D255ACE0486D3F9007BF209 /* Cocoa.framework in Frameworks */, + 8D255ACF0486D3F9007BF209 /* ScreenSaver.framework in Frameworks */, + 4D856DCE10845D98006C781A /* WebKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* WebSaver */ = { + isa = PBXGroup; + children = ( + 08FB77AFFE84173DC02AAC07 /* Classes */, + 32DBCFA70370C4F300C91783 /* Other Sources */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, + 19C28FB8FE9D52D311CA2CBB /* Products */, + ); + name = WebSaver; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, + ); + name = "Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 4D856DF21084601E006C781A /* index.html */, + 8D255AD20486D3F9007BF209 /* Info.plist */, + 089C167DFE841241C02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77AFFE84173DC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + F50079790118B23001CA0E54 /* WebSaverView.h */, + F500797A0118B23001CA0E54 /* WebSaverView.m */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 4D856DCD10845D98006C781A /* WebKit.framework */, + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, + 06F27B2DFFEEEFEF11CA0E56 /* ScreenSaver.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 089C1672FE841209C02AAC07 /* Foundation.framework */, + 089C167FFE841241C02AAC07 /* AppKit.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FB8FE9D52D311CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D255AD30486D3F9007BF209 /* Web.saver */, + ); + name = Products; + sourceTree = ""; + }; + 32DBCFA70370C4F300C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32DBCFA80370C50100C91783 /* WebSaver_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D255AC60486D3F9007BF209 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D255AC70486D3F9007BF209 /* WebSaver_Prefix.pch in Headers */, + 8D255AC80486D3F9007BF209 /* WebSaverView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D255AC50486D3F9007BF209 /* Web */ = { + isa = PBXNativeTarget; + buildConfigurationList = EF7AD72D08BB986600CE4634 /* Build configuration list for PBXNativeTarget "Web" */; + buildPhases = ( + 8D255AC60486D3F9007BF209 /* Headers */, + 8D255AC90486D3F9007BF209 /* Resources */, + 8D255ACB0486D3F9007BF209 /* Sources */, + 8D255ACD0486D3F9007BF209 /* Frameworks */, + 8D255AD00486D3F9007BF209 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Web; + productInstallPath = "$(HOME)/Library/Screen Savers"; + productName = WebSaver; + productReference = 8D255AD30486D3F9007BF209 /* Web.saver */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = EF7AD73108BB986600CE4634 /* Build configuration list for PBXProject "WebSaver" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* WebSaver */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D255AC50486D3F9007BF209 /* Web */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D255AC90486D3F9007BF209 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D255ACA0486D3F9007BF209 /* InfoPlist.strings in Resources */, + 4D856DF31084601E006C781A /* index.html in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D255AD00486D3F9007BF209 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D255ACB0486D3F9007BF209 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D255ACC0486D3F9007BF209 /* WebSaverView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C167EFE841241C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EF7AD72E08BB986600CE4634 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WebSaver_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Screen Savers"; + PRODUCT_NAME = Web; + WRAPPER_EXTENSION = saver; + ZERO_LINK = YES; + }; + name = Debug; + }; + EF7AD72F08BB986600CE4634 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WebSaver_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Screen Savers"; + PRODUCT_NAME = Web; + WRAPPER_EXTENSION = saver; + }; + name = Release; + }; + EF7AD73208BB986600CE4634 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Debug; + }; + EF7AD73308BB986600CE4634 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EF7AD72D08BB986600CE4634 /* Build configuration list for PBXNativeTarget "Web" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EF7AD72E08BB986600CE4634 /* Debug */, + EF7AD72F08BB986600CE4634 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EF7AD73108BB986600CE4634 /* Build configuration list for PBXProject "WebSaver" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EF7AD73208BB986600CE4634 /* Debug */, + EF7AD73308BB986600CE4634 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/WebSaverView.h b/WebSaverView.h new file mode 100644 index 0000000..947e798 --- /dev/null +++ b/WebSaverView.h @@ -0,0 +1,18 @@ +// +// WebSaverView.h +// WebSaver +// +// Created by Thomas Robinson on 10/13/09. +// Copyright (c) 2009, 280 North. All rights reserved. +// + +#import + +#import + +@interface WebSaverView : ScreenSaverView +{ + WebView *webView; +} + +@end diff --git a/WebSaverView.m b/WebSaverView.m new file mode 100644 index 0000000..6a44c13 --- /dev/null +++ b/WebSaverView.m @@ -0,0 +1,31 @@ +// +// WebSaverView.m +// WebSaver +// +// Created by Thomas Robinson on 10/13/09. +// Copyright (c) 2009, 280 North. All rights reserved. +// + +#import "WebSaverView.h" + +#import + +@implementation WebSaverView + +- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview +{ + self = [super initWithFrame:frame isPreview:isPreview]; + if (self) { + webView = [[WebView alloc] initWithFrame:[self bounds] frameName:nil groupName:nil]; + [webView setMainFrameURL:[NSString stringWithFormat:@"file://%@/index.html", [[NSBundle bundleForClass:[self class]] resourcePath]]]; + [self addSubview:webView]; + } + return self; +} + +- (BOOL)hasConfigureSheet +{ + return NO; +} + +@end diff --git a/WebSaver_Prefix.pch b/WebSaver_Prefix.pch new file mode 100644 index 0000000..647bc8c --- /dev/null +++ b/WebSaver_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'WebSaver' target in the 'WebSaver' project. +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/index.html b/index.html new file mode 100644 index 0000000..b087c52 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + Hello world + + +

Hello world

+ +