Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
-rw-r--r-- 1 zblaxell zblaxell 8786914 May 27 06:18 xscreensaver-5.27.tar.gz
20c4c0f501ef92b2752397c0f25ce4c0bd5bcde0  xscreensaver-5.27.tar.gz
  • Loading branch information
Zygo Blaxell committed May 30, 2014
1 parent 3f10912 commit 8afc01a
Show file tree
Hide file tree
Showing 124 changed files with 16,908 additions and 16,989 deletions.
27 changes: 22 additions & 5 deletions Makefile.in
Expand Up @@ -12,7 +12,7 @@ SUBDIRS2 = $(SUBDIRS) OSX
TARFILES = README README.hacking README.VMS INSTALL \
configure configure.in Makefile.in config.h.in \
config.h-vms install-sh setup.com config.guess aclocal.m4 \
config.sub makevms.com \
ax_pthread.m4 config.sub makevms.com \
intltool-merge.in intltool-extract.in intltool-update.in \
xscreensaver.spec \
xscreensaver.xcodeproj/project.pbxproj
Expand Down Expand Up @@ -294,6 +294,13 @@ www::
NAME2="$$ADIR$$BNAME2" ; \
DNAME2="$$DEST/$$HEAD.dmg" ; \
\
if ! git diff --quiet ; then \
echo "uncommitted changes exist!" ; \
exit 1 ; \
fi ; \
\
$(MAKE) -C OSX updates.xml ; \
\
if [ ! -f $$NAME ]; then \
echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
exit 1 ; \
Expand All @@ -317,9 +324,16 @@ www::
exit 1 ; \
fi ; \
fi ; \
\
git commit -a -m "$$VERS" . ; \
git tag -a "v$$VERS" -m "$$VERS" . ; \
\
( cd $$DEST ; git pull . ) ; \
\
cp -p $$NAME $$DNAME ; \
cp -p $$NAME2 $$DNAME2 ; \
chmod u+w $$DNAME $$DNAME2 ; \
cp -p OSX/updates.xml $$DEST ; \
cd $$DEST ; \
\
TMP=/tmp/xd.$$$$ ; \
Expand All @@ -337,17 +351,18 @@ www::
if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then \
set -x ; \
rm $$OLDEST ; \
cvs remove $$OLDEST ; \
git rm $$OLDEST ; \
set +x ; \
fi ; \
done ; \
set -x ; \
cvs add -kb $$BNAME $$BNAME2 ; \
cat $$TMP > download.html ; \
rm -f $$TMP ; \
\
git add $$BNAME $$BNAME2 ; \
\
$(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
cvs diff -U0 changelog.html ; \
git diff changelog.html ; \
set +x ; \
\
/bin/echo -n "Ok? "; \
Expand All @@ -356,7 +371,9 @@ www::
exit 1 ; \
fi ; \
\
cvs commit -m "$$VERS"
git commit -m "$$VERS" . ; \
git tag -a "v$$VERS" -m "$$VERS" . ; \
git push . ; \
count::
Expand Down
42 changes: 34 additions & 8 deletions OSX/PrefsReader.m
Expand Up @@ -26,6 +26,7 @@ the UI (XScreenSaverConfigSheet).

#ifndef USE_IPHONE

#include <objc/runtime.h>

/* GlobalDefaults is an NSUserDefaults implementation that writes into
the preferences key we provide, instead of whatever the default would
Expand All @@ -49,18 +50,42 @@ @interface GlobalDefaults : NSUserDefaults
@end

@implementation GlobalDefaults
- (id) initWithDomain:(NSString *)_domain
{
- (id) initWithDomain:(NSString *)_domain module:(NSString *)_module
{
// Key-Value Observing tries to create an Objective-C class named
// NSKVONotifying_GlobalDefaults when the configuration page is shown. But if
// this is the second XScreenSaver .saver running in the same process, class
// creation fails because that class name was already used by the first
// .saver, and it refers to the GlobalDefaults from the other .saver.

// This gives the class a unique name, sidestepping the above issue.

// It really just needs to be unique for this .saver and this instance.
// Using the pointer to the .saver's mach_header and the full path to the
// .saver would be preferable, but this should be good enough.
char class_name[128];
sprintf(class_name, "GlobalDefaults_%s_%p_%u",
strrchr(_module.UTF8String, '.') + 1, self, random());
Class c = objc_allocateClassPair([GlobalDefaults class], class_name, 0);
if (!c)
return nil;
objc_registerClassPair(c);

self = [super init];
object_setClass(self, c);
domain = [_domain retain];
return self;
}

- (void) dealloc
{
Class c = object_getClass(self);

[domain release];
[defaults release];
[super dealloc];

objc_disposeClassPair(c);
}

- (void)registerDefaults:(NSDictionary *)dict
Expand Down Expand Up @@ -223,7 +248,7 @@ - (NSDictionary *) defaultsToDict: (const char * const *) defs
while (*val == ' ' || *val == '\t')
val++;

int L = strlen(val);
unsigned long L = strlen(val);
while (L > 0 && (val[L-1] == ' ' || val[L-1] == '\t'))
val[--L] = 0;

Expand Down Expand Up @@ -289,8 +314,8 @@ - (void) registerXrmKeys: (const XrmOptionDescRec *) opts
[[NSUserDefaultsController alloc] initWithDefaults:globalDefaults
initialValues:defsdict];
# else // USE_IPHONE
userDefaultsController = userDefaults;
globalDefaultsController = userDefaults;
userDefaultsController = [userDefaults retain];
globalDefaultsController = [userDefaults retain];
# endif // USE_IPHONE

NSDictionary *optsdict = [NSMutableDictionary dictionaryWithCapacity:20];
Expand Down Expand Up @@ -542,11 +567,11 @@ - (id) initWithName: (NSString *) name

# ifndef USE_IPHONE
userDefaults = [ScreenSaverDefaults defaultsForModuleWithName:name];
globalDefaults = [[[GlobalDefaults alloc] initWithDomain:@UPDATER_DOMAIN]
retain];
globalDefaults = [[GlobalDefaults alloc] initWithDomain:@UPDATER_DOMAIN
module:name];
# else // USE_IPHONE
userDefaults = [NSUserDefaults standardUserDefaults];
globalDefaults = userDefaults;
globalDefaults = [userDefaults retain];
# endif // USE_IPHONE

// Convert "org.jwz.xscreensaver.NAME" to just "NAME".
Expand All @@ -565,6 +590,7 @@ - (void) dealloc
[saver_name release];
[userDefaultsController release];
[globalDefaultsController release];
[globalDefaults release];
[super dealloc];
}

Expand Down
2 changes: 1 addition & 1 deletion OSX/README
Expand Up @@ -35,6 +35,6 @@ ridiculously long list of steps!
18: Build "XScreenSaver-iOS" once. then:
cd ~/src/xscreensaver/OSX ; make ios-function-table.m
and build it again.
19: cvs add xscreensaver.xcodeproj/xcuserdata/*/xcschemes/*.xcscheme
19: git add xscreensaver.xcodeproj/xcuserdata/*/xcschemes/*.xcscheme
20: Don't forget to create a man page from the XML with xml2man.pl,
and update Makefile.in.
19 changes: 10 additions & 9 deletions OSX/SaverListController.m
@@ -1,4 +1,4 @@
/* xscreensaver, Copyright (c) 2012-2013 Jamie Zawinski <jwz@jwz.org>
/* xscreensaver, Copyright (c) 2012-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
Expand Down Expand Up @@ -59,14 +59,15 @@ - (void)makeTitleBar
[[[NSBundle mainBundle] bundlePath]
stringByAppendingPathComponent:
@"iSaverRunner29t.png"]];
UIBarButtonItem *button = [[[UIBarButtonItem alloc]
initWithImage: img
style: UIBarButtonItemStylePlain
target: self
action: @selector(titleTapped:)]
autorelease];
button.width = img.size.width;
self.navigationItem.rightBarButtonItem = button;
UIButton *button = [[UIButton alloc] init];
[button setFrame: CGRectMake(0, 0, img.size.width, img.size.height)];
[button setBackgroundImage:img forState:UIControlStateNormal];
[button addTarget:self
action:@selector(titleTapped:)
forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem =
[[UIBarButtonItem alloc] initWithCustomView: button];
[button release];

// The title bar

Expand Down
3 changes: 2 additions & 1 deletion OSX/SaverRunner.m
Expand Up @@ -445,6 +445,8 @@ - (void)loadSaver:(NSString *)name launch:(BOOL)launch
[saverView stopAnimation];
[saverView removeFromSuperview];
[backgroundView removeFromSuperview];
[[NSNotificationCenter defaultCenter] removeObserver:saverView];
[saverView release];
}

NSSize size = [window frame].size;
Expand All @@ -461,7 +463,6 @@ - (void)loadSaver:(NSString *)name launch:(BOOL)launch
}

[saverView setFrame: [window frame]];
[saverView retain];
[[NSNotificationCenter defaultCenter]
addObserver:saverView
selector:@selector(didRotate:)
Expand Down
10 changes: 5 additions & 5 deletions OSX/SaverRunner.plist
Expand Up @@ -7,29 +7,29 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>5.26</string>
<string>5.27</string>
<key>CFBundleIconFile</key>
<string>SaverRunner</string>
<key>CFBundleIdentifier</key>
<string>${BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>5.26</string>
<string>5.27</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.26</string>
<string>5.27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.26</string>
<string>5.27</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>5.26</string>
<string>5.27</string>
<key>NSMainNibFile</key>
<string>SaverRunner</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 4 additions & 0 deletions OSX/Updater.h
Expand Up @@ -12,6 +12,9 @@
#ifndef USE_IPHONE
#import <Cocoa/Cocoa.h>
@interface XScreenSaverUpdater : NSObject <NSApplicationDelegate>
{
NSTimer *timer;
}
@end
#endif // !USE_IPHONE

Expand All @@ -26,6 +29,7 @@
#define SUSendProfileInfoDef YES
#define SUScheduledCheckIntervalKey "SUScheduledCheckInterval"
#define SUScheduledCheckIntervalDef 604800
#define SULastCheckTimeKey "SULastCheckTime"

#define UPDATER_DEFAULTS @{ \
@SUSUEnableAutomaticChecksKey: @SUSUEnableAutomaticChecksDef, \
Expand Down

0 comments on commit 8afc01a

Please sign in to comment.