Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge with configure sheet

  • Loading branch information...
commit 1d62ad27f2f8ffaac754244678d4e900153cb6b1 2 parents 952a5c4 + 02c4048
@gaohao gaohao authored
View
406 ConfigureSheet.nib/designable.nib
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1070</int>
+ <string key="IBDocument.SystemVersion">11E53</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.47</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">2182</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>NSTextField</string>
+ <string>NSView</string>
+ <string>NSWindowTemplate</string>
+ <string>NSTextFieldCell</string>
+ <string>NSButtonCell</string>
+ <string>NSButton</string>
+ <string>NSCustomObject</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="497868249">
+ <object class="NSCustomObject" id="503414426">
+ <string key="NSClassName">WebSaverView</string>
+ </object>
+ <object class="NSCustomObject" id="330826777">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="52339834">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="118645062">
+ <int key="NSWindowStyleMask">3</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{220, 283}, {373, 125}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle"/>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <nil key="NSUserInterfaceItemIdentifier"/>
+ <string key="NSWindowContentMinSize">{213, 107}</string>
+ <object class="NSView" key="NSWindowView" id="148509054">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSButton" id="974972154">
+ <reference key="NSNextResponder" ref="148509054"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{275, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="148509054"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="358906087">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">OK</string>
+ <object class="NSFont" key="NSSupport" id="919771288">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="974972154"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <object class="NSFont" key="NSAlternateImage" id="289168706">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="440118152">
+ <reference key="NSNextResponder" ref="148509054"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{191, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="148509054"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="974972154"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="662030944">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Cancel</string>
+ <reference key="NSSupport" ref="919771288"/>
+ <reference key="NSControlView" ref="440118152"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="289168706"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="56327547">
+ <reference key="NSNextResponder" ref="148509054"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{17, 88}, {29, 17}}</string>
+ <reference key="NSSuperview" ref="148509054"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="702940011"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="151749290">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">URL</string>
+ <reference key="NSSupport" ref="919771288"/>
+ <reference key="NSControlView" ref="56327547"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor" id="272141895">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextField" id="702940011">
+ <reference key="NSNextResponder" ref="148509054"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{20, 58}, {333, 22}}</string>
+ <reference key="NSSuperview" ref="148509054"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="440118152"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="976143226">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="919771288"/>
+ <reference key="NSControlView" ref="702940011"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textColor</string>
+ <reference key="NSColor" ref="272141895"/>
+ </object>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrameSize">{373, 125}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="56327547"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMinSize">{213, 129}</string>
+ <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ <bool key="NSWindowIsRestorable">YES</bool>
+ </object>
+ <object class="NSView" id="821279184">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{222, 1}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">configSheet</string>
+ <reference key="source" ref="503414426"/>
+ <reference key="destination" ref="118645062"/>
+ </object>
+ <int key="connectionID">33</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">okClick:</string>
+ <reference key="source" ref="503414426"/>
+ <reference key="destination" ref="974972154"/>
+ </object>
+ <int key="connectionID">39</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cancelClick:</string>
+ <reference key="source" ref="503414426"/>
+ <reference key="destination" ref="440118152"/>
+ </object>
+ <int key="connectionID">40</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">url</string>
+ <reference key="source" ref="503414426"/>
+ <reference key="destination" ref="702940011"/>
+ </object>
+ <int key="connectionID">57</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="702940011"/>
+ <reference key="destination" ref="974972154"/>
+ </object>
+ <int key="connectionID">52</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="497868249"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="503414426"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="330826777"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">13</int>
+ <reference key="object" ref="118645062"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="148509054"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Panel</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">18</int>
+ <reference key="object" ref="148509054"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="56327547"/>
+ <reference ref="974972154"/>
+ <reference ref="440118152"/>
+ <reference ref="702940011"/>
+ </array>
+ <reference key="parent" ref="118645062"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="974972154"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="358906087"/>
+ </array>
+ <reference key="parent" ref="148509054"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="440118152"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="662030944"/>
+ </array>
+ <reference key="parent" ref="148509054"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">16</int>
+ <reference key="object" ref="56327547"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="151749290"/>
+ </array>
+ <reference key="parent" ref="148509054"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">42</int>
+ <reference key="object" ref="358906087"/>
+ <reference key="parent" ref="974972154"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">43</int>
+ <reference key="object" ref="662030944"/>
+ <reference key="parent" ref="440118152"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">44</int>
+ <reference key="object" ref="151749290"/>
+ <reference key="parent" ref="56327547"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="52339834"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">28</int>
+ <reference key="object" ref="821279184"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">50</int>
+ <reference key="object" ref="702940011"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="976143226"/>
+ </array>
+ <reference key="parent" ref="148509054"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">51</int>
+ <reference key="object" ref="976143226"/>
+ <reference key="parent" ref="702940011"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="16.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="18.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="28.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="42.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="43.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="44.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="50.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="51.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">57</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">ScreenSaverView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ScreenSaverView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">WebSaverView</string>
+ <string key="superclassName">ScreenSaverView</string>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="configSheet">id</string>
+ <string key="url">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="configSheet">
+ <string key="name">configSheet</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="url">
+ <string key="name">url</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/WebSaverView.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1070" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
View
BIN  ConfigureSheet.nib/keyedobjects.nib
Binary file not shown
View
2  Info.plist
@@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
+ <string>com.github.gaohao.WebSaver</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
View
20 README.md
@@ -5,6 +5,8 @@ A Mac OS X screensaver which simply embeds WebKit to display a webpage or JavaSc
By default WebSaver comes with Tom Theisen's excellent "spread" Canvas experiment: http://tomtheisen.com/spread/
+This version includes a simple Preferences sheet.
+
Instructions
------------
@@ -16,26 +18,20 @@ To build from source, do the following:
1. Open WebSaver.xcodeproj in Xcode.
-2. Modify or replace index.html.
-
-3. Build.
+2. Build.
-4. Double-click the built Web.saver to install.
+3. 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 <http://tlrobinson.net/>
+Copyright (c) 2012, Senseg Ltd <http://www.senseg.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -45,11 +41,11 @@ modification, are permitted provided that the following conditions are met:
* 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
+ * Neither the name of the Thomas Robinson, Senseg 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
+THIS SOFTWARE IS PROVIDED BY Thomas Robinson AND/OR Senseg ''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
@@ -58,4 +54,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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.
View
8 WebSaver.xcodeproj/project.pbxproj
@@ -15,6 +15,7 @@
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 */; };
+ EA4A502B1563C91F005E4CCA /* ConfigureSheet.nib in Resources */ = {isa = PBXBuildFile; fileRef = EA4A502A1563C91F005E4CCA /* ConfigureSheet.nib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -28,6 +29,7 @@
4D856DF21084601E006C781A /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
8D255AD20486D3F9007BF209 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D255AD30486D3F9007BF209 /* Web.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Web.saver; sourceTree = BUILT_PRODUCTS_DIR; };
+ EA4A502A1563C91F005E4CCA /* ConfigureSheet.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = ConfigureSheet.nib; sourceTree = "<group>"; };
F50079790118B23001CA0E54 /* WebSaverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSaverView.h; sourceTree = "<group>"; };
F500797A0118B23001CA0E54 /* WebSaverView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSaverView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -70,6 +72,7 @@
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
+ EA4A502A1563C91F005E4CCA /* ConfigureSheet.nib */,
4D856DF21084601E006C781A /* index.html */,
8D255AD20486D3F9007BF209 /* Info.plist */,
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
@@ -187,6 +190,7 @@
files = (
8D255ACA0486D3F9007BF209 /* InfoPlist.strings in Resources */,
4D856DF31084601E006C781A /* index.html in Resources */,
+ EA4A502B1563C91F005E4CCA /* ConfigureSheet.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -267,7 +271,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
"INFOPLIST_FILE[sdk=*]" = "";
- MACOSX_DEPLOYMENT_TARGET = 10.4;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PUBLIC_HEADERS_FOLDER_PATH = Info.plist;
SDKROOT = macosx;
@@ -283,7 +287,7 @@
GCC_ENABLE_OBJC_GC = supported;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.4;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PUBLIC_HEADERS_FOLDER_PATH = Info.plist;
SDKROOT = macosx;
View
4 WebSaverView.h
@@ -3,7 +3,9 @@
// WebSaver
//
// Created by Thomas Robinson on 10/13/09.
+// Modified by Pekka Nikander in May 2012.
// Copyright (c) 2009, 280 North. All rights reserved.
+// Copyright (c) 2012, Senseg. All rights reserved.
//
#import <ScreenSaver/ScreenSaver.h>
@@ -12,6 +14,8 @@
@interface WebSaverView : ScreenSaverView
{
+ IBOutlet id configSheet;
+ IBOutlet id url;
WebView *webView;
}
View
53 WebSaverView.m
@@ -3,7 +3,9 @@
// WebSaver
//
// Created by Thomas Robinson on 10/13/09.
+// Modified by Pekka Nikander in May 2012.
// Copyright (c) 2009, 280 North. All rights reserved.
+// Copyright (c) 2012, Senseg. All rights reserved.
//
#import "WebSaverView.h"
@@ -12,12 +14,22 @@
@implementation WebSaverView
+static NSString * const ModuleName = @"com.github.gaohao.WebSaver";
+static NSString * const DefaultURL = @"www.haogao.me";
+
- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
self = [super initWithFrame:frame isPreview:isPreview];
if (self) {
+ ScreenSaverDefaults *defaults =
+ [ScreenSaverDefaults defaultsForModuleWithName:ModuleName];
+
+ [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
+ DefaultURL, @"URL",
+ nil]];
+
webView = [[WebView alloc] initWithFrame:[self bounds] frameName:nil groupName:nil];
- [webView setMainFrameURL:[NSString stringWithFormat:@"file://%@/index.html", [[NSBundle bundleForClass:[self class]] resourcePath]]];
+ [webView setMainFrameURL: [defaults valueForKey: @"URL"]];
[self addSubview:webView];
}
return self;
@@ -25,7 +37,44 @@ - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
- (BOOL)hasConfigureSheet
{
- return NO;
+ return YES;
+}
+
+- (NSWindow *)configureSheet
+{
+ ScreenSaverDefaults *defaults = [ScreenSaverDefaults defaultsForModuleWithName:ModuleName];
+
+ if (!configSheet)
+ {
+ if (![NSBundle loadNibNamed:@"ConfigureSheet" owner:self])
+ {
+ NSLog( @"Failed to load configure sheet." );
+ NSBeep();
+ }
+ }
+
+ [url setStringValue: [defaults valueForKey: @"URL"]];
+
+ return configSheet;
+}
+
+// Invoked when the user clicks "OK"
+- (IBAction) okClick: (id)sender
+{
+ ScreenSaverDefaults *defaults = [ScreenSaverDefaults defaultsForModuleWithName:ModuleName];
+
+ NSString *value = [url stringValue];
+ [defaults setValue: value forKey: @"URL"];
+ [defaults synchronize];
+ [webView setMainFrameURL: value];
+
+ [[NSApplication sharedApplication] endSheet:configSheet];
+}
+
+
+- (IBAction)cancelClick:(id)sender
+{
+ [[NSApplication sharedApplication] endSheet:configSheet];
}
@end
View
BIN  build/Release/Web.saver/Contents/Resources/English.lproj/InfoPlist.strings
Binary file not shown
View
140 build/Release/Web.saver/Contents/Resources/index.html
@@ -1,140 +0,0 @@
-<!DOCTYPE html >
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>spread</title>
- <!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
- <script type="text/javascript">
- var startradius = 20;
- var width = 600;
- var height = 600;
- var frame_time = 30;
- var straighten_factor = 0.95;
- var curviness = 0.2;
- var color_speed = 0.03;
- var new_branch_frames = 2;
- var branch_shrink = 0.95;
- var branch_opacity = 0.4;
-
- var paper;
- var branches = [];
- var direction_offset = 0;
- var frame = 0;
- var fadecheck;
- var cyclecheck;
- var randomizecheck;
- var wrapcheck;
-
- function paper_click(event) {
- create_tree(event.pageX - paper.canvas.offsetLeft, event.pageY - paper.canvas.offsetTop);
- }
-
- function create_tree(x, y) {
- branches.push(new Branch(x, y, 0, startradius));
- branches.push(new Branch(x, y, Math.PI * 2 / 3, startradius));
- branches.push(new Branch(x, y, Math.PI * 4 / 3, startradius));
- }
-
- function Branch(x, y, direction, radius) {
- this.x = x;
- this.y = y;
- this.radius = radius;
- this.original_radius = radius;
- this.direction = direction;
- }
-
- function clock_tick() {
- if (fadecheck.checked) {
- paper.fillRect(0,0,width,height);
- }
-
- if (cyclecheck.checked) {
- r = Math.floor(Math.sin(frame * color_speed) * 128 + 128)
- g = Math.floor(Math.sin(frame * color_speed + Math.PI * 2 / 3) * 128 + 128)
- b = Math.floor(Math.sin(frame * color_speed + Math.PI * 4 / 3) * 128 + 128)
- paper.strokeStyle = "rgba(" + r + "," + g + "," + b + ", " + branch_opacity + ")";
- }
-
- if(++frame % new_branch_frames == 0) {
- if (randomizecheck.checked) {
- x = (Math.random() + 0.1) * width * 0.8;
- y = (Math.random() + 0.1) * height * 0.8
- create_tree(x, y);
- } else {
- create_tree(width / 2, height / 2);
- }
- }
-
- direction_offset += Math.random() * curviness - curviness / 2;
- direction_offset *= straighten_factor;
-
- for (var i = branches.length - 1; i >= 0; i--) {
- var branch = branches[i];
-
- paper.beginPath();
- paper.lineWidth = branch.radius;
- paper.moveTo(branch.x, branch.y);
-
- branch.radius *= branch_shrink;
- branch.direction += direction_offset;
- branch.x += Math.cos(branch.direction) * branch.radius;
- branch.y += Math.sin(branch.direction) * branch.radius;
-
- paper.lineTo(branch.x, branch.y);
- paper.stroke();
-
- if (wrapcheck.checked) {
- if (branch.x > width) branch.x -= width;
- if (branch.x < 0) branch.x += width;
- if (branch.y > height) branch.y -= height;
- if (branch.y < 0) branch.y += height;
- }
-
- if (branch.radius < branch.original_radius / 2) {
- branches.splice(i, 1);
- var new_radius = branch.original_radius / 2;
- if (new_radius > 1) {
- branches.push(new Branch(branch.x, branch.y, branch.direction, new_radius));
- branches.push(new Branch(branch.x, branch.y, branch.direction + 1, new_radius));
- }
- }
- }
- }
-
- function setup() {
- fadecheck = document.getElementById("fadecheck");
- cyclecheck = document.getElementById("cyclecheck");
- randomizecheck = document.getElementById("randomizecheck");
- wrapcheck = document.getElementById("wrapcheck");
-
- var notepad = document.getElementById("notepad");
-
- width = notepad.width = window.innerWidth;
- height = notepad.height = window.innerHeight;
-
-
- paper = notepad.getContext("2d");
- paper.fillStyle = "rgb(0,0, 0)";
- paper.fillRect(0,0,width,height);
- paper.fillStyle = "rgba(0,0, 0, 0.005)";
-
- paper.strokeStyle = "rgba(128,128,64," + branch_opacity + ")";
- notepad.onclick = paper_click;
- document.getElementById("branchframestext").onblur = function() {new_branch_frames = parseInt(this.value);};
-
- setInterval(clock_tick, frame_time);
- }
-
- </script>
- </head>
- <body onload="setup()">
- <p>
- <input type="checkbox" id="cyclecheck" checked="checked" /> <label for="cyclecheck">Cycle colors</label>
- <input type="checkbox" id="fadecheck" /> <label for="fadecheck">Fade</label>
- <input type="checkbox" id="randomizecheck" checked="checked" /> <label for="randomizecheck">Randomize Position</label>
- <input type="checkbox" id="wrapcheck" /> <label for="wrapcheck">Wrap Edges</label>
- <br />
- <label for="branchframestext">Spawn new every n frames:</label> <input type="text" id="branchframestext" value="1" size="3" />
- </p>
- <canvas id="notepad" width="600" height="600" style="position: absolute; top: 0px; left: 0px;"></canvas>
- </body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.