mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-02 18:23:35 +00:00
Merge branch 'master' of git://github.com/cappuccino/cappuccino
Conflicts: Tests/Manual/CPButtonTest/Resources/MainMenu.cib
This commit is contained in:
+8
-8
@@ -96,12 +96,12 @@ function CPRectIntegral(aRect)
|
||||
function CPRectIntersection(lhsRect, rhsRect)
|
||||
{
|
||||
var intersection = CPRectMake(
|
||||
Math.max(CPRectGetMinX(lhsRect), CPRectGetMinX(rhsRect)),
|
||||
Math.max(CPRectGetMinY(lhsRect), CPRectGetMinY(rhsRect)),
|
||||
MAX(CPRectGetMinX(lhsRect), CPRectGetMinX(rhsRect)),
|
||||
MAX(CPRectGetMinY(lhsRect), CPRectGetMinY(rhsRect)),
|
||||
0, 0);
|
||||
|
||||
intersection.size.width = Math.min(CPRectGetMaxX(lhsRect), CPRectGetMaxX(rhsRect)) - CPRectGetMinX(intersection);
|
||||
intersection.size.height = Math.min(CPRectGetMaxY(lhsRect), CPRectGetMaxY(rhsRect)) - CPRectGetMinY(intersection);
|
||||
intersection.size.width = MIN(CPRectGetMaxX(lhsRect), CPRectGetMaxX(rhsRect)) - CPRectGetMinX(intersection);
|
||||
intersection.size.height = MIN(CPRectGetMaxY(lhsRect), CPRectGetMaxY(rhsRect)) - CPRectGetMinY(intersection);
|
||||
|
||||
return CPRectIsEmpty(intersection) ? CPRectMakeZero() : intersection;
|
||||
}
|
||||
@@ -179,10 +179,10 @@ function CPRectStandardize(aRect)
|
||||
*/
|
||||
function CPRectUnion(lhsRect, rhsRect)
|
||||
{
|
||||
var minX = Math.min(CPRectGetMinX(lhsRect), CPRectGetMinX(rhsRect)),
|
||||
minY = Math.min(CPRectGetMinY(lhsRect), CPRectGetMinY(rhsRect)),
|
||||
maxX = Math.max(CPRectGetMaxX(lhsRect), CPRectGetMaxX(rhsRect)),
|
||||
maxY = Math.max(CPRectGetMaxY(lhsRect), CPRectGetMaxY(rhsRect));
|
||||
var minX = MIN(CPRectGetMinX(lhsRect), CPRectGetMinX(rhsRect)),
|
||||
minY = MIN(CPRectGetMinY(lhsRect), CPRectGetMinY(rhsRect)),
|
||||
maxX = MAX(CPRectGetMaxX(lhsRect), CPRectGetMaxX(rhsRect)),
|
||||
maxY = MAX(CPRectGetMaxY(lhsRect), CPRectGetMaxY(rhsRect));
|
||||
|
||||
return CPRectMake(minX, minY, maxX - minX, maxY - minY);
|
||||
}
|
||||
|
||||
+18
-7
@@ -151,19 +151,19 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the behaviour of the CPPopover. It can be:
|
||||
Set the behavior of the CPPopover. It can be:
|
||||
|
||||
- \c CPPopoverBehaviorTransient: the popover will close if another control outside the popover becomes the responder
|
||||
- \c CPPopoverBehaviorApplicationDefined: (DEFAULT) the application is responsible for closing the popover
|
||||
|
||||
@param aBehaviour the desired behaviour
|
||||
@param aBehavior the desired behavior
|
||||
*/
|
||||
- (void)setBehaviour:(int)aBehaviour
|
||||
- (void)setBehavior:(int)aBehavior
|
||||
{
|
||||
if (_behavior == aBehaviour)
|
||||
if (_behavior == aBehavior)
|
||||
return;
|
||||
|
||||
_behavior = aBehaviour;
|
||||
_behavior = aBehavior;
|
||||
[_attachedWindow setStyleMask:[self styleMaskForBehavior]];
|
||||
}
|
||||
|
||||
@@ -329,6 +329,17 @@ Set the behaviour of the CPPopover. It can be:
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPPopover (Deprecated)
|
||||
|
||||
- (void)setBehaviour:(int)aBehavior
|
||||
{
|
||||
_CPReportLenientDeprecation(self, _cmd, @selector(setBehavior:));
|
||||
|
||||
[self setBehavior:aBehavior];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPPopoverNeedsNewAttachedWindowKey = @"CPPopoverNeedsNewAttachedWindowKey",
|
||||
CPPopoverAppearanceKey = @"CPPopoverAppearanceKey",
|
||||
CPPopoverAnimatesKey = @"CPPopoverAnimatesKey",
|
||||
@@ -348,7 +359,7 @@ var CPPopoverNeedsNewAttachedWindowKey = @"CPPopoverNeedsNewAttachedWindowKey",
|
||||
_animates = [aCoder decodeBoolForKey:CPPopoverAnimatesKey];
|
||||
_contentViewController = [aCoder decodeObjectForKey:CPPopoverContentViewControllerKey];
|
||||
[self setDelegate:[aCoder decodeObjectForKey:CPPopoverDelegateKey]];
|
||||
[self setBehaviour:[aCoder decodeIntForKey:CPPopoverBehaviorKey]];
|
||||
[self setBehavior:[aCoder decodeIntForKey:CPPopoverBehaviorKey]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -364,4 +375,4 @@ var CPPopoverNeedsNewAttachedWindowKey = @"CPPopoverNeedsNewAttachedWindowKey",
|
||||
[aCoder encodeInt:_behavior forKey:CPPopoverBehaviorKey];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -71,8 +71,6 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
|
||||
BOOL _isDisplayedWhenStoppedSet;
|
||||
BOOL _isDisplayedWhenStopped;
|
||||
|
||||
CPView _barView;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -410,27 +408,38 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
if (_style == CPProgressIndicatorSpinningStyle)
|
||||
return;
|
||||
|
||||
if (!_barView)
|
||||
{
|
||||
_barView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 16.0)];
|
||||
[self addSubview:_barView];
|
||||
}
|
||||
var barView = [self layoutEphemeralSubviewNamed:"bar-view"
|
||||
positioned:CPWindowBelow
|
||||
relativeToEphemeralSubviewNamed:nil];
|
||||
|
||||
[_barView setBackgroundColor:_CPControlThreePartImagePattern(
|
||||
[barView setBackgroundColor:_CPControlThreePartImagePattern(
|
||||
NO,
|
||||
CPProgressIndicatorStyleSizes,
|
||||
CPProgressIndicatorClassName,
|
||||
@"Bar",
|
||||
CPProgressIndicatorStyleIdentifiers[_style],
|
||||
_CPControlIdentifierForControlSize(_controlSize))];
|
||||
}
|
||||
|
||||
var width = CGRectGetWidth([self bounds]),
|
||||
barWidth = width * ((_doubleValue - _minValue) / (_maxValue - _minValue));
|
||||
- (CPView)createEphemeralSubviewNamed:(CPString)aName
|
||||
{
|
||||
return [[CPView alloc] initWithFrame:_CGRectMakeZero()];
|
||||
}
|
||||
|
||||
if (barWidth > 0.0 && barWidth < 4.0)
|
||||
barWidth = 4.0;
|
||||
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aViewName
|
||||
{
|
||||
if (aViewName === @"bar-view" && _style !== CPProgressIndicatorSpinningStyle)
|
||||
{
|
||||
var width = CGRectGetWidth([self bounds]),
|
||||
barWidth = width * ((_doubleValue - _minValue) / (_maxValue - _minValue));
|
||||
|
||||
[_barView setFrameSize:CGSizeMake(barWidth, 16.0)];
|
||||
if (barWidth > 0.0 && barWidth < 4.0)
|
||||
barWidth = 4.0;
|
||||
|
||||
return _CGRectMake(0, 0, barWidth, 16.0);
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
@@ -440,9 +449,10 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
{
|
||||
if (_style == CPProgressIndicatorSpinningStyle)
|
||||
{
|
||||
[_barView removeFromSuperview];
|
||||
|
||||
_barView = nil;
|
||||
// This will cause the bar view to go away due to having a nil rect when _style == CPProgressIndicatorSpinningStyle.
|
||||
[self layoutEphemeralSubviewNamed:"bar-view"
|
||||
positioned:CPWindowBelow
|
||||
relativeToEphemeralSubviewNamed:nil];
|
||||
|
||||
[self setBackgroundColor:CPProgressIndicatorSpinningStyleColors[_controlSize]];
|
||||
}
|
||||
@@ -481,6 +491,8 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
_isAnimating = [aCoder decodeObjectForKey:@"_isAnimating"];
|
||||
_isDisplayedWhenStoppedSet = [aCoder decodeObjectForKey:@"_isDisplayedWhenStoppedSet"];
|
||||
_isDisplayedWhenStopped = [aCoder decodeObjectForKey:@"_isDisplayedWhenStopped"];
|
||||
|
||||
[self updateBackgroundColor];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -488,7 +500,12 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
// Don't encode the background colour. It can be recreated based on the flags and if encoded causes hardcoded
|
||||
// image paths in the cib while just wasting space.
|
||||
var backgroundColor = [self backgroundColor];
|
||||
[self setBackgroundColor:nil];
|
||||
[super encodeWithCoder:aCoder];
|
||||
[self setBackgroundColor:backgroundColor];
|
||||
|
||||
[aCoder encodeObject:_minValue forKey:@"_minValue"];
|
||||
[aCoder encodeObject:_maxValue forKey:@"_maxValue"];
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@
|
||||
_blurRadius = aBlurRadius;
|
||||
_color = aColor;
|
||||
|
||||
_cssString = [_color cssString] + " " + Math.round(anOffset.width) + @"px " + Math.round(anOffset.height) + @"px " + Math.round(_blurRadius) + @"px";
|
||||
_cssString = [_color cssString] + " " + ROUND(anOffset.width) + @"px " + ROUND(anOffset.height) + @"px " + ROUND(_blurRadius) + @"px";
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
+2
-2
@@ -144,8 +144,8 @@
|
||||
minSize = _CGSizeMake(upSize.width, upSize.height + downSize.height),
|
||||
frame = _CGRectMakeCopy(aFrame);
|
||||
|
||||
frame.size.width = Math.max(minSize.width, frame.size.width);
|
||||
frame.size.height = Math.max(minSize.height, frame.size.height);
|
||||
frame.size.width = MAX(minSize.width, frame.size.width);
|
||||
frame.size.height = MAX(minSize.height, frame.size.height);
|
||||
[super setFrame:frame];
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ var _CPWindowViewResizeIndicatorImage = nil;
|
||||
|
||||
if ([theWindow isMovable] && [theWindow isMovableByWindowBackground])
|
||||
[self trackMoveWithEvent:anEvent];
|
||||
|
||||
else
|
||||
[super mouseDown:anEvent];
|
||||
}
|
||||
@@ -140,7 +139,7 @@ var _CPWindowViewResizeIndicatorImage = nil;
|
||||
var newSize = CGSizeMake(CGRectGetWidth(_resizeFrame) + location.x - CGRectGetMinX(_resizeFrame), CGRectGetHeight(_resizeFrame) + location.y - CGRectGetMinY(_resizeFrame));
|
||||
|
||||
if (theWindow._isSheet && theWindow._parentView && (theWindow._frame.size.width !== newSize.width))
|
||||
[theWindow._parentView _setAttachedSheetFrameOrigin];
|
||||
[theWindow._parentView _setAttachedSheetFrameOrigin];
|
||||
|
||||
[theWindow setFrameSize:newSize];
|
||||
}
|
||||
@@ -184,13 +183,11 @@ var _CPWindowViewResizeIndicatorImage = nil;
|
||||
_cachedScreenFrame = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
else if (type === CPLeftMouseDown)
|
||||
{
|
||||
_mouseDraggedPoint = [[self window] convertBaseToGlobal:[anEvent locationInWindow]];
|
||||
_cachedScreenFrame = [[CPPlatformWindow primaryPlatformWindow] visibleFrame];
|
||||
}
|
||||
|
||||
else if (type === CPLeftMouseDragged)
|
||||
{
|
||||
var theWindow = [self window],
|
||||
|
||||
@@ -323,7 +323,7 @@ function CGContextTranslateCTM(aContext, tx, ty)
|
||||
|
||||
#define rotate_scale(a, b, c, d) \
|
||||
var sign = (a * d < 0.0 || b * c > 0.0) ? -1.0 : 1.0;\
|
||||
a1 = (Math.atan2(sign * b, sign * a) + Math.atan2(-c, d)) / 2.0,\
|
||||
a1 = (ATAN2(sign * b, sign * a) + ATAN2(-c, d)) / 2.0,\
|
||||
cos = COS(a1),\
|
||||
sin = SIN(a1);\
|
||||
\
|
||||
|
||||
@@ -799,25 +799,23 @@ var concat = Array.prototype.concat,
|
||||
{
|
||||
var index = 0,
|
||||
count = [self count],
|
||||
description = '(';
|
||||
description = "(";
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
if (index === 0)
|
||||
description += '\n';
|
||||
description += "\n\t";
|
||||
|
||||
var object = [self objectAtIndex:index],
|
||||
objectDescription = object && object.isa ? [object description] : String(object);
|
||||
|
||||
description += "\t" + objectDescription.split('\n').join("\n\t");
|
||||
var object = [self objectAtIndex:index];
|
||||
description += CPDescriptionOfObject(object);
|
||||
|
||||
if (index !== count - 1)
|
||||
description += ", ";
|
||||
|
||||
description += '\n';
|
||||
description += ",\n\t";
|
||||
else
|
||||
description += "\n";
|
||||
}
|
||||
|
||||
return description + ')';
|
||||
return description + ")";
|
||||
}
|
||||
|
||||
// Collecting paths
|
||||
|
||||
@@ -255,7 +255,7 @@ var CPCharacterSetInvertedKey = @"CPCharacterSetInvertedKey";
|
||||
// FIXME: range is undefined... don't know what's supposed to be going on here.
|
||||
// the highest Unicode plane we reach.
|
||||
// (There are 65536 code points in each plane.)
|
||||
var maxPlane = Math.floor((range.start + range.length - 1) / 65536); // FIXME: should iterate _ranges
|
||||
var maxPlane = FLOOR((range.start + range.length - 1) / 65536); // FIXME: should iterate _ranges
|
||||
|
||||
return (plane <= maxPlane);
|
||||
}
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@
|
||||
{
|
||||
var data = [[self alloc] init];
|
||||
data.setBytes(bytesArray);
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
{
|
||||
var data = [[self alloc] init];
|
||||
data.setBase64String(aString);
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -765,7 +765,7 @@ function _SimpleDivide(result, leftOperand, rightOperand, roundingMode)
|
||||
|
||||
n1._mantissa = [];
|
||||
|
||||
while ((k < leftOperand._mantissa.length) || (n1._mantissa.length
|
||||
while ((used < leftOperand._mantissa.length) || (n1._mantissa.length
|
||||
&& !((n1._mantissa.length == 1) && (n1._mantissa[0] == 0))))
|
||||
{
|
||||
while (CPOrderedAscending == CPDecimalCompare(n1, rightOperand))
|
||||
|
||||
@@ -576,7 +576,20 @@
|
||||
*/
|
||||
- (CPString)description
|
||||
{
|
||||
return self.toString();
|
||||
var string = "{\n\t",
|
||||
keys = _keys,
|
||||
index = 0,
|
||||
count = _count;
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var key = keys[index],
|
||||
value = valueForKey(key);
|
||||
|
||||
string += key + " = \"" + CPDescriptionOfObject(value).split('\n').join("\n\t") + "\"\n\t";
|
||||
}
|
||||
|
||||
return string + "}";
|
||||
}
|
||||
|
||||
- (BOOL)containsKey:(id)aKey
|
||||
|
||||
@@ -529,3 +529,23 @@ CPLog(@"Got some class: %@", inst);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
function CPDescriptionOfObject(anObject)
|
||||
{
|
||||
if (anObject.isa)
|
||||
return [anObject description];
|
||||
|
||||
if (typeof(anObject) !== "object")
|
||||
return String(anObject);
|
||||
|
||||
var desc = "JSObject\n{\n";
|
||||
|
||||
for (var property in anObject)
|
||||
{
|
||||
if (anObject.hasOwnProperty(property))
|
||||
desc += " " + property + ": " + CPDescriptionOfObject(anObject[property]) + "\n";
|
||||
}
|
||||
desc += "}";
|
||||
|
||||
return desc.split('\n').join("\n\t");
|
||||
}
|
||||
|
||||
+25
-25
@@ -31,7 +31,7 @@ GLOBAL(CFData) = function()
|
||||
|
||||
this._bytes = NULL;
|
||||
this._base64 = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.prototype.propertyList = function()
|
||||
{
|
||||
@@ -39,7 +39,7 @@ CFData.prototype.propertyList = function()
|
||||
this._propertyList = CFPropertyList.propertyListFromString(this.rawString());
|
||||
|
||||
return this._propertyList;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.prototype.JSONObject = function()
|
||||
{
|
||||
@@ -55,7 +55,7 @@ CFData.prototype.JSONObject = function()
|
||||
}
|
||||
|
||||
return this._JSONObject;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.prototype.rawString = function()
|
||||
{
|
||||
@@ -78,7 +78,7 @@ CFData.prototype.rawString = function()
|
||||
}
|
||||
|
||||
return this._rawString;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.prototype.bytes = function()
|
||||
{
|
||||
@@ -87,9 +87,9 @@ CFData.prototype.bytes = function()
|
||||
var bytes = CFData.stringToBytes(this.rawString());
|
||||
this.setBytes(bytes);
|
||||
}
|
||||
|
||||
|
||||
return this._bytes;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.prototype.base64 = function()
|
||||
{
|
||||
@@ -100,17 +100,17 @@ CFData.prototype.base64 = function()
|
||||
base64 = CFData.encodeBase64Array(this._bytes);
|
||||
else
|
||||
base64 = CFData.encodeBase64String(this.rawString());
|
||||
|
||||
|
||||
this.setBase64String(base64);
|
||||
}
|
||||
|
||||
|
||||
return this._base64;
|
||||
}
|
||||
};
|
||||
|
||||
GLOBAL(CFMutableData) = function()
|
||||
{
|
||||
CFData.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
CFMutableData.prototype = new CFData();
|
||||
|
||||
@@ -133,35 +133,35 @@ CFMutableData.prototype.setPropertyList = function(/*PropertyList*/ aPropertyLis
|
||||
|
||||
this._propertyList = aPropertyList;
|
||||
this._propertyListFormat = aFormat;
|
||||
}
|
||||
};
|
||||
|
||||
CFMutableData.prototype.setJSONObject = function(/*Object*/ anObject)
|
||||
{
|
||||
clearMutableData(this);
|
||||
|
||||
this._JSONObject = anObject
|
||||
}
|
||||
this._JSONObject = anObject;
|
||||
};
|
||||
|
||||
CFMutableData.prototype.setRawString = function(/*String*/ aString)
|
||||
{
|
||||
clearMutableData(this);
|
||||
|
||||
this._rawString = aString;
|
||||
}
|
||||
};
|
||||
|
||||
CFMutableData.prototype.setBytes = function(/*Array*/ bytes)
|
||||
{
|
||||
clearMutableData(this);
|
||||
|
||||
this._bytes = bytes;
|
||||
}
|
||||
};
|
||||
|
||||
CFMutableData.prototype.setBase64String = function(/*String*/ aBase64String)
|
||||
{
|
||||
clearMutableData(this);
|
||||
|
||||
this._base64 = aBase64String;
|
||||
}
|
||||
};
|
||||
|
||||
// Base64 encoding and decoding
|
||||
|
||||
@@ -201,7 +201,7 @@ CFData.decodeBase64ToArray = function(input, strip)
|
||||
return output.slice(0, -1 * pad);
|
||||
|
||||
return output;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.encodeBase64Array = function(input)
|
||||
{
|
||||
@@ -239,23 +239,23 @@ CFData.encodeBase64Array = function(input)
|
||||
}
|
||||
|
||||
return output.join("");
|
||||
}
|
||||
};
|
||||
|
||||
CFData.decodeBase64ToString = function(input, strip)
|
||||
{
|
||||
return CFData.bytesToString(CFData.decodeBase64ToArray(input, strip));
|
||||
}
|
||||
};
|
||||
|
||||
CFData.decodeBase64ToUtf16String = function(input, strip)
|
||||
{
|
||||
return CFData.bytesToUtf16String(CFData.decodeBase64ToArray(input, strip));
|
||||
}
|
||||
};
|
||||
|
||||
CFData.bytesToString = function(bytes)
|
||||
{
|
||||
// This is relatively efficient, I think:
|
||||
return String.fromCharCode.apply(NULL, bytes);
|
||||
}
|
||||
};
|
||||
|
||||
CFData.stringToBytes = function(input)
|
||||
{
|
||||
@@ -264,7 +264,7 @@ CFData.stringToBytes = function(input)
|
||||
temp.push(input.charCodeAt(i));
|
||||
|
||||
return temp;
|
||||
}
|
||||
};
|
||||
|
||||
CFData.encodeBase64String = function(input)
|
||||
{
|
||||
@@ -273,7 +273,7 @@ CFData.encodeBase64String = function(input)
|
||||
temp.push(input.charCodeAt(i));
|
||||
|
||||
return CFData.encodeBase64Array(temp);
|
||||
}
|
||||
};
|
||||
|
||||
CFData.bytesToUtf16String = function(bytes)
|
||||
{
|
||||
@@ -283,7 +283,7 @@ CFData.bytesToUtf16String = function(bytes)
|
||||
temp.push(bytes[i+1] << 8 | bytes[i]);
|
||||
// This is relatively efficient, I think:
|
||||
return String.fromCharCode.apply(NULL, temp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CFData.encodeBase64Utf16String = function(input)
|
||||
@@ -298,4 +298,4 @@ CFData.encodeBase64Utf16String = function(input)
|
||||
}
|
||||
|
||||
return CFData.encodeBase64Array(temp);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,6 +64,7 @@ GLOBAL(SQRT) = Math.sqrt;
|
||||
GLOBAL(E) = Math.E;
|
||||
GLOBAL(LN2) = Math.LN2;
|
||||
GLOBAL(LN10) = Math.LN10;
|
||||
GLOBAL(LOG) = Math.log;
|
||||
GLOBAL(LOG2E) = Math.LOG2E;
|
||||
GLOBAL(LOG10E) = Math.LOG10E;
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
- (void)testAffineTransformMake
|
||||
{
|
||||
[self compareTransform:CGAffineTransformMake(1, 2, 3, 4, 3.2, 5.4)
|
||||
with:{ a: 1, b: 2, c:3, d:4, tx:3.2, ty:5.4 }
|
||||
with:{ a: 1, b: 2, c: 3, d: 4, tx: 3.2, ty: 5.4 }
|
||||
message:"transform make"];
|
||||
}
|
||||
|
||||
- (void)testCGAffineTransformMakeIdentity
|
||||
{
|
||||
[self compareTransform:CGAffineTransformMakeIdentity()
|
||||
with:{ a: 1, b: 0, c:0, d:1, tx:0, ty:0 }
|
||||
with:{ a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0 }
|
||||
message:"transform make identity"];
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
transform.tx = transform.ty = 0;
|
||||
|
||||
[self compareTransform:t2
|
||||
with:CGAffineTransformMake( 1,2,3,4,3.2,5.4 )
|
||||
with:CGAffineTransformMake(1, 2, 3, 4, 3.2, 5.4)
|
||||
message:"copy correctly made"];
|
||||
|
||||
[self compareTransform:transform
|
||||
with:CGAffineTransformMake( 0, 0, 0, 0, 0, 0 )
|
||||
message:"original transform was changed"] ;
|
||||
with:CGAffineTransformMake(0, 0, 0, 0, 0, 0)
|
||||
message:"original transform was changed"];
|
||||
}
|
||||
|
||||
- (void)testAffineTransformCreateCopy
|
||||
@@ -44,46 +44,46 @@
|
||||
transform.tx = transform.ty = 0;
|
||||
|
||||
[self compareTransform:t2
|
||||
with:CGAffineTransformMake( 1,2,3,4,3.2,5.4 )
|
||||
with:CGAffineTransformMake(1, 2, 3, 4, 3.2, 5.4)
|
||||
message:"copy correctly made"];
|
||||
|
||||
[self compareTransform:transform
|
||||
with:CGAffineTransformMake( 0, 0, 0, 0, 0, 0 )
|
||||
with:CGAffineTransformMake(0, 0, 0, 0, 0, 0)
|
||||
message:"original transform was changed"] ;
|
||||
}
|
||||
|
||||
- (void)testAffineTransformMakeScale
|
||||
{
|
||||
[self compareTransform:CGAffineTransformMakeScale(3,4)
|
||||
[self compareTransform:CGAffineTransformMakeScale(3, 4)
|
||||
with:CGAffineTransformMake(3, 0, 0, 4, 0, 0)
|
||||
message:"make scale"];
|
||||
}
|
||||
|
||||
- (void)testAffineTransformMakeTranslation
|
||||
{
|
||||
[self compareTransform:CGAffineTransformMakeTranslation(3,4)
|
||||
with:CGAffineTransformMake(1,0,0,1,3,4)
|
||||
[self compareTransform:CGAffineTransformMakeTranslation(3, 4)
|
||||
with:CGAffineTransformMake(1, 0, 0, 1, 3, 4)
|
||||
message:"make translation"];
|
||||
}
|
||||
|
||||
- (void)testAffineTransformTranslate
|
||||
{
|
||||
var transform = CGAffineTransformMakeTranslation(3,4);
|
||||
var transform = CGAffineTransformMakeTranslation(3, 4);
|
||||
|
||||
[self compareTransform:CGAffineTransformTranslate(transform,-3,-4)
|
||||
[self compareTransform:CGAffineTransformTranslate(transform, -3, -4)
|
||||
with:CGAffineTransformMakeIdentity()
|
||||
message:"translate to identity"];
|
||||
|
||||
[self compareTransform:CGAffineTransformTranslate(transform,0,0)
|
||||
[self compareTransform:CGAffineTransformTranslate(transform, 0, 0)
|
||||
with:transform
|
||||
message:"zero translate"];
|
||||
}
|
||||
|
||||
- (void)testAffineTransformScale
|
||||
{
|
||||
var transform = CGAffineTransformMakeScale(3,4);
|
||||
var transform = CGAffineTransformMakeScale(3, 4);
|
||||
|
||||
[self compareTransform:CGAffineTransformScale( transform, 1/3, 1/4)
|
||||
[self compareTransform:CGAffineTransformScale(transform, 1 / 3, 1 / 4)
|
||||
with:CGAffineTransformMakeIdentity()
|
||||
message:"scale to identity"];
|
||||
|
||||
@@ -101,38 +101,38 @@
|
||||
{
|
||||
var testcases = {
|
||||
"identity concat" : {
|
||||
testdata: CGAffineTransformConcat( CGAffineTransformMakeIdentity(),
|
||||
CGAffineTransformMakeIdentity() ),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeIdentity(),
|
||||
CGAffineTransformMakeIdentity()),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGAffineTransformConcat( CGAffineTransformMakeTranslation(3,4),
|
||||
CGAffineTransformMakeTranslation(-3,-4) ),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeTranslation(3, 4),
|
||||
CGAffineTransformMakeTranslation(-3, -4)),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
|
||||
"translation (reversed)" : {
|
||||
testdata: CGAffineTransformConcat( CGAffineTransformMakeTranslation(-3,-4),
|
||||
CGAffineTransformMakeTranslation(3,4) ),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeTranslation(-3, -4),
|
||||
CGAffineTransformMakeTranslation(3, 4)),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(3,4),
|
||||
CGAffineTransformMakeScale(1/3,1/4)),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(3, 4),
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4)),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
|
||||
"scale (reversed)" : {
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(1/3,1/4),
|
||||
CGAffineTransformMakeScale(3,4)),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(1 / 3, 1 / 4),
|
||||
CGAffineTransformMakeScale(3, 4)),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
|
||||
"rotation" : {
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeRotation(Math.PI),
|
||||
CGAffineTransformMakeRotation(-Math.PI)),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeRotation(PI),
|
||||
CGAffineTransformMakeRotation(-PI)),
|
||||
expdata: CGAffineTransformMakeIdentity()
|
||||
},
|
||||
};
|
||||
@@ -145,28 +145,28 @@
|
||||
{
|
||||
var testcases = {
|
||||
"translate to zero" : {
|
||||
testdata: CGPointApplyAffineTransform( CGPointMake( 3, 4 ),
|
||||
CGAffineTransformMakeTranslation(-3,-4)),
|
||||
testdata: CGPointApplyAffineTransform(CGPointMake(3, 4),
|
||||
CGAffineTransformMakeTranslation(-3, -4)),
|
||||
expdata: CGPointMakeZero()
|
||||
},
|
||||
|
||||
"scale to 1,1" : {
|
||||
testdata: CGPointApplyAffineTransform( CGPointMake( 3, 4 ),
|
||||
CGAffineTransformMakeScale(1/3,1/4) ),
|
||||
expdata: CGPointMake(1,1)
|
||||
testdata: CGPointApplyAffineTransform(CGPointMake(3, 4),
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4)),
|
||||
expdata: CGPointMake(1, 1)
|
||||
},
|
||||
|
||||
"scale and translate to zero" : {
|
||||
testdata: CGPointApplyAffineTransform( CGPointMake( 3, 4 ),
|
||||
CGAffineTransformConcat(
|
||||
CGAffineTransformMakeScale(1/3,1/4),
|
||||
CGAffineTransformMakeTranslation(-1,-1))),
|
||||
testdata: CGPointApplyAffineTransform(CGPointMake(3, 4),
|
||||
CGAffineTransformConcat(
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4),
|
||||
CGAffineTransformMakeTranslation(-1, -1))),
|
||||
expdata: CGPointMakeZero()
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
for ( var key in testcases )
|
||||
for (var key in testcases)
|
||||
[self comparePoint:testcases[key].testdata with:testcases[key].expdata message:key];
|
||||
}
|
||||
|
||||
@@ -174,22 +174,22 @@
|
||||
{
|
||||
var testcases = {
|
||||
"translation on size should do nothing" : {
|
||||
testdata: CGSizeApplyAffineTransform( CGSizeMake(3, 12),
|
||||
CGAffineTransformMakeTranslation(-3,-4)),
|
||||
testdata: CGSizeApplyAffineTransform(CGSizeMake(3, 12),
|
||||
CGAffineTransformMakeTranslation(-3, -4)),
|
||||
expdata: CGSizeMake(3, 12)
|
||||
},
|
||||
|
||||
"scale to 1,1" : {
|
||||
testdata: CGSizeApplyAffineTransform( CGSizeMake( 3, 4 ),
|
||||
CGAffineTransformMakeScale(1/3,1/4) ),
|
||||
testdata: CGSizeApplyAffineTransform(CGSizeMake(3, 4),
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4) ),
|
||||
expdata: CGSizeMake(1, 1)
|
||||
},
|
||||
|
||||
"scale and translate combined" : {
|
||||
testdata: CGSizeApplyAffineTransform( CGSizeMake( 3, 4 ),
|
||||
CGAffineTransformConcat(
|
||||
CGAffineTransformMakeScale(1/3,1/4),
|
||||
CGAffineTransformMakeTranslation(-1,-1))),
|
||||
testdata: CGSizeApplyAffineTransform(CGSizeMake(3, 4),
|
||||
CGAffineTransformConcat(
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4),
|
||||
CGAffineTransformMakeTranslation(-1, -1))),
|
||||
expdata: CGSizeMake(1, 1)
|
||||
|
||||
},
|
||||
@@ -215,7 +215,7 @@
|
||||
},
|
||||
|
||||
"one scale is identity" : {
|
||||
testdata: CGAffineTransformMakeScale(1,1)
|
||||
testdata: CGAffineTransformMakeScale(1, 1)
|
||||
},
|
||||
|
||||
"identity concat'ed" : {
|
||||
@@ -224,18 +224,18 @@
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGAffineTransformConcat( CGAffineTransformMakeTranslation(3,4),
|
||||
CGAffineTransformMakeTranslation(-3,-4) ),
|
||||
testdata: CGAffineTransformConcat( CGAffineTransformMakeTranslation(3, 4),
|
||||
CGAffineTransformMakeTranslation(-3, -4) ),
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(3,4),
|
||||
CGAffineTransformMakeScale(1/3,1/4)),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeScale(3, 4),
|
||||
CGAffineTransformMakeScale(1 / 3, 1 / 4)),
|
||||
},
|
||||
|
||||
"rotation" : {
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeRotation(-Math.PI),
|
||||
CGAffineTransformMakeRotation(Math.PI)),
|
||||
testdata: CGAffineTransformConcat(CGAffineTransformMakeRotation(-PI),
|
||||
CGAffineTransformMakeRotation(PI)),
|
||||
},
|
||||
|
||||
};
|
||||
@@ -250,11 +250,11 @@
|
||||
{
|
||||
var testcases = {
|
||||
"some random transform" : {
|
||||
testdata: CGAffineTransformMake(1,1,1,1,1,1)
|
||||
testdata: CGAffineTransformMake(1, 1, 1, 1, 1, 1)
|
||||
},
|
||||
|
||||
"non-zero translation is not identity" : {
|
||||
testdata: CGAffineTransformMakeTranslation(1,1)
|
||||
testdata: CGAffineTransformMakeTranslation(1, 1)
|
||||
},
|
||||
|
||||
"non-one scale is not identity" : {
|
||||
@@ -262,12 +262,12 @@
|
||||
},
|
||||
|
||||
"rotation" : {
|
||||
testdata: CGAffineTransformMakeRotation(Math.PI),
|
||||
testdata: CGAffineTransformMakeRotation(PI),
|
||||
},
|
||||
|
||||
// TODO a two-pi rotation is actually identity
|
||||
"2PI rotation is NOT identity?" : {
|
||||
testdata: CGAffineTransformMakeRotation(Math.PI * 2),
|
||||
testdata: CGAffineTransformMakeRotation(PI * 2),
|
||||
},
|
||||
|
||||
};
|
||||
@@ -288,26 +288,26 @@
|
||||
},
|
||||
|
||||
"translate" : {
|
||||
lhs: CGAffineTransformMakeTranslation(1,1),
|
||||
rhs: CGAffineTransformMakeTranslation(1,1),
|
||||
lhs: CGAffineTransformMakeTranslation(1, 1),
|
||||
rhs: CGAffineTransformMakeTranslation(1, 1),
|
||||
expdata: YES
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
lhs: CGAffineTransformMakeScale(1,1),
|
||||
rhs: CGAffineTransformMakeScale(1,1),
|
||||
lhs: CGAffineTransformMakeScale(1, 1),
|
||||
rhs: CGAffineTransformMakeScale(1, 1),
|
||||
expdata: YES
|
||||
},
|
||||
|
||||
"rotation" : {
|
||||
lhs: CGAffineTransformMakeRotation(Math.PI),
|
||||
rhs: CGAffineTransformMakeRotation(Math.PI),
|
||||
lhs: CGAffineTransformMakeRotation(PI),
|
||||
rhs: CGAffineTransformMakeRotation(PI),
|
||||
expdata: YES
|
||||
},
|
||||
|
||||
"translate and scale" : {
|
||||
lhs: CGAffineTransformMakeScale(1,1),
|
||||
rhs: CGAffineTransformMakeTranslation(1,1),
|
||||
lhs: CGAffineTransformMakeScale(1, 1),
|
||||
rhs: CGAffineTransformMakeTranslation(1, 1),
|
||||
expdata: NO
|
||||
},
|
||||
};
|
||||
@@ -328,17 +328,17 @@
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGAffineTransformMakeScale(3,4),
|
||||
testdata: CGAffineTransformMakeScale(3, 4),
|
||||
expdata: " [[ 3, 0, 0 ], [ 0, 4, 0 ], [ 0, 0, 1]]"
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGAffineTransformMakeTranslation(3,4),
|
||||
testdata: CGAffineTransformMakeTranslation(3, 4),
|
||||
expdata: " [[ 1, 0, 0 ], [ 0, 1, 0 ], [ 3, 4, 1]]"
|
||||
},
|
||||
|
||||
"scale and translation" : {
|
||||
testdata: CGAffineTransformTranslate(CGAffineTransformMakeScale(3,4),5,6),
|
||||
testdata: CGAffineTransformTranslate(CGAffineTransformMakeScale(3, 4), 5, 6),
|
||||
expdata: " [[ 3, 0, 0 ], [ 0, 4, 0 ], [ 15, 24, 1]]"
|
||||
},
|
||||
};
|
||||
@@ -358,12 +358,12 @@
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGAffineTransformMakeScale(3,4),
|
||||
testdata: CGAffineTransformMakeScale(3, 4),
|
||||
expdata: "{3, 0, 0, 4, 0, 0}"
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGAffineTransformMakeTranslation(3,4),
|
||||
testdata: CGAffineTransformMakeTranslation(3, 4),
|
||||
expdata: "{1, 0, 0, 1, 3, 4}"
|
||||
},
|
||||
|
||||
@@ -373,22 +373,22 @@
|
||||
},
|
||||
|
||||
"rotation - pi" : {
|
||||
testdata: CGAffineTransformMakeRotation(Math.PI),
|
||||
testdata: CGAffineTransformMakeRotation(PI),
|
||||
expdata: "{-1, 1.2246467991473532e-16, -1.2246467991473532e-16, -1, 0, 0}"
|
||||
},
|
||||
|
||||
"rotation - 2pi" : {
|
||||
testdata: CGAffineTransformMakeRotation(2 * Math.PI),
|
||||
testdata: CGAffineTransformMakeRotation(2 * PI),
|
||||
expdata: "{1, -2.4492935982947064e-16, 2.4492935982947064e-16, 1, 0, 0}"
|
||||
},
|
||||
|
||||
"rotation - 3pi" : {
|
||||
testdata: CGAffineTransformMakeRotation(3 * Math.PI),
|
||||
testdata: CGAffineTransformMakeRotation(3 * PI),
|
||||
expdata: "{-1, 3.6739403974420594e-16, -3.6739403974420594e-16, -1, 0, 0}"
|
||||
},
|
||||
|
||||
"scale and translation and rotate" : {
|
||||
testdata: CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3,4),5,6),Math.PI),
|
||||
testdata: CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3, 4), 5, 6), PI),
|
||||
expdata: "{-3, 4.898587196589413e-16, -3.6739403974420594e-16, -4, 15, 24}"
|
||||
},
|
||||
};
|
||||
@@ -401,8 +401,8 @@
|
||||
|
||||
- (void)testAffineTransformRotate
|
||||
{
|
||||
var ang = Math.PI + 0.5 * Math.PI,
|
||||
transform = CGAffineTransformMake( 1,2,3,4, 5,6 ),
|
||||
var ang = PI + 0.5 * PI,
|
||||
transform = CGAffineTransformMake(1, 2, 3, 4, 5, 6),
|
||||
cos = COS(ang),
|
||||
sin = SIN(ang);
|
||||
|
||||
@@ -417,18 +417,18 @@
|
||||
},
|
||||
|
||||
"rotation negation" : {
|
||||
testdata: CGAffineTransformRotate(CGAffineTransformRotate(CGAffineTransformMakeScale(3,4),Math.PI),-Math.PI),
|
||||
expdata: CGAffineTransformMakeScale(3,4)
|
||||
testdata: CGAffineTransformRotate(CGAffineTransformRotate(CGAffineTransformMakeScale(3, 4), PI), -PI),
|
||||
expdata: CGAffineTransformMakeScale(3, 4)
|
||||
}
|
||||
};
|
||||
|
||||
for ( var key in testcases )
|
||||
for (var key in testcases)
|
||||
[self compareTransform:testcases[key].testdata with:testcases[key].expdata message:key];
|
||||
}
|
||||
|
||||
- (void)testAffineTransformInvert
|
||||
{
|
||||
var transform = CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3,4),5,6),Math.PI),
|
||||
var transform = CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3, 4), 5, 6), PI),
|
||||
determinant = 1 / (transform.a * transform.d - transform.b * transform.c),
|
||||
invertedtransform = CGAffineTransformMake(determinant * transform.d,
|
||||
-determinant * transform.b,
|
||||
@@ -451,18 +451,18 @@
|
||||
},
|
||||
|
||||
"rotation" : {
|
||||
testdata: CGAffineTransformMakeRotation(-Math.PI),
|
||||
expdata: CGAffineTransformMakeRotation(Math.PI),
|
||||
testdata: CGAffineTransformMakeRotation(-PI),
|
||||
expdata: CGAffineTransformMakeRotation(PI),
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGAffineTransformMakeTranslation(4,5),
|
||||
expdata: CGAffineTransformMakeTranslation(-4,-5)
|
||||
testdata: CGAffineTransformMakeTranslation(4, 5),
|
||||
expdata: CGAffineTransformMakeTranslation(-4, -5)
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGAffineTransformMakeScale(3,4),
|
||||
expdata: CGAffineTransformMakeScale(1/3,1/4)
|
||||
testdata: CGAffineTransformMakeScale(3, 4),
|
||||
expdata: CGAffineTransformMakeScale(1 / 3, 1 / 4)
|
||||
},
|
||||
};
|
||||
|
||||
@@ -483,28 +483,28 @@
|
||||
},
|
||||
|
||||
"rotation 90 degrees" : {
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformMakeRotation(Math.PI/2)),
|
||||
expdata: CGRectMake( -10,3.0000000000000004,6,5 )
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformMakeRotation(PI/2)),
|
||||
expdata: CGRectMake(-10, 3.0000000000000004, 6, 5)
|
||||
},
|
||||
|
||||
"translation" : {
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformMakeTranslation(3,4)),
|
||||
expdata: CGRectMake( 6,8,5,6 )
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformMakeTranslation(3, 4)),
|
||||
expdata: CGRectMake(6, 8, 5, 6)
|
||||
},
|
||||
|
||||
"scale" : {
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformMakeScale(1,4)),
|
||||
expdata: CGRectMake( 3,16,5,24 )
|
||||
expdata: CGRectMake(3, 16, 5, 24)
|
||||
},
|
||||
|
||||
"rotate, translate and scale" : {
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3,4),5,6),Math.PI)),
|
||||
expdata: CGRectMake( -9.000000000000004, -16,
|
||||
15.000000000000002, 24.000000000000004 )
|
||||
testdata: CGRectApplyAffineTransform(rect, CGAffineTransformRotate(CGAffineTransformTranslate(CGAffineTransformMakeScale(3, 4),5,6), PI)),
|
||||
expdata: CGRectMake(-9.000000000000004, -16,
|
||||
15.000000000000002, 24.000000000000004)
|
||||
},
|
||||
};
|
||||
|
||||
for ( var key in testcases )
|
||||
for (var key in testcases)
|
||||
[self compareRect:testcases[key].testdata with:testcases[key].expdata message:key];
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
{
|
||||
var rgbaColour = [CPColor colorWithCSSString:@"rgba(32, 64, 128, 0.5)"];
|
||||
|
||||
[self assert:32 equals:Math.round([rgbaColour redComponent] * 255) message:"red component"];
|
||||
[self assert:64 equals:Math.round([rgbaColour greenComponent] * 255) message:"green component"];
|
||||
[self assert:128 equals:Math.round([rgbaColour blueComponent] * 255) message:"blue component"];
|
||||
[self assert:128 equals:Math.round([rgbaColour alphaComponent] * 255) message:"alpha component"];
|
||||
[self assert:32 equals:ROUND([rgbaColour redComponent] * 255) message:"red component"];
|
||||
[self assert:64 equals:ROUND([rgbaColour greenComponent] * 255) message:"green component"];
|
||||
[self assert:128 equals:ROUND([rgbaColour blueComponent] * 255) message:"blue component"];
|
||||
[self assert:128 equals:ROUND([rgbaColour alphaComponent] * 255) message:"alpha component"];
|
||||
}
|
||||
|
||||
- (void)testIsEqual_
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
{
|
||||
var view = allViews[i],
|
||||
column = i % 2,
|
||||
row = startingRow + Math.floor(i / 2); // Two columns per row.
|
||||
row = startingRow + FLOOR(i / 2); // Two columns per row.
|
||||
//CPLog.error([view stringValue] + " frame: " + CPStringFromRect([tableView convertRect:[view frame] toView:nil]));
|
||||
[self assert:("R" + row + "C" + column) equals:[view stringValue] message:"(" + row + ", " + column + ") string value"];
|
||||
[self assert:"CustomTextView" + column equals:[[view class] description] message:"(" + row + ", " + column + ") data view"];
|
||||
@@ -205,11 +205,11 @@
|
||||
var allViews = AssertCorrectCellsVisible(0),
|
||||
visibleHeight = [tableView visibleRect].size.height,
|
||||
fullRowHeight = [tableView rowHeight] + [tableView intercellSpacing].height,
|
||||
visibleRows = Math.ceil(visibleHeight / fullRowHeight);
|
||||
visibleRows = CEIL(visibleHeight / fullRowHeight);
|
||||
[self assert:2 * visibleRows equals:[allViews count] message:"only as many data views as necessary should be present"];
|
||||
|
||||
// Now if we scroll down, new views should come in and others should go out.
|
||||
var rowTwentyFiveAndAHalfY = Math.floor(25.5 * fullRowHeight);
|
||||
var rowTwentyFiveAndAHalfY = FLOOR(25.5 * fullRowHeight);
|
||||
[tableView scrollPoint:CGPointMake(0, rowTwentyFiveAndAHalfY)];
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -526,6 +526,18 @@
|
||||
[self assert:input1[1] equals:[output valueForKey:"1"] message:@"output[0]"];
|
||||
}
|
||||
|
||||
- (void)testJSObjectDescription
|
||||
{
|
||||
var array = [CGRectMake(1, 2, 3, 4), CGPointMake(5, 6)],
|
||||
d = [array description];
|
||||
|
||||
[self assertTrue:d.indexOf("x: 1") !== -1 message:"Can't find 'x: 1' in description of array " + d];
|
||||
[self assertTrue:d.indexOf("y: 2") !== -1 message:"Can't find 'y: 2' in description of array " + d];
|
||||
[self assertTrue:d.indexOf("width: 3") !== -1 message:"Can't find 'width: 3' in description of array " + d];
|
||||
[self assertTrue:d.indexOf("height: 4") !== -1 message:"Can't find 'height: 4' in description of array " + d];
|
||||
[self assertTrue:d.indexOf("x: 5") !== -1 message:"Can't find 'x: 5' in description of array " + d];
|
||||
[self assertTrue:d.indexOf("y: 6") !== -1 message:"Can't find 'y: 6' in description of array " + d];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
expectedMinute = 31,
|
||||
offset = -date.getTimezoneOffset(),
|
||||
offsetPositive = offset >= 0,
|
||||
offsetHours = offsetPositive ? Math.floor(offset / 60) : Math.ceil(offset / 60),
|
||||
offsetHours = offsetPositive ? FLOOR(offset / 60) : CEIL(offset / 60),
|
||||
offsetMinutes = offset - offsetHours * 60,
|
||||
expectedString;
|
||||
expectedHour += offsetHours;
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
- (void)testInitialisersAndMisc
|
||||
{
|
||||
// CPDecimalNumber class initialisers
|
||||
var dcmn = [[CPDecimalNumber alloc] initWithString:@"10.72342"];
|
||||
var dcm = [dcmn decimalValue];
|
||||
var dcmn = [[CPDecimalNumber alloc] initWithString:@"10.72342"],
|
||||
dcm = [dcmn decimalValue];
|
||||
[self assert:-5 equals:dcm._exponent message:"initWithString: - exponent"];
|
||||
[self assert:[1,0,7,2,3,4,2] equals:dcm._mantissa message:"initWithString: - mantissa"];
|
||||
[self assert:NO equals:dcm._isNegative message:"initWithString: - sign"];
|
||||
@@ -141,22 +141,22 @@
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 1 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"foo"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 2 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@".123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 3 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"-.123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 4 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"0123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 5 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"1e200"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 6 overflow should return NaN"];
|
||||
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"12312e-23421"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 7 overflow should return NaN"];
|
||||
}
|
||||
@@ -164,10 +164,10 @@
|
||||
- (void)testAdd
|
||||
{
|
||||
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"123"];
|
||||
var dcmn2 = [CPDecimalNumber decimalNumberWithString:@"321"];
|
||||
var dcmn3 = [dcmn1 decimalNumberByAdding:dcmn2];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"123"],
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"321"],
|
||||
dcmn3 = [dcmn1 decimalNumberByAdding:dcmn2],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:0 equals:d1._exponent message:"decimalNumberByAdding: - exponent"];
|
||||
[self assert:[4,4,4] equals:d1._mantissa message:"decimalNumberByAdding: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByAdding: - sign"];
|
||||
@@ -176,7 +176,8 @@
|
||||
// precision throw - with behavior
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"10000000000000000000000000000000000001"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"1.00001"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByAdding:dcmn2 withBehavior:_dcmnhWithExactness];
|
||||
[self fail:"decimalNumberByAdding:withBehavior: TEX1 - should have throw precision error "];
|
||||
}
|
||||
@@ -185,7 +186,8 @@
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByAdding:dcmn2];
|
||||
}
|
||||
catch (e)
|
||||
@@ -196,7 +198,8 @@
|
||||
// overflow
|
||||
dcmn1 = [CPDecimalNumber maximumDecimalNumber];
|
||||
dcmn2 = [CPDecimalNumber maximumDecimalNumber];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByAdding:dcmn2];
|
||||
[self fail:"decimalNumberByAdding: TEX3 - should have thrown overflow error "];
|
||||
}
|
||||
@@ -210,10 +213,10 @@
|
||||
|
||||
- (void)testSubtract
|
||||
{
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"301"];
|
||||
var dcmn2 = [CPDecimalNumber decimalNumberWithString:@"153"];
|
||||
var dcmn3 = [dcmn1 decimalNumberBySubtracting:dcmn2];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"301"],
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"153"],
|
||||
dcmn3 = [dcmn1 decimalNumberBySubtracting:dcmn2],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:0 equals:d1._exponent message:"decimalNumberBySubtracting: - exponent"];
|
||||
[self assert:[1,4,8] equals:d1._mantissa message:"decimalNumberBySubtracting: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberBySubtracting: - sign"];
|
||||
@@ -222,7 +225,8 @@
|
||||
// precision throw - with behavior
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1e-128"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"1"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberBySubtracting:dcmn2 withBehavior:_dcmnhWithExactness];
|
||||
[self fail:"decimalNumberBySubtracting:withBehavior: TEX1 - should have throw precision error "];
|
||||
}
|
||||
@@ -231,7 +235,8 @@
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberBySubtracting:dcmn2];
|
||||
}
|
||||
catch (e)
|
||||
@@ -244,10 +249,10 @@
|
||||
|
||||
- (void)testDivide
|
||||
{
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"7126313"];
|
||||
var dcmn2 = [CPDecimalNumber decimalNumberWithString:@"1235"];
|
||||
var dcmn3 = [dcmn1 decimalNumberByDividingBy:dcmn2];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"7126313"],
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"1235"],
|
||||
dcmn3 = [dcmn1 decimalNumberByDividingBy:dcmn2],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:-34 equals:d1._exponent message:"decimalNumberByDividingBy: - exponent"];
|
||||
[self assert:[5,7,7,0,2,9,3,9,2,7,1,2,5,5,0,6,0,7,2,8,7,4,4,9,3,9,2,7,1,2,5,5,0,6,0,7,2,8] equals:d1._mantissa message:"decimalNumberByDividingBy: T1: mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByDividingBy: - sign"];
|
||||
@@ -265,7 +270,8 @@
|
||||
// Exceptions
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"3"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByDividingBy:dcmn2 withBehavior:_dcmnhWithExactness];
|
||||
[self fail:"decimalNumberByDividingBy:withBehavior: TEX1 - should have thrown precision error "];
|
||||
}
|
||||
@@ -274,7 +280,8 @@
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByDividingBy:dcmn2];
|
||||
}
|
||||
catch (e)
|
||||
@@ -297,7 +304,8 @@
|
||||
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"-1e-128"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"0"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByDividingBy:dcmn2];
|
||||
[self fail:"decimalNumberByDividingBy: TEX3 - should have thrown DIV0 error "];
|
||||
}
|
||||
@@ -307,14 +315,24 @@
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
- (void)testDivide2
|
||||
{
|
||||
// https://github.com/cappuccino/cappuccino/issues/1529
|
||||
var dcm1 = [CPDecimalNumber decimalNumberWithString:@"220000"],
|
||||
dcm2 = [CPDecimalNumber decimalNumberWithString:@"220"],
|
||||
res = [dcm1 decimalNumberByDividingBy:dcm2];
|
||||
|
||||
[self assert:1000 equals:[res doubleValue] message:"220000/220 == 1000"];
|
||||
}
|
||||
|
||||
- (void)testMutliply
|
||||
{
|
||||
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"];
|
||||
var dcmn2 = [CPDecimalNumber decimalNumberWithString:@"512"];
|
||||
var dcmn3 = [dcmn1 decimalNumberByMultiplyingBy:dcmn2];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"],
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"512"],
|
||||
dcmn3 = [dcmn1 decimalNumberByMultiplyingBy:dcmn2],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:0 equals:d1._exponent message:"decimalNumberByMultiplyingBy: - exponent"];
|
||||
[self assert:[8,7,0,4] equals:d1._mantissa message:"decimalNumberByMultiplyingBy: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByMultiplyingBy: - sign"];
|
||||
@@ -332,7 +350,8 @@
|
||||
// Exceptions
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"18302741890374918"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"123847190277982223422346878934534"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByMultiplyingBy:dcmn2 withBehavior:_dcmnhWithExactness];
|
||||
[self fail:"decimalNumberByMultiplyingBy:withBehavior: TEX1 - should have thrown precision error "];
|
||||
}
|
||||
@@ -341,7 +360,8 @@
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByMultiplyingBy:dcmn2];
|
||||
}
|
||||
catch (e)
|
||||
@@ -352,7 +372,8 @@
|
||||
// overflow
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"23e100"];
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"-13e76"];
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByMultiplyingBy:dcmn2];
|
||||
[self fail:"decimalNumberByMultiplyingBy: TEX3 - should have overflowed "];
|
||||
}
|
||||
@@ -365,10 +386,10 @@
|
||||
|
||||
- (void)testPower10
|
||||
{
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"];
|
||||
var p = 21;
|
||||
var dcmn3 = [dcmn1 decimalNumberByMultiplyingByPowerOf10:p];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"],
|
||||
p = 21,
|
||||
dcmn3 = [dcmn1 decimalNumberByMultiplyingByPowerOf10:p],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:21 equals:d1._exponent message:"decimalNumberByMultiplyingByPowerOf10: - exponent"];
|
||||
[self assert:[1,7] equals:d1._mantissa message:"decimalNumberByMultiplyingByPowerOf10: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByMultiplyingByPowerOf10: - sign"];
|
||||
@@ -401,10 +422,10 @@
|
||||
|
||||
- (void)testPower
|
||||
{
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"];
|
||||
var p = 10;
|
||||
var dcmn3 = [dcmn1 decimalNumberByRaisingToPower:p];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"],
|
||||
p = 10,
|
||||
dcmn3 = [dcmn1 decimalNumberByRaisingToPower:p],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:0 equals:d1._exponent message:"decimalNumberByRaisingToPower: - exponent"];
|
||||
[self assert:[2,0,1,5,9,9,3,9,0,0,4,4,9] equals:d1._mantissa message:"decimalNumberByRaisingToPower: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByRaisingToPower: - sign"];
|
||||
@@ -422,7 +443,8 @@
|
||||
// Exceptions
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"123198771093489073413"];
|
||||
p = 2;
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByRaisingToPower:p withBehavior:_dcmnhWithExactness];
|
||||
[self fail:"decimalNumberByRaisingToPower:withBehavior: TEX1 - should have thrown precision error "];
|
||||
}
|
||||
@@ -431,7 +453,8 @@
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByRaisingToPower:p];
|
||||
}
|
||||
catch (e)
|
||||
@@ -442,7 +465,8 @@
|
||||
// overflow
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1234"];
|
||||
p = 123;
|
||||
try {
|
||||
try
|
||||
{
|
||||
dcmn3 = [dcmn1 decimalNumberByRaisingToPower:p];
|
||||
[self fail:"decimalNumberByRaisingToPower: TEX3 - should have overflowed "];
|
||||
}
|
||||
@@ -455,10 +479,10 @@
|
||||
|
||||
- (void)testRounding
|
||||
{
|
||||
var h = [CPDecimalNumberHandler decimalNumberHandlerWithRoundingMode:CPRoundDown scale:0 raiseOnExactness:NO raiseOnOverflow:YES raiseOnUnderflow:YES raiseOnDivideByZero:YES];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1.4"];
|
||||
var dcmn3 = [dcmn1 decimalNumberByRoundingAccordingToBehavior:h];
|
||||
var d1 = [dcmn3 decimalValue];
|
||||
var h = [CPDecimalNumberHandler decimalNumberHandlerWithRoundingMode:CPRoundDown scale:0 raiseOnExactness:NO raiseOnOverflow:YES raiseOnUnderflow:YES raiseOnDivideByZero:YES],
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1.4"],
|
||||
dcmn3 = [dcmn1 decimalNumberByRoundingAccordingToBehavior:h],
|
||||
d1 = [dcmn3 decimalValue];
|
||||
[self assert:0 equals:d1._exponent message:"decimalNumberByRoundingAccordingToBehavior: - exponent"];
|
||||
[self assert:[1] equals:d1._mantissa message:"decimalNumberByRoundingAccordingToBehavior: - mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"decimalNumberByRoundingAccordingToBehavior: - sign"];
|
||||
@@ -467,9 +491,9 @@
|
||||
|
||||
- (void)testCompare
|
||||
{
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"];
|
||||
var dcmn2 = [CPDecimalNumber decimalNumberWithString:@"512"];
|
||||
var c = [dcmn1 compare:dcmn2];
|
||||
var dcmn1 = [CPDecimalNumber decimalNumberWithString:@"17"],
|
||||
dcmn2 = [CPDecimalNumber decimalNumberWithString:@"512"],
|
||||
c = [dcmn1 compare:dcmn2];
|
||||
[self assert:c equals:CPOrderedAscending message:"compare: - ascending"];
|
||||
|
||||
dcmn1 = [CPDecimalNumber decimalNumberWithString:@"1234"];
|
||||
@@ -495,7 +519,6 @@
|
||||
[self assert:"82346.2341144" equals:[dcmn descriptionWithLocale:nil] message:"descriptionWithLocale: - large number"];
|
||||
}
|
||||
|
||||
|
||||
- (void)testEncoding
|
||||
{
|
||||
var number = [CPDecimalNumber decimalNumberWithString:@"-1.233e24"],
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
// too large return NaN
|
||||
dcm = CPDecimalMakeWithString(@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To1: number overflow handling. Should return NaN"];
|
||||
dcm =CPDecimalMakeWithString(@"-1e1000");
|
||||
dcm = CPDecimalMakeWithString(@"-1e1000");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To2: exponent overflow not caught. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"-1e-2342");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To3: exponent underflow not caught. Should return NaN"];
|
||||
@@ -103,7 +103,7 @@
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti11: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"-.1");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti12: catch of invalid number string. Should return NaN"];
|
||||
|
||||
|
||||
//test make with parts
|
||||
dcm = CPDecimalMakeWithParts(10127658,2);
|
||||
[self assert:2 equals:dcm._exponent message:"CPDecimalMakeWithParts() Tmp1: exponent"];
|
||||
@@ -315,9 +315,9 @@
|
||||
|
||||
- (void)testCompare
|
||||
{
|
||||
var dcm1 = CPDecimalMakeWithString(@"75836");
|
||||
var dcm = CPDecimalMakeWithString(@"75836");
|
||||
var c = CPDecimalCompare(dcm1,dcm);
|
||||
var dcm1 = CPDecimalMakeWithString(@"75836"),
|
||||
dcm = CPDecimalMakeWithString(@"75836"),
|
||||
c = CPDecimalCompare(dcm1,dcm);
|
||||
[self assert:CPOrderedSame equals:c message:"CPDecimalCompare() Tc1: should be same"];
|
||||
|
||||
dcm1 = CPDecimalMakeWithString(@"75836");
|
||||
@@ -449,9 +449,9 @@
|
||||
|
||||
- (void)testSubtract
|
||||
{
|
||||
var d1 = CPDecimalMakeZero();
|
||||
var d2 = CPDecimalMakeWithString(@"0.875");
|
||||
var d3 = CPDecimalMakeWithString(@"12.67");
|
||||
var d1 = CPDecimalMakeZero(),
|
||||
d2 = CPDecimalMakeWithString(@"0.875"),
|
||||
d3 = CPDecimalMakeWithString(@"12.67");
|
||||
[self assert:CPCalculationNoError equals:CPDecimalSubtract(d1,d2,d3,CPRoundPlain) message:"CPDecimalSubtract(): Ts1: Should succeed"];
|
||||
[self assert:-3 equals:d1._exponent message:"CPDecimalSubtract(): Ts1: exponent"];
|
||||
[self assert:[1,1,7,9,5] equals:d1._mantissa message:"CPDecimalSubtract(): Ts1: mantissa"];
|
||||
@@ -498,9 +498,9 @@
|
||||
|
||||
- (void)testDivide
|
||||
{
|
||||
var d1 = CPDecimalMakeZero();
|
||||
var d2 = CPDecimalMakeWithString(@"55e12");
|
||||
var d3 = CPDecimalMakeWithString(@"-5e20");
|
||||
var d1 = CPDecimalMakeZero(),
|
||||
d2 = CPDecimalMakeWithString(@"55e12"),
|
||||
d3 = CPDecimalMakeWithString(@"-5e20");
|
||||
[self assert:CPCalculationNoError equals:CPDecimalDivide(d1,d2,d3,CPRoundPlain) message:"CPDecimalDivide(): Td1: Should succeed"];
|
||||
[self assert:-8 equals:d1._exponent message:"CPDecimalDivide(): Td1: exponent"];
|
||||
[self assert:[1,1] equals:d1._mantissa message:"CPDecimalDivide(): Td1: mantissa"];
|
||||
@@ -549,13 +549,23 @@
|
||||
d2 = CPDecimalMakeWithString(@"-0.875");
|
||||
d3 = CPDecimalMakeWithString(@"0");
|
||||
[self assert:CPCalculationDivideByZero equals:CPDecimalDivide(d1,d2,d3,CPRoundUp) message:"CPDecimalDivide(): Tdp2: Should Loss of precision"];
|
||||
|
||||
d1 = CPDecimalMakeZero();
|
||||
d2 = CPDecimalMakeWithString(@"11");
|
||||
d3 = CPDecimalMakeWithString(@"11");
|
||||
|
||||
[self assert:CPCalculationNoError equals:CPDecimalDivide(d1, d2, d3, CPRoundPlain) message:"CPDecimalDivide(): Td4: Should succeed"];
|
||||
[self assert:0 equals:d1._exponent message:"CPDecimalDivide(): Td4: exponent"];
|
||||
[self assert:[1] equals:d1._mantissa message:"CPDecimalDivide(): Td4: mantissa"];
|
||||
[self assert:NO equals:d1._isNegative message:"CPDecimalDivide(): Td4: sign"];
|
||||
[self assert:NO equals:d1._isNaN message:"CPDecimalDivide(): Td4: NaN is incorrectly set"];
|
||||
}
|
||||
|
||||
- (void)testMultiply
|
||||
{
|
||||
var d1 = CPDecimalMakeZero();
|
||||
var d2 = CPDecimalMakeWithString(@"12");
|
||||
var d3 = CPDecimalMakeWithString(@"-1441231251321235231");
|
||||
var d1 = CPDecimalMakeZero(),
|
||||
d2 = CPDecimalMakeWithString(@"12"),
|
||||
d3 = CPDecimalMakeWithString(@"-1441231251321235231");
|
||||
[self assert:CPCalculationNoError equals:CPDecimalMultiply(d1,d2,d3,CPRoundPlain) message:"CPDecimalMultiply(): Tm1: Should succeed"];
|
||||
[self assert:0 equals:d1._exponent message:"CPDecimalMultiply(): Tm1: exponent"];
|
||||
[self assert:[1,7,2,9,4,7,7,5,0,1,5,8,5,4,8,2,2,7,7,2] equals:d1._mantissa message:"CPDecimalMultiply(): Tm1: mantissa"];
|
||||
@@ -610,9 +620,9 @@
|
||||
// Power is unsigned
|
||||
- (void)testPower
|
||||
{
|
||||
var d1 = CPDecimalMakeZero();
|
||||
var d2 = CPDecimalMakeWithString(@"123");
|
||||
var d3 = 12;
|
||||
var d1 = CPDecimalMakeZero(),
|
||||
d2 = CPDecimalMakeWithString(@"123"),
|
||||
d3 = 12;
|
||||
[self assert:CPCalculationNoError equals:CPDecimalPower(d1,d2,d3,CPRoundPlain) message:"CPDecimalPower(): Tp1: Should succeed"];
|
||||
[self assert:0 equals:d1._exponent message:"CPDecimalPower(): Tp1: exponent"];
|
||||
[self assert:[1,1,9,9,1,1,6,3,8,4,8,7,1,6,9,0,6,2,9,7,0,7,2,7,2,1] equals:d1._mantissa message:"CPDecimalPower(): Tp1: mantissa"];
|
||||
@@ -634,9 +644,9 @@
|
||||
|
||||
- (void)testPower10
|
||||
{
|
||||
var d1 = CPDecimalMakeZero();
|
||||
var d2 = CPDecimalMakeWithString(@"-0.875");
|
||||
var d3 = 3;
|
||||
var d1 = CPDecimalMakeZero(),
|
||||
d2 = CPDecimalMakeWithString(@"-0.875"),
|
||||
d3 = 3;
|
||||
[self assert:CPCalculationNoError equals:CPDecimalMultiplyByPowerOf10(d1,d2,d3,CPRoundPlain) message:"CPDecimalMultiplyByPowerOf10(): Tpp1: Should succeed"];
|
||||
[self assert:0 equals:d1._exponent message:"CPDecimalMultiplyByPowerOf10(): Tpp1: exponent"];
|
||||
[self assert:[8,7,5] equals:d1._mantissa message:"CPDecimalMultiplyByPowerOf10(): Tpp1: mantissa"];
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"key3": {
|
||||
"another": "object"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
string_dict = [[CPDictionary alloc] initWithObjects:[@"1", @"2", @"This is a String", @"This is a String"] forKeys:[@"key1", @"key2", @"key3", @"key4"]];
|
||||
json_dict = [CPDictionary dictionaryWithJSObject:json recursively:YES];
|
||||
@@ -237,4 +237,17 @@
|
||||
[self assert:expected equals:result];
|
||||
}
|
||||
|
||||
- (void)testJSObjectDescription
|
||||
{
|
||||
var dict = [[CPDictionary alloc] initWithObjects:[CGRectMake(1, 2, 3, 4), CGPointMake(5, 6)] forKeys:[@"key1", @"key2"]],
|
||||
d = [dict description];
|
||||
|
||||
[self assertTrue:d.indexOf("x: 1") !== -1 message:"Can't find 'x: 1' in description of dictionary " + d];
|
||||
[self assertTrue:d.indexOf("y: 2") !== -1 message:"Can't find 'y: 2' in description of dictionary " + d];
|
||||
[self assertTrue:d.indexOf("width: 3") !== -1 message:"Can't find 'width: 3' in description of dictionary " + d];
|
||||
[self assertTrue:d.indexOf("height: 4") !== -1 message:"Can't find 'height: 4' in description of dictionary " + d];
|
||||
[self assertTrue:d.indexOf("x: 5") !== -1 message:"Can't find 'x: 5' in description of dictionary " + d];
|
||||
[self assertTrue:d.indexOf("y: 6") !== -1 message:"Can't find 'y: 6' in description of dictionary " + d];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -380,11 +380,11 @@
|
||||
|
||||
[pretty sortUsingDescriptors:[[[CPSortDescriptor alloc] initWithKey:@"value" ascending:NO]]];
|
||||
|
||||
[self assert:"(\n\t3:d, \n\t2:c, \n\t1:b, \n\t0:a\n)" equals:[pretty description]];
|
||||
[self assert:"(\n\t3:d,\n\t2:c,\n\t1:b,\n\t0:a\n)" equals:[pretty description]];
|
||||
|
||||
[pretty sortUsingDescriptors:[[[CPSortDescriptor alloc] initWithKey:@"value" ascending:YES]]];
|
||||
|
||||
[self assert:"(\n\t0:a, \n\t1:b, \n\t2:c, \n\t3:d\n)" equals:[pretty description]]
|
||||
[self assert:"(\n\t0:a,\n\t1:b,\n\t2:c,\n\t3:d\n)" equals:[pretty description]];
|
||||
}
|
||||
|
||||
- (void)testThatCPArrayDoesSortUsingTwoDescriptors
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -17,7 +17,7 @@ var RecordData = [
|
||||
|
||||
var randomFromTo = function(from, to)
|
||||
{
|
||||
return Math.floor(Math.random() * (to - from + 1) + from);
|
||||
return FLOOR(RAND() * (to - from + 1) + from);
|
||||
};
|
||||
|
||||
@implementation AppController : CPObject
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -186,7 +186,7 @@
|
||||
{
|
||||
[aPopover setDelegate:self];
|
||||
[aPopover setAnimates:([buttonAnimation title] === @"With animation")];
|
||||
[aPopover setBehaviour:([buttonBehaviour title] === @"Transient") ? CPPopoverBehaviorTransient : CPPopoverBehaviorApplicationDefined];
|
||||
[aPopover setBehavior:([buttonBehaviour title] === @"Transient") ? CPPopoverBehaviorTransient : CPPopoverBehaviorApplicationDefined];
|
||||
[aPopover setAppearance:appearance];
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPProgressIndicator
|
||||
*
|
||||
* Created by Alexander Ljungberg on May 3, 2012.
|
||||
* Copyright 2012, SlevenBits Ltd. All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||
@outlet CPProgressIndicator fiftyPercentBar @accessors;
|
||||
@outlet CPProgressIndicator hundredPercentBar @accessors;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// This is called when the application is done loading.
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
// This is called when the cib is done loading.
|
||||
// You can implement this method on any object instantiated from a Cib.
|
||||
// It's a useful hook for setting up current UI values, and other things.
|
||||
|
||||
// Interface Builder does not encode the current progress.
|
||||
[fiftyPercentBar setDoubleValue:50];
|
||||
[hundredPercentBar setDoubleValue:100];
|
||||
|
||||
[theWindow center];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Main cib file base name</key>
|
||||
<string>MainMenu.cib</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>CPProgressIndicator</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPProgressIndicator
|
||||
*
|
||||
* Created by Alexander Ljungberg on May 3, 2012.
|
||||
* Copyright 2012, SlevenBits Ltd. All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("CPProgressIndicator", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPProgressIndicator.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPProgressIndicator");
|
||||
task.setIdentifier("com.yourcompany.CPProgressIndicator");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("SlevenBits Ltd");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPProgressIndicator");
|
||||
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
task.setNib2CibFlags("-R Resources/");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O");
|
||||
});
|
||||
|
||||
task ("default", ["CPProgressIndicator"], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"]);
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", "CPProgressIndicator", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPProgressIndicator", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPProgressIndicator"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPProgressIndicator"), FILE.join("Build", "Deployment", "CPProgressIndicator")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPProgressIndicator"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPProgressIndicator"), FILE.join("Build", "Desktop", "CPProgressIndicator", "CPProgressIndicator.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "CPProgressIndicator", "CPProgressIndicator.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPProgressIndicator"));
|
||||
print("----------------------------");
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,629 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">11D50</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.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>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSView</string>
|
||||
<string>NSProgressIndicator</string>
|
||||
<string>NSCustomObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1021">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1014">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1050">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="972006081">
|
||||
<int key="NSWindowStyleMask">7</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{335, 390}, {266, 190}}</string>
|
||||
<int key="NSWTFlags">1946157056</int>
|
||||
<string key="NSWindowTitle">CPProgressIndicator</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="439893737">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSProgressIndicator" id="685095827">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{152, 151}, {96, 20}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="272394105"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSHuggingPriority">{250, 250}</string>
|
||||
<int key="NSpiFlags">16397</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="11973700">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{152, 127}, {96, 20}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="617255042"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSHuggingPriority">{250, 250}</string>
|
||||
<int key="NSpiFlags">16397</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="623175648">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{152, 79}, {96, 20}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="266460629"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSHuggingPriority">{250, 250}</string>
|
||||
<int key="NSpiFlags">16399</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="257414374">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">1292</int>
|
||||
<object class="NSPSMatrix" key="NSDrawMatrix"/>
|
||||
<string key="NSFrame">{{154, 43}, {32, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="382264783"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:926</string>
|
||||
<int key="NSpiFlags">20490</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="582226310">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{152, 103}, {96, 20}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="125720689"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSHuggingPriority">{250, 250}</string>
|
||||
<int key="NSpiFlags">16397</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSTextField" id="728836983">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 154}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="685095827"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="306424160">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">Empty progress bar:</string>
|
||||
<object class="NSFont" key="NSSupport" id="187808035">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="728836983"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="437744893">
|
||||
<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" id="446913689">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="272394105">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 131}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="11973700"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="835598184">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">50% progress bar:</string>
|
||||
<reference key="NSSupport" ref="187808035"/>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="272394105"/>
|
||||
<reference key="NSBackgroundColor" ref="437744893"/>
|
||||
<reference key="NSTextColor" ref="446913689"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="617255042">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 106}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="582226310"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="2122616">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">100% progress bar:</string>
|
||||
<reference key="NSSupport" ref="187808035"/>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="617255042"/>
|
||||
<reference key="NSBackgroundColor" ref="437744893"/>
|
||||
<reference key="NSTextColor" ref="446913689"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="125720689">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 83}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="623175648"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="968461958">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">Indeterminate bar:</string>
|
||||
<reference key="NSSupport" ref="187808035"/>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="125720689"/>
|
||||
<reference key="NSBackgroundColor" ref="437744893"/>
|
||||
<reference key="NSTextColor" ref="446913689"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="266460629">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 59}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="257414374"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="345370421">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">Regular spinner:</string>
|
||||
<reference key="NSSupport" ref="187808035"/>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="266460629"/>
|
||||
<reference key="NSBackgroundColor" ref="437744893"/>
|
||||
<reference key="NSTextColor" ref="446913689"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="382264783">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 20}, {132, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="392821092"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="317438590">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">Small spinner:</string>
|
||||
<reference key="NSSupport" ref="187808035"/>
|
||||
<string key="NSCellIdentifier">_NS:1505</string>
|
||||
<reference key="NSControlView" ref="382264783"/>
|
||||
<reference key="NSBackgroundColor" ref="437744893"/>
|
||||
<reference key="NSTextColor" ref="446913689"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSProgressIndicator" id="392821092">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">1292</int>
|
||||
<object class="NSPSMatrix" key="NSDrawMatrix"/>
|
||||
<string key="NSFrame">{{154, 20}, {16, 16}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:926</string>
|
||||
<int key="NSpiFlags">20746</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{266, 190}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="728836983"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="635946545">
|
||||
<string key="NSClassName">AppController</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
</object>
|
||||
<int key="connectionID">451</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">theWindow</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="972006081"/>
|
||||
</object>
|
||||
<int key="connectionID">459</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">fiftyPercentBar</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="11973700"/>
|
||||
</object>
|
||||
<int key="connectionID">475</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">hundredPercentBar</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="582226310"/>
|
||||
</object>
|
||||
<int key="connectionID">476</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1021"/>
|
||||
<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="1014"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1050"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">371</int>
|
||||
<reference key="object" ref="972006081"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="439893737"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">372</int>
|
||||
<reference key="object" ref="439893737"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="728836983"/>
|
||||
<reference ref="685095827"/>
|
||||
<reference ref="11973700"/>
|
||||
<reference ref="623175648"/>
|
||||
<reference ref="582226310"/>
|
||||
<reference ref="272394105"/>
|
||||
<reference ref="617255042"/>
|
||||
<reference ref="125720689"/>
|
||||
<reference ref="266460629"/>
|
||||
<reference ref="257414374"/>
|
||||
<reference ref="392821092"/>
|
||||
<reference ref="382264783"/>
|
||||
</object>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">450</int>
|
||||
<reference key="object" ref="635946545"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">460</int>
|
||||
<reference key="object" ref="685095827"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">461</int>
|
||||
<reference key="object" ref="11973700"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">462</int>
|
||||
<reference key="object" ref="623175648"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">463</int>
|
||||
<reference key="object" ref="257414374"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">464</int>
|
||||
<reference key="object" ref="582226310"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">465</int>
|
||||
<reference key="object" ref="728836983"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="306424160"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">466</int>
|
||||
<reference key="object" ref="306424160"/>
|
||||
<reference key="parent" ref="728836983"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">467</int>
|
||||
<reference key="object" ref="272394105"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="835598184"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">468</int>
|
||||
<reference key="object" ref="835598184"/>
|
||||
<reference key="parent" ref="272394105"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">469</int>
|
||||
<reference key="object" ref="617255042"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="2122616"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">470</int>
|
||||
<reference key="object" ref="2122616"/>
|
||||
<reference key="parent" ref="617255042"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">471</int>
|
||||
<reference key="object" ref="125720689"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="968461958"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">472</int>
|
||||
<reference key="object" ref="968461958"/>
|
||||
<reference key="parent" ref="125720689"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">473</int>
|
||||
<reference key="object" ref="266460629"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="345370421"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">474</int>
|
||||
<reference key="object" ref="345370421"/>
|
||||
<reference key="parent" ref="266460629"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">477</int>
|
||||
<reference key="object" ref="382264783"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="317438590"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">478</int>
|
||||
<reference key="object" ref="317438590"/>
|
||||
<reference key="parent" ref="382264783"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">479</int>
|
||||
<reference key="object" ref="392821092"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>371.IBPluginDependency</string>
|
||||
<string>371.IBWindowTemplateEditedContentRect</string>
|
||||
<string>371.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>372.IBPluginDependency</string>
|
||||
<string>450.IBPluginDependency</string>
|
||||
<string>460.IBPluginDependency</string>
|
||||
<string>461.IBPluginDependency</string>
|
||||
<string>462.IBPluginDependency</string>
|
||||
<string>463.IBPluginDependency</string>
|
||||
<string>464.IBPluginDependency</string>
|
||||
<string>465.IBPluginDependency</string>
|
||||
<string>466.IBPluginDependency</string>
|
||||
<string>467.IBPluginDependency</string>
|
||||
<string>468.IBPluginDependency</string>
|
||||
<string>469.IBPluginDependency</string>
|
||||
<string>470.IBPluginDependency</string>
|
||||
<string>471.IBPluginDependency</string>
|
||||
<string>472.IBPluginDependency</string>
|
||||
<string>473.IBPluginDependency</string>
|
||||
<string>474.IBPluginDependency</string>
|
||||
<string>477.IBPluginDependency</string>
|
||||
<string>478.IBPluginDependency</string>
|
||||
<string>479.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{303, 221}, {480, 360}}</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">479</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">AppController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>fiftyPercentBar</string>
|
||||
<string>hundredPercentBar</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSProgressIndicator</string>
|
||||
<string>NSProgressIndicator</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>fiftyPercentBar</string>
|
||||
<string>hundredPercentBar</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">fiftyPercentBar</string>
|
||||
<string key="candidateClassName">NSProgressIndicator</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">hundredPercentBar</string>
|
||||
<string key="candidateClassName">NSProgressIndicator</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/AppController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</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="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPProgressIndicator
|
||||
|
||||
Created by Alexander Ljungberg on May 3, 2012.
|
||||
Copyright 2012, SlevenBits Ltd. All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPProgressIndicator</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPProgressIndicator...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPProgressIndicator
|
||||
|
||||
Created by Alexander Ljungberg on May 3, 2012.
|
||||
Copyright 2012, SlevenBits Ltd. All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPProgressIndicator</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPProgressIndicator...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPProgressIndicator
|
||||
*
|
||||
* Created by Alexander Ljungberg on May 3, 2012.
|
||||
* Copyright 2012, SlevenBits Ltd. All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -42,12 +42,12 @@
|
||||
launchAvg /= data.length;
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
loadStdev += Math.pow(data[i][0] - loadAvg, 2);
|
||||
launchStdev += Math.pow(data[i][1] - launchAvg, 2);
|
||||
loadStdev += POW(data[i][0] - loadAvg, 2);
|
||||
launchStdev += POW(data[i][1] - launchAvg, 2);
|
||||
}
|
||||
|
||||
loadStdev = Math.sqrt(loadStdev / data.length);
|
||||
launchStdev = Math.sqrt(launchStdev / data.length);
|
||||
loadStdev = SQRT(loadStdev / data.length);
|
||||
launchStdev = SQRT(launchStdev / data.length);
|
||||
|
||||
if (window.parent.BCOMM) {
|
||||
window.parent.BCOMM.finishTest({
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
|
||||
|
||||
[label setStringValue:"load avg="+Math.round(loadAvg)+" (stdev="+Math.round(loadStdev)+"); launch avg="+Math.round(launchAvg)+" (stdev="+Math.round(launchStdev)+")"];
|
||||
[label setStringValue:"load avg="+ROUND(loadAvg)+" (stdev="+ROUND(loadStdev)+"); launch avg="+ROUND(launchAvg)+" (stdev="+ROUND(launchStdev)+")"];
|
||||
[label setFont:[CPFont boldSystemFontOfSize:24.0]];
|
||||
|
||||
[label sizeToFit];
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -59,13 +59,13 @@
|
||||
|
||||
- (void)changeBorderWidth:(id)sender
|
||||
{
|
||||
[standardBox setBorderWidth:ROUND(Math.random() * 7)];
|
||||
[standardBox setBorderWidth:ROUND(RAND() * 7)];
|
||||
}
|
||||
|
||||
- (void)changeBorderColor:(id)sender
|
||||
{
|
||||
[customBox setBorderColor:[CPColor randomColor]];
|
||||
[customBox setCornerRadius:ROUND(Math.random() * 10)];
|
||||
[customBox setCornerRadius:ROUND(RAND() * 10)];
|
||||
}
|
||||
|
||||
- (void)changeContentView:(id)sender
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -86,7 +86,7 @@
|
||||
|
||||
- (IBAction)randomTitle:(id)aSender
|
||||
{
|
||||
[theWindow setTitle:@"Window random number " + Math.random(1000)];
|
||||
[theWindow setTitle:@"Window random number " + RAND(1000)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;4E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;7E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;9E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;2;10E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;2;11E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;2;12E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;2;13E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;2;14E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;16E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;18E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;E;E;S;16;IBCocoaFrameworkD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;22E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;16E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;15E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;33E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;34E;E;D;K;6;$classD;K;6;CP$UIDd;2;15E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;33E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;35E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;36E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;37E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;38E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;39E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;24E;E;D;K;6;$classD;K;6;CP$UIDd;2;15E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;40E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;23E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;41E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;42E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;42E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;43E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;44E;E;S;11;ApplicationS;6;WindowS;12;File's OwnerS;14;App ControllerS;12;Content ViewD;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;30E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;16E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;22E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;45E;E;D;K;6;$classD;K;6;CP$UIDd;2;30E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;22E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;21E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;46E;E;S;13;CPApplicationD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;21E;E;E;S;28;{1.79769e+308, 1.79769e+308}S;8;CPWindowS;23;{{408, 63}, {569, 418}}d;1;7S;12;CPTheme TestS;13;AppControllerd;1;0S;20;{{0, 0}, {569, 418}}d;2;18S;6;normalS;8;delegateS;9;theWindowE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;23E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;24E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;22E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;25E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;22E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;19E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;26E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;23E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;18E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;27E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;28E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;29E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;30E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;31E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;21E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;32E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;33E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;33E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;34E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;35E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;36E;E;S;13;CPApplicationD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;19E;E;E;S;8;delegateS;9;theWindowS;32;{10000000000000, 10000000000000}S;8;CPWindowS;23;{{408, 63}, {569, 418}}d;1;7S;15;CPTheme Browserd;1;0S;20;{{0, 0}, {569, 418}}d;2;18S;6;normalS;13;AppControllerE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
|
||||
- (CPNumber)sqrt:(CPNumber)operand
|
||||
{
|
||||
return Math.sqrt(operand);
|
||||
return SQRT(operand);
|
||||
}
|
||||
|
||||
- (CPNumber)multiply:(CPNumber)firstOperand with:(CPNumber)secondOperand
|
||||
|
||||
@@ -129,7 +129,7 @@ ConverterConversionException = @"ConverterConversionException";
|
||||
if (!FILE.isReadable(temporaryPlistFilePath))
|
||||
[CPException raise:ConverterConversionException reason:@"Unable to convert nib file."];
|
||||
|
||||
var plistContents = FILE.read(temporaryPlistFilePath, { charset:"UTF-8" });
|
||||
var plistContents = FILE.read(temporaryPlistFilePath, { charset: "UTF-8" });
|
||||
|
||||
// Minor NS keyed archive to CP keyed archive conversion.
|
||||
// Use Java directly because rhino's string.replace is *so slow*. 4 seconds vs. 1 millisecond.
|
||||
@@ -142,7 +142,7 @@ ConverterConversionException = @"ConverterConversionException";
|
||||
plistContents = plistContents.replace(/<string>[\u0000-\u0008\u000B\u000C\u000E-\u001F]<\/string>/g, function(c)
|
||||
{
|
||||
CPLog.warn("Warning: converting character 0x" + c.charCodeAt(8).toString(16) + " to base64 representation");
|
||||
return "<string type=\"base64\">"+CFData.encodeBase64String(c.charAt(8))+"</string>";
|
||||
return "<string type=\"base64\">" + CFData.encodeBase64String(c.charAt(8)) + "</string>";
|
||||
});
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -40,7 +40,14 @@ var NSProgressIndicatorSpinningFlag = 1 << 12;
|
||||
_style = (NS_flags & NSProgressIndicatorSpinningFlag) ? CPProgressIndicatorSpinningStyle : CPProgressIndicatorBarStyle;
|
||||
_isIndeterminate = (NS_flags & 2) ? YES : NO;
|
||||
_isDisplayedWhenStopped = (NS_flags & 8192) ? NO : YES;
|
||||
_controlSize = CPRegularControlSize;
|
||||
_controlSize = (NS_flags & 256) ? CPSmallControlSize : CPRegularControlSize;
|
||||
|
||||
if (_style === CPProgressIndicatorSpinningStyle)
|
||||
{
|
||||
// For whatever reason, our 'regular' size is larger than any Cocoa size, our 'small' size is Cocoa's regular and
|
||||
// our 'mini' size is Cocoa's small.
|
||||
_controlSize = _controlSize == CPRegularControlSize ? CPSmallControlSize : CPMiniControlSize;
|
||||
}
|
||||
|
||||
// There is a bug in Xcode. the currentValue is not stored.
|
||||
// Let's set it to 0.0 for now.
|
||||
@@ -48,12 +55,7 @@ var NSProgressIndicatorSpinningFlag = 1 << 12;
|
||||
|
||||
// Readjust the height of the control to the correct size.
|
||||
var currentFrameSize = [self frameSize];
|
||||
if (_style == CPProgressIndicatorSpinningStyle)
|
||||
{
|
||||
currentFrameSize.height = 64.0;
|
||||
currentFrameSize.width = 64.0;
|
||||
}
|
||||
else
|
||||
if (_style !== CPProgressIndicatorSpinningStyle)
|
||||
currentFrameSize.height = 15.0;
|
||||
|
||||
[self setFrameSize:currentFrameSize];
|
||||
|
||||
Reference in New Issue
Block a user