Merge branch 'master' of github.com:cappuccino/cappuccino

This commit is contained in:
Alexander Ljungberg committed 2012-01-27 12:20:17 +00:00
commit 8e007985a1
60 files changed
+4376 -218

No files matched your search

+3 -3
View File
@@ -1166,12 +1166,12 @@ CPRunContinuesResponse = -1002;
var _CPModalSessionMake = function(aWindow, aStopCode)
{
return { _window:aWindow, _state:CPRunContinuesResponse , _previous:nil };
}
};
var _CPEventListenerMake = function(anEventMask, aCallback)
{
return { _mask:anEventMask, _callback:aCallback };
}
};
// Make this a global for use in CPPlatformWindow+DOM.j.
_CPRunModalLoop = function(anEvent)
@@ -1183,7 +1183,7 @@ _CPRunModalLoop = function(anEvent)
if (theWindow == modalSession._window || [theWindow worksWhenModal])
[theWindow sendEvent:anEvent];
}
};
/*!
Starts the GUI and Cappuccino frameworks. This function should be
+129 -7
View File
@@ -35,6 +35,16 @@ CPLineBorder = 1;
CPBezelBorder = 2;
CPGrooveBorder = 3;
// CPTitlePosition
CPNoTitle = 0;
CPAboveTop = 1;
CPAtTop = 2;
CPBelowTop = 3;
CPAboveBottom = 4;
CPAtBottom = 5;
CPBelowBottom = 6;
/*!
@ingroup appkit
@class CPBox
@@ -54,6 +64,10 @@ CPGrooveBorder = 3;
CPSize _contentMargin;
CPView _contentView;
CPString _title @accessors(getter=title);
int _titlePosition @accessors(getter=titlePosition);
CPTextField _titleView;
}
+ (id)boxEnclosingView:(CPView)aView
@@ -61,7 +75,7 @@ CPGrooveBorder = 3;
var box = [[self alloc] initWithFrame:CGRectMakeZero()],
enclosingView = [aView superview];
[box setAutoresizingMask:[aView autoresizingMask]];
[box setAutoresizingMask:[aView autoresizingMask]];
[box setFrameFromContentFrame:[aView frame]];
[enclosingView replaceSubview:aView with:box];
@@ -84,6 +98,9 @@ CPGrooveBorder = 3;
_borderWidth = 1.0;
_contentMargin = CGSizeMake(0.0, 0.0);
_titlePosition = CPNoTitle;
_titleView = [CPTextField labelWithTitle:@""];
_contentView = [[CPView alloc] initWithFrame:[self bounds]];
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
@@ -278,18 +295,100 @@ CPGrooveBorder = 3;
- (void)setFrameFromContentFrame:(CPRect)aRect
{
[self setFrame:CGRectInset(aRect, -(_contentMargin.width + _borderWidth), -(_contentMargin.height + _borderWidth))];
var offset = [self _titleHeightOffset];
[self setFrame:CGRectInset(aRect, -(_contentMargin.width + _borderWidth), -(_contentMargin.height + offset[0] + _borderWidth))];
[self setNeedsDisplay:YES];
}
- (void)setTitle:(CPString)aTitle
{
if (aTitle == _title)
return;
_title = aTitle;
[self _manageTitlePositioning];
}
- (void)setTitlePosition:(int)aTitlePotisition
{
if (aTitlePotisition == _titlePosition)
return;
_titlePosition = aTitlePotisition;
[self _manageTitlePositioning];
}
- (void)_manageTitlePositioning
{
if (_titlePosition == CPNoTitle)
{
[_titleView removeFromSuperview];
[self setNeedsDisplay:YES];
return;
}
[_titleView setStringValue:_title];
[_titleView sizeToFit];
[self addSubview:_titleView];
switch (_titlePosition)
{
case CPAtTop:
case CPAboveTop:
case CPBelowTop:
[_titleView setFrameOrigin:CPPointMake(5.0, 0.0)];
[_titleView setAutoresizingMask:CPViewNotSizable];
break;
case CPAboveBottom:
case CPAtBottom:
case CPBelowBottom:
var h = [_titleView frameSize].height;
[_titleView setFrameOrigin:CPPointMake(5.0, [self frameSize].height - h)];
[_titleView setAutoresizingMask:CPViewMinYMargin];
break;
}
[self sizeToFit];
[self setNeedsDisplay:YES];
}
- (void)sizeToFit
{
var contentFrame = [_contentView frame];
var contentFrame = [_contentView frame],
offset = [self _titleHeightOffset];
if (!contentFrame)
return;
[_contentView setAutoresizingMask:CPViewNotSizable];
[self setFrameSize:CGSizeMake(contentFrame.size.width + _contentMargin.width * 2,
contentFrame.size.height + _contentMargin.height * 2)];
contentFrame.size.height + _contentMargin.height * 2 + offset[0])];
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[_contentView setFrameOrigin:CGPointMake(_contentMargin.width, _contentMargin.height)];
[_contentView setFrameOrigin:CGPointMake(_contentMargin.width, _contentMargin.height + offset[1])];
}
- (float)_titleHeightOffset
{
if (_titlePosition == CPNoTitle)
return [0.0, 0.0];
switch (_titlePosition)
{
case CPAtTop:
return [[_titleView frameSize].height, [_titleView frameSize].height];
case CPAtBottom:
return [[_titleView frameSize].height, 0.0];
default:
return [0.0, 0.0];
}
}
- (void)drawRect:(CPRect)rect
@@ -297,7 +396,7 @@ CPGrooveBorder = 3;
if (_borderType === CPNoBorder)
return;
var bounds = [self bounds];
var bounds = CGRectMakeCopy([self bounds]);
switch (_boxType)
{
@@ -312,6 +411,16 @@ CPGrooveBorder = 3;
break;
}
if (_titlePosition == CPAtTop)
{
bounds.origin.y += [_titleView frameSize].height;
bounds.size.height -= [_titleView frameSize].height;
}
if (_titlePosition == CPAtBottom)
{
bounds.size.height -= [_titleView frameSize].height;
}
switch (_borderType)
{
case CPBezelBorder:
@@ -386,7 +495,10 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
CPBoxFillColorKey = @"CPBoxFillColorKey",
CPBoxCornerRadiusKey = @"CPBoxCornerRadiusKey",
CPBoxBorderWidthKey = @"CPBoxBorderWidthKey",
CPBoxContentMarginKey = @"CPBoxContentMarginKey";
CPBoxContentMarginKey = @"CPBoxContentMarginKey",
CPBoxTitle = @"CPBoxTitle",
CPBoxTitlePosition = @"CPBoxTitlePosition",
CPBoxTitleView = @"CPBoxTitleView";
@implementation CPBox (CPCoding)
@@ -407,10 +519,16 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
_contentMargin = [aCoder decodeSizeForKey:CPBoxContentMarginKey];
_title = [aCoder decodeObjectForKey:CPBoxTitle];
_titlePosition = [aCoder decodeIntForKey:CPBoxTitlePosition];
_titleView = [aCoder decodeObjectForKey:CPBoxTitleView] || [CPTextField labelWithTitle:_title];
_contentView = [self subviews][0];
[self setAutoresizesSubviews:YES];
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[self _manageTitlePositioning];
}
return self;
@@ -429,6 +547,10 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
[aCoder encodeFloat:_cornerRadius forKey:CPBoxCornerRadiusKey];
[aCoder encodeFloat:_borderWidth forKey:CPBoxBorderWidthKey];
[aCoder encodeObject:_title forKey:CPBoxTitle];
[aCoder encodeInt:_titlePosition forKey:CPBoxTitlePosition];
[aCoder encodeObject:_titleView forKey:CPBoxTitleView];
[aCoder encodeSize:_contentMargin forKey:CPBoxContentMarginKey];
}
+2 -2
View File
@@ -922,9 +922,9 @@ var CPDocumentUntitledCount = 0;
var _CPReadSessionMake = function(aType, aDelegate, aDidReadSelector, aContextInfo)
{
return { fileType:aType, delegate:aDelegate, didReadSelector:aDidReadSelector, contextInfo:aContextInfo };
}
};
var _CPSaveSessionMake = function(anAbsoluteURL, aSaveOperation, aChangeCount, aDelegate, aDidSaveSelector, aContextInfo, aConnection)
{
return { absoluteURL:anAbsoluteURL, saveOperation:aSaveOperation, changeCount:aChangeCount, delegate:aDelegate, didSaveSelector:aDidSaveSelector, contextInfo:aContextInfo, connection:aConnection };
}
};
+3 -3
View File
@@ -143,7 +143,7 @@ var _CPFontDetectFontAvailable = function(font)
if (_CPFontDetectCompareFonts(_CPFontDetectReferenceFonts[i], font))
return true;
return false;
}
};
var _CPFontDetectCache = {};
@@ -165,7 +165,7 @@ var _CPFontDetectCompareFonts = function(fontA, fontB)
bHeight = _CPFontDetectSpan.offsetHeight;
return (a.w != bWidth || a.h != bHeight);
}
};
// Test the candidate fonts pairwise until we find two that are different. Otherwise return the first.
var _CPFontDetectPickTwoDifferentFonts = function(candidates)
@@ -175,6 +175,6 @@ var _CPFontDetectPickTwoDifferentFonts = function(candidates)
if (_CPFontDetectCompareFonts(candidates[i], candidates[j]))
return [candidates[i], candidates[j]];
return [candidates[0]];
}
};
[CPFontManager setFontManagerFactory:[CPFontManager class]];
+3 -3
View File
@@ -281,7 +281,7 @@ function CPAppKitImage(aFilename, aSize)
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
[self _derefFromImage];
}
};
_image.onerror = function ()
{
@@ -293,7 +293,7 @@ function CPAppKitImage(aFilename, aSize)
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
[self _derefFromImage];
}
};
_image.onabort = function ()
{
@@ -305,7 +305,7 @@ function CPAppKitImage(aFilename, aSize)
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
[self _derefFromImage];
}
};
_image.src = _filename;
+3 -3
View File
@@ -426,7 +426,7 @@ var resolveMultipleValues = function resolveMultipleValues(/*CPString*/key, /*CP
}
return !operation;
}
};
var invokeAction = function invokeAction(/*CPString*/targetKey, /*CPString*/argumentKey, /*CPDictionary*/bindings)
{
@@ -463,7 +463,7 @@ var invokeAction = function invokeAction(/*CPString*/targetKey, /*CPString*/argu
}
[invocation invoke];
}
};
// Keys in options dictionary
@@ -518,4 +518,4 @@ CPValueTransformerBindingOption = @"CPValueTransformer";
CPIsControllerMarker = function(/*id*/anObject)
{
return anObject === CPMultipleValuesMarker || anObject === CPNoSelectionMarker || anObject === CPNotApplicableMarker || anObject === CPNullMarker;
}
};
+11 -9
View File
@@ -1120,13 +1120,14 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
if (_dragHoverTimer)
[_dragHoverTimer invalidate];
var autoExpandCallBack = function(){
var autoExpandCallBack = function()
{
if (_dropItem)
{
[_dropOperationFeedbackView blink];
[CPTimer scheduledTimerWithTimeInterval:.3 callback:objj_msgSend(self, "expandItem:", _dropItem) repeats:NO];
}
}
};
_dragHoverTimer = [CPTimer scheduledTimerWithTimeInterval:.8 callback:autoExpandCallBack repeats:NO];
}
@@ -1467,7 +1468,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
// Check for the key events manually, as opposed to waiting for CPWindow to sent the actual action message
// in _processKeyboardUIKey:, because we might not want to handle the arrow events.
if (character !== CPRightArrowFunctionKey && character !== CPLeftArrowFunctionKey)
if (character !== CPRightArrowFunctionKey && character !== CPLeftArrowFunctionKey)
return [super keyDown:anEvent];
var rows = [self selectedRowIndexes],
@@ -1481,7 +1482,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
for (; i < c; i++)
items.push([self itemAtRow:indexes[i]]);
if (character === CPRightArrowFunctionKey)
{
@@ -1491,7 +1492,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
else if (character === CPLeftArrowFunctionKey)
{
for (var i = 0; i < c; i++)
[self collapseItem:items[i]];
[self collapseItem:items[i]];
}
[super keyDown:anEvent];
@@ -1535,7 +1536,7 @@ var _reloadItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anItem)
itemInfo.isExpandable = [dataSource outlineView:anOutlineView isItemExpandable:newItem];
itemInfo.isExpanded = itemInfo.isExpandable && itemInfo.isExpanded;
}
}
};
// FIX ME: We're using with() here because Safari fails if we use anOutlineView._itemInfosForItems or whatever...
var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anItem, /*BOOL*/ isIntermediate)
@@ -1640,7 +1641,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt
}
}//end of with
return descendants;
}
};
@implementation _CPOutlineViewTableViewDataSource : CPObject
{
@@ -1984,7 +1985,8 @@ var CPOutlineViewIndentationPerLevelKey = @"CPOutlineViewIndentationPerLevelKey"
@end
var colorForDisclosureTriangle = function(isSelected, isHighlighted) {
var colorForDisclosureTriangle = function(isSelected, isHighlighted)
{
return isSelected
? (isHighlighted
? [CPColor colorWithCalibratedWhite:0.9 alpha: 1.0]
@@ -1992,4 +1994,4 @@ var colorForDisclosureTriangle = function(isSelected, isHighlighted) {
: (isHighlighted
? [CPColor colorWithCalibratedWhite:0.4 alpha: 1.0]
: [CPColor colorWithCalibratedWhite:0.5 alpha: 1.0]);
}
};
+1 -1
View File
@@ -63,7 +63,7 @@ var _isSystemUsingOverlayScrollers = function()
#else
return NO;
#endif
}
};
/*!
@ingroup appkit
+18 -14
View File
@@ -98,20 +98,24 @@ var LIGHT_LEFT_INSET = 3.0,
+ (id)shadowViewEnclosingView:(CPView)aView withWeight:(CPShadowWeight)aWeight
{
var shadowView = [[CPShadowView alloc] initWithFrame:[aView frame]];
[shadowView setWeight:aWeight];
var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];
[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
var shadowView = [[self alloc] initWithFrame:[aView frame]];
if (shadowView)
{
[shadowView setWeight:aWeight];
var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];
[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
}
return shadowView;
}
+10 -8
View File
@@ -683,7 +683,7 @@ NOT YET IMPLEMENTED
*/
- (void)setRowHeight:(unsigned)aRowHeight
{
aRowHeight = +aRowHeight;
aRowHeight = aRowHeight;
if (_rowHeight === aRowHeight)
return;
@@ -954,8 +954,8 @@ NOT YET IMPLEMENTED
*/
- (void)_moveColumn:(unsigned)fromIndex toColumn:(unsigned)toIndex
{
fromIndex = +fromIndex;
toIndex = +toIndex;
fromIndex = fromIndex;
toIndex = toIndex;
if (fromIndex === toIndex)
return;
@@ -1562,7 +1562,7 @@ NOT YET IMPLEMENTED
*/
- (CGRect)rectOfColumn:(CPInteger)aColumnIndex
{
aColumnIndex = +aColumnIndex;
aColumnIndex = aColumnIndex;
if (aColumnIndex < 0 || aColumnIndex >= NUMBER_OF_COLUMNS())
return _CGRectMakeZero();
@@ -4939,15 +4939,17 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
isBlinking = YES;
var showCallback = function() {
var showCallback = function()
{
objj_msgSend(self, "setHidden:", NO)
isBlinking = NO;
}
};
var hideCallback = function() {
var hideCallback = function()
{
objj_msgSend(self, "setHidden:", YES)
isBlinking = YES;
}
};
objj_msgSend(self, "setHidden:", YES);
[CPTimer scheduledTimerWithTimeInterval:0.1 callback:showCallback repeats:NO];
+3 -3
View File
@@ -202,14 +202,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
CPTextFieldInputDidBlur = YES;
return true;
}
};
CPTextFieldHandleBlur = function(anEvent)
{
CPTextFieldInputOwner = nil;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
};
//FIXME make this not onblur
CPTextFieldDOMInputElement.onblur = CPTextFieldBlurFunction;
@@ -1433,7 +1433,7 @@ var secureStringForString = function(aString)
return "";
return Array(aString.length + 1).join(CPSecureTextFieldCharacter);
}
};
var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
+3 -1
View File
@@ -579,6 +579,7 @@ CPThemeStateCircular = CPThemeState("circular");
_cache = {};
_name = [aCoder decodeObjectForKey:@"name"];
_defaultValue = [aCoder decodeObjectForKey:@"defaultValue"];
_values = [CPDictionary dictionary];
if ([aCoder containsValueForKey:@"value"])
@@ -611,6 +612,7 @@ CPThemeStateCircular = CPThemeState("circular");
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeObject:_name forKey:@"name"];
[aCoder encodeObject:_defaultValue forKey:@"defaultValue"];
var keys = [_values allKeys],
count = keys.length;
@@ -666,7 +668,7 @@ var numberOfOnes = function(aNumber)
cachedNumberOfOnes[slot] = count;
return count;
}
};
numberOfOnes.displayName = "numberOfOnes";
+7 -7
View File
@@ -660,7 +660,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
CPTokenFieldInputDidBlur = YES;
return true;
}
};
CPTokenFieldKeyDownFunction = function(aDOMEvent)
{
@@ -814,7 +814,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
}
return true;
}
};
CPTokenFieldKeyPressFunction = function(aDOMEvent)
{
@@ -844,7 +844,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// Force immediate layout in case word wrapping is now necessary.
[owner setNeedsLayout];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
};
CPTokenFieldKeyUpFunction = function()
{
@@ -857,14 +857,14 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
[self setNeedsLayout];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
};
CPTokenFieldHandleBlur = function(anEvent)
{
CPTokenFieldInputOwner = nil;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
};
if (document.attachEvent)
{
@@ -1026,7 +1026,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
offset.x += width + spaceBetweenTokens.width;
return r;
}
};
var placeEditor = function(useRemainingWidth)
{
@@ -1053,7 +1053,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// When editing, always scroll to the cursor.
if (_selectedRange.length == 0)
[[_tokenScrollView documentView] scrollRectToVisible:inputFrame];
}
};
for (var i = 0, count = [tokens count]; i < count; i++)
{
+2 -2
View File
@@ -515,7 +515,7 @@ var TOOLBAR_TOP_MARGIN = 5.0,
var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
{
return { index:anIndex, view:aView, label:aLabel, minWidth:aMinWidth };
}
};
/* @ignore */
@implementation _CPToolbarView : CPView
@@ -876,7 +876,7 @@ var _CPToolbarItemVisibilityPriorityCompare = function(lhs, rhs)
return CPOrderedAscending;
return CPOrderedDescending;
}
};
var TOP_MARGIN = 5.0,
LABEL_MARGIN = 2.0;
+2 -2
View File
@@ -2799,7 +2799,7 @@ var _CPViewFullScreenModeStateMake = function(aView)
var superview = aView._superview;
return { autoresizingMask:aView._autoresizingMask, frame:CGRectMakeCopy(aView._frame), index:(superview ? [superview._subviews indexOfObjectIdenticalTo:aView] : 0), superview:superview };
}
};
var _CPViewGetTransform = function(/*CPView*/ fromView, /*CPView */ toView)
{
@@ -2896,4 +2896,4 @@ var _CPViewGetTransform = function(/*CPView*/ fromView, /*CPView */ toView)
}*/
return transform;
}
};
+2 -2
View File
@@ -199,7 +199,7 @@ CPWebViewAppKitScrollMaxPollCount = 3;
_ignoreLoadEnd = NO;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
};
if (_iframe.addEventListener)
_iframe.addEventListener("load", _loadCallback, false);
@@ -830,7 +830,7 @@ CPWebViewAppKitScrollMaxPollCount = 3;
- (@action)reload:(id)sender
{
// If we're displaying pure HTML, redisplay it.
if(!_url && (_html !== nil))
if (!_url && (_html !== nil))
[self loadHTMLString:_html];
else
[self _loadMainFrameURL];
+3 -3
View File
@@ -2673,7 +2673,7 @@ var allViews = function(aWindow)
views = views.concat([views[index] subviews]);
return views;
}
};
var keyViewComparator = function(lhs, rhs, context)
{
@@ -2704,7 +2704,7 @@ var keyViewComparator = function(lhs, rhs, context)
return CPOrderedSame;
return CPOrderedDescending;
}
};
@implementation CPWindow (MenuBar)
@@ -2928,7 +2928,7 @@ var keyViewComparator = function(lhs, rhs, context)
var interpolate = function(fromValue, toValue, progress)
{
return fromValue + (toValue - fromValue) * progress;
}
};
/* @ignore */
@implementation _CPWindowFrameAnimation : CPAnimation
+7 -6
View File
@@ -29,7 +29,7 @@
function CABackingStoreGetContext(aBackingStore)
{
return aBackingStore.context;
}
};
if (CPFeatureIsCompatible(CPHTMLCanvasFeature))
{
@@ -42,7 +42,7 @@ CABackingStoreCreate = function()
// FIXME: Consolidate drawImage to support this.
return { context:DOMElement.getContext("2d"), buffer:DOMElement, _image:DOMElement };
}
};
CABackingStoreSetSize = function(aBackingStore, aSize)
{
@@ -52,7 +52,8 @@ CABackingStoreSetSize = function(aBackingStore, aSize)
buffer.height = aSize.height;
buffer.style.width = PIXEL(aSize.width);
buffer.style.height = PIXEL(aSize.height);
}
};
}
else
{
@@ -64,10 +65,10 @@ CABackingStoreCreate = function()
context.buffer = "";
return { context:context };
}
};
CABackingStoreSetSize = function(aBackingStore, aSize)
{
}
};
}
}
+2 -2
View File
@@ -358,7 +358,7 @@ if (CPFeatureIsCompatible(CPJavaScriptCanvasTransformFeature))
CGContextConcatCTM = function(aContext, anAffineTransform)
{
aContext.transform(anAffineTransform.a, anAffineTransform.b, anAffineTransform.c, anAffineTransform.d, anAffineTransform.tx, anAffineTransform.ty);
}
};
}
else
@@ -428,7 +428,7 @@ CGContextConcatCTM = function(aContext, anAffineTransform)
CGContextScaleCTM(aContext, sx, sy);
if (a2 != 0.0)
CGContextRotateCTM(aContext, a2);
}
};
}
+1 -1
View File
@@ -49,7 +49,7 @@ var screenNeedsInitialization = NO,
window.onunload = function()
{
[CPApp terminate:nil];
}
};
}
+ (BOOL)isBrowser
+4 -4
View File
@@ -1568,7 +1568,7 @@ var _CPEventFromNativeMouseEvent = function(aNativeEvent, anEventType, aPoint, m
aNativeEvent._eventNumber = anEventNumber;
aNativeEvent._clickCount = aClickCount;
aNativeEvent._pressure = aPressure;
if((anEventType == CPLeftMouseDragged) || (anEventType == CPRightMouseDragged) || (anEventType == CPMouseMoved))
if ((anEventType == CPLeftMouseDragged) || (anEventType == CPRightMouseDragged) || (anEventType == CPMouseMoved))
{
aNativeEvent._deltaX = aPoint.x - aMouseDragStart.x;
aNativeEvent._deltaY = aPoint.y - aMouseDragStart.y;
@@ -1581,7 +1581,7 @@ var _CPEventFromNativeMouseEvent = function(aNativeEvent, anEventType, aPoint, m
return aNativeEvent;
}
};
var CLICK_SPACE_DELTA = 5.0,
CLICK_TIME_DELTA = (typeof document != "undefined" && document.addEventListener) ? 350.0 : 1000.0;
@@ -1596,7 +1596,7 @@ var CPDOMEventGetClickCount = function(aComparisonEvent, aTimestamp, aLocation)
return (aTimestamp - [aComparisonEvent timestamp] < CLICK_TIME_DELTA &&
ABS(comparisonLocation.x - aLocation.x) < CLICK_SPACE_DELTA &&
ABS(comparisonLocation.y - aLocation.y) < CLICK_SPACE_DELTA) ? [aComparisonEvent clickCount] + 1 : 1;
}
};
var CPDOMEventStop = function(aDOMEvent, aPlatformWindow)
{
@@ -1616,7 +1616,7 @@ var CPDOMEventStop = function(aDOMEvent, aPlatformWindow)
aPlatformWindow._DOMFocusElement.focus();
aPlatformWindow._DOMFocusElement.blur();
}
}
};
function CPWindowObjectList()
{
@@ -229,4 +229,4 @@ CPKeyCodes.isCharacterKey = function(keyCode)
default:
return false;
}
}
};
+8 -8
View File
@@ -26,7 +26,7 @@ BlendTask.prototype.__proto__ = BundleTask.prototype;
BlendTask.prototype.packageType = function()
{
return "BLND";
}
};
BlendTask.prototype.infoPlist = function()
{
@@ -35,28 +35,28 @@ BlendTask.prototype.infoPlist = function()
infoPlist.setValueForKey("CPKeyedThemes", require("narwhal/util").unique(this._keyedThemes));
return infoPlist;
}
};
BlendTask.prototype.themeDescriptors = function()
{
return this._themeDescriptors;
}
};
BlendTask.prototype.setThemeDescriptors = function(/*Array | FileList*/ themeDescriptors)
{
this._themeDescriptors = themeDescriptors;
}
};
BlendTask.prototype.defineTasks = function()
{
this.defineThemeDescriptorTasks();
BundleTask.prototype.defineTasks.apply(this, arguments);
}
};
BlendTask.prototype.defineSourceTasks = function()
{
}
};
BlendTask.prototype.defineThemeDescriptorTasks = function()
{
@@ -106,7 +106,7 @@ BlendTask.prototype.defineThemeDescriptorTasks = function()
});
});
}, this);
}
};
function cibDataFromTopLevelObjects(objects)
{
@@ -232,4 +232,4 @@ exports.blend = function(aName, aFunction)
{
// No .apply necessary because the parameters aren't variable.
return BlendTask.defineTask(aName, aFunction);
}
};
+1 -2
View File
@@ -371,8 +371,7 @@ function pngcrushDirectory(directory) {
var pngs = directoryPath.glob("**/*.png");
system.stderr.print("Running pngcrush on " + pngs.length + " pngs:");
pngs.forEach(function(dst) {
var dstPath = directoryPath.join(dst);
pngs.forEach(function(dstPath) {
var tmpPath = FILE.path(dstPath+".tmp");
var p = OS.popen(["pngcrush", "-rem", "alla", "-reduce", /*"-brute",*/ dstPath, tmpPath]);
+7 -6
View File
@@ -2,19 +2,19 @@
@import <AppKit/AppKit.j>
function findCibClassDependencies(cibPath) {
var cib = [[CPCib alloc] initWithContentsOfURL:cibPath];
var cib = [[CPCib alloc] initWithContentsOfURL:cibPath],
dependencies = {},
CPClassFromStringOriginal = CPClassFromString;
var dependencies = {};
var CPClassFromStringOriginal = CPClassFromString;
CPClassFromString = function(aClassName) {
CPClassFromString = function(aClassName)
{
var result = CPClassFromStringOriginal(aClassName);
// print("CPClassFromString: " + Array.prototype.slice.call(arguments) + " => " + result);
dependencies[aClassName] = true;
return result;
}
};
// make sure CPApp is init'd
[CPApplication sharedApplication];
@@ -29,6 +29,7 @@ function findCibClassDependencies(cibPath) {
return Object.keys(dependencies);
}
// this is copied from CPCib's "instantiateCibWithExternalNameTable:"
@implementation CPCib (Press)
+1 -1
View File
@@ -9,4 +9,4 @@ exports.fontinfo = function(name, size)
return JSON.parse(p.stdout.read());
else
return null;
}
};
+29 -26
View File
@@ -21,15 +21,15 @@ ObjectiveJRuntimeAnalyzer = function(rootPath)
_OBJJ.Executable.prototype.path = function() {
var url = this.URL();
return url ? url.absoluteURL().path() : null;
}
};
_OBJJ.FileDependency.prototype.path = function() {
var url = this.URL();
return url ? url.path() : null;
}
};
this.context.global.CFBundle.prototype.executablePath = function() {
var url = this.executableURL();
return url ? url.absoluteURL().path() : null;
}
};
this.require("cappuccino/objj-flatten-additions");
@@ -42,16 +42,16 @@ ObjectiveJRuntimeAnalyzer = function(rootPath)
var path = new CFURL(aURL, this.rootURL).absoluteURL().path();
requestedURLs[path] = true;
return _lookupCachedRequest.apply(null, arguments);
}
}
};
};
ObjectiveJRuntimeAnalyzer.prototype.setIncludePaths = function(includePaths) {
this.context.global.OBJJ_INCLUDE_PATHS = includePaths;
}
};
ObjectiveJRuntimeAnalyzer.prototype.setEnvironments = function(environments) {
this.context.global.CFBundle.environments = function() { return environments; };
}
};
ObjectiveJRuntimeAnalyzer.prototype.makeAbsoluteURL = function(/*CFURL|String*/ aURL)
{
@@ -59,7 +59,7 @@ ObjectiveJRuntimeAnalyzer.prototype.makeAbsoluteURL = function(/*CFURL|String*/
return aURL;
return new this.context.global.CFURL(aURL, this.mainBundleURL);
}
};
ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
{
@@ -103,7 +103,8 @@ ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
var _OBJJ = this.require("objective-j");
var _fileExecuterForURL = _OBJJ.Executable.fileExecuterForURL;
_OBJJ.Executable.fileExecuterForURL = function(/*CFURL*/ referenceURL) {
_OBJJ.Executable.fileExecuterForURL = function(/*CFURL*/ referenceURL)
{
referenceURL = self.makeAbsoluteURL(referenceURL);
var referencePath = referenceURL.absoluteURL().path()
var fileExecutor = _fileExecuterForURL.apply(this, arguments);
@@ -130,8 +131,8 @@ ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
currentFile = evaluatingPaths.pop();
};
}
}
};
};
ObjectiveJRuntimeAnalyzer.prototype.load = function(path)
{
@@ -142,13 +143,13 @@ ObjectiveJRuntimeAnalyzer.prototype.load = function(path)
});
})+")"
)(path);
}
};
ObjectiveJRuntimeAnalyzer.prototype.finishLoading = function(path)
{
// run the "event loop"
this.require('browser/timeout').serviceTimeouts();
}
};
ObjectiveJRuntimeAnalyzer.prototype.mapGlobalsToFiles = function()
{
@@ -164,7 +165,7 @@ ObjectiveJRuntimeAnalyzer.prototype.mapGlobalsToFiles = function()
(globals[globalName] = globals[globalName] || []).push(fileName);
}
return globals;
}
};
ObjectiveJRuntimeAnalyzer.prototype.mapFilesToGlobals = function()
{
@@ -177,7 +178,7 @@ ObjectiveJRuntimeAnalyzer.prototype.mapFilesToGlobals = function()
files[fileName][globalName] = true;
}
return files;
}
};
// this method resolves library imports and merges their recorded globals with the canonical
// file object for each file
@@ -197,7 +198,7 @@ ObjectiveJRuntimeAnalyzer.prototype.mergeLibraryImports = function()
delete this.files[relativePath];
}
}
}
};
// returns an executable for the import path, or null if none exists
ObjectiveJRuntimeAnalyzer.prototype.executableForImport = function(path, isLocal)
@@ -213,7 +214,7 @@ ObjectiveJRuntimeAnalyzer.prototype.executableForImport = function(path, isLocal
});
return fileExecutable;
}
};
/*
param context includes
@@ -313,7 +314,7 @@ ObjectiveJRuntimeAnalyzer.prototype.traverseDependencies = function(executable,
context.referencedFiles[path] = referencedFiles;
return context;
}
};
ObjectiveJRuntimeAnalyzer.prototype.checkImported = function(context, path, importedFiles) {
for (var importedFile in importedFiles)
@@ -330,7 +331,7 @@ ObjectiveJRuntimeAnalyzer.prototype.checkImported = function(context, path, impo
CPLog.error("Missing imported file: " + importedFile);
}
}
}
};
ObjectiveJRuntimeAnalyzer.prototype.checkReferenced = function(context, path, referencedFiles) {
for (var referencedFile in referencedFiles)
@@ -347,16 +348,17 @@ ObjectiveJRuntimeAnalyzer.prototype.checkReferenced = function(context, path, re
CPLog.error("Missing referenced file: " + referencedFile);
}
}
}
};
ObjectiveJRuntimeAnalyzer.prototype.fileExecutables = function() {
var _OBJJ = this.require("objective-j");
return _OBJJ.FileExecutablesForPaths;
}
};
// returns a unique list of tokens for a piece of code.
// ideally this should return identifiers only
function uniqueTokens(code) {
function uniqueTokens(code)
{
// FIXME: this breaks for indentifiers containing "$" since it's considered a distinct token by the lexer
var lexer = new OBJJ.Lexer(code, null);
@@ -374,7 +376,8 @@ function uniqueTokens(code) {
globalsToFiles (in): map from tokens to files which define those tokens
referencedFiles (out): map of required files (to map of tokens defined in that file)
*/
function markFilesReferencedByTokens(tokens, globalsToFiles, referencedFiles) {
function markFilesReferencedByTokens(tokens, globalsToFiles, referencedFiles)
{
tokens.forEach(function(token) {
if (globalsToFiles.hasOwnProperty(token))
{
@@ -427,14 +430,14 @@ function addMockBrowserEnvironment(scope)
if (!scope.Element)
scope.Element = function() {
this.style = {}
}
};
if (!scope.document)
scope.document = {
createElement : function() {
return new scope.Element();
}
}
};
}
// does a shallow copy of an object. if onlyList is true, it sets each property to "true" instead of the actual value
@@ -457,4 +460,4 @@ function diff(o)
for (var i in o.before)
if (o.deleted && !o.ignore[i] && typeof o.after[i] == "undefined")
o.deleted[i] = true;
}
}
+2 -2
View File
@@ -411,7 +411,7 @@
var selectorCompare = function selectorCompare(object1, object2, selector)
{
return [object1 performSelector:selector withObject:object2];
}
};
// sort using sort descriptors
var compareObjectsUsingDescriptors= function compareObjectsUsingDescriptors(lhs, rhs, descriptors)
@@ -424,4 +424,4 @@ var compareObjectsUsingDescriptors= function compareObjectsUsingDescriptors(lhs,
result = [descriptors[i++] compareObject:lhs withObject:rhs];
return result;
}
};
+5 -5
View File
@@ -145,7 +145,7 @@
return CPOrderedDescending;
else
return CPOrderedAscending;
}
};
return [_rangeEntries indexOfObject:anIndex inSortedRange:nil options:0 usingComparator:sortFunction];
}
@@ -814,17 +814,17 @@ var isEqual = function isEqual(a, b)
return YES;
return NO;
}
};
var makeRangeEntry = function makeRangeEntry(/*CPRange*/aRange, /*CPDictionary*/attributes)
{
return {range:aRange, attributes:[attributes copy]};
}
};
var copyRangeEntry = function copyRangeEntry(/*RangeEntry*/aRangeEntry)
{
return makeRangeEntry(CPCopyRange(aRangeEntry.range), [aRangeEntry.attributes copy]);
}
};
var splitRangeEntry = function splitRangeEntryAtIndex(/*RangeEntry*/aRangeEntry, /*unsigned*/anIndex)
{
@@ -837,4 +837,4 @@ var splitRangeEntry = function splitRangeEntryAtIndex(/*RangeEntry*/aRangeEntry,
newRangeEntry.attributes = [newRangeEntry.attributes copy];
return [aRangeEntry, newRangeEntry];
}
};
+2 -2
View File
@@ -890,7 +890,7 @@ var positionOfIndex = function(ranges, anIndex)
}
return CPNotFound;
}
};
var assumedPositionOfIndex = function(ranges, anIndex)
{
@@ -935,7 +935,7 @@ var assumedPositionOfIndex = function(ranges, anIndex)
}
return CPNotFound;
}
};
/*
new old method
+2 -2
View File
@@ -214,7 +214,7 @@ var _changeKindForSetMutationKind = function(mutationKind)
case CPKeyValueIntersectSetMutation: return CPKeyValueChangeRemoval;
case CPKeyValueSetSetMutation: return CPKeyValueChangeReplacement;
}
}
};
var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld,
DependentKeysKey = "$KVODEPENDENT",
@@ -1139,7 +1139,7 @@ var _CPKVOInfoMake = function _CPKVOInfoMake(anObserver, theOptions, aContext, a
context: aContext,
forwarder: aForwarder
};
}
};
@import "CPArray+KVO.j"
@import "CPSet+KVO.j"
+1 -1
View File
@@ -597,4 +597,4 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional)
}
return [CPDictionary dictionaryWithObject:UID forKey:_CPKeyedArchiverUIDKey];
}
};
+1 -1
View File
@@ -541,4 +541,4 @@ var _CPKeyedUnarchiverDecodeObjectAtIndex = function(self, anIndex)
object = [object JSObject];
return object;
}
};
+1 -1
View File
@@ -171,7 +171,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
{
[self._unnamedRegistry postNotification:aNotification];
[[self._namedRegistries objectForKey:[aNotification name]] postNotification:aNotification];
}
};
/*
Mapping of Notification Name to listening object/selector.
@@ -587,4 +587,4 @@ String.prototype.escapeForRegExp = function()
}
return result;
}
};
+1 -1
View File
@@ -233,7 +233,7 @@ var CPCompoundPredicateType;
if (self === anObject)
return YES;
if (object.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]])
if (anObject.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]])
return NO;
return YES;
+1 -1
View File
@@ -968,7 +968,7 @@ function(newValue)\
var CPRaiseParseError = function CPRaiseParseError(aScanner, target)
{
[CPException raise:CPInvalidArgumentException reason:@"unable to parse " + target + " at index " + [aScanner scanLocation]];
}
};
@import "CPCompoundPredicate.j"
@import "CPComparisonPredicate.j"
+22 -9
View File
@@ -9,10 +9,9 @@
@import "CPSet.j"
@implementation CPMutableSet : CPSet
/*
/*!
Returns an initialized set with a given initial capacity.
@param aCapacity, only present for compatability
*/
@@ -21,7 +20,7 @@
return [self init];
}
/*
/*!
Creates and returns a set with a given initial capacity.
@param aCapacity, only present for compatability
*/
@@ -30,7 +29,10 @@
return [[self alloc] initWithCapacity:aCapacity];
}
- (void)filterUsingPredicate:(CPPredicate)aPredicate
/*!
Returns a set filtered using a given predicate.
@prarm aPredicate a CPPredicate object used to filter the objects in the set.
*/- (void)filterUsingPredicate:(CPPredicate)aPredicate
{
var object,
objectEnumerator = [self objectEnumerator];
@@ -40,11 +42,19 @@
[self removeObject:object];
}
/*!
Removes an object from the set.
@param anObject the object to remove from the set. If the object is not in the set, the method will not modify the set.
*/
- (void)removeObject:(id)anObject
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
Removes an array of objects from the set.
@param anArray an array of object to remove from the set.
*/
- (void)removeObjectsInArray:(CPArray)anArray
{
var index = 0,
@@ -54,6 +64,9 @@
[self removeObject:[anArray objectAtIndex:index]];
}
/*!
Removes all the objects from the set.
*/
- (void)removeAllObjects
{
var object,
@@ -63,7 +76,7 @@
[self removeObject:object];
}
/*
/*!
Adds to the receiver each object contained in a given array that is not already a member.
@param array An array of objects to add to the receiver.
*/
@@ -75,7 +88,7 @@
[self addObject:objects[count]];
}
/*
/*!
Adds to the receiver each object contained in another given set
@param set The set of objects to add to the receiver.
*/
@@ -88,7 +101,7 @@
[self addObject:object];
}
/*
/*!
Removes from the receiver each object contained in another given set that is present in the receiver.
@param set The set of objects to remove from the receiver.
*/
@@ -101,7 +114,7 @@
[self removeObject:object];
}
/*
/*!
Removes from the receiver each object that isn't a member of another given set.
@param set The set with which to perform the intersection.
*/
@@ -121,7 +134,7 @@
[self removeObject:objectsToRemove[count]];
}
/*
/*!
Empties the receiver, then adds to the receiver each object contained in another given set.
@param set The set whose members replace the receiver's content.
*/
+66 -24
View File
@@ -29,6 +29,13 @@
@import "CPNumber.j"
@import "CPObject.j"
/*!
@class CPMutableSet
@ingroup Foundation
CPSet is a data structure for storing an an unordered collection of unique objects.
Sets have O(1) insertion/lookup/deletion time complexity.
*/
@implementation CPSet : CPObject
{
@@ -42,7 +49,7 @@
return [super alloc];
}
/*
/*!
Creates and returns an empty set.
*/
+ (id)set
@@ -50,7 +57,7 @@
return [[self alloc] init];
}
/*
/*!
Creates and returns a set containing a uniqued collection of those objects contained in a given array.
@param anArray array containing the objects to add to the new set. If the same object appears more than once objects, it is added only once to the returned set.
*/
@@ -59,7 +66,7 @@
return [[self alloc] initWithArray:anArray];
}
/*
/*!
Creates and returns a set that contains a single given object.
@param anObject The object to add to the new set.
*/
@@ -68,7 +75,7 @@
return [[self alloc] initWithObjects:anObject];
}
/*
/*!
Creates and returns a set containing a specified number of objects from a given array of objects.
@param objects A array of objects to add to the new set. If the same object appears more than once objects, it is added only once to the returned set.
@param count The number of objects from objects to add to the new set.
@@ -78,7 +85,7 @@
return [[self alloc] initWithObjects:objects count:count];
}
/*
/*!
Creates and returns a set containing the objects in a given argument list.
@param anObject The first object to add to the new set.
@param ... A comma-separated list of objects, ending with nil, to add to the new set. If the same object appears more than once objects, it is added only once to the returned set.
@@ -93,7 +100,7 @@
return objj_msgSend.apply(this, argumentsArray);
}
/*
/*!
Creates and returns a set containing the objects from another set.
@param aSet A set containing the objects to add to the new set.
*/
@@ -102,30 +109,42 @@
return [[self alloc] initWithSet:set];
}
/*!
Creates and returns a set by adding anObject.
@param anObject to add to the new set.
*/
- (id)setByAddingObject:(id)anObject
{
return [[self class] setWithArray:[[self allObjects] arrayByAddingObject:anObject]];
}
/*!
Creates and returns a set by adding the objects from another set.
@param aSet to add objects to add to the new set.
*/
- (id)setByAddingObjectsFromSet:(CPSet)aSet
{
return [self setByAddingObjectsFromArray:[aSet allObjects]];
}
/*!
Creates and returns a set by adding the objects from an array.
@param anArray with objects to add to a new set.
*/
- (id)setByAddingObjectsFromArray:(CPArray)anArray
{
return [[self class] setWithArray:[[self allObjects] arrayByAddingObjectsFromArray:anArray]];
}
/*
Basic initializer, returns an empty set
/*!
Basic initializer, returns an empty set.
*/
- (id)init
{
return [self initWithObjects:nil count:0];
}
/*
/*!
Initializes a newly allocated set with the objects that are contained in a given array.
@param array An array of objects to add to the new set. If the same object appears more than once in array, it is represented only once in the returned set.
*/
@@ -134,7 +153,7 @@
return [self initWithObjects:anArray count:[anArray count]];
}
/*
/*!
Initializes a newly allocated set with members taken from the specified list of objects.
@param anObject The first object to add to the new set.
@param ... A comma-separated list of objects, ending with nil, to add to the new set. If the same object appears more than once in the list, it is represented only once in the returned set.
@@ -151,6 +170,11 @@
return [self initWithObjects:Array.prototype.slice.call(arguments, 2, index) count:index - 2];
}
/*!
Creates and returns a set containing the objects from an array.
@param anArray An array containing the objects to add to the new set.
@param aCount the number of objects in anArray.
*/
- (id)initWithObjects:(CPArray)objects count:(CPUInteger)aCount
{
if (self === _CPSharedPlaceholderSet)
@@ -159,16 +183,19 @@
return [super init];
}
/*
/*!
Initializes a newly allocated set and adds to it objects from another given set.
@param aSet a set containing objects to add to the new set.
*/
- (id)initWithSet:(CPSet)aSet
{
return [self initWithArray:[aSet allObjects]];
}
/*
/*!
Initializes a newly allocated set and adds to it members of another given set. Only included for compatability.
@param aSet a set of objects to add to the new set.
@param shouldCopyItems a boolean value. If YES the objects would be copied, if NO the objects will not be copied.
*/
- (id)initWithSet:(CPSet)aSet copyItems:(BOOL)shouldCopyItems
{
@@ -178,7 +205,7 @@
return [self initWithSet:aSet];
}
/*
/*!
Returns the number of members in the receiver.
*/
- (CPUInteger)count
@@ -186,7 +213,7 @@
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*
/*!
Returns an array containing the receiver’s members, or an empty array if the receiver has no members.
*/
- (CPArray)allObjects
@@ -201,7 +228,7 @@
return objects;
}
/*
/*!
Returns one of the objects in the receiver, or nil if the receiver contains no objects.
*/
- (id)anyObject
@@ -209,7 +236,7 @@
return [[self objectEnumerator] nextObject];
}
/*
/*!
Returns a Boolean value that indicates whether a given object is present in the receiver.
@param anObject The object for which to test membership of the receiver.
*/
@@ -218,7 +245,11 @@
return [self member:anObject] !== nil;
}
- (void)filteredSetUsingPredicate:(CPPredicate)aPredicate
/*!
Returns a set filtered using a given predicate.
@prarm aPredicate a CPPredicate object used to filter the objects in the set.
*/
- (CPSet)filteredSetUsingPredicate:(CPPredicate)aPredicate
{
var objects = [],
object,
@@ -231,7 +262,7 @@
return [[[self class] alloc] initWithArray:objects];
}
/*
/*!
Sends to each object in the receiver a message specified by a given selector.
@param aSelector A selector that specifies the message to send to the members of the receiver. The method must not take any arguments. It should not have the side effect of modifying the receiver. This value must not be NULL.
*/
@@ -240,7 +271,7 @@
[self makeObjectsPerformSelector:aSelector withObjects:nil];
}
/*
/*!
Sends to each object in the receiver a message specified by a given selector.
@param aSelector A selector that specifies the message to send to the receiver's members. The method must take a single argument of type id. The method should not, as a side effect, modify the receiver. The value must not be NULL.
@param anObject The object to pass as an argument to the method specified by aSelector.
@@ -250,7 +281,7 @@
[self makeObjectsPerformSelector:aSelector withObjects:[anObject]];
}
/*
/*!
Sends to each object in the receiver a message specified by a given selector.
@param aSelector A selector that specifies the message to send to the receiver's members. The method must take a single argument of type id. The method should not, as a side effect, modify the receiver. The value must not be NULL.
@param objects The objects to pass as an argument to the method specified by aSelector.
@@ -268,7 +299,7 @@
}
}
/*
/*!
Determines whether the receiver contains an object equal to a given object, and returns that object if it is present.
@param anObject The object for which to test for membership of the receiver.
*/
@@ -277,11 +308,18 @@
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
Returns an object enumerator (CPEnumerator) for the receiver.
*/
- (CPEnumerator)objectEnumerator
{
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
Enumberates over the objects in a set using a given function.
@param aFunction a callback for each itteration, should be of the format: function(anObject).
*/
- (void)enumerateObjectsUsingBlock:(Function)aFunction
{
var object,
@@ -306,7 +344,7 @@
return [[[self class] alloc] initWithArray:objects];
}
/*
/*!
Returns a Boolean value that indicates whether every object in the receiver is also present in another given set.
@param set The set with which to compare the receiver.
*/
@@ -322,7 +360,7 @@
return YES;
}
/*
/*!
Returns a Boolean value that indicates whether at least one object in the receiver is also present in another given set.
@param set The set with which to compare the receiver.
*/
@@ -342,7 +380,7 @@
return NO;
}
/*
/*!
Compares the receiver to another set.
@param set The set with which to compare the receiver.
*/
@@ -351,6 +389,10 @@
return [self isEqual:aSet];
}
/*!
Returns YES if BOTH sets are a subset of the other.
@param aSet a set of objects
*/
- (BOOL)isEqual:(CPSet)aSet
{
// If both are subsets of each other, they are equal
+1 -1
View File
@@ -849,6 +849,6 @@ String.prototype.stripDiacritics = function()
}
return output;
}
};
String.prototype.isa = CPString;
+5 -5
View File
@@ -257,7 +257,7 @@ var _CPTimerBridgeTimer = function(codeOrFunction, aDelay, shouldRepeat, functio
CPTimersForTimeoutIDs[timeoutID] = [CPTimer scheduledTimerWithTimeInterval:aDelay / 1000 callback:theFunction repeats:shouldRepeat];
return timeoutID;
}
};
// Avoid "TypeError: Result of expression 'window' [undefined] is not an object" when running unit tests.
// We can't use a regular PLATFORM(DOM) check because that platform constant is not defined in Foundation.
@@ -266,7 +266,7 @@ if (typeof(window) !== 'undefined')
window.setTimeout = function(codeOrFunction, aDelay)
{
return _CPTimerBridgeTimer(codeOrFunction, aDelay, NO, Array.prototype.slice.apply(arguments, [2]));
}
};
window.clearTimeout = function(aTimeoutID)
{
@@ -276,15 +276,15 @@ if (typeof(window) !== 'undefined')
[timer invalidate];
CPTimersForTimeoutIDs[aTimeoutID] = nil;
}
};
window.setInterval = function(codeOrFunction, aDelay, functionArgs)
{
return _CPTimerBridgeTimer(codeOrFunction, aDelay, YES, Array.prototype.slice.apply(arguments, [2]));
}
};
window.clearInterval = function(aTimeoutID)
{
window.clearTimeout(aTimeoutID);
}
};
}
+1 -1
View File
@@ -190,7 +190,7 @@ var CPURLConnectionDelegate = nil;
{
_HTTPRequest.open([_request HTTPMethod], [[_request URL] absoluteString], YES);
_HTTPRequest.onreadystatechange = function() { [self _readyStateDidChange]; }
_HTTPRequest.onreadystatechange = function() { [self _readyStateDidChange]; };
var fields = [_request allHTTPHeaderFields],
key = nil,
+5 -5
View File
@@ -50,7 +50,7 @@ var setURLResourceValuesForKeysFromProperties = function(aURL, keys, properties)
[aURL setResourceValue:displayName forKey:CPURLNameKey];
[aURL setResourceValue:displayName forKey:CPURLLocalizedNameKey];
}
}
};
CPWebDAVManagerCollectionResourceType = 1;
CPWebDAVManagerNonCollectionResourceType = 0;
@@ -99,7 +99,7 @@ CPWebDAVManagerNonCollectionResourceType = 0;
}
return contents;
}
};
if (!aBlock)
return makeContents(aURL, [self PROPFIND:aURL properties:properties depth:1 block:nil]);
@@ -190,7 +190,7 @@ var XMLDocumentFromString = function(anXMLString)
}
return new DOMParser().parseFromString(anXMLString,"text/xml");
}
};
var parsePROPFINDResponse = function(anXMLString)
{
@@ -233,9 +233,9 @@ var parsePROPFINDResponse = function(anXMLString)
}
return propertiesForURLs;
}
};
var mapURLsAndProperties = function(/*CPDictionary*/ properties, /*CPURL*/ ignoredURL)
{
}
};
+2 -2
View File
@@ -106,7 +106,7 @@ function environmentFlags()
return environments.map(function(anEnvironment) {
return "-D" + anEnvironment.toUpperCase();
}).concat("-DENVIRONMENTS=" + JSON.stringify(environments));
}).concat("-DENVIRONMENTS=" + OS.enquote(JSON.stringify(environments)));
}
var SHRINKSAFE = require("minify/shrinksafe");
@@ -119,7 +119,7 @@ function gcc(inputFilePath, outputFilePath, flags, compress)
stream.print("Building... \0green(" + outputFilePath +"\0)");
// GCC preprocess the file.
var cmd = ["gcc", "-E", "-x", "c", "-P"].concat(flags, inputFilePath);
var cmd = ["gcc", "-E", "-x", "c", "-P"].concat(flags, inputFilePath).join(" ");
var gcc = OS.popen(cmd, { charset:"UTF-8" });
var contents = FILE.read("header.txt", { charset : "UTF-8" });
+4
View File
@@ -434,6 +434,10 @@
pred1 = [CPPredicate predicateWithFormat:@"$x CONTAINS 'a'"];
pred2 = [CPPredicate predicateWithFormat:@"$x CONTAINS 'a'"];
[self assert:pred1 equals:pred2];
pred1 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"];
pred2 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"];
[self assert:pred1 equals:pred2];
}
- (void)testProxyArrayFiltering
+71
View File
@@ -0,0 +1,71 @@
/*
* AppController.j
* CPBoxTest
*
* Created by You on January 13, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
@outlet CPBox box1;
}
- (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.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
}
- (IBAction)click:(id)sender
{
[box1 setFrameFromContentFrame:CPRectMake(30, 30, 100, 100)];
}
- (IBAction)click2:(id)sender
{
[box1 setFrameFromContentFrame:CPRectMake(30, 30, 300, 300)];
}
- (IBAction)change:(id)aSender
{
switch ([aSender title])
{
case @"CPAtTop":
pos = CPAtTop;
break;
case @"CPAtBottom":
pos = CPAtBottom;
break;
case @"CPAboveBottom":
pos = CPAboveBottom;
break;
case @"CPBelowBottom":
pos = CPBelowBottom;
break;
case @"CPAboveTop":
pos = CPAboveTop;
break;
case @"CPBelowTop":
pos = CPBelowTop;
break;
case @"CPNoTitle":
pos = CPNoTitle;
break;
}
[box1 setTitlePosition:pos];
}
@end
+10
View File
@@ -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>CPBox</string>
</dict>
</plist>
+94
View File
@@ -0,0 +1,94 @@
/*
* Jakefile
* CPBoxTest
*
* Created by You on January 13, 2012.
* Copyright 2012, Your Company 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 ("CPBoxTest", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "CPBoxTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPBoxTest");
task.setIdentifier("com.yourcompany.CPBoxTest");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPBoxTest");
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", ["CPBoxTest"], 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", "CPBoxTest", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "CPBoxTest", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "CPBoxTest"));
OS.system(["press", "-f", FILE.join("Build", "Release", "CPBoxTest"), FILE.join("Build", "Deployment", "CPBoxTest")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "CPBoxTest"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPBoxTest"), FILE.join("Build", "Desktop", "CPBoxTest", "CPBoxTest.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "CPBoxTest", "CPBoxTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPBoxTest"));
print("----------------------------");
}
@@ -0,0 +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;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;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;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;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;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;83E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;149E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;152E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;3;158E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;176E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;3;180E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;3;196E;D;K;6;CP$UIDd;3;197E;D;K;6;CP$UIDd;3;198E;D;K;6;CP$UIDd;3;199E;D;K;6;CP$UIDd;3;200E;D;K;6;CP$UIDd;3;201E;D;K;6;CP$UIDd;3;202E;D;K;6;CP$UIDd;3;203E;D;K;6;CP$UIDd;3;204E;D;K;6;CP$UIDd;3;205E;D;Line truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+103
View File
@@ -0,0 +1,103 @@
<!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
CPBox
Created by You on January 13, 2012.
Copyright 2012, Your Company 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>CPBoxTest</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);
</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 CPBoxTest...</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>
+77
View File
@@ -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
CPBoxTest
Created by You on January 13, 2012.
Copyright 2012, Your Company 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>CPBoxTest</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 CPBoxTest...</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>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPBoxTest
*
* Created by You on January 13, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -16,9 +16,9 @@ CPViewAnimationFadeOutEffect = "CPViewAnimationFadeOutEffect";
@implementation CPViewAnimationTransition : CPAnimation
{
CPArray _viewAnimations;
Function endListener;
BOOL _isAnimating;
CPArray _viewAnimations;
Function endListener;
BOOL _isAnimating;
}
// INSTANCE METHODS
@@ -57,14 +57,14 @@ CPViewAnimationFadeOutEffect = "CPViewAnimationFadeOutEffect";
var count = [_viewAnimations count];
for (var i = 0; i < count; i++)
{
var animation = [_viewAnimations objectAtIndex:i],
var animation = [_viewAnimations objectAtIndex:i],
target = [animation objectForKey:CPViewAnimationTargetKey];
[self _updateAnimationCurve:[self animationCurve] forView:target];
[self _updateAnimationDuration:[self duration] forView:target];
}
endListener = function(event){[self _animationDidEnd:_viewAnimations]};
endListener = function(event){[self _animationDidEnd:_viewAnimations]};
}
- (void)_updateTransitionPropertiesForView:(CPView)target
@@ -136,17 +136,17 @@ CPViewAnimationFadeOutEffect = "CPViewAnimationFadeOutEffect";
if (effect = [animation objectForKey:CPViewAnimationEffectKey])
{
var opacity;
switch (effect)
{
case CPViewAnimationFadeInEffect: opacity = 1;
break;
case CPViewAnimationFadeOutEffect: opacity = 0;
break;
default : opacity = 1;
}
var opacity;
switch (effect)
{
case CPViewAnimationFadeInEffect: opacity = 1;
break;
case CPViewAnimationFadeOutEffect: opacity = 0;
break;
default : opacity = 1;
}
[target setAlphaValue:opacity];
[target setAlphaValue:opacity];
}
[target setFrame:endFrame];
@@ -208,7 +208,7 @@ CPViewAnimationFadeOutEffect = "CPViewAnimationFadeOutEffect";
this.counter = null;
_isAnimating = NO;
while(count--)
while (count--)
{
var target = [viewAnimations[count] objectForKey:CPViewAnimationTargetKey];
target._DOMElement.style.removeProperty("-webkit-transition");
+5 -5
View File
@@ -251,7 +251,7 @@ div.contents > table {
}
td.indexkey {
font-family: Consolas, "Lucida Console";
font-family: Consolas, "Lucida Console", Courier, monospace;
padding: .25em 0 .25em .5em;
font-weight: bold;
border-bottom: 1px solid #C5CFE5;
@@ -284,7 +284,7 @@ table tr.memlist > td {
}
tr.memlist td {
font-family: Consolas, "Lucida Console";
font-family: Consolas, "Lucida Console", Courier, monospace;
padding: .25em 0;
border-bottom: 1px solid #eee;
}
@@ -423,7 +423,7 @@ hr.footer {
/* @group Member Descriptions */
table.memberdecls {
font-family: Consolas, "Lucida Console";
font-family: Consolas, "Lucida Console", Courier, monospace;
border-spacing: 0px;
padding: 0px;
}
@@ -493,7 +493,7 @@ table.memberdecls {
.memname {
white-space: nowrap;
font: bold 105% Consolas, "Lucida Console";
font: bold 105% Consolas, "Lucida Console", Courier, monospace;
margin: .25em 0 0 .25em;
}
@@ -562,7 +562,7 @@ dl.reflist dt {
}
.memdoc dl dd td em {
font-family: Consolas, "Lucida Console";
font-family: Consolas, "Lucida Console", Courier, monospace;
font-weight: bold;
white-space: nowrap;
}
@@ -91,7 +91,6 @@ def writeAccessors(className, ivars, sourceFile, interfaceFile)
return if accessorsMatches.length == 0
accessorsSource = ""
accessorsInterface = ""
# Create a CPSynthesizedAccessor category for the class with synthesized
# accessor methods for each @accessors declaration.
+3
View File
@@ -40,6 +40,9 @@
_borderWidth = [aCoder decodeFloatForKey:@"NSBorderWidth2"] || 1.0;
_contentMargin = [aCoder decodeSizeForKey:@"NSOffsets"];
_title = [[aCoder decodeObjectForKey:@"NSTitleCell"] objectValue] || @"";
_titlePosition = [aCoder decodeObjectForKey:@"NSTitlePosition"] || CPAtTop;
}
return self;
+1 -1
View File
@@ -87,4 +87,4 @@ FILE.listPaths = function(aPath)
paths[count] = FILE.join(aPath, paths[count]);
return paths;
}
};
+1 -1
View File
@@ -583,7 +583,7 @@ function readTheme(name, path)
// By default when we try to load the bundle it will use the CommonJS environment,
// but we want the Browser environment. So we override mostEligibleEnvironment().
themeBundle.mostEligibleEnvironment = function() { return "Browser"; }
themeBundle.mostEligibleEnvironment = function() { return "Browser"; };
themeBundle.load();
var keyedThemes = themeBundle.valueForInfoDictionaryKey("CPKeyedThemes");