From: Zygo Blaxell Date: Mon, 17 Oct 2016 02:50:43 +0000 (-0400) Subject: From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=commitdiff_plain;h=aa75c7476aeaa84cf3abc192b376a8b03c325213 From jwz.org/xscreensaver/xscreensaver-5.35.tar.gz -rw-r--r-- 1 zblaxell zblaxell 10502468 May 24 14:06 xscreensaver-5.35.tar.gz 2918e9db7a6d24189c5bcc401cec2d3adbee644b xscreensaver-5.35.tar.gz --- diff --git a/Makefile.in b/Makefile.in index bd6dd28b..c9190518 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,7 +6,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ SHELL = /bin/sh -SUBDIRS = utils driver hacks hacks/glx po +SUBDIRS = utils jwxyz hacks hacks/glx driver po SUBDIRS2 = $(SUBDIRS) OSX android TARFILES = README README.hacking README.VMS INSTALL \ configure configure.in Makefile.in config.h.in \ @@ -273,6 +273,7 @@ test-tar:: ../../configure --with-motif=/usr/local/lesstif --without-gnome ; \ echo --------------------------------------------------------------- ; \ ( cd utils; gmake all ) ; \ + ( cd jwxyz; gmake all ) ; \ ( cd driver; gmake all ) ; \ echo --------------------------------------------------------------- ); \ \ @@ -280,6 +281,8 @@ test-tar:: dmg:: $(MAKE) -C OSX release dmg +apk:: + $(MAKE) -C android apk www:: @ \ @@ -293,6 +296,9 @@ www:: BNAME2="$$HEAD.dmg" ; \ NAME2="$$ADIR$$BNAME2" ; \ DNAME2="$$DEST/$$HEAD.dmg" ; \ + BNAME3="$$HEAD.apk" ; \ + NAME3="$$ADIR$$BNAME3" ; \ + DNAME3="$$DEST/$$HEAD.apk" ; \ \ if ! git diff --quiet ; then \ echo "uncommitted changes exist!" ; \ @@ -309,6 +315,10 @@ www:: echo "$$NAME2 does not exist! Did you forget to \`make dmg'?" ; \ exit 1 ; \ fi ; \ + if [ ! -f $$NAME3 ]; then \ + echo "$$NAME3 does not exist! Did you forget to \`make apk'?" ; \ + exit 1 ; \ + fi ; \ chmod a-w $$NAME ; \ if [ -f $$DNAME ]; then \ /bin/echo -n "WARNING: $$DNAME already exists! Overwrite? "; \ @@ -323,6 +333,13 @@ www:: if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \ exit 1 ; \ fi ; \ + fi ; \ + if [ -f $$DNAME3 ]; then \ + /bin/echo -n "WARNING: $$DNAME3 already exists! Overwrite? "; \ + read line; \ + if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \ + exit 1 ; \ + fi ; \ fi ; \ \ git tag -a "v$$VERS" -m "$$VERS" ; \ @@ -332,7 +349,8 @@ www:: \ cp -p $$NAME $$DNAME ; \ cp -p $$NAME2 $$DNAME2 ; \ - chmod u+w $$DNAME $$DNAME2 ; \ + cp -p $$NAME3 $$DNAME3 ; \ + chmod u+w $$DNAME $$DNAME2 $$DNAME3 ; \ cp -p OSX/updates.xml $$DEST ; \ cd $$DEST ; \ \ @@ -359,7 +377,7 @@ www:: cat $$TMP > download.html ; \ rm -f $$TMP ; \ \ - git add $$BNAME $$BNAME2 ; \ + git add $$BNAME $$BNAME2 $$BNAME3 ; \ \ $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \ git diff changelog.html ; \ diff --git a/OSX/InvertedSlider.m b/OSX/InvertedSlider.m index 642a3e4f..6ac0b419 100644 --- a/OSX/InvertedSlider.m +++ b/OSX/InvertedSlider.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2015 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -83,8 +83,8 @@ - (NSAttributedString *)attributedStringValue; { - // #### "Build and Analyze" says this leaks. Unsure whether this is true. - return [[NSAttributedString alloc] initWithString:[self stringValue]]; + return [[[NSAttributedString alloc] initWithString:[self stringValue]] + autorelease]; } -(void)setFloatValue:(float)v { [self setDoubleValue: (double) v]; } diff --git a/OSX/LaunchScreen.xib b/OSX/LaunchScreen.xib index 580d9357..731d86e2 100644 --- a/OSX/LaunchScreen.xib +++ b/OSX/LaunchScreen.xib @@ -1,8 +1,8 @@ - + - + diff --git a/OSX/Makefile b/OSX/Makefile index 8400adf0..d8664552 100644 --- a/OSX/Makefile +++ b/OSX/Makefile @@ -1,21 +1,23 @@ -# XScreenSaver for MacOS X, Copyright (c) 2006-2014 by Jamie Zawinski. +# XScreenSaver for MacOS X, Copyright (c) 2006-2015 by Jamie Zawinski. -# We have to use Xcode 5.0.2 in order to build savers that will run on -# MacOS 10.6 and 10.7, because that's the latest version of Xcode that -# ships with a version of clang that implements "-fobjc-gc". +XCODE_APP = /Applications/Xcode.app + +# To build savers that will run on MacOS 10.6 and 10.7, Xcode 5.0.2 must +# be used (as that's the latest version of Xcode that ships with a version +# of clang that implements "-fobjc-gc"). However, Xcode 5.0.2 will not +# launch on MacOS 10.11 or later. # -XCODE_APP = /Applications/Xcode-5.0.2.app +# XCODE_APP = /Applications/Xcode-5.0.2.app TARGETS = All Savers -ARCH = -arch i386 -arch x86_64 +ARCH = -arch i386 -arch x86_64 ONLY_ACTIVE_ARCH=NO CERT = 'Jamie Zawinski' CERT = 'iPhone Developer: Jamie Zawinski (Y5M82TL69N)' PKGID = org.jwz.xscreensaver -THUMBDIR = $(HOME)/www/xscreensaver/screenshots/ +THUMBDIR = build/screenshots XCODEBUILD = $(XCODE_APP)/Contents/Developer/usr/bin/xcodebuild SETFILE = $(XCODE_APP)/Contents/Developer/Tools/SetFile -SETICON = /usr/local/bin/seticon -# seticon is from osxutils1.7.pkg +SETICON = ./seticon.pl default: release all: debug release @@ -40,12 +42,63 @@ release:: distdepend $(XCODEBUILD) $(ARCH) -target "$(TARGETS)" -configuration Release build release:: check_versions -release:: update_thumbs release:: sign Sparkle.framework: unzip ../archive/Sparkle.framework-2013-12-04.zip +# Download and resize images from jwz.org. +# This saves us having to include 4MB of images in the tar file +# that will only be used by a vast minority of people building +# from source. +# update-info-plist.pl runs this as needed. +# Might be better to do this with curl, since that is installed by default. + +URL = https://www.jwz.org/xscreensaver/screenshots/ +WGET = wget -q -U xscreensaver-build-osx +CVT = -thumbnail '200x150^' -gravity center -extent 200x150 \ + \( +clone -alpha extract \ + -draw 'fill black polygon 0,0 0,6 6,0 fill white circle 6,6 6,0' \ + \( +clone -flip \) -compose Multiply -composite \ + \( +clone -flop \) -compose Multiply -composite \ + \) -alpha off -compose CopyOpacity -composite \ + -colorspace sRGB \ + -strip \ + -quality 95 \ + +dither -colors 128 + +$(THUMBDIR)/%.png: + @\ + FILE1=`echo "$@" | sed 's!^.*/\([^/]*\)\.png$$!\1.jpg!'` ; \ + FILE2="$@" ; \ + TMP="$$FILE2".tmp ; \ + URL="$(URL)$$FILE1" ; \ + URL2="$(URL)retired/$$FILE1" ; \ + if [ ! -d $(THUMBDIR) ]; then mkdir -p $(THUMBDIR) ; fi ; \ + rm -f "$$FILE2" "$$TMP" ; \ + set +e ; \ + echo "downloading $$URL..." ; \ + $(WGET) -O"$$TMP" "$$URL" ; \ + if [ ! -s "$$TMP" ]; then \ + echo "downloading $$URL2..." ; \ + $(WGET) -O"$$TMP" "$$URL2" ; \ + fi ; \ + if [ ! -s "$$TMP" ]; then \ + rm -f "$$TMP" ; \ + echo "failed: $$URL" ; \ + exit 1 ; \ + fi ; \ + rm -f "$$FILE2" ; \ + convert jpg:- $(CVT) "$$FILE2" < "$$TMP" ; \ + if [ ! -s "$$FILE2" ]; then \ + echo "$$FILE2 failed" >&2 ; \ + rm -f "$$FILE2" "$$TMP" ; \ + exit 1 ; \ + else \ + rm -f "$$TMP" ; \ + fi + + sign: @for f in build/Release/*.app/Contents/*/*.saver \ build/Release/*.{saver,app} ; do \ @@ -131,10 +184,6 @@ check_coretext: exit $$RESULT -update_thumbs:: - ./update-thumbnail.pl $(THUMBDIR) build/Release/*.saver - - # Arrrrgh ios-function-table.m:: @./build-fntable.pl build/Debug-iphonesimulator/XScreenSaver.app $@ @@ -235,7 +284,8 @@ build/Release/installer.pkg: installer.rtf installer.xml installer.sh installer. # -format UDBZ saves 4% (~1.2 MB) over UDZO. dmg:: distdepend -dmg:: check_versions check_gc check_coretext +dmg:: check_versions check_coretext +#dmg:: check_gc dmg:: build/Release/installer.pkg dmg:: @ \ @@ -291,7 +341,7 @@ dmg:: cp -p bindist.rtf "$$STAGE/Read Me.rtf" ; \ cp -p build/Release/installer.pkg "$$PKG" ; \ cp -p bindist-DS_Store "$$STAGE/.DS_Store" ; \ - cp -p bindist.webloc "$$STAGE/Get the iPhone:iPad Version.webloc" ; \ + cp -p bindist.webloc "$$STAGE/" ; \ cp -p XScreenSaverDMG.icns "$$STAGE/.VolumeIcon.icns" ; \ ${SETFILE} -a C "$$STAGE" ; \ ${SETFILE} -a E "$$STAGE"/*.{rtf,pkg,webloc} ; \ @@ -300,6 +350,7 @@ dmg:: $(SETICON) -d XScreenSaverFolder.icns "$$DST" ; \ $(SETICON) -d XScreenSaverWebloc.icns "$$STAGE"/*.webloc ; \ $(SETICON) -d XScreenSaverPkg.icns "$$STAGE"/*.pkg ; \ + mv "$$STAGE/bindist.webloc" "$$STAGE/Get the iPhone:iPad Version.webloc" ; \ hdiutil makehybrid -quiet -ov -hfs -hfs-volume-name "$$VOLNAME" \ -hfs-openfolder "$$STAGE" "$$STAGE" -o "$$TMPDMG" ; \ rm -rf "$$STAGE" ; \ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/Contents.json b/OSX/Media-iOS.xcassets/AppIcon.appiconset/Contents.json index 43db2a4d..89e33aff 100644 --- a/OSX/Media-iOS.xcassets/AppIcon.appiconset/Contents.json +++ b/OSX/Media-iOS.xcassets/AppIcon.appiconset/Contents.json @@ -7,15 +7,29 @@ "scale" : "1x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "iSaverRunner58.png", "scale" : "2x" }, { + "size" : "29x29", "idiom" : "iphone", + "filename" : "iSaverRunner87.png", + "scale" : "3x" + }, + { "size" : "40x40", + "idiom" : "iphone", + "filename" : "iSaverRunner80.png", "scale" : "2x" }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "iSaverRunner120.png", + "scale" : "3x" + }, { "size" : "57x57", "idiom" : "iphone", @@ -35,8 +49,9 @@ "scale" : "2x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "iSaverRunner180.png", "scale" : "3x" }, { @@ -46,18 +61,21 @@ "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "iSaverRunner58.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "iSaverRunner40.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "iSaverRunner80.png", "scale" : "2x" }, { @@ -67,8 +85,9 @@ "scale" : "1x" }, { - "idiom" : "ipad", "size" : "50x50", + "idiom" : "ipad", + "filename" : "iSaverRunner100.png", "scale" : "2x" }, { @@ -94,6 +113,12 @@ "idiom" : "ipad", "filename" : "iSaverRunner152.png", "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "iSaverRunner167.png", + "scale" : "2x" } ], "info" : { diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner100.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner100.png new file mode 100644 index 00000000..4a71d447 Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner100.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner167.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner167.png new file mode 100644 index 00000000..85824f02 Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner167.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner180.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner180.png new file mode 100644 index 00000000..1e7d0ba6 Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner180.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner40.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner40.png new file mode 100644 index 00000000..20db74e8 Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner40.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner58.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner58.png new file mode 100644 index 00000000..e62c324f Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner58.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner80.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner80.png new file mode 100644 index 00000000..adc5ad7e Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner80.png differ diff --git a/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner87.png b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner87.png new file mode 100644 index 00000000..0335f60e Binary files /dev/null and b/OSX/Media-iOS.xcassets/AppIcon.appiconset/iSaverRunner87.png differ diff --git a/OSX/Media-iOS.xcassets/Contents.json b/OSX/Media-iOS.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/OSX/Media-iOS.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OSX/Media-iOS.xcassets/Image.imageset/Contents.json b/OSX/Media-iOS.xcassets/Image.imageset/Contents.json new file mode 100644 index 00000000..f8f827e4 --- /dev/null +++ b/OSX/Media-iOS.xcassets/Image.imageset/Contents.json @@ -0,0 +1,20 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/1242x2208.png b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/1242x2208.png new file mode 100644 index 00000000..2f3cd23c Binary files /dev/null and b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/1242x2208.png differ diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x1136.png b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x1136.png new file mode 100644 index 00000000..6763abe7 Binary files /dev/null and b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x1136.png differ diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x960.png b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x960.png new file mode 100644 index 00000000..0bfc1a93 Binary files /dev/null and b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/640x960.png differ diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/750x1334.png b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/750x1334.png new file mode 100644 index 00000000..4ec452de Binary files /dev/null and b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/750x1334.png differ diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Contents.json b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Contents.json index a6f99a2f..5dd89e09 100644 --- a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Contents.json +++ b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Contents.json @@ -3,6 +3,7 @@ { "orientation" : "portrait", "idiom" : "iphone", + "filename" : "640x960.png", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" @@ -11,7 +12,7 @@ "extent" : "full-screen", "idiom" : "iphone", "subtype" : "retina4", - "filename" : "Default-568h@2x.png", + "filename" : "640x1136.png", "minimum-system-version" : "7.0", "orientation" : "portrait", "scale" : "2x" @@ -19,23 +20,29 @@ { "orientation" : "portrait", "idiom" : "iphone", + "filename" : "640x1136.png", "extent" : "full-screen", - "scale" : "1x" + "subtype" : "retina4", + "scale" : "2x" }, { - "orientation" : "portrait", - "idiom" : "iphone", "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "750x1334.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", "scale" : "2x" }, { - "orientation" : "portrait", - "idiom" : "iphone", "extent" : "full-screen", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", - "scale" : "2x" - } + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "1242x2208.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, ], "info" : { "version" : 1, diff --git a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aa..00000000 Binary files a/OSX/Media-iOS.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/OSX/PrefsReader.m b/OSX/PrefsReader.m index 40442802..a1c4ed48 100644 --- a/OSX/PrefsReader.m +++ b/OSX/PrefsReader.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2015 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -97,7 +97,9 @@ { NSObject *obj = (NSObject *) CFPreferencesCopyAppValue ((CFStringRef) key, (CFStringRef) domain); - if (!obj && defaults) + if (obj) + [obj autorelease]; + else if (defaults) obj = [defaults objectForKey:key]; return obj; } diff --git a/OSX/PxPlus_IBM_VGA8.ttf b/OSX/PxPlus_IBM_VGA8.ttf new file mode 100644 index 00000000..0368d2bb Binary files /dev/null and b/OSX/PxPlus_IBM_VGA8.ttf differ diff --git a/OSX/README b/OSX/README index 68c2d003..555e8e25 100644 --- a/OSX/README +++ b/OSX/README @@ -15,25 +15,28 @@ ridiculously long list of steps! 1: Duplicate a target (Dangerball for GL, or Attraction for X11). 2: Rename it, and drag it to the right spot in the list. - 3: Delete the dangerball.c and dangerball.xml files from the new target. + 3: Delete the dangerball.c and dangerball.xml files from Build Phases. 4: Delete the "DangerBall copy-Info.plist" file that got created. 5: Delete the "DangerBall copy-Info.plist" from the Build Settings too. - 6: Change PRODUCT_NAME in Build Settings. + 6: Change PRODUCT_NAME in Build Settings (maybe this automatic now?) 7: Manage Schemes, rename "DangerBall Copy". 8: Move to the right place in the list. 9: Scheme / Run / Info: Executable: SaverTester.app. 10: Scheme / Run / Arguments: set SELECTED_SAVER environment variable. 11: File / Add Files / the new .c and .xml. - Add to targets: the new target, and also "XScreenSaver-iOS". - 12: Re-order them in the file list. - 13: In target "All Savers (OpenGL)" add the new target as a dependency. - 14: In target "XScreenSaver-iOS", reorder new files in "Copy" and "Compile". - 15: In target "XScreenSaver-iOS", add "-DUSE_GL" to the new file's options. - 16: Put a 200x150 screen shot in ~/www/xscreensaver/screenshots/ - 17: ln -s ../../src/xscreensaver/OSX/build/Debug/NEW.saver \ + 12: Select each file in the left pane; see Target Membership in the right + pane and add them to the new target, and to "XScreenSaver-iOS". + 13: Re-order them in the file list. + 14: In target "All Savers (OpenGL)" add the new target as Build Phases / + Target Dependency. + 15: In target "XScreenSaver-iOS", reorder new files in Build Phases / + "Copy" and "Compile", since they showed up in a random place. + 16: In target "XScreenSaver-iOS", add "-DUSE_GL" to the new file's options. + 17: Put a 200x150 screen shot in ~/www/xscreensaver/screenshots/ + 18: ln -s ../../src/xscreensaver/OSX/build/Debug/NEW.saver \ ~/Library/Screen\ Savers/ - 18: git add xscreensaver.xcodeproj/xcuserdata/*/xcschemes/*.xcscheme - 19: Don't forget to create a man page from the XML with xml2man.pl, + 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. - 20: Make a video: -record-animation 3600 -delay 1 -geom 1920x1080+128+64 + 21: Make a video: -record-animation 3600 -delay 1 -geom 1920x1080+128+64 ./upload-video.pl NAME diff --git a/OSX/SaverListController.m b/OSX/SaverListController.m index 05d2c436..9377275b 100644 --- a/OSX/SaverListController.m +++ b/OSX/SaverListController.m @@ -28,7 +28,7 @@ - (void) titleTapped:(id) sender { [[UIApplication sharedApplication] - openURL:[NSURL URLWithString:@"http://www.jwz.org/xscreensaver/"]]; + openURL:[NSURL URLWithString:@"https://www.jwz.org/xscreensaver/"]]; } @@ -65,8 +65,9 @@ [button addTarget:self action:@selector(titleTapped:) forControlEvents:UIControlEventTouchUpInside]; - self.navigationItem.rightBarButtonItem = - [[UIBarButtonItem alloc] initWithCustomView: button]; + UIBarButtonItem *bi = [[UIBarButtonItem alloc] initWithCustomView: button]; + self.navigationItem.rightBarButtonItem = bi; + [bi release]; [button release]; // The title bar diff --git a/OSX/SaverRunner.h b/OSX/SaverRunner.h index 8e88b86b..bacfd386 100644 --- a/OSX/SaverRunner.h +++ b/OSX/SaverRunner.h @@ -51,7 +51,11 @@ orientation just before the view controller is modal-presented, and restore the proper status bar orientation just before the saverView is created so it can pick it up in didRotate:. */ - UIInterfaceOrientation _storedOrientation; + // UIInterfaceOrientation _storedOrientation; + + BOOL _showAboutBox; + UIView *aboutBox; + NSTimer *splashTimer; } @property(nonatomic, retain) NSString *saverName; @@ -85,14 +89,12 @@ SaverViewController *nonrotating_controller; // Hierarchy 2 (savers) UIImage *saved_screenshot; - UIView *aboutBox; - NSTimer *splashTimer; # endif // USE_IPHONE } -- (XScreenSaverView *) makeSaverView: (NSString *) module - withSize: (NSSize) size; +- (XScreenSaverView *) newSaverView: (NSString *) module + withSize: (NSSize) size; - (void) loadSaver: (NSString *)name; - (void) selectedSaverDidChange:(NSDictionary *)change; @@ -101,8 +103,8 @@ #else // USE_IPHONE - (void) openPreferences: (NSString *)which; - (UIImage *) screenshot; -- (void)aboutPanel:(UIView *)saverView - orientation:(UIInterfaceOrientation)orient; +- (NSString *) makeDesc:(NSString *)saver + yearOnly:(BOOL) yearp; #endif // USE_IPHONE @end diff --git a/OSX/SaverRunner.m b/OSX/SaverRunner.m index b3ae2818..ac010b9f 100644 --- a/OSX/SaverRunner.m +++ b/OSX/SaverRunner.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2015 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2016 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -77,7 +77,7 @@ return allowRotation; } -- (NSUInteger)supportedInterfaceOrientations /* Added in iOS 6 */ +- (UIInterfaceOrientationMask)supportedInterfaceOrientations /* Added in iOS 6 */ { return UIInterfaceOrientationMaskAll; } @@ -90,11 +90,13 @@ @synthesize saverName; - (id)initWithSaverRunner:(SaverRunner *)parent + showAboutBox:(BOOL)showAboutBox { self = [super init]; if (self) { _parent = parent; - _storedOrientation = UIInterfaceOrientationUnknown; + // _storedOrientation = UIInterfaceOrientationUnknown; + _showAboutBox = showAboutBox; self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; self.wantsFullScreenLayout = YES; @@ -106,7 +108,13 @@ - (void)dealloc { [_saverName release]; - [_saverView dealloc]; + // iOS: When a UIView deallocs, it doesn't do [UIView removeFromSuperView] + // for its subviews, so the subviews end up with a dangling pointer in their + // superview properties. + [aboutBox removeFromSuperview]; + [aboutBox release]; + [_saverView removeFromSuperview]; + [_saverView release]; [super dealloc]; } @@ -121,6 +129,200 @@ UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectNull]; backgroundView.backgroundColor = [UIColor blackColor]; self.view = backgroundView; + [backgroundView release]; +} + + +- (void)aboutPanel:(UIView *)saverView + orientation:(UIInterfaceOrientation)orient +{ + if (!_showAboutBox) + return; + + NSString *name = _saverName; + NSString *year = [_parent makeDesc:_saverName yearOnly:YES]; + + + CGRect frame = [saverView frame]; + CGFloat rot; + CGFloat pt1 = 24; + CGFloat pt2 = 14; + UIFont *font1 = [UIFont boldSystemFontOfSize: pt1]; + UIFont *font2 = [UIFont italicSystemFontOfSize:pt2]; + +# ifdef __IPHONE_7_0 + CGSize s = CGSizeMake(frame.size.width, frame.size.height); + CGSize tsize1 = [[[NSAttributedString alloc] + initWithString: name + attributes:@{ NSFontAttributeName: font1 }] + boundingRectWithSize: s + options: NSStringDrawingUsesLineFragmentOrigin + context: nil].size; + CGSize tsize2 = [[[NSAttributedString alloc] + initWithString: name + attributes:@{ NSFontAttributeName: font2 }] + boundingRectWithSize: s + options: NSStringDrawingUsesLineFragmentOrigin + context: nil].size; +# else // iOS 6 or Cocoa + CGSize tsize1 = [name sizeWithFont:font1 + constrainedToSize:CGSizeMake(frame.size.width, + frame.size.height)]; + CGSize tsize2 = [year sizeWithFont:font2 + constrainedToSize:CGSizeMake(frame.size.width, + frame.size.height)]; +# endif + + CGSize tsize = CGSizeMake (tsize1.width > tsize2.width ? + tsize1.width : tsize2.width, + tsize1.height + tsize2.height); + + tsize.width = ceilf(tsize.width); + tsize.height = ceilf(tsize.height); + + // Don't know how to find inner margin of UITextView. + CGFloat margin = 10; + tsize.width += margin * 4; + tsize.height += margin * 2; + + if ([saverView frame].size.width >= 768) + tsize.height += pt1 * 3; // extra bottom margin on iPad + + frame = CGRectMake (0, 0, tsize.width, tsize.height); + + /* Get the text oriented properly, and move it to the bottom of the + screen, since many savers have action in the middle. + */ + switch (orient) { + case UIInterfaceOrientationLandscapeLeft: + rot = -M_PI/2; + frame.origin.x = ([saverView frame].size.width + - (tsize.width - tsize.height) / 2 + - tsize.height); + frame.origin.y = ([saverView frame].size.height - tsize.height) / 2; + break; + case UIInterfaceOrientationLandscapeRight: + rot = M_PI/2; + frame.origin.x = -(tsize.width - tsize.height) / 2; + frame.origin.y = ([saverView frame].size.height - tsize.height) / 2; + break; + case UIInterfaceOrientationPortraitUpsideDown: + rot = M_PI; + frame.origin.x = ([saverView frame].size.width - tsize.width) / 2; + frame.origin.y = 0; + break; + default: + rot = 0; + frame.origin.x = ([saverView frame].size.width - tsize.width) / 2; + frame.origin.y = [saverView frame].size.height - tsize.height; + break; + } + + if (aboutBox) { + [aboutBox removeFromSuperview]; + [aboutBox release]; + } + + aboutBox = [[UIView alloc] initWithFrame:frame]; + + aboutBox.transform = CGAffineTransformMakeRotation (rot); + aboutBox.backgroundColor = [UIColor clearColor]; + + /* There seems to be no easy way to stroke the font, so instead draw + it 5 times, 4 in black and 1 in yellow, offset by 1 pixel, and add + a black shadow to each. (You'd think the shadow alone would be + enough, but there's no way to make it dark enough to be legible.) + */ + for (int i = 0; i < 5; i++) { + UITextView *textview; + int off = 1; + frame.origin.x = frame.origin.y = 0; + switch (i) { + case 0: frame.origin.x = -off; break; + case 1: frame.origin.x = off; break; + case 2: frame.origin.y = -off; break; + case 3: frame.origin.y = off; break; + } + + for (int j = 0; j < 2; j++) { + + frame.origin.y = (j == 0 ? 0 : pt1); + textview = [[UITextView alloc] initWithFrame:frame]; + textview.font = (j == 0 ? font1 : font2); + textview.text = (j == 0 ? name : year); + textview.textAlignment = NSTextAlignmentCenter; + textview.showsHorizontalScrollIndicator = NO; + textview.showsVerticalScrollIndicator = NO; + textview.scrollEnabled = NO; + textview.editable = NO; + textview.userInteractionEnabled = NO; + textview.backgroundColor = [UIColor clearColor]; + textview.textColor = (i == 4 + ? [UIColor yellowColor] + : [UIColor blackColor]); + + CALayer *textLayer = (CALayer *) + [textview.layer.sublayers objectAtIndex:0]; + textLayer.shadowColor = [UIColor blackColor].CGColor; + textLayer.shadowOffset = CGSizeMake(0, 0); + textLayer.shadowOpacity = 1; + textLayer.shadowRadius = 2; + + [aboutBox addSubview:textview]; + } + } + + CABasicAnimation *anim = + [CABasicAnimation animationWithKeyPath:@"opacity"]; + anim.duration = 0.3; + anim.repeatCount = 1; + anim.autoreverses = NO; + anim.fromValue = [NSNumber numberWithFloat:0.0]; + anim.toValue = [NSNumber numberWithFloat:1.0]; + [aboutBox.layer addAnimation:anim forKey:@"animateOpacity"]; + + [saverView addSubview:aboutBox]; + + if (splashTimer) + [splashTimer invalidate]; + + splashTimer = + [NSTimer scheduledTimerWithTimeInterval: anim.duration + 2 + target:self + selector:@selector(aboutOff) + userInfo:nil + repeats:NO]; +} + + +- (void)aboutOff +{ + [self aboutOff:FALSE]; +} + +- (void)aboutOff:(BOOL)fast +{ + if (aboutBox) { + if (splashTimer) { + [splashTimer invalidate]; + splashTimer = 0; + } + if (fast) { + aboutBox.layer.opacity = 0; + return; + } + + CABasicAnimation *anim = + [CABasicAnimation animationWithKeyPath:@"opacity"]; + anim.duration = 0.3; + anim.repeatCount = 1; + anim.autoreverses = NO; + anim.fromValue = [NSNumber numberWithFloat: 1]; + anim.toValue = [NSNumber numberWithFloat: 0]; + // anim.delegate = self; + aboutBox.layer.opacity = 0; + [aboutBox.layer addAnimation:anim forKey:@"animateOpacity"]; + } } @@ -133,14 +335,16 @@ [_saverView release]; } +# if 0 if (_storedOrientation != UIInterfaceOrientationUnknown) { [[UIApplication sharedApplication] setStatusBarOrientation:_storedOrientation animated:NO]; } +# endif - _saverView = [_parent makeSaverView:_saverName - withSize:parentView.bounds.size]; + _saverView = [_parent newSaverView:_saverName + withSize:parentView.bounds.size]; if (! _saverView) { [[[UIAlertView alloc] initWithTitle: _saverName @@ -153,6 +357,8 @@ } _saverView.delegate = _parent; + _saverView.autoresizingMask = + UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:_saverView]; @@ -160,12 +366,14 @@ // heirarchy. [_saverView becomeFirstResponder]; // For shakes on iOS 6. [_saverView startAnimation]; - [_parent aboutPanel:_saverView orientation:_storedOrientation]; + [self aboutPanel:_saverView + orientation:/* _storedOrientation */ UIInterfaceOrientationPortrait]; } - (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; [self createSaverView]; } @@ -178,23 +386,25 @@ - (BOOL)shouldAutorotate /* Added in iOS 6 */ { - return NO; + return YES; } -- (NSUInteger)supportedInterfaceOrientations /* Added in iOS 6 */ +- (UIInterfaceOrientationMask)supportedInterfaceOrientations /* Added in iOS 6 */ { // Lies from the iOS docs: // "This method is only called if the view controller's shouldAutorotate // method returns YES." - return UIInterfaceOrientationMaskPortrait; + return UIInterfaceOrientationMaskAll; } +/* - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationPortrait; } +*/ - (void)setSaverName:(NSString *)name @@ -202,12 +412,43 @@ [name retain]; [_saverName release]; _saverName = name; - _storedOrientation = [UIApplication sharedApplication].statusBarOrientation; + // _storedOrientation = + // [UIApplication sharedApplication].statusBarOrientation; if (_saverView) [self createSaverView]; } + +- (void)viewWillTransitionToSize: (CGSize)size + withTransitionCoordinator: + (id) coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + + if (!_saverView) + return; + + [CATransaction begin]; + + // Completely suppress the rotation animation, since we + // will not (visually) be rotating at all. + if ([_saverView suppressRotationAnimation]) + [CATransaction setDisableActions:YES]; + + [self aboutOff:TRUE]; // It does goofy things if we rotate while it's up + + [coordinator animateAlongsideTransition:^ + (id context) { + // This executes repeatedly during the rotation. + } completion:^(id context) { + // This executes once when the rotation has finished. + [CATransaction commit]; + [_saverView orientationChanged]; + }]; + // No code goes here, as it would execute before the above completes. +} + @end #endif // USE_IPHONE @@ -216,8 +457,8 @@ @implementation SaverRunner -- (XScreenSaverView *) makeSaverView: (NSString *) module - withSize: (NSSize) size +- (XScreenSaverView *) newSaverView: (NSString *) module + withSize: (NSSize) size { Class new_class = 0; @@ -293,7 +534,7 @@ */ # ifndef USE_IPHONE if ([saverNames count] == 1) { - putenv (strdup ("XSCREENSAVER_STANDALONE=1")); + setenv ("XSCREENSAVER_STANDALONE", "1", 1); } # endif @@ -516,8 +757,8 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) - (void) openPreferences: (NSString *) saver { - XScreenSaverView *saverView = [self makeSaverView:saver - withSize:CGSizeMake(0, 0)]; + XScreenSaverView *saverView = [self newSaverView:saver + withSize:CGSizeMake(0, 0)]; if (! saverView) return; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; @@ -526,8 +767,6 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) [rotating_nav pushViewController: [saverView configureView] animated:YES]; - - [saverView release]; } @@ -567,15 +806,15 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) } NSSize size = [cv frame].size; - ScreenSaverView *new_view = [self makeSaverView:name withSize: size]; + ScreenSaverView *new_view = [self newSaverView:name withSize: size]; NSAssert (new_view, @"unable to make a saver view"); [new_view setFrame: (old_view ? [old_view frame] : [cv frame])]; [sup addSubview: new_view]; [win makeFirstResponder:new_view]; [new_view setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; - [new_view retain]; [new_view startAnimation]; + [new_view release]; } NSUserDefaultsController *ctl = @@ -584,7 +823,7 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) # else // USE_IPHONE -# if TARGET_IPHONE_SIMULATOR +# if !defined __OPTIMIZE__ || TARGET_IPHONE_SIMULATOR NSLog (@"selecting saver \"%@\"", name); # endif @@ -608,7 +847,7 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) return; } -# if TARGET_IPHONE_SIMULATOR +# if !defined __OPTIMIZE__ || TARGET_IPHONE_SIMULATOR UIScreen *screen = [UIScreen mainScreen]; /* 'nativeScale' is very confusing. @@ -685,7 +924,9 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) // presentation full screen. rotating_nav.modalPresentationStyle = UIModalPresentationFullScreen; - nonrotating_controller = [[SaverViewController alloc] initWithSaverRunner:self]; + nonrotating_controller = [[SaverViewController alloc] + initWithSaverRunner:self + showAboutBox:[saverNames count] != 1]; nonrotating_controller.saverName = name; /* LAUNCH: */ @@ -712,197 +953,17 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) [d setValue:[bd objectForKey:@"CFBundleShortVersionString"] forKey:@"ApplicationVersion"]; [d setValue:[bd objectForKey:@"NSHumanReadableCopyright"] forKey:@"Copy"]; - [d setValue:[[NSAttributedString alloc] - initWithString: (NSString *) - [bd objectForKey:@"CFBundleGetInfoString"]] - forKey:@"Credits"]; - + NSAttributedString *s = [[NSAttributedString alloc] + initWithString: (NSString *) + [bd objectForKey:@"CFBundleGetInfoString"]]; + [d setValue:s forKey:@"Credits"]; + [s release]; + [[NSApplication sharedApplication] orderFrontStandardAboutPanelWithOptions:d]; } -#else // USE_IPHONE - -- (void)aboutPanel:(UIView *)saverView - orientation:(UIInterfaceOrientation)orient -{ - if ([saverNames count] == 1) - return; - - NSString *name = saverName; - NSString *year = [self makeDesc:saverName yearOnly:YES]; - - - CGRect frame = [saverView frame]; - CGFloat rot; - CGFloat pt1 = 24; - CGFloat pt2 = 14; - UIFont *font1 = [UIFont boldSystemFontOfSize: pt1]; - UIFont *font2 = [UIFont italicSystemFontOfSize:pt2]; - -# ifdef __IPHONE_7_0 - CGSize s = CGSizeMake(frame.size.width, frame.size.height); - CGSize tsize1 = [[[NSAttributedString alloc] - initWithString: name - attributes:@{ NSFontAttributeName: font1 }] - boundingRectWithSize: s - options: NSStringDrawingUsesLineFragmentOrigin - context: nil].size; - CGSize tsize2 = [[[NSAttributedString alloc] - initWithString: name - attributes:@{ NSFontAttributeName: font2 }] - boundingRectWithSize: s - options: NSStringDrawingUsesLineFragmentOrigin - context: nil].size; -# else // iOS 6 or Cocoa - CGSize tsize1 = [name sizeWithFont:font1 - constrainedToSize:CGSizeMake(frame.size.width, - frame.size.height)]; - CGSize tsize2 = [year sizeWithFont:font2 - constrainedToSize:CGSizeMake(frame.size.width, - frame.size.height)]; -# endif - - CGSize tsize = CGSizeMake (tsize1.width > tsize2.width ? - tsize1.width : tsize2.width, - tsize1.height + tsize2.height); - - tsize.width = ceilf(tsize.width); - tsize.height = ceilf(tsize.height); - - // Don't know how to find inner margin of UITextView. - CGFloat margin = 10; - tsize.width += margin * 4; - tsize.height += margin * 2; - - if ([saverView frame].size.width >= 768) - tsize.height += pt1 * 3; // extra bottom margin on iPad - - frame = CGRectMake (0, 0, tsize.width, tsize.height); - - /* Get the text oriented properly, and move it to the bottom of the - screen, since many savers have action in the middle. - */ - switch (orient) { - case UIInterfaceOrientationLandscapeLeft: - rot = -M_PI/2; - frame.origin.x = ([saverView frame].size.width - - (tsize.width - tsize.height) / 2 - - tsize.height); - frame.origin.y = ([saverView frame].size.height - tsize.height) / 2; - break; - case UIInterfaceOrientationLandscapeRight: - rot = M_PI/2; - frame.origin.x = -(tsize.width - tsize.height) / 2; - frame.origin.y = ([saverView frame].size.height - tsize.height) / 2; - break; - case UIInterfaceOrientationPortraitUpsideDown: - rot = M_PI; - frame.origin.x = ([saverView frame].size.width - tsize.width) / 2; - frame.origin.y = 0; - break; - default: - rot = 0; - frame.origin.x = ([saverView frame].size.width - tsize.width) / 2; - frame.origin.y = [saverView frame].size.height - tsize.height; - break; - } - - if (aboutBox) - [aboutBox removeFromSuperview]; - - aboutBox = [[UIView alloc] initWithFrame:frame]; - - aboutBox.transform = CGAffineTransformMakeRotation (rot); - aboutBox.backgroundColor = [UIColor clearColor]; - - /* There seems to be no easy way to stroke the font, so instead draw - it 5 times, 4 in black and 1 in yellow, offset by 1 pixel, and add - a black shadow to each. (You'd think the shadow alone would be - enough, but there's no way to make it dark enough to be legible.) - */ - for (int i = 0; i < 5; i++) { - UITextView *textview; - int off = 1; - frame.origin.x = frame.origin.y = 0; - switch (i) { - case 0: frame.origin.x = -off; break; - case 1: frame.origin.x = off; break; - case 2: frame.origin.y = -off; break; - case 3: frame.origin.y = off; break; - } - - for (int j = 0; j < 2; j++) { - - frame.origin.y = (j == 0 ? 0 : pt1); - textview = [[UITextView alloc] initWithFrame:frame]; - textview.font = (j == 0 ? font1 : font2); - textview.text = (j == 0 ? name : year); - textview.textAlignment = NSTextAlignmentCenter; - textview.showsHorizontalScrollIndicator = NO; - textview.showsVerticalScrollIndicator = NO; - textview.scrollEnabled = NO; - textview.editable = NO; - textview.userInteractionEnabled = NO; - textview.backgroundColor = [UIColor clearColor]; - textview.textColor = (i == 4 - ? [UIColor yellowColor] - : [UIColor blackColor]); - - CALayer *textLayer = (CALayer *) - [textview.layer.sublayers objectAtIndex:0]; - textLayer.shadowColor = [UIColor blackColor].CGColor; - textLayer.shadowOffset = CGSizeMake(0, 0); - textLayer.shadowOpacity = 1; - textLayer.shadowRadius = 2; - - [aboutBox addSubview:textview]; - } - } - - CABasicAnimation *anim = - [CABasicAnimation animationWithKeyPath:@"opacity"]; - anim.duration = 0.3; - anim.repeatCount = 1; - anim.autoreverses = NO; - anim.fromValue = [NSNumber numberWithFloat:0.0]; - anim.toValue = [NSNumber numberWithFloat:1.0]; - [aboutBox.layer addAnimation:anim forKey:@"animateOpacity"]; - - [saverView addSubview:aboutBox]; - - if (splashTimer) - [splashTimer invalidate]; - - splashTimer = - [NSTimer scheduledTimerWithTimeInterval: anim.duration + 2 - target:self - selector:@selector(aboutOff) - userInfo:nil - repeats:NO]; -} - - -- (void)aboutOff -{ - if (aboutBox) { - if (splashTimer) { - [splashTimer invalidate]; - splashTimer = 0; - } - CABasicAnimation *anim = - [CABasicAnimation animationWithKeyPath:@"opacity"]; - anim.duration = 0.3; - anim.repeatCount = 1; - anim.autoreverses = NO; - anim.fromValue = [NSNumber numberWithFloat: 1]; - anim.toValue = [NSNumber numberWithFloat: 0]; - anim.delegate = self; - aboutBox.layer.opacity = 0; - [aboutBox.layer addAnimation:anim forKey:@"animateOpacity"]; - } -} -#endif // USE_IPHONE +#endif // !USE_IPHONE @@ -942,12 +1003,6 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) NSString *name = [[p lastPathComponent] stringByDeletingPathExtension]; # ifdef USE_IPHONE - -# ifdef __OPTIMIZE__ - // Do not show TestX11 in release builds. - if (! [name caseInsensitiveCompare:@"testx11"]) - continue; -# endif // Get the saver name's capitalization right by reading the XML file. p = [dir stringByAppendingPathComponent: p]; @@ -1068,6 +1123,7 @@ relabel_menus (NSObject *v, NSString *old_str, NSString *new_str) NSRect r = [popup frame]; r.size.width = max_width; [popup setFrame:r]; + [popup autorelease]; return popup; } @@ -1185,9 +1241,23 @@ FAIL: and/or 8.2), this confuses the UINavigationController, so put the orientation back to portrait before dismissing the SaverViewController. */ +# if 0 [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; +# endif + + /* Make sure the most-recently-run saver is visible. Sometimes it ends + up scrolled half a line off the bottom of the screen. + */ + if (saverName) { + for (UIViewController *v in [rotating_nav viewControllers]) { + if ([v isKindOfClass:[SaverListController class]]) { + [(SaverListController *)v scrollTo: saverName]; + break; + } + } + } [rotating_nav dismissViewControllerAnimated:YES completion:^() { [nonrotating_controller release]; @@ -1301,8 +1371,10 @@ FAIL: [pbox setTitlePosition:NSNoTitle]; [pbox setBorderType:NSNoBorder]; [pbox addSubview:gbox]; + [gbox release]; if (menu) [pbox addSubview:menu]; if (pb) [pbox addSubview:pb]; + [pb release]; [pbox sizeToFit]; [pb setAutoresizingMask:NSViewMinXMargin|NSViewMaxXMargin]; @@ -1334,10 +1406,12 @@ FAIL: screen:screen]; [win setMinSize:[win frameRectForContentRect:rect].size]; [[win contentView] addSubview: (pbox ? (NSView *) pbox : (NSView *) sv)]; + [pbox release]; [win makeKeyAndOrderFront:win]; [sv startAnimation]; // this is the dummy saver + [sv autorelease]; count++; @@ -1386,6 +1460,7 @@ FAIL: [a addObject: win]; // This prevents clicks from being seen by savers. // [win setMovableByWindowBackground:YES]; + [win release]; } # else // USE_IPHONE @@ -1419,6 +1494,7 @@ FAIL: descriptions:[self makeDescTable]]; [rotating_nav pushViewController:menu animated:YES]; [menu becomeFirstResponder]; + [menu autorelease]; application.applicationSupportsShakeToEdit = YES; diff --git a/OSX/SaverRunner.plist b/OSX/SaverRunner.plist index d28e99aa..b3b74991 100644 --- a/OSX/SaverRunner.plist +++ b/OSX/SaverRunner.plist @@ -7,29 +7,29 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleGetInfoString - 5.34 + 5.35 CFBundleIconFile SaverRunner CFBundleIdentifier - ${BUNDLE_IDENTIFIER} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString - 5.34 + 5.35 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString - 5.34 + 5.35 CFBundleSignature ???? CFBundleVersion - 5.34 + 5.35 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - 5.34 + 5.35 NSMainNibFile SaverRunner NSPrincipalClass diff --git a/OSX/Updater.plist b/OSX/Updater.plist index b8550832..692f7a01 100644 --- a/OSX/Updater.plist +++ b/OSX/Updater.plist @@ -4,36 +4,36 @@ CFBundleDevelopmentRegion English + CFBundleDisplayName + XScreenSaver CFBundleExecutable ${EXECUTABLE_NAME} CFBundleGetInfoString - 5.34 + 5.35 CFBundleIconFile SaverRunner CFBundleIdentifier - $(BUNDLE_IDENTIFIER) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString - 5.34 + 5.35 CFBundleName ${PRODUCT_NAME} - CFBundleDisplayName - XScreenSaver CFBundlePackageType APPL CFBundleShortVersionString - 5.34 + 5.35 CFBundleSignature ???? CFBundleVersion - 5.34 + 5.35 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} LSUIElement NSHumanReadableCopyright - 5.34 + 5.35 NSMainNibFile Updater NSPrincipalClass @@ -41,7 +41,7 @@ SUEnableSystemProfiling SUFeedURL - http://www.jwz.org/xscreensaver/updates.xml + https://www.jwz.org/xscreensaver/updates.xml SUPublicDSAKeyFile sparkle_dsa_pub.pem SUScheduledCheckInterval diff --git a/OSX/XScreenSaver.plist b/OSX/XScreenSaver.plist index cf23f9c0..9af74f5f 100644 --- a/OSX/XScreenSaver.plist +++ b/OSX/XScreenSaver.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - ${BUNDLE_IDENTIFIER} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,11 +15,11 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 5.34 + 5.35 CFBundleSignature ???? CFBundleVersion - 5.34 + 5.35 LSMinimumSystemVersion 10.4 NSMainNibFile diff --git a/OSX/XScreenSaverConfigSheet.m b/OSX/XScreenSaverConfigSheet.m index ec08b904..576c8ab3 100644 --- a/OSX/XScreenSaverConfigSheet.m +++ b/OSX/XScreenSaverConfigSheet.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2014 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2016 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -129,6 +129,7 @@ typedef enum { SimpleXMLCommentKind, [n setName:key]; [n setObjectValue:val]; [attributes addObject:n]; + [n release]; } } @@ -543,7 +544,7 @@ static void layout_group (NSView *group, BOOL horiz_p); opts:(const XrmOptionDescRec *)opts_array valRet:(NSString **)val_ret { - char buf[255]; + char buf[1280]; char *tail = 0; NSAssert(cmdline_switch, @"cmdline switch is null"); if (! [cmdline_switch getCString:buf maxLength:sizeof(buf) @@ -1190,6 +1191,8 @@ hreffify (NSText *nstext) [self parseAttrs:dict node:node]; NSString *name = [dict objectForKey:@"name"]; NSString *label = [dict objectForKey:@"_label"]; + [dict release]; + dict = 0; NSAssert1 (label, @"no _label in %@", [node name]); NSAssert1 (name, @"no name in \"%@\"", label); @@ -1223,6 +1226,7 @@ hreffify (NSText *nstext) [lab setAutoresizingMask: (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; # endif // USE_IPHONE + [lab autorelease]; return lab; } @@ -1240,6 +1244,8 @@ hreffify (NSText *nstext) NSString *label = [dict objectForKey:@"_label"]; NSString *arg_set = [dict objectForKey:@"arg-set"]; NSString *arg_unset = [dict objectForKey:@"arg-unset"]; + [dict release]; + dict = 0; if (!label) { NSAssert1 (0, @"no _label in %@", [node name]); @@ -1283,7 +1289,6 @@ hreffify (NSText *nstext) [self placeChild:lab on:parent]; UISwitch *button = [[UISwitch alloc] initWithFrame:rect]; [self placeChild:button on:parent right:YES]; - [lab release]; # endif // USE_IPHONE @@ -1319,6 +1324,8 @@ hreffify (NSText *nstext) NSString *high = [dict objectForKey:@"high"]; NSString *def = [dict objectForKey:@"default"]; NSString *cvt = [dict objectForKey:@"convert"]; + [dict release]; + dict = 0; NSAssert1 (arg, @"no arg in %@", label); NSAssert1 (type, @"no type in %@", label); @@ -1372,6 +1379,7 @@ hreffify (NSText *nstext) while (range2 > max_ticks) range2 /= 10; +# ifndef USE_IPHONE // If we have elided ticks, leave it at the max number of ticks. if (range != range2 && range2 < max_ticks) range2 = max_ticks; @@ -1380,7 +1388,6 @@ hreffify (NSText *nstext) if (float_p && range2 < max_ticks) range2 = max_ticks; -# ifndef USE_IPHONE [slider setNumberOfTickMarks:range2]; [slider setAllowsTickMarkValuesOnly: @@ -1403,7 +1410,6 @@ hreffify (NSText *nstext) [lab setFont:[NSFont boldSystemFontOfSize:s]]; } # endif - [lab release]; } if (low_label) { @@ -1423,8 +1429,6 @@ hreffify (NSText *nstext) [lab setLineBreakMode:NSLineBreakByClipping]; [self placeChild:lab on:parent right:(label ? YES : NO)]; # endif // USE_IPHONE - - [lab release]; } # ifndef USE_IPHONE @@ -1460,7 +1464,6 @@ hreffify (NSText *nstext) [lab setLineBreakMode:NSLineBreakByClipping]; # endif [self placeChild:lab on:parent right:YES]; - [lab release]; } [self bindSwitch:slider cmdline:arg]; @@ -1500,7 +1503,6 @@ hreffify (NSText *nstext) rect.size.height = [txt frame].size.height; [lab setFrame:rect]; [self placeChild:lab on:parent]; - [lab release]; } [self placeChild:txt on:parent right:(label ? YES : NO)]; @@ -1601,6 +1603,8 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) // NSMutableDictionary *dict = [@{ @"id": @"", } mutableCopy]; [self parseAttrs:dict node:node]; + [dict release]; + dict = 0; NSRect rect; rect.origin.x = rect.origin.y = 0; @@ -1653,6 +1657,8 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) [self parseAttrs:dict2 node:child]; NSString *label = [dict2 objectForKey:@"_label"]; NSString *arg_set = [dict2 objectForKey:@"arg-set"]; + [dict2 release]; + dict2 = 0; if (!label) { NSAssert1 (0, @"no _label in %@", [child name]); @@ -1792,6 +1798,7 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) [b setLineBreakMode:NSLineBreakByTruncatingHead]; [b setFont:[NSFont boldSystemFontOfSize: FONT_SIZE]]; [self placeChild:b on:parent]; + [b release]; i++; } @@ -1829,6 +1836,7 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) rect.size.height = 50; // sized later # ifndef USE_IPHONE NSText *lab = [[NSText alloc] initWithFrame:rect]; + [lab autorelease]; [lab setEditable:NO]; [lab setDrawsBackground:NO]; [lab setHorizontallyResizable:YES]; @@ -1850,6 +1858,7 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) HTMLLabel *lab = [[HTMLLabel alloc] initWithText:text font:[NSFont systemFontOfSize: [NSFont systemFontSize]]]; + [lab autorelease]; [lab setFrame:rect]; [lab sizeToFit]; # endif // USE_HTML_LABELS @@ -1859,7 +1868,6 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) # endif // USE_IPHONE [self placeChild:lab on:parent]; - [lab release]; } @@ -1877,6 +1885,8 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) [self parseAttrs:dict node:node]; NSString *label = [dict objectForKey:@"_label"]; NSString *arg = [dict objectForKey:@"arg"]; + [dict release]; + dict = 0; if (!label && label_p) { NSAssert1 (0, @"no _label in %@", [node name]); @@ -1927,7 +1937,6 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) if (label) { LABEL *lab = [self makeLabel:label]; [self placeChild:lab on:parent]; - [lab release]; } [self placeChild:txt on:parent right:(label ? YES : NO)]; @@ -1954,6 +1963,8 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) [self parseAttrs:dict node:node]; NSString *label = [dict objectForKey:@"_label"]; NSString *arg = [dict objectForKey:@"arg"]; + [dict release]; + dict = 0; if (!label && label_p) { NSAssert1 (0, @"no _label in %@", [node name]); @@ -1985,7 +1996,6 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) if (label) { lab = [self makeLabel:label]; [self placeChild:lab on:parent]; - [lab release]; } [self placeChild:txt on:parent right:(label ? YES : NO)]; @@ -2043,21 +2053,10 @@ do_file_selector (NSTextField *txt, BOOL dirs_p) [panel setCanChooseFiles:!dirs_p]; [panel setCanChooseDirectories:dirs_p]; - NSString *file = [txt stringValue]; - if ([file length] <= 0) { - file = NSHomeDirectory(); - if (dirs_p) - file = [file stringByAppendingPathComponent:@"Pictures"]; - } - -// NSString *dir = [file stringByDeletingLastPathComponent]; - - int result = [panel runModalForDirectory:file //dir - file:nil //[file lastPathComponent] - types:nil]; + int result = [panel runModal]; if (result == NSOKButton) { - NSArray *files = [panel filenames]; - file = ([files count] > 0 ? [files objectAtIndex:0] : @""); + NSArray *files = [panel URLs]; + NSString *file = ([files count] > 0 ? [[files objectAtIndex:0] path] : @""); file = [file stringByAbbreviatingWithTildeInPath]; [txt setStringValue:file]; @@ -2070,22 +2069,6 @@ do_file_selector (NSTextField *txt, BOOL dirs_p) if ([path hasPrefix:@"values."]) // WTF. path = [path substringFromIndex:7]; [[prefs values] setValue:file forKey:path]; - -#if 0 - // make sure the end of the string is visible. - NSText *fe = [[txt window] fieldEditor:YES forObject:txt]; - NSRange range; - range.location = [file length]-3; - range.length = 1; - if (! [[txt window] makeFirstResponder:[txt window]]) - [[txt window] endEditingFor:nil]; -// [[txt window] makeFirstResponder:nil]; - [fe setSelectedRange:range]; -// [tv scrollRangeToVisible:range]; -// [txt setNeedsDisplay:YES]; -// [[txt cell] setNeedsDisplay:YES]; -// [txt selectAll:txt]; -#endif } } @@ -2189,6 +2172,9 @@ find_text_field_of_button (NSButton *button) [self placeChild:matrix on:group]; [self placeChild:rgroup on:group right:YES]; + [proto release]; + [matrix release]; + [rgroup release]; NSXMLNode *node2; @@ -2212,7 +2198,7 @@ find_text_field_of_button (NSButton *button) @"arg-set": @"-text-mode date", @"_label": @"Display the date and time" }]; [node3 setParent: node2]; - //[node3 release]; + [node3 autorelease]; node3 = [[NSXMLElement alloc] initWithName:@"option"]; [node3 setAttributesAsDictionary: @@ -2220,16 +2206,17 @@ find_text_field_of_button (NSButton *button) @"arg-set": @"-text-mode literal", @"_label": @"Display static text" }]; [node3 setParent: node2]; - //[node3 release]; + [node3 autorelease]; node3 = [[NSXMLElement alloc] initWithName:@"option"]; [node3 setAttributesAsDictionary: @{ @"id": @"url", @"_label": @"Display the contents of a URL" }]; [node3 setParent: node2]; - //[node3 release]; + [node3 autorelease]; [self makeOptionMenu:node2 on:rgroup]; + [node2 release]; # endif // USE_IPHONE @@ -2250,6 +2237,7 @@ find_text_field_of_button (NSButton *button) withLabel:YES # endif horizontal:NO]; + [node2 release]; // rect = [last_child(rgroup) frame]; @@ -2270,6 +2258,7 @@ find_text_field_of_button (NSButton *button) @"arg": @"-text-file %" }]; [self makeFileSelector:node2 on:rgroup dirsOnly:NO withLabel:NO editable:NO]; + [node2 release]; # endif // !USE_IPHONE // rect = [last_child(rgroup) frame]; @@ -2290,6 +2279,7 @@ find_text_field_of_button (NSButton *button) withLabel:YES # endif horizontal:NO]; + [node2 release]; // rect = [last_child(rgroup) frame]; @@ -2302,6 +2292,7 @@ find_text_field_of_button (NSButton *button) @"arg": @"-text-program %", }]; [self makeTextField:node2 on:rgroup withLabel:NO horizontal:NO]; + [node2 release]; } // rect = [last_child(rgroup) frame]; @@ -2357,6 +2348,8 @@ find_text_field_of_button (NSButton *button) [box sizeToFit]; [self placeChild:box on:parent]; + [group release]; + [box release]; # endif // !USE_IPHONE } @@ -2393,6 +2386,7 @@ find_text_field_of_button (NSButton *button) @"arg-unset": @"-no-grab-desktop", }]; [self makeCheckbox:node2 on:parent]; + [node2 release]; node2 = [[NSXMLElement alloc] initWithName:@"boolean"]; [node2 setAttributesAsDictionary: @@ -2401,6 +2395,7 @@ find_text_field_of_button (NSButton *button) @"arg-set": @"-choose-random-images", }]; [self makeCheckbox:node2 on:parent]; + [node2 release]; node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: @@ -2410,6 +2405,7 @@ find_text_field_of_button (NSButton *button) }]; [self makeFileSelector:node2 on:parent dirsOnly:YES withLabel:YES editable:YES]; + [node2 release]; # undef SCREENS # undef PHOTOS @@ -2426,7 +2422,6 @@ find_text_field_of_button (NSButton *button) r2.origin.x += 20; r2.origin.y += 14; [lab2 setFrameOrigin:r2.origin]; - [lab2 release]; # endif // USE_IPHONE } @@ -2468,6 +2463,7 @@ find_text_field_of_button (NSButton *button) @"arg-unset": @"-no-" SUSUEnableAutomaticChecksKey, }]; [self makeCheckbox:node2 on:group]; + [node2 release]; // +