Commit c2e5b42c authored by Tormod Volden's avatar Tormod Volden

Imported Upstream version 5.42

parent 5c78fd80
Binary files a/OSX/English.lproj/InfoPlist.strings and /dev/null differ
This diff is collapsed.
This diff is collapsed.
/* xscreensaver, Copyright (c) 2006-2013 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
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* This is a subclass of NSSlider that is flipped horizontally:
* the high value is on the left and the low value is on the right.
*/
#ifdef USE_IPHONE
# import <UIKit/UIKit.h>
# define NSSlider UISlider
# define NSRect CGRect
# define minValue minimumValue
# define maxValue maximumValue
#else
# import <Cocoa/Cocoa.h>
#endif
@interface InvertedSlider : NSSlider
{
BOOL inverted;
BOOL integers;
}
- (id) initWithFrame:(NSRect)r inverted:(BOOL)_inv integers:(BOOL)_int;
# ifdef USE_IPHONE
- (double) transformedValue;
- (void) setTransformedValue:(double)v;
# endif
@end
/* xscreensaver, Copyright (c) 2006-2015 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
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* This is a subclass of NSSlider that is flipped horizontally:
* the high value is on the left and the low value is on the right.
*/
#import "InvertedSlider.h"
@implementation InvertedSlider
- (id) initWithFrame:(NSRect)r
{
self = [super initWithFrame:r];
if (! self) return 0;
inverted = YES;
integers = NO;
return self;
}
- (id) initWithFrame:(NSRect)r inverted:(BOOL)_inv integers:(BOOL)_int
{
self = [self initWithFrame:r];
inverted = _inv;
integers = _int;
return self;
}
-(double) transformValue:(double) value
{
double v2 = (integers
? (int) (value + (value < 0 ? -0.5 : 0.5))
: value);
double low = [self minValue];
double high = [self maxValue];
double range = high - low;
double off = v2 - low;
if (inverted)
v2 = low + (range - off);
// NSLog (@" ... %.1f -> %.1f [%.1f - %.1f]", value, v2, low, high);
return v2;
}
#ifndef USE_IPHONE
/* On MacOS, we have to transform the value on every entry and exit point
to this class. So, we implement doubleValue and setDoubleValue to
transform the value; and we then have to re-implement every getter and
setter in terms of those. There's no way to simply change how the
slider is displayed without mucking with the value inside of it.
*/
-(double) doubleValue
{
return [self transformValue:[super doubleValue]];
}
-(void) setDoubleValue:(double)v
{
return [super setDoubleValue:[self transformValue:v]];
}
-(float)floatValue { return (float) [self doubleValue]; }
-(int)intValue { return (int) [self doubleValue]; }
-(NSInteger)integerValue { return (NSInteger) [self doubleValue]; }
-(id)objectValue { return [NSNumber numberWithDouble:[self doubleValue]]; }
-(NSString *)stringValue
{
if (integers)
return [NSString stringWithFormat:@"%d", [self intValue]];
else
return [NSString stringWithFormat:@"%f", [self doubleValue]];
}
- (NSAttributedString *)attributedStringValue;
{
return [[[NSAttributedString alloc] initWithString:[self stringValue]]
autorelease];
}
-(void)setFloatValue:(float)v { [self setDoubleValue: (double) v]; }
-(void)setIntValue: (int)v { [self setDoubleValue: (double) v]; }
-(void)setIntegerValue:(NSInteger)v { [self setDoubleValue: (double) v]; }
-(void)setStringValue:(NSString *)v { [self setDoubleValue: [v doubleValue]]; }
-(void)takeIntValueFrom:(id)f { [self setIntValue: [f intValue]]; }
-(void)takeFloatValueFrom:(id)f { [self setFloatValue: [f floatValue]]; }
-(void)takeDoubleValueFrom:(id)f { [self setDoubleValue: [f doubleValue]]; }
-(void)takeStringValueFrom:(id)f { [self setStringValue: [f stringValue]]; }
-(void)takeObjectValueFrom:(id)f { [self setObjectValue: [f objectValue]]; }
-(void)takeIntegerValueFrom:(id)f { [self setIntegerValue:[f integerValue]];}
-(void) setAttributedStringValue:(NSAttributedString *)v {
[self setStringValue:[v string]];
}
-(void) setObjectValue:(id <NSCopying>)v
{
NSAssert2((v == nil) ||
[(NSObject *) v respondsToSelector:@selector(doubleValue)],
@"argument %@ to %s does not respond to doubleValue",
v, __PRETTY_FUNCTION__);
[self setDoubleValue:[((NSNumber *) v) doubleValue]];
}
#else // USE_IPHONE
/* On iOS, we have control over how the value is displayed, but there's no
way to transform the value on input and output: if we wrap 'value' and
'setValue' analagously to what we do on MacOS, things fail in weird
ways. Presumably some parts of the system are accessing the value
instance variable directly instead of going through the methods.
So the only way around this is to enforce that all of our calls into
this object use a new API: 'transformedValue' and 'setTransformedValue'.
The code in XScreenSaverConfigSheet uses that instead.
*/
- (CGRect)thumbRectForBounds:(CGRect)bounds
trackRect:(CGRect)rect
value:(float)value
{
CGRect thumb = [super thumbRectForBounds: bounds
trackRect: rect
value: [self transformValue:value]];
if (inverted)
thumb.origin.x = rect.size.width - thumb.origin.x - thumb.size.width;
return thumb;
}
-(double) transformedValue
{
return [self transformValue: [self value]];
}
-(void) setTransformedValue:(double)v
{
[self setValue: [self transformValue: v]];
}
#endif // USE_IPHONE
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="404" y="445"/>
</view>
</objects>
</document>
This diff is collapsed.
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "iSaverRunner29.png",
"scale" : "1x"
},
{
"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",
"filename" : "iSaverRunner57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "iSaverRunner114.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "iSaverRunner120.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "iSaverRunner180.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "iSaverRunner29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "iSaverRunner58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "iSaverRunner40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "iSaverRunner80.png",
"scale" : "2x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "iSaverRunner50.png",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "iSaverRunner100.png",
"scale" : "2x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "iSaverRunner72.png",
"scale" : "1x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "iSaverRunner144.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "iSaverRunner76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "iSaverRunner152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "iSaverRunner167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "iSaverRunner1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "1242x2208.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "750x1334.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "640x960.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "640x1136.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "640x1136.png",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
/* xscreensaver, Copyright (c) 2006-2013 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
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*/
/* This implements the substrate of the xscreensaver preferences code:
It does this by writing defaults to, and reading values from, the
NSUserDefaultsController (and ScreenSaverDefaults/NSUserDefaults)
and thereby reading the preferences that may have been edited by
the UI (XScreenSaverConfigSheet).
*/
#ifdef USE_IPHONE
# import <Foundation/Foundation.h>
# import <UIKit/UIKit.h>
# define NSUserDefaultsController NSUserDefaults
#else
# import <Cocoa/Cocoa.h>
#endif