mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-30 14:17:40 +00:00
Merge remote-tracking branch 'upstream/master' into CPTableView-content-binding
This commit is contained in:
@@ -307,7 +307,7 @@ ACTUAL_FRAME_RATE = 0;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(animation:valueForProgress:)])
|
||||
return [_delegate animation:self valueForProgress:t];
|
||||
|
||||
|
||||
if (_animationCurve == CPAnimationLinear)
|
||||
return t;
|
||||
|
||||
|
||||
+6
-2
@@ -111,8 +111,12 @@
|
||||
for (var i = 0; i < ca.length; i++)
|
||||
{
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
|
||||
while (c.charAt(0) == ' ')
|
||||
c = c.substring(1, c.length);
|
||||
|
||||
if (c.indexOf(nameEQ) == 0)
|
||||
return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
#endif
|
||||
return "";
|
||||
|
||||
+5
-2
@@ -70,7 +70,10 @@ function CPDrawColorTiledRects(
|
||||
if (_CGRectIsEmpty(slice))
|
||||
continue;
|
||||
|
||||
var minX, maxX, minY, maxY;
|
||||
var minX,
|
||||
maxX,
|
||||
minY,
|
||||
maxY;
|
||||
|
||||
if (side == CPMinXEdge || side == CPMaxXEdge)
|
||||
{
|
||||
@@ -105,4 +108,4 @@ function CPDrawColorTiledRects(
|
||||
CGContextRestoreGState(context);
|
||||
|
||||
return resultRect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
|
||||
var location = [self convertPoint:[anEvent locationInWindow] fromView:nil],
|
||||
bounds = [self bounds],
|
||||
oldValue = [self doubleValue];
|
||||
oldValue = [self doubleValue],
|
||||
newValue = oldValue;
|
||||
|
||||
// Moving the mouse outside of the widget to the left sets it
|
||||
|
||||
+2
-2
@@ -296,7 +296,7 @@ Set the behavior of the CPPopover. It can be:
|
||||
/*! @ignore */
|
||||
- (BOOL)attachedWindowShouldClose:(_CPAttachedWindow)anAttachedWindow
|
||||
{
|
||||
[self close];
|
||||
[self performClose:self];
|
||||
|
||||
// We return NO, because we want the CPPopover to determine
|
||||
// if the attached window can be closed and to give us a chance
|
||||
@@ -375,4 +375,4 @@ var CPPopoverNeedsNewAttachedWindowKey = @"CPPopoverNeedsNewAttachedWindowKey",
|
||||
[aCoder encodeInt:_behavior forKey:CPPopoverBehaviorKey];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -185,7 +185,8 @@ CPTransformableAttributeType = 1800;
|
||||
if (![[self operators] containsObject:[predicate predicateOperatorType]])
|
||||
return 0;
|
||||
|
||||
if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]]) return 0;
|
||||
if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]])
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,7 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
*/
|
||||
- (void)_autosave
|
||||
{
|
||||
if (!_shouldAutosave || !autosaveName)
|
||||
if (!_shouldAutosave || !_autosaveName)
|
||||
return;
|
||||
|
||||
var userDefaults = [CPUserDefaults standardUserDefaults],
|
||||
|
||||
@@ -24,7 +24,7 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
|
||||
if (self)
|
||||
{
|
||||
var theClass = [self class],
|
||||
bounds = [self bounds];
|
||||
bounds = [self bounds];
|
||||
|
||||
_bodyView = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, _CGRectGetWidth(bounds), _CGRectGetHeight(bounds))];
|
||||
|
||||
@@ -54,4 +54,4 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
|
||||
return aContentRect;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
@implementation CPCibHelpConnector : CPCibConnector
|
||||
{
|
||||
id _destination;
|
||||
id _file;
|
||||
id _marker;
|
||||
id _file;
|
||||
id _marker;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
|
||||
@@ -193,7 +193,7 @@ function CGColorSpaceRetain(aColorSpace)
|
||||
}
|
||||
|
||||
// FIXME: We should refer to some default values.
|
||||
#define STANDARDIZE(components, index, minimum, maximum, multiplier) \
|
||||
#define STANDARDIZE(components, index, minimum, maximum, multiplier) \
|
||||
{ \
|
||||
if (index > components.length) \
|
||||
{ \
|
||||
|
||||
@@ -245,14 +245,14 @@ function CGPointFromString(aString)
|
||||
{
|
||||
var comma = aString.indexOf(',');
|
||||
|
||||
return { x:parseInt(aString.substr(1, comma - 1)), y:parseInt(aString.substring(comma + 1, aString.length)) };
|
||||
return { x:parseFloat(aString.substr(1, comma - 1)), y:parseFloat(aString.substring(comma + 1, aString.length)) };
|
||||
}
|
||||
|
||||
function CGSizeFromString(aString)
|
||||
{
|
||||
var comma = aString.indexOf(',');
|
||||
|
||||
return { width:parseInt(aString.substr(1, comma - 1)), height:parseInt(aString.substring(comma + 1, aString.length)) };
|
||||
return { width:parseFloat(aString.substr(1, comma - 1)), height:parseFloat(aString.substring(comma + 1, aString.length)) };
|
||||
}
|
||||
|
||||
function CGRectFromString(aString)
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
[_CPCibCustomResource imageResourceWithName:"horizontal-track-center.png" size:CPSizeMake(1.0, 4.0)],
|
||||
[_CPCibCustomResource imageResourceWithName:"horizontal-track-right.png" size:CPSizeMake(2.0, 4.0)]
|
||||
]
|
||||
isVertical:NO]];
|
||||
|
||||
var horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
|
||||
isVertical:NO]],
|
||||
horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
|
||||
|
||||
[horizontalSlider setTrackWidth:4.0];
|
||||
[horizontalSlider setHorizontalTrackColor:horizontalTrackColor];
|
||||
@@ -55,9 +54,8 @@
|
||||
[_CPCibCustomResource imageResourceWithName:"vertical-track-center.png" size:CPSizeMake(4.0, 1.0)],
|
||||
[_CPCibCustomResource imageResourceWithName:"vertical-track-bottom.png" size:CPSizeMake(4.0, 2.0)]
|
||||
]
|
||||
isVertical:YES]];
|
||||
|
||||
var verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
|
||||
isVertical:YES]],
|
||||
verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
|
||||
|
||||
[verticalSlider setTrackWidth:4];
|
||||
[verticalSlider setVerticalTrackColor:verticalTrackColor];
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ Date.parseISO8601 = function (date)
|
||||
|
||||
if (isNaN(timestamp) && (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(date)))
|
||||
{
|
||||
// avoid NaN timestamps caused by “undefined” values being passed to Date.UTC
|
||||
// avoid NaN timestamps caused by "undefined" values being passed to Date.UTC
|
||||
for (var i = 0, k; (k = numericKeys[i]); ++i)
|
||||
struct[k] = +struct[k] || 0;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ function CPDecimalMakeWithParts(mantissa, exponent)
|
||||
var m = [],
|
||||
isNegative = NO;
|
||||
|
||||
if (mantissa < 0 )
|
||||
if (mantissa < 0)
|
||||
{
|
||||
isNegative = YES;
|
||||
mantissa = ABS(mantissa);
|
||||
@@ -1400,10 +1400,9 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
function CPDecimalCompact(dcm)
|
||||
{
|
||||
// if positive or zero exp leading zeros simply delete, trailing ones u need to increment exponent
|
||||
if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm) )
|
||||
if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm))
|
||||
return;
|
||||
|
||||
|
||||
if (CPDecimalIsZero(dcm))
|
||||
{
|
||||
// handle zero number compacting
|
||||
|
||||
+24
-12
@@ -222,7 +222,8 @@ FIXME: Do we need this?
|
||||
|
||||
- (CPString)descriptionWithLocale:(CPDictionary)aDictionary
|
||||
{
|
||||
if (!aDictionary) return toString();
|
||||
if (!aDictionary)
|
||||
return toString();
|
||||
|
||||
throw new Error("descriptionWithLocale: NOT YET IMPLEMENTED");
|
||||
}
|
||||
@@ -234,37 +235,43 @@ FIXME: Do we need this?
|
||||
|
||||
- (double)doubleValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (float)floatValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int)intValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (long long)longLongValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (long)longValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (short)shortValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -280,7 +287,8 @@ FIXME: Do we need this?
|
||||
|
||||
- (unsigned int)unsignedIntValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
/*
|
||||
@@ -292,20 +300,24 @@ FIXME: Do we need this?
|
||||
*/
|
||||
- (unsigned long)unsignedLongValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (unsigned short)unsignedShortValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (CPComparisonResult)compare:(CPNumber)aNumber
|
||||
{
|
||||
if (self > aNumber) return CPOrderedDescending;
|
||||
else if (self < aNumber) return CPOrderedAscending;
|
||||
if (self > aNumber)
|
||||
return CPOrderedDescending;
|
||||
else if (self < aNumber)
|
||||
return CPOrderedAscending;
|
||||
|
||||
return CPOrderedSame;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
loc += (""+f).length;
|
||||
var i = 0;
|
||||
while (!isNaN(parseFloat(str.substring(loc+i, str.length))))
|
||||
while (!isNaN(parseFloat(str.substring(loc + i, str.length))))
|
||||
{i++;}
|
||||
|
||||
[self setScanLocation:loc + i];
|
||||
|
||||
+130
-18
@@ -66,9 +66,9 @@ CPNumericSearch = 64;
|
||||
*/
|
||||
CPDiacriticInsensitiveSearch = 128;
|
||||
|
||||
var CPStringUIDs = new CFMutableDictionary();
|
||||
var CPStringUIDs = new CFMutableDictionary(),
|
||||
|
||||
var CPStringRegexSpecialCharacters = [
|
||||
CPStringRegexSpecialCharacters = [
|
||||
'/', '.', '*', '+', '?', '|', '$', '^',
|
||||
'(', ')', '[', ']', '{', '}', '\\'
|
||||
],
|
||||
@@ -624,9 +624,9 @@ var CPStringRegexSpecialCharacters = [
|
||||
rhs = [rhs lowercaseString];
|
||||
}
|
||||
|
||||
for (; len < min; len++ )
|
||||
for (; len < min; len++)
|
||||
{
|
||||
if ( [lhs characterAtIndex:len] !== [rhs characterAtIndex:len] )
|
||||
if ([lhs characterAtIndex:len] !== [rhs characterAtIndex:len])
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -706,14 +706,77 @@ var CPStringRegexSpecialCharacters = [
|
||||
Returns an the path components of this string. This
|
||||
method assumes that the string's content is a '/'
|
||||
separated file system path.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
- (CPArray)pathComponents
|
||||
{
|
||||
if (length === 0)
|
||||
return [""];
|
||||
|
||||
if (self === "/")
|
||||
return ["/"];
|
||||
|
||||
var result = split('/');
|
||||
|
||||
if (result[0] === "")
|
||||
result[0] = "/";
|
||||
if (result[result.length - 1] === "")
|
||||
result.pop();
|
||||
|
||||
var index = result.length - 1;
|
||||
|
||||
if (index > 0)
|
||||
{
|
||||
if (result[index] === "")
|
||||
result[index] = "/";
|
||||
|
||||
while (index--)
|
||||
{
|
||||
while (result[index] === "")
|
||||
result.splice(index--, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a string built from the strings in a given array by
|
||||
concatenating them with a path separator between each pair.
|
||||
This method assumes that the string's content is a '/'
|
||||
separated file system path.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
+ (CPString)pathWithComponents:(CPArray)components
|
||||
{
|
||||
var size = components.length,
|
||||
result = "",
|
||||
i = -1,
|
||||
firstRound = true,
|
||||
firstIsSlash = false;
|
||||
|
||||
while (++i < size)
|
||||
{
|
||||
var component = components[i],
|
||||
lenMinusOne = component.length - 1;
|
||||
|
||||
if (lenMinusOne >= 0 && (component !== "/" || firstRound)) // Skip "" and "/" (not first time)
|
||||
{
|
||||
if (lenMinusOne > 0 && component.indexOf("/",lenMinusOne) === lenMinusOne) // Ends with "/"
|
||||
component = component.substring(0, lenMinusOne);
|
||||
|
||||
if (firstRound)
|
||||
{
|
||||
if (component === "/")
|
||||
firstIsSlash = true;
|
||||
firstRound = false;
|
||||
}
|
||||
else if (!firstIsSlash)
|
||||
result += "/";
|
||||
else
|
||||
firstIsSlash = false;
|
||||
|
||||
result += component;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -737,41 +800,87 @@ var CPStringRegexSpecialCharacters = [
|
||||
*/
|
||||
- (CPString)lastPathComponent
|
||||
{
|
||||
var components = [self pathComponents];
|
||||
return components[components.length - 1];
|
||||
var components = [self pathComponents],
|
||||
lastIndex = components.length - 1,
|
||||
lastComponent = components[lastIndex];
|
||||
|
||||
return lastIndex > 0 && lastComponent === "/" ? components[lastIndex - 1] : lastComponent;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a new string made by appending to the receiver a given string
|
||||
This method assumes that the string's content is a '/'
|
||||
separated file system path.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
- (CPString)stringByAppendingPathComponent:(CPString)aString
|
||||
{
|
||||
var components = [self pathComponents],
|
||||
addComponents = aString && aString !== "/" ? [aString pathComponents] : [];
|
||||
|
||||
return [CPString pathWithComponents:components.concat(addComponents)];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a new string made by appending to the receiver an extension separator followed by a given extension
|
||||
This method assumes that the extension separator is a '.'
|
||||
Extension can't include a '/' character, receiver can't be empty or be just a '/'. If so the
|
||||
result will be the receiver itself.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
- (CPString)stringByAppendingPathExtension:(CPString)ext
|
||||
{
|
||||
if (ext.indexOf('/') >= 0 || length === 0 || self === "/") // Can't handle these
|
||||
return self;
|
||||
|
||||
var components = [self pathComponents],
|
||||
last = components.length - 1;
|
||||
|
||||
if (last > 0 && components[last] === "/")
|
||||
components.splice(last--, 1);
|
||||
|
||||
components[last] = components[last] + "." + ext;
|
||||
|
||||
return [CPString pathWithComponents:components];
|
||||
}
|
||||
|
||||
/*!
|
||||
Deletes the last path component of a string.
|
||||
This method assumes that the string's content is a '/'
|
||||
separated file system path.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
- (CPString)stringByDeletingLastPathComponent
|
||||
{
|
||||
var path = self,
|
||||
start = length - 1;
|
||||
if (length === 0)
|
||||
return "";
|
||||
else if (self === "/")
|
||||
return "/";
|
||||
|
||||
while (path.charAt(start) === '/')
|
||||
start--;
|
||||
var components = [self pathComponents],
|
||||
last = components.length - 1;
|
||||
|
||||
path = path.substr(0, path.lastIndexOf('/', start));
|
||||
if (components[last] === "/")
|
||||
last--;
|
||||
|
||||
if (path === "" && charAt(0) === '/')
|
||||
return '/';
|
||||
components.splice(last, components.length - last);
|
||||
|
||||
return path;
|
||||
return [CPString pathWithComponents:components];
|
||||
}
|
||||
|
||||
/*!
|
||||
Deletes the extension of a string.
|
||||
This method assumes that the string's content is a '/'
|
||||
separated file system path.
|
||||
Multiple '/' separators between components are truncated to a single one.
|
||||
*/
|
||||
- (CPString)stringByDeletingPathExtension
|
||||
{
|
||||
var extension = [self pathExtension];
|
||||
|
||||
if (extension === "")
|
||||
return self;
|
||||
|
||||
if (lastIndexOf('.') < 1)
|
||||
else if (lastIndexOf('.') < 1)
|
||||
return self;
|
||||
|
||||
return substr(0, [self length] - (extension.length + 1));
|
||||
@@ -785,6 +894,7 @@ var CPStringRegexSpecialCharacters = [
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation CPString (JSON)
|
||||
|
||||
/*!
|
||||
@@ -824,12 +934,14 @@ var CPStringRegexSpecialCharacters = [
|
||||
|
||||
@end
|
||||
|
||||
|
||||
var diacritics = [[192,198],[224,230],[231,231],[232,235],[236,239],[242,246],[249,252]], // Basic Latin ; Latin-1 Supplement.
|
||||
normalized = [65,97,99,101,105,111,117];
|
||||
|
||||
String.prototype.stripDiacritics = function()
|
||||
{
|
||||
var output = "";
|
||||
|
||||
for (var indexSource = 0; indexSource < this.length; indexSource++)
|
||||
{
|
||||
var code = this.charCodeAt(indexSource);
|
||||
|
||||
@@ -111,11 +111,27 @@
|
||||
{
|
||||
// Verify that the split view does not attempt to auto save without an auto save name.
|
||||
|
||||
// This storage class will cause a crash if a save is attempted.
|
||||
[[CPUserDefaults standardUserDefaults] setPersistentStoreClass:CPUserDefaultsFailingStore forDomain:CPApplicationDomain reloadData:NO];
|
||||
|
||||
[splitView setPosition:50 ofDividerAtIndex:0];
|
||||
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
|
||||
// Now test that it does work normally.
|
||||
[[CPUserDefaults standardUserDefaults] setPersistentStoreClass:CPUserDefaultsTestStore forDomain:CPApplicationDomain reloadData:NO];
|
||||
[splitView setAutosaveName:@"Charles"];
|
||||
[splitView setPosition:25 ofDividerAtIndex:0];
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
|
||||
// Recreate the split view.
|
||||
[self setUp];
|
||||
[splitView setAutosaveName:@"Charles"];
|
||||
// FIXME At the moment restore from autosave only happens if the split view is loaded from a
|
||||
// coder. It seems like it should happen when initialising in code too, but some research of
|
||||
// Cocoa's behaviour will need to be done first.
|
||||
splitView._needsRestoreFromAutosave = YES;
|
||||
// Trigger autosave restore.
|
||||
[splitView setFrameSize:CGSizeMake(110, 100)];
|
||||
[self assert:25 equals:[viewA frameSize].height message:@"divider position restored"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -131,6 +147,7 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
This store always fails.
|
||||
*/
|
||||
@@ -149,3 +166,24 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
This is a temporary store.
|
||||
*/
|
||||
@implementation CPUserDefaultsTestStore : CPUserDefaultsStore
|
||||
{
|
||||
CPData _data;
|
||||
}
|
||||
|
||||
- (CPData)data
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
|
||||
- (void)setData:(CPData)aData
|
||||
{
|
||||
_data = aData;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -225,6 +225,52 @@
|
||||
[self assert:"ffffff" equals:[CPString stringWithHash:16777215]];
|
||||
}
|
||||
|
||||
- (void)testStringByAppendingPathComponent
|
||||
{
|
||||
var testStrings = [
|
||||
["/tmp/", "scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/tmp///", "scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/tmp///", "///scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/tmp", "scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/tmp///", "scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/tmp///", "///scratch.tiff", "/tmp/scratch.tiff"],
|
||||
["/", "scratch.tiff", "/scratch.tiff"],
|
||||
["", "scratch.tiff", "scratch.tiff"],
|
||||
["", "", ""],
|
||||
["", "/", ""],
|
||||
["/", "/", "/"],
|
||||
["/tmp", nil, "/tmp"],
|
||||
["/tmp", "/", "/tmp"],
|
||||
["/tmp/", "", "/tmp"]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
{
|
||||
var result = [testStrings[i][0] stringByAppendingPathComponent:testStrings[i][1]];
|
||||
|
||||
[self assertTrue:result === testStrings[i][2] message:"Value <" + testStrings[i][0] + "> Adding <" + testStrings[i][1] + "> Expected <" + testStrings[i][2] + "> was <" + result + ">"];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testStringByAppendingPathExtension
|
||||
{
|
||||
var testStrings = [
|
||||
["/tmp/scratch.old", "tiff", "/tmp/scratch.old.tiff"],
|
||||
["/tmp/scratch.", "tiff", "/tmp/scratch..tiff"],
|
||||
["/tmp///", "tiff", "/tmp.tiff"],
|
||||
["scratch", "tiff", "scratch.tiff"],
|
||||
["/", "tiff", "/"],
|
||||
["", "tiff", ""]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
{
|
||||
var result = [testStrings[i][0] stringByAppendingPathExtension:testStrings[i][1]];
|
||||
|
||||
[self assertTrue:result === testStrings[i][2] message:"Value <" + testStrings[i][0] + "> Adding <" + testStrings[i][1] + "> Expected <" + testStrings[i][2] + "> was <" + result + ">"];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testStringByDeletingLastPathComponent
|
||||
{
|
||||
var testStrings = [
|
||||
@@ -235,22 +281,58 @@
|
||||
["/", "/"],
|
||||
["scratch.tiff", ""],
|
||||
["a/b/c/d//////", "a/b/c"],
|
||||
["a/b/////////c/d//////", "a/b/c"],
|
||||
["a/b/././././c/d/./././", "a/b/././././c/d/./."],
|
||||
[@"a/b/././././d////", "a/b/./././."],
|
||||
[@"~/a", "~"],
|
||||
[@"~/a/", "~"],
|
||||
[@"../../", ".."]
|
||||
[@"../../", ".."],
|
||||
[@"", ""]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] stringByDeletingLastPathComponent] equals:testStrings[i][1]];
|
||||
{
|
||||
var result = [testStrings[i][0] stringByDeletingLastPathComponent];
|
||||
|
||||
[self assertTrue:result === testStrings[i][1] message:"Value <" + testStrings[i][0] + "> Expected <" + testStrings[i][1] + "> was <" + result + ">"];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testPathWithComponents
|
||||
{
|
||||
var testStrings = [
|
||||
[["tmp", "scratch"], "tmp/scratch"],
|
||||
[["/", "tmp", "scratch"], "/tmp/scratch"],
|
||||
[["/", "tmp", "/", "scratch"], "/tmp/scratch"],
|
||||
[["/", "tmp", "scratch", "/"], "/tmp/scratch"],
|
||||
[["/", "tmp", "scratch", ""], "/tmp/scratch"],
|
||||
[["", "/tmp", "scratch", ""], "/tmp/scratch"],
|
||||
[["", "tmp", "scratch", ""], "tmp/scratch"],
|
||||
[["/"], "/"],
|
||||
[["/", "/", "/"], "/"],
|
||||
[["", "", ""], ""],
|
||||
[[""], ""]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
{
|
||||
var result = [CPString pathWithComponents:testStrings[i][0]];
|
||||
|
||||
[self assertTrue:result === testStrings[i][1] message:"Value <" + testStrings[i][0] + "> Expected [" + testStrings[i][1] + "] was [" + result + "]"];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testPathComponents
|
||||
{
|
||||
var testStrings = [
|
||||
["tmp/scratch", ["tmp", "scratch"]],
|
||||
["/tmp/scratch", ["/", "tmp", "scratch"]]
|
||||
["/tmp/scratch", ["/", "tmp", "scratch"]],
|
||||
["/tmp/scratch/", ["/", "tmp", "scratch", "/"]],
|
||||
["/tmp/", ["/", "tmp", "/"]],
|
||||
["/////tmp/////scratch///", ["/", "tmp", "scratch", "/"]],
|
||||
["scratch.tiff", ["scratch.tiff"]],
|
||||
["/", ["/"]],
|
||||
["", [""]]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
@@ -268,7 +350,8 @@
|
||||
["/tmp/scratch", "scratch"],
|
||||
["/tmp/", "tmp"],
|
||||
["scratch", "scratch"],
|
||||
["/", "/"]
|
||||
["/", "/"],
|
||||
["", ""]
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)open:(id)sender
|
||||
- (@action)open:(id)sender
|
||||
{
|
||||
var edge = [self popoverEdge],
|
||||
appearance;
|
||||
@@ -169,12 +169,12 @@
|
||||
[popoverWindow orderFront:nil];
|
||||
}
|
||||
|
||||
- (IBAction)openWindowPopover:(id)sender
|
||||
- (@action)openWindowPopover:(id)sender
|
||||
{
|
||||
[windowPopover showRelativeToRect:nil ofView:sender preferredEdge:[self popoverEdge]];
|
||||
}
|
||||
|
||||
- (IBAction)movePopover:(id)sender
|
||||
- (@action)movePopover:(id)sender
|
||||
{
|
||||
if (++lastPreferredEdge > CPMaxYEdge)
|
||||
lastPreferredEdge = CPMinXEdge;
|
||||
@@ -182,6 +182,11 @@
|
||||
[popover showRelativeToRect:CGRectMakeZero() ofView:lastButton preferredEdge:lastPreferredEdge];
|
||||
}
|
||||
|
||||
- (@action)closePopover:(id)sender
|
||||
{
|
||||
[popover close];
|
||||
}
|
||||
|
||||
- (void)initPopover:(CPPopover)aPopover withAppearance:(int)appearance
|
||||
{
|
||||
[aPopover setDelegate:self];
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,10 +2,10 @@
|
||||
<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.SystemVersion">11E53</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.00</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.47</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">2182</string>
|
||||
@@ -62,7 +62,7 @@
|
||||
<object class="NSTextField" id="545120110">
|
||||
<reference key="NSNextResponder" ref="857722922"/>
|
||||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{31, 97}, {239, 22}}</string>
|
||||
<string key="NSFrame">{{31, 137}, {239, 22}}</string>
|
||||
<reference key="NSSuperview" ref="857722922"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="767709548"/>
|
||||
@@ -101,10 +101,33 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="913980254">
|
||||
<reference key="NSNextResponder" ref="857722922"/>
|
||||
<int key="NSvFlags">293</int>
|
||||
<string key="NSFrame">{{114, 50}, {73, 32}}</string>
|
||||
<reference key="NSSuperview" ref="857722922"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="801370502">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">close</string>
|
||||
<reference key="NSSupport" ref="500612644"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="913980254"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="13055898">
|
||||
<reference key="NSNextResponder" ref="857722922"/>
|
||||
<int key="NSvFlags">293</int>
|
||||
<string key="NSFrame">{{193, 34}, {74, 32}}</string>
|
||||
<string key="NSFrame">{{113, 18}, {74, 32}}</string>
|
||||
<reference key="NSSuperview" ref="857722922"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
@@ -128,7 +151,7 @@
|
||||
<object class="NSButton" id="767709548">
|
||||
<reference key="NSNextResponder" ref="857722922"/>
|
||||
<int key="NSvFlags">293</int>
|
||||
<string key="NSFrame">{{34, 34}, {126, 32}}</string>
|
||||
<string key="NSFrame">{{87, 82}, {126, 32}}</string>
|
||||
<reference key="NSSuperview" ref="857722922"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="13055898"/>
|
||||
@@ -152,7 +175,7 @@
|
||||
<object class="NSTextField" id="143820433">
|
||||
<reference key="NSNextResponder" ref="857722922"/>
|
||||
<int key="NSvFlags">269</int>
|
||||
<string key="NSFrame">{{28, 141}, {245, 32}}</string>
|
||||
<string key="NSFrame">{{28, 185}, {245, 32}}</string>
|
||||
<reference key="NSSuperview" ref="857722922"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="545120110"/>
|
||||
@@ -187,7 +210,7 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{301, 217}</string>
|
||||
<string key="NSFrameSize">{301, 261}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="143820433"/>
|
||||
@@ -239,7 +262,7 @@
|
||||
<reference key="NSNextKeyView" ref="58551230"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:20</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -263,6 +286,7 @@
|
||||
<string key="NSFrame">{{18, 12}, {126, 32}}</string>
|
||||
<reference key="NSSuperview" ref="200356413"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="1032520345">
|
||||
@@ -286,7 +310,7 @@
|
||||
<string key="NSFrame">{{37, 59}, {89, 17}}</string>
|
||||
<reference key="NSSuperview" ref="200356413"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<reference key="NSNextKeyView" ref="400712972"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="420985577">
|
||||
@@ -309,11 +333,9 @@
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSTextField" id="260721902">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrameSize">{38, 17}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1505</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="171236348">
|
||||
@@ -379,6 +401,14 @@
|
||||
</object>
|
||||
<int key="connectionID">555</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">closePopover:</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="913980254"/>
|
||||
</object>
|
||||
<int key="connectionID">559</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
@@ -478,10 +508,11 @@
|
||||
<reference key="object" ref="857722922"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="545120110"/>
|
||||
<reference ref="143820433"/>
|
||||
<reference ref="767709548"/>
|
||||
<reference ref="545120110"/>
|
||||
<reference ref="913980254"/>
|
||||
<reference ref="13055898"/>
|
||||
<reference ref="767709548"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
@@ -638,6 +669,20 @@
|
||||
<reference key="object" ref="1032520345"/>
|
||||
<reference key="parent" ref="400712972"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">556</int>
|
||||
<reference key="object" ref="913980254"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="801370502"/>
|
||||
</object>
|
||||
<reference key="parent" ref="857722922"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">557</int>
|
||||
<reference key="object" ref="801370502"/>
|
||||
<reference key="parent" ref="913980254"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -675,6 +720,8 @@
|
||||
<string>536.IBPluginDependency</string>
|
||||
<string>551.IBPluginDependency</string>
|
||||
<string>552.IBPluginDependency</string>
|
||||
<string>556.IBPluginDependency</string>
|
||||
<string>557.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -709,6 +756,8 @@
|
||||
<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">
|
||||
@@ -723,7 +772,7 @@
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">555</int>
|
||||
<int key="maxID">559</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -735,6 +784,7 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>closePopover:</string>
|
||||
<string>movePopover:</string>
|
||||
<string>open:</string>
|
||||
<string>openWindowPopover:</string>
|
||||
@@ -744,18 +794,24 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>closePopover:</string>
|
||||
<string>movePopover:</string>
|
||||
<string>open:</string>
|
||||
<string>openWindowPopover:</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">closePopover:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">movePopover:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<string key="IBDocument.SystemVersion">11E53</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.47</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1306</string>
|
||||
<string key="NS.object.0">2182</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -27,11 +27,8 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
<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>
|
||||
@@ -1127,8 +1124,9 @@
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="439893737">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -1137,7 +1135,6 @@
|
||||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{192, 143}, {96, 21}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSSliderCell" key="NSCell" id="600801425">
|
||||
<int key="NSCellFlags">-2079981824</int>
|
||||
@@ -1164,7 +1161,6 @@
|
||||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{192, 191}, {96, 22}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="46991665">
|
||||
<int key="NSCellFlags">-1804468671</int>
|
||||
@@ -1199,11 +1195,10 @@
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{7, 11}, {480, 360}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMaxSize">{1e+13, 1e+13}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="635946545">
|
||||
<string key="NSClassName">AppController</string>
|
||||
@@ -1212,6 +1207,30 @@
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">terminate:</string>
|
||||
<reference key="source" ref="1050"/>
|
||||
<reference key="destination" ref="632727374"/>
|
||||
</object>
|
||||
<int key="connectionID">449</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFrontStandardAboutPanel:</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="238522557"/>
|
||||
</object>
|
||||
<int key="connectionID">142</int>
|
||||
</object>
|
||||
<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="IBActionConnection" key="connection">
|
||||
<string key="label">performMiniaturize:</string>
|
||||
@@ -1252,14 +1271,6 @@
|
||||
</object>
|
||||
<int key="connectionID">127</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFrontStandardAboutPanel:</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="238522557"/>
|
||||
</object>
|
||||
<int key="connectionID">142</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">performClose:</string>
|
||||
@@ -1692,21 +1703,13 @@
|
||||
</object>
|
||||
<int key="connectionID">448</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">terminate:</string>
|
||||
<reference key="source" ref="1050"/>
|
||||
<reference key="destination" ref="632727374"/>
|
||||
</object>
|
||||
<int key="connectionID">449</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<string key="label">theWindow</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="972006081"/>
|
||||
</object>
|
||||
<int key="connectionID">451</int>
|
||||
<int key="connectionID">459</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
@@ -1716,21 +1719,15 @@
|
||||
</object>
|
||||
<int key="connectionID">458</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>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
@@ -1794,7 +1791,6 @@
|
||||
<reference ref="374024848"/>
|
||||
</object>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
<string key="objectName">1</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">217</int>
|
||||
@@ -1837,19 +1833,16 @@
|
||||
<int key="objectID">75</int>
|
||||
<reference key="object" ref="1023925487"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">3</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">80</int>
|
||||
<reference key="object" ref="117038363"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">8</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">78</int>
|
||||
<reference key="object" ref="49223823"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">6</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">72</int>
|
||||
@@ -1860,7 +1853,6 @@
|
||||
<int key="objectID">82</int>
|
||||
<reference key="object" ref="705341025"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">9</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">124</int>
|
||||
@@ -1875,31 +1867,26 @@
|
||||
<int key="objectID">77</int>
|
||||
<reference key="object" ref="294629803"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">5</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">73</int>
|
||||
<reference key="object" ref="776162233"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">1</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">79</int>
|
||||
<reference key="object" ref="425164168"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">7</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">112</int>
|
||||
<reference key="object" ref="579971712"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">10</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">74</int>
|
||||
<reference key="object" ref="1010469920"/>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
<string key="objectName">2</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">125</int>
|
||||
@@ -2072,7 +2059,6 @@
|
||||
<reference ref="238773614"/>
|
||||
</object>
|
||||
<reference key="parent" ref="391199113"/>
|
||||
<string key="objectName">2</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">111</int>
|
||||
@@ -2117,7 +2103,6 @@
|
||||
<int key="objectID">136</int>
|
||||
<reference key="object" ref="632727374"/>
|
||||
<reference key="parent" ref="110575045"/>
|
||||
<string key="objectName">1111</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">144</int>
|
||||
@@ -2128,7 +2113,6 @@
|
||||
<int key="objectID">129</int>
|
||||
<reference key="object" ref="609285721"/>
|
||||
<reference key="parent" ref="110575045"/>
|
||||
<string key="objectName">121</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">143</int>
|
||||
@@ -2661,142 +2645,70 @@
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>103.IBPluginDependency</string>
|
||||
<string>103.ImportedFromIB2</string>
|
||||
<string>106.IBPluginDependency</string>
|
||||
<string>106.ImportedFromIB2</string>
|
||||
<string>106.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>111.IBPluginDependency</string>
|
||||
<string>111.ImportedFromIB2</string>
|
||||
<string>112.IBPluginDependency</string>
|
||||
<string>112.ImportedFromIB2</string>
|
||||
<string>124.IBPluginDependency</string>
|
||||
<string>124.ImportedFromIB2</string>
|
||||
<string>125.IBPluginDependency</string>
|
||||
<string>125.ImportedFromIB2</string>
|
||||
<string>125.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>126.IBPluginDependency</string>
|
||||
<string>126.ImportedFromIB2</string>
|
||||
<string>129.IBPluginDependency</string>
|
||||
<string>129.ImportedFromIB2</string>
|
||||
<string>130.IBPluginDependency</string>
|
||||
<string>130.ImportedFromIB2</string>
|
||||
<string>130.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>131.IBPluginDependency</string>
|
||||
<string>131.ImportedFromIB2</string>
|
||||
<string>134.IBPluginDependency</string>
|
||||
<string>134.ImportedFromIB2</string>
|
||||
<string>136.IBPluginDependency</string>
|
||||
<string>136.ImportedFromIB2</string>
|
||||
<string>143.IBPluginDependency</string>
|
||||
<string>143.ImportedFromIB2</string>
|
||||
<string>144.IBPluginDependency</string>
|
||||
<string>144.ImportedFromIB2</string>
|
||||
<string>145.IBPluginDependency</string>
|
||||
<string>145.ImportedFromIB2</string>
|
||||
<string>149.IBPluginDependency</string>
|
||||
<string>149.ImportedFromIB2</string>
|
||||
<string>150.IBPluginDependency</string>
|
||||
<string>150.ImportedFromIB2</string>
|
||||
<string>19.IBPluginDependency</string>
|
||||
<string>19.ImportedFromIB2</string>
|
||||
<string>195.IBPluginDependency</string>
|
||||
<string>195.ImportedFromIB2</string>
|
||||
<string>196.IBPluginDependency</string>
|
||||
<string>196.ImportedFromIB2</string>
|
||||
<string>197.IBPluginDependency</string>
|
||||
<string>197.ImportedFromIB2</string>
|
||||
<string>198.IBPluginDependency</string>
|
||||
<string>198.ImportedFromIB2</string>
|
||||
<string>199.IBPluginDependency</string>
|
||||
<string>199.ImportedFromIB2</string>
|
||||
<string>200.IBPluginDependency</string>
|
||||
<string>200.ImportedFromIB2</string>
|
||||
<string>200.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>201.IBPluginDependency</string>
|
||||
<string>201.ImportedFromIB2</string>
|
||||
<string>202.IBPluginDependency</string>
|
||||
<string>202.ImportedFromIB2</string>
|
||||
<string>203.IBPluginDependency</string>
|
||||
<string>203.ImportedFromIB2</string>
|
||||
<string>204.IBPluginDependency</string>
|
||||
<string>204.ImportedFromIB2</string>
|
||||
<string>205.IBPluginDependency</string>
|
||||
<string>205.ImportedFromIB2</string>
|
||||
<string>205.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>206.IBPluginDependency</string>
|
||||
<string>206.ImportedFromIB2</string>
|
||||
<string>207.IBPluginDependency</string>
|
||||
<string>207.ImportedFromIB2</string>
|
||||
<string>208.IBPluginDependency</string>
|
||||
<string>208.ImportedFromIB2</string>
|
||||
<string>209.IBPluginDependency</string>
|
||||
<string>209.ImportedFromIB2</string>
|
||||
<string>210.IBPluginDependency</string>
|
||||
<string>210.ImportedFromIB2</string>
|
||||
<string>211.IBPluginDependency</string>
|
||||
<string>211.ImportedFromIB2</string>
|
||||
<string>212.IBPluginDependency</string>
|
||||
<string>212.ImportedFromIB2</string>
|
||||
<string>212.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>213.IBPluginDependency</string>
|
||||
<string>213.ImportedFromIB2</string>
|
||||
<string>214.IBPluginDependency</string>
|
||||
<string>214.ImportedFromIB2</string>
|
||||
<string>215.IBPluginDependency</string>
|
||||
<string>215.ImportedFromIB2</string>
|
||||
<string>216.IBPluginDependency</string>
|
||||
<string>216.ImportedFromIB2</string>
|
||||
<string>217.IBPluginDependency</string>
|
||||
<string>217.ImportedFromIB2</string>
|
||||
<string>218.IBPluginDependency</string>
|
||||
<string>218.ImportedFromIB2</string>
|
||||
<string>219.IBPluginDependency</string>
|
||||
<string>219.ImportedFromIB2</string>
|
||||
<string>220.IBPluginDependency</string>
|
||||
<string>220.ImportedFromIB2</string>
|
||||
<string>220.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>221.IBPluginDependency</string>
|
||||
<string>221.ImportedFromIB2</string>
|
||||
<string>23.IBPluginDependency</string>
|
||||
<string>23.ImportedFromIB2</string>
|
||||
<string>236.IBPluginDependency</string>
|
||||
<string>236.ImportedFromIB2</string>
|
||||
<string>239.IBPluginDependency</string>
|
||||
<string>239.ImportedFromIB2</string>
|
||||
<string>24.IBPluginDependency</string>
|
||||
<string>24.ImportedFromIB2</string>
|
||||
<string>24.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>29.IBEditorWindowLastContentRect</string>
|
||||
<string>29.IBPluginDependency</string>
|
||||
<string>29.ImportedFromIB2</string>
|
||||
<string>29.WindowOrigin</string>
|
||||
<string>29.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>295.IBPluginDependency</string>
|
||||
<string>296.IBPluginDependency</string>
|
||||
<string>296.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>297.IBPluginDependency</string>
|
||||
<string>298.IBPluginDependency</string>
|
||||
<string>346.IBPluginDependency</string>
|
||||
<string>346.ImportedFromIB2</string>
|
||||
<string>348.IBPluginDependency</string>
|
||||
<string>348.ImportedFromIB2</string>
|
||||
<string>349.IBPluginDependency</string>
|
||||
<string>349.ImportedFromIB2</string>
|
||||
<string>349.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>350.IBPluginDependency</string>
|
||||
<string>350.ImportedFromIB2</string>
|
||||
<string>351.IBPluginDependency</string>
|
||||
<string>351.ImportedFromIB2</string>
|
||||
<string>354.IBPluginDependency</string>
|
||||
<string>354.ImportedFromIB2</string>
|
||||
<string>371.IBEditorWindowLastContentRect</string>
|
||||
<string>371.IBPluginDependency</string>
|
||||
<string>371.IBWindowTemplateEditedContentRect</string>
|
||||
<string>371.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>371.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>372.IBPluginDependency</string>
|
||||
<string>375.IBPluginDependency</string>
|
||||
<string>376.IBEditorWindowLastContentRect</string>
|
||||
<string>376.IBPluginDependency</string>
|
||||
<string>377.IBPluginDependency</string>
|
||||
<string>378.IBPluginDependency</string>
|
||||
@@ -2809,7 +2721,6 @@
|
||||
<string>385.IBPluginDependency</string>
|
||||
<string>386.IBPluginDependency</string>
|
||||
<string>387.IBPluginDependency</string>
|
||||
<string>388.IBEditorWindowLastContentRect</string>
|
||||
<string>388.IBPluginDependency</string>
|
||||
<string>389.IBPluginDependency</string>
|
||||
<string>390.IBPluginDependency</string>
|
||||
@@ -2848,183 +2759,92 @@
|
||||
<string>456.IBPluginDependency</string>
|
||||
<string>457.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>5.ImportedFromIB2</string>
|
||||
<string>56.IBPluginDependency</string>
|
||||
<string>56.ImportedFromIB2</string>
|
||||
<string>57.IBEditorWindowLastContentRect</string>
|
||||
<string>57.IBPluginDependency</string>
|
||||
<string>57.ImportedFromIB2</string>
|
||||
<string>57.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>58.IBPluginDependency</string>
|
||||
<string>58.ImportedFromIB2</string>
|
||||
<string>72.IBPluginDependency</string>
|
||||
<string>72.ImportedFromIB2</string>
|
||||
<string>73.IBPluginDependency</string>
|
||||
<string>73.ImportedFromIB2</string>
|
||||
<string>74.IBPluginDependency</string>
|
||||
<string>74.ImportedFromIB2</string>
|
||||
<string>75.IBPluginDependency</string>
|
||||
<string>75.ImportedFromIB2</string>
|
||||
<string>77.IBPluginDependency</string>
|
||||
<string>77.ImportedFromIB2</string>
|
||||
<string>78.IBPluginDependency</string>
|
||||
<string>78.ImportedFromIB2</string>
|
||||
<string>79.IBPluginDependency</string>
|
||||
<string>79.ImportedFromIB2</string>
|
||||
<string>80.IBPluginDependency</string>
|
||||
<string>80.ImportedFromIB2</string>
|
||||
<string>81.IBPluginDependency</string>
|
||||
<string>81.ImportedFromIB2</string>
|
||||
<string>81.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>82.IBPluginDependency</string>
|
||||
<string>82.ImportedFromIB2</string>
|
||||
<string>83.IBPluginDependency</string>
|
||||
<string>83.ImportedFromIB2</string>
|
||||
<string>92.IBPluginDependency</string>
|
||||
<string>92.ImportedFromIB2</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<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>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{596, 852}, {216, 23}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{522, 812}, {146, 23}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{436, 809}, {64, 6}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{608, 612}, {275, 83}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{187, 434}, {243, 243}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{608, 612}, {167, 43}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{608, 612}, {241, 103}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{525, 802}, {197, 73}}</string>
|
||||
<string>{{143, 285}, {478, 20}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{74, 862}</string>
|
||||
<string>{{6, 978}, {478, 20}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{475, 832}, {234, 43}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{608, 612}, {215, 63}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{303, 221}, {480, 360}}</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>
|
||||
<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>
|
||||
<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>{{303, 221}, {480, 360}}</string>
|
||||
<integer value="1"/>
|
||||
<string>{{33, 99}, {480, 360}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{437, 242}, {86, 43}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -3037,7 +2857,6 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{523, 2}, {178, 283}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -3076,40 +2895,21 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{155, 102}, {245, 183}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{23, 794}, {245, 183}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{145, 474}, {199, 203}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
@@ -3168,10 +2968,10 @@
|
||||
<string>NSMenuCheckmark</string>
|
||||
<string>NSMenuMixedState</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{9, 8}</string>
|
||||
<string>{7, 2}</string>
|
||||
<string>{11, 11}</string>
|
||||
<string>{10, 3}</string>
|
||||
</object>
|
||||
</object>
|
||||
</data>
|
||||
|
||||
+176
-36
@@ -36,7 +36,7 @@ import os
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
|
||||
import unittest
|
||||
|
||||
EXIT_CODE_SHOW_HTML = 205
|
||||
EXIT_CODE_SHOW_TOOLTIP = 206
|
||||
@@ -77,7 +77,54 @@ def relative_path(basedir, filename):
|
||||
return filename
|
||||
|
||||
|
||||
def string_replacer(line):
|
||||
"""Take string literals like 'hello' and replace them with empty string literals, while respecting escaping."""
|
||||
|
||||
r = []
|
||||
in_quote = None
|
||||
escapes = 0
|
||||
for i, c in enumerate(line):
|
||||
if in_quote:
|
||||
if not escapes and c == in_quote:
|
||||
in_quote = None
|
||||
r.append(c)
|
||||
continue
|
||||
|
||||
# We're inside of a string literal. Ignore everything.
|
||||
else:
|
||||
if not escapes and (c == '"' or c == "'"):
|
||||
in_quote = c
|
||||
r.append(c)
|
||||
continue
|
||||
|
||||
# Outside of a string literal, preserve everything.
|
||||
r.append(c)
|
||||
|
||||
if c == '\\':
|
||||
escapes = (escapes + 1) % 2
|
||||
else:
|
||||
escapes = 0
|
||||
|
||||
if in_quote:
|
||||
# Unterminated string literal.
|
||||
pass
|
||||
return "".join(r)
|
||||
|
||||
|
||||
class LintChecker(object):
|
||||
"""Examine Objective-J code statically and generate warnings for possible errors and deviations from the coding-style standard.
|
||||
|
||||
>>> LintChecker().lint_text('var b = 5+5;')
|
||||
[{'positions': [9], 'filename': '<stdin>', 'lineNum': 1, 'message': 'binary operator without surrounding spaces', 'type': 2, 'line': u'var b = 5+5;'}]
|
||||
|
||||
>>> LintChecker().lint_text('''
|
||||
... if( 1 ) {
|
||||
... var b=7;
|
||||
... c = 8;
|
||||
... }
|
||||
... ''')
|
||||
[{'positions': [2], 'filename': '<stdin>', 'lineNum': 2, 'message': 'missing space between control statement and parentheses', 'type': 2, 'line': u'if( 1 ) {'}, {'positions': [8], 'filename': '<stdin>', 'lineNum': 2, 'message': 'braces should be on their own line', 'type': 1, 'line': u'if( 1 ) {'}, {'positions': [3, 5], 'filename': '<stdin>', 'lineNum': 2, 'message': 'space inside parentheses', 'type': 1, 'line': u'if( 1 ) {'}, {'positions': [7], 'filename': '<stdin>', 'lineNum': 3, 'message': 'assignment operator without surrounding spaces', 'type': 2, 'line': u' var b=7;'}, {'lineNum': 4, 'message': 'accidental global variable', 'type': 1, 'line': u' c = 8;', 'filename': '<stdin>'}]
|
||||
"""
|
||||
|
||||
VAR_BLOCK_START_RE = re.compile(ur'''(?x)
|
||||
(?P<indent>\s*) # indent before a var keyword
|
||||
@@ -128,15 +175,33 @@ class LintChecker(object):
|
||||
TRAILING_WHITESPACE_RE = re.compile(ur'^.*(\s+)$')
|
||||
STRIP_LINE_COMMENT_RE = re.compile(ur'(.*)\s*(?://.*|/\*.*\*/\s*)$')
|
||||
LINE_COMMENT_RE = re.compile(ur'\s*(?:/\*.*\*/\s*|//.*)$')
|
||||
COMMENT_RE = re.compile(ur'/\*.*?\*/')
|
||||
BLOCK_COMMENT_START_RE = re.compile(ur'\s*/\*.*(?!\*/\s*)$')
|
||||
BLOCK_COMMENT_END_RE = re.compile(ur'.*?\*/')
|
||||
METHOD_RE = ur'[-+]\s*\([a-zA-Z_$]\w*\)\s*[a-zA-Z_$]\w*'
|
||||
FUNCTION_RE = re.compile(ur'\s*function\s*(?P<name>[a-zA-Z_$]\w*)?\(.*\)\s*\{?')
|
||||
STRING_LITERAL_RE = re.compile(ur'(?<!\\)(["\'])(.*?)(?<!\\)\1')
|
||||
RE_RE = re.compile(ur'(?<!\\)/.*?[^\\]/[gims]*')
|
||||
EMPTY_STRING_LITERAL_FUNCTION = lambda match: match.group(1) + (len(match.group(2)) * ' ') + match.group(1)
|
||||
EMPTY_SELF_STRING_LITERAL_FUNCTION = lambda self, match: match.group(1) + (len(match.group(2)) * ' ') + match.group(1)
|
||||
|
||||
def noncapturing(regex):
|
||||
return ur'(?:%s)' % regex
|
||||
|
||||
def optional(regex):
|
||||
return ur'(?:%s)?' % regex
|
||||
|
||||
DECIMAL_DIGIT_RE = ur'[0-9]'
|
||||
NON_ZERO_DIGIT_RE = ur'[1-9]'
|
||||
DECIMAL_DIGITS_RE = DECIMAL_DIGIT_RE + ur'+'
|
||||
DECIMAL_DIGITS_OPT_RE = optional(DECIMAL_DIGIT_RE + ur'+')
|
||||
EXPONENT_INDICATOR_RE = ur'[eE]'
|
||||
SIGNED_INTEGER_RE = noncapturing(DECIMAL_DIGITS_RE) + ur'|' + noncapturing(ur'\+' + DECIMAL_DIGITS_RE) + ur'|' + noncapturing('-' + DECIMAL_DIGITS_RE)
|
||||
DECIMAL_INTEGER_LITERAL_RE = ur'0|' + noncapturing(NON_ZERO_DIGIT_RE + DECIMAL_DIGIT_RE + ur'*')
|
||||
EXPONENT_PART_RE = EXPONENT_INDICATOR_RE + noncapturing(SIGNED_INTEGER_RE)
|
||||
EXPONENT_PART_OPT_RE = optional(EXPONENT_PART_RE)
|
||||
|
||||
DECIMAL_LITERAL_RE = re.compile(noncapturing(noncapturing(DECIMAL_INTEGER_LITERAL_RE) + ur'\.' + DECIMAL_DIGITS_OPT_RE + EXPONENT_PART_OPT_RE) + ur'|\.' + noncapturing(DECIMAL_DIGITS_RE + EXPONENT_PART_OPT_RE) + ur'|' + noncapturing(noncapturing(DECIMAL_INTEGER_LITERAL_RE) + EXPONENT_PART_OPT_RE))
|
||||
|
||||
ERROR_TYPE_ILLEGAL = 1
|
||||
ERROR_TYPE_WARNING = 2
|
||||
|
||||
@@ -144,10 +209,19 @@ class LintChecker(object):
|
||||
# with spaces so we don't get false matches within them
|
||||
STD_IGNORES = (
|
||||
{'regex': STRIP_LINE_COMMENT_RE, 'replace': ''},
|
||||
{'regex': STRING_LITERAL_RE, 'replace': EMPTY_STRING_LITERAL_FUNCTION},
|
||||
{'function': string_replacer},
|
||||
{'regex': COMMENT_RE, 'replace': ''},
|
||||
{'regex': RE_RE, 'replace': '/ /'},
|
||||
)
|
||||
|
||||
# Convert exponential notation like 1.1e-6 to an arbitrary constant number so that the "e" notation doesn't
|
||||
# need to be understood by the regular matchers. Obviously this is limited by the fact that we're regexing
|
||||
# so this will probably catch some things which are not properly decimal literals (parts of strings or
|
||||
# variable names for instance).
|
||||
EXPONENTIAL_TO_SIMPLE = (
|
||||
{'regex': DECIMAL_LITERAL_RE, 'replace': '42'},
|
||||
)
|
||||
|
||||
LINE_CHECKLIST = (
|
||||
{
|
||||
'id': 'tabs',
|
||||
@@ -175,6 +249,18 @@ class LintChecker(object):
|
||||
'showPositionForGroup': 1,
|
||||
'type': ERROR_TYPE_ILLEGAL
|
||||
},
|
||||
{
|
||||
'regex': re.compile(ur'^\s*(?:(?:else )?if|for|switch|while|with)\s*\((\s+)?.+?(\s+)?\)\s*(?:(?:\{|//.*|/\*.*\*/)\s*)?$'),
|
||||
'error': 'space inside parentheses',
|
||||
'showPositionForGroup': [1, 2],
|
||||
'type': ERROR_TYPE_ILLEGAL
|
||||
},
|
||||
{
|
||||
'regex': re.compile(ur'^\s*(?:(?:else )?if|for|switch|while|with)\s*\(.+\)\s*(?:[\w_]|\[).+(;)\s*(?://.*|/\*.*\*/\s*)?$'),
|
||||
'error': 'dependent statements must be on their own line',
|
||||
'showPositionForGroup': 1,
|
||||
'type': ERROR_TYPE_ILLEGAL
|
||||
},
|
||||
{
|
||||
'regex': TRAILING_WHITESPACE_RE,
|
||||
'error': 'trailing whitespace',
|
||||
@@ -185,29 +271,20 @@ class LintChecker(object):
|
||||
# Filter out @import statements, method declarations, method parameters, unary plus/minus/increment/decrement
|
||||
'filter': {'regex': re.compile(ur'(^@import\b|^\s*' + METHOD_RE + '|^\s*[a-zA-Z_$]\w*:\s*\([a-zA-Z_$][\w<>]*\)\s*\w+|[a-zA-Z_$]\w*(\+\+|--)|([ -+*/%^&|<>!]=?|&&|\|\||<<|>>>|={1,3}|!==?)\s*[-+][\w(\[])'), 'pass': False},
|
||||
|
||||
'preprocess': STD_IGNORES,
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))([-+*/%^]|&&?|\|\|?|<<|>>>?)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'binary operator without surrounding spaces',
|
||||
# Also convert literals like 1.5e+7 to 42 so that the - or + in there is ignored for purposes of this warning.
|
||||
'preprocess': STD_IGNORES + EXPONENTIAL_TO_SIMPLE,
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))([-+*/%^]|&&?|\|\|?|<<|>>>?)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'binary operator without surrounding spaces',
|
||||
'showPositionForGroup': 2,
|
||||
'type': ERROR_TYPE_WARNING
|
||||
},
|
||||
{
|
||||
# Filter out @import statements, method declarations
|
||||
'filter': {'regex': re.compile(ur'^(@import\b|\s*' + METHOD_RE + ')'), 'pass': False},
|
||||
|
||||
'preprocess': STD_IGNORES,
|
||||
'regex': re.compile(ur'(?:[-*/%^&|<>!]=?|&&|\|\||<<|>>>|={1,3}|!==?)\s*(?<!\+)(\+)[\w(\[]'),
|
||||
'error': 'useless unary + operator',
|
||||
'showPositionForGroup': 1,
|
||||
'type': ERROR_TYPE_WARNING
|
||||
},
|
||||
{
|
||||
# Filter out possible = within @accessors
|
||||
'filter': {'regex': re.compile(ur'^\s*(?:@outlet\s+)?[a-zA-Z_$]\w*\s+[a-zA-Z_$]\w*\s+@accessors\b'), 'pass': False},
|
||||
|
||||
'preprocess': STD_IGNORES,
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))(=|[-+*/%^&|]=|<<=|>>>?=)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'assignment operator without surrounding spaces',
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))(=|[-+*/%^&|]=|<<=|>>>?=)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'assignment operator without surrounding spaces',
|
||||
'showPositionForGroup': 2,
|
||||
'type': ERROR_TYPE_WARNING
|
||||
},
|
||||
@@ -216,8 +293,8 @@ class LintChecker(object):
|
||||
'filter': {'regex': re.compile(ur'^(@import\b|@implementation\b|\s*' + METHOD_RE + ')'), 'pass': False},
|
||||
|
||||
'preprocess': STD_IGNORES,
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))(===?|!==?|[<>]=?)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'comparison operator without surrounding spaces',
|
||||
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))(===?|!==?|[<>]=?)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
|
||||
'error': 'comparison operator without surrounding spaces',
|
||||
'showPositionForGroup': 2,
|
||||
'type': ERROR_TYPE_WARNING
|
||||
},
|
||||
@@ -254,7 +331,7 @@ class LintChecker(object):
|
||||
TEXT_ERROR_SINGLE_FILE_TEMPLATE = Template(u'$lineNum: $message.\n+$line\n')
|
||||
TEXT_ERROR_MULTI_FILE_TEMPLATE = Template(u'$filename:$lineNum: $message.\n+$line\n')
|
||||
|
||||
def __init__(self, view, basedir='', var_declarations=VAR_DECLARATIONS_SINGLE, verbose=False):
|
||||
def __init__(self, view=None, basedir='', var_declarations=VAR_DECLARATIONS_SINGLE, verbose=False):
|
||||
self.view = view
|
||||
self.basedir = unicode(basedir, 'utf-8')
|
||||
self.errors = []
|
||||
@@ -284,6 +361,7 @@ class LintChecker(object):
|
||||
continue
|
||||
|
||||
line = self.line
|
||||
originalLine = line
|
||||
lineFilter = check.get('filter')
|
||||
|
||||
if lineFilter:
|
||||
@@ -304,6 +382,11 @@ class LintChecker(object):
|
||||
if regex:
|
||||
line = regex.sub(processor.get('replace', ''), line)
|
||||
|
||||
fnct = processor.get('function')
|
||||
|
||||
if fnct:
|
||||
line = fnct(line)
|
||||
|
||||
regex = check.get('regex')
|
||||
|
||||
if not regex:
|
||||
@@ -315,29 +398,40 @@ class LintChecker(object):
|
||||
continue
|
||||
|
||||
positions = []
|
||||
group = check.get('showPositionForGroup')
|
||||
groups = check.get('showPositionForGroup')
|
||||
|
||||
if (check.get('id') == 'tabs'):
|
||||
line = tabs2spaces(line, positions=positions)
|
||||
elif group is not None:
|
||||
elif groups is not None:
|
||||
line = tabs2spaces(line)
|
||||
|
||||
for match in regex.finditer(line):
|
||||
if group > 0:
|
||||
positions.append(match.start(group))
|
||||
else:
|
||||
# group 0 means show the first non-empty match
|
||||
for i in range(1, len(match.groups()) + 1):
|
||||
if match.start(i) >= 0:
|
||||
positions.append(match.start(i))
|
||||
break
|
||||
if not isinstance(groups, (list, tuple)):
|
||||
groups = (groups,)
|
||||
|
||||
self.error(check['error'], line=line, positions=positions, type=check['type'])
|
||||
for match in regex.finditer(line):
|
||||
for group in groups:
|
||||
if group > 0:
|
||||
start = match.start(group)
|
||||
|
||||
if start >= 0:
|
||||
positions.append(start)
|
||||
else:
|
||||
# group 0 means show the first non-empty match
|
||||
for i in range(1, len(match.groups()) + 1):
|
||||
if match.start(i) >= 0:
|
||||
positions.append(match.start(i))
|
||||
break
|
||||
|
||||
if positions:
|
||||
self.error(check['error'], line=originalLine, positions=positions, type=check['type'])
|
||||
|
||||
def next_statement(self, expect_line=False, check_line=True):
|
||||
try:
|
||||
while True:
|
||||
raw_line = self.sourcefile.next()[:-1] # strip EOL
|
||||
raw_line = self.sourcefile.next()
|
||||
# strip EOL
|
||||
if raw_line[-1] == '\n': # ... unless this is the last line which might not have a \n.
|
||||
raw_line = raw_line[:-1]
|
||||
|
||||
try:
|
||||
self.line = unicode(raw_line, 'utf-8', 'strict') # convert to Unicode
|
||||
@@ -410,7 +504,7 @@ class LintChecker(object):
|
||||
|
||||
# Remove all quoted strings from the expression so that we don't
|
||||
# count unmatched pairs inside the strings.
|
||||
self.expression = self.STRING_LITERAL_RE.sub(self.EMPTY_SELF_STRING_LITERAL_FUNCTION, self.expression)
|
||||
self.expression = string_replacer(self.expression)
|
||||
|
||||
self.strip_comment()
|
||||
self.expression = self.expression.strip()
|
||||
@@ -727,7 +821,7 @@ class LintChecker(object):
|
||||
print u'EOF\n'
|
||||
pass
|
||||
|
||||
def lint_text(self, text, filename):
|
||||
def lint_text(self, text, filename="<stdin>"):
|
||||
self.filename = filename
|
||||
self.filesToCheck = []
|
||||
|
||||
@@ -739,6 +833,8 @@ class LintChecker(object):
|
||||
print u'EOF\n'
|
||||
pass
|
||||
|
||||
return self.errors
|
||||
|
||||
def count_files_checked(self):
|
||||
return len(self.filesToCheck)
|
||||
|
||||
@@ -939,6 +1035,50 @@ class LintChecker(object):
|
||||
exit_show_html(html)
|
||||
|
||||
|
||||
class MiscTest(unittest.TestCase):
|
||||
def test_string_replacer(self):
|
||||
self.assertEquals(string_replacer("x = 'hello';"), "x = '';")
|
||||
self.assertEquals(string_replacer("x = '\\' hello';"), "x = '';")
|
||||
self.assertEquals(string_replacer("x = '\\\\';"), "x = '';")
|
||||
self.assertEquals(string_replacer("""x = '"string in string"';"""), "x = '';")
|
||||
|
||||
self.assertEquals(string_replacer('x = "hello";'), 'x = "";')
|
||||
self.assertEquals(string_replacer('x = "\\" hello";'), 'x = "";')
|
||||
self.assertEquals(string_replacer('x = "\\\\";'), 'x = "";')
|
||||
self.assertEquals(string_replacer('''x = "'";'''), 'x = "";')
|
||||
|
||||
|
||||
class LintCheckerTest(unittest.TestCase):
|
||||
def test_exponential_notation(self):
|
||||
"""Test that exponential notation such as 1.1e-6 doesn't cause a warning about missing whitespace."""
|
||||
|
||||
# This should not report "binary operator without surrounding spaces".
|
||||
self.assertEquals(LintChecker().lint_text("a = 2.1e-6;"), [])
|
||||
self.assertEquals(LintChecker().lint_text("a = 2.1e+6;"), [])
|
||||
self.assertEquals(LintChecker().lint_text("a = 2e-0;"), [])
|
||||
self.assertEquals(LintChecker().lint_text("a = 2e+0;"), [])
|
||||
|
||||
# But this should.
|
||||
self.assertEquals(LintChecker().lint_text("a = 1.1e-6+2e2;"), [{'positions': [6], 'filename': '<stdin>', 'lineNum': 1, 'message': 'binary operator without surrounding spaces', 'type': 2, 'line': u'a = 1.1e-6+2e2;'}])
|
||||
|
||||
def test_function_types(self):
|
||||
"""Test that function definitions like function(/*CPString*/key) don't cause warnings about surrounding spaces."""
|
||||
|
||||
# This should not report "binary operator without surrounding spaces".
|
||||
self.assertEquals(LintChecker().lint_text("var resolveMultipleValues = function(/*CPString*/key, /*CPDictionary*/bindings, /*GSBindingOperationKind*/operation)"), [])
|
||||
|
||||
def test_unary_plus(self):
|
||||
"""Test that = +<variable>, like in `x = +y;`, doesn't cause a warning."""
|
||||
|
||||
# +<variable> converts number in a string to a number.
|
||||
self.assertEquals(LintChecker().lint_text("var y = +x;"), [])
|
||||
|
||||
def test_string_escaping(self):
|
||||
"""Test that string literals are not parsed as syntax, even when they end with a double backslash."""
|
||||
|
||||
self.assertEquals(LintChecker().lint_text('var x = "(\\\\";'), [])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
usage = 'usage: %prog [options] [file ... | -]'
|
||||
parser = OptionParser(usage=usage, version='1.02')
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super NS_initWithCoder:aCoder];
|
||||
|
||||
|
||||
if (self)
|
||||
{
|
||||
{
|
||||
_allTemplates = [aCoder decodeObjectForKey:@"NSPredicateTemplates"];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
||||
if (self)
|
||||
{
|
||||
_templateType = [aCoder decodeIntForKey:@"NSPredicateTemplateType"];
|
||||
@@ -71,7 +71,7 @@
|
||||
_rightIsWildcard = [aCoder decodeBoolForKey:@"NSPredicateTemplateRightIsWildcard"];
|
||||
_views = [aCoder decodeObjectForKey:@"NSPredicateTemplateViews"];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super NS_initWithCoder:aCoder];
|
||||
|
||||
|
||||
if (self)
|
||||
{
|
||||
_alignmentGridWidth = [aCoder decodeFloatForKey:@"NSRuleEditorAlignmentGridWidth"];
|
||||
@@ -40,20 +40,20 @@
|
||||
_stringsFilename = [aCoder decodeObjectForKey:@"NSRuleEditorStringsFileName"];
|
||||
_editable = [aCoder decodeBoolForKey:@"NSRuleEditorEditable"];
|
||||
_allowsEmptyCompoundRows = [aCoder decodeBoolForKey:@"NSRuleEditorAllowsEmptyCompoundRows"];
|
||||
_disallowEmpty = [aCoder decodeBoolForKey:@"NSRuleEditorDisallowEmpty"];
|
||||
_disallowEmpty = [aCoder decodeBoolForKey:@"NSRuleEditorDisallowEmpty"];
|
||||
_nestingMode = [aCoder decodeIntForKey:@"NSRuleEditorNestingMode"];
|
||||
_typeKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorRowTypeKeyPath"];
|
||||
_itemsKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorItemsKeyPath"];
|
||||
_valuesKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorValuesKeyPath"];
|
||||
_subrowsArrayKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorSubrowsArrayKeyPath"];
|
||||
_boundArrayKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorBoundArrayKeyPath"];
|
||||
|
||||
|
||||
//_slicesHolder = [aCoder decodeObjectForKey:@"NSRuleEditorViewSliceHolder"];
|
||||
_boundArrayOwner = [aCoder decodeObjectForKey:@"NSRuleEditorBoundArrayOwner"];
|
||||
_slices = [aCoder decodeObjectForKey:@"NSRuleEditorSlices"];
|
||||
_ruleDelegate = [aCoder decodeObjectForKey:@"NSRuleEditorDelegate"];
|
||||
_ruleDelegate = [aCoder decodeObjectForKey:@"NSRuleEditorDelegate"];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
{
|
||||
if (self = [super init])
|
||||
boundArray = [aCoder decodeObjectForKey:@"NSBoundArray"];
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ var FILE = require("file"),
|
||||
DefaultTheme = "Aristo",
|
||||
BuildTypes = ["Debug", "Release"],
|
||||
DefaultFile = "MainMenu",
|
||||
AllowedStoredOptionsRe = new RegExp("^(defaultTheme|auxThemes|verbosity|quiet|frameworks|format)$");
|
||||
AllowedStoredOptionsRe = new RegExp("^(defaultTheme|auxThemes|verbosity|quiet|frameworks|format)$"),
|
||||
ArgsRe = /"[^\"]+"|'[^\']+'|\S+/g;
|
||||
|
||||
|
||||
@@ -127,6 +127,8 @@ var FILE = require("file"),
|
||||
if (systemFontSize)
|
||||
[CPFont setSystemFontSize:parseFloat(systemFontSize, 10)];
|
||||
}
|
||||
else
|
||||
infoPlist = [CPDictionary dictionary];
|
||||
|
||||
var themeList = [self getThemeList:options],
|
||||
themes = [self loadThemesFromList:themeList];
|
||||
|
||||
Reference in New Issue
Block a user