Merge branch 'refs/heads/upstream'

This commit is contained in:
Aparajita Fishman
2013-01-12 09:11:48 +07:00
41 changed files with 4690 additions and 131 deletions
+22 -3
View File
@@ -310,11 +310,18 @@ function CPBrowserStyleProperty(aProperty)
break;
default:
var prefixes = ["Webkit", "Moz", "O", "ms"],
capProperty = [aProperty capitalizedString];
strippedProperty = aProperty.split('-').join(' '),
capProperty = [strippedProperty capitalizedString].split(' ').join('');
for (var i = 0; i < prefixes.length; i++)
{
if (prefixes[i] + capProperty in testElement.style)
// First check if the property is already valid without being formatted, otherwise try the capitalized property
if (prefixes[i] + aProperty in testElement.style)
{
r = prefixes[i] + aProperty;
break;
}
else if (prefixes[i] + capProperty in testElement.style)
{
r = prefixes[i] + capProperty;
break;
@@ -352,9 +359,21 @@ function CPBrowserCSSProperty(aProperty)
{
if (browserProperty.substring(0, prefix.length) == prefix)
{
return prefixes[prefix] + browserProperty.substring(prefix.length).toLowerCase();
var browserPropertyWithoutPrefix = browserProperty.substring(prefix.length),
parts = browserPropertyWithoutPrefix.match(/[A-Z][a-z]+/g);
// If there were any capitalized words in the browserProperty, insert a "-" between each one
if (parts && parts.length > 0)
browserPropertyWithoutPrefix = parts.join("-");
return prefixes[prefix] + browserPropertyWithoutPrefix.toLowerCase();
}
}
var parts = browserProperty.match(/[A-Z][a-z]+/g);
if (parts && parts.length > 0)
browserProperty = parts.join("-");
return browserProperty.toLowerCase();
}
+1 -1
View File
@@ -94,7 +94,7 @@
domain = "";
#if PLATFORM(DOM)
document.cookie = _cookieName+"="+value+expires+"; path=/"+domain;
document.cookie = _cookieName + "=" + value + expires + "; path=/" + domain;
#else
_cookieValue = value;
_expires = expires;
@@ -3,6 +3,8 @@
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*/
@import "CPPopUpButton.j"
var GRADIENT_START_COLOR = "#fcfcfc",
GRADIENT_END_COLOR = "#dfdfdf",
BORDER_COLOR = "#BDBDBD";
+7 -5
View File
@@ -115,13 +115,15 @@ CPSegmentSwitchTrackingMomentary = 2;
if (_selectedSegment >= _segments.length)
_selectedSegment = -1;
// Make space for/remove space used by dividers.
var thickness = [self currentValueForThemeAttribute:@"divider-thickness"],
delta = thickness * (dividersAfter - dividersBefore),
frame = [self frame];
frame = [self frame],
widthOfAllSegments = 0,
dividerExtraSpace = ([_segments count] - 1) * thickness;
if (delta)
[self setFrameSize:CGSizeMake(frame.size.width + delta, frame.size.height)];
for (var i = 0; i < [_segments count]; i++)
widthOfAllSegments += [_segments[i] width];
[self setFrameSize:CGSizeMake(widthOfAllSegments + dividerExtraSpace, frame.size.height)];
[self tileWithChangedSegment:0];
}
+21
View File
@@ -1,3 +1,24 @@
/*
* CPTreeNode.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPIndexPath.j>
+61 -52
View File
@@ -368,7 +368,7 @@ var CPWindowActionMessageKeys = [
var bundle = [CPBundle bundleForClass:[CPWindow class]];
CPWindowSavingImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"] size:CGSizeMake(16.0, 16.0)]
CPWindowSavingImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"] size:_CGSizeMake(16.0, 16.0)]
}
- (id)init
@@ -438,11 +438,11 @@ CPTexturedBackgroundWindowMask
[self setLevel:CPNormalWindowLevel];
_minSize = CGSizeMake(0.0, 0.0);
_maxSize = CGSizeMake(1000000.0, 1000000.0);
_minSize = _CGSizeMake(0.0, 0.0);
_maxSize = _CGSizeMake(1000000.0, 1000000.0);
// Create our border view which is the actual root of our view hierarchy.
_windowView = [[windowViewClass alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(_frame), CGRectGetHeight(_frame)) styleMask:aStyleMask];
_windowView = [[windowViewClass alloc] initWithFrame:_CGRectMake(0.0, 0.0, _CGRectGetWidth(_frame), _CGRectGetHeight(_frame)) styleMask:aStyleMask];
[_windowView _setWindow:self];
[_windowView setNextResponder:self];
@@ -450,7 +450,7 @@ CPTexturedBackgroundWindowMask
[self setMovableByWindowBackground:aStyleMask & CPHUDBackgroundWindowMask];
// Create a generic content view.
[self setContentView:[[CPView alloc] initWithFrame:CGRectMakeZero()]];
[self setContentView:[[CPView alloc] initWithFrame:_CGRectMakeZero()]];
[self setInitialFirstResponder:[self contentView]];
_firstResponder = self;
@@ -657,7 +657,7 @@ CPTexturedBackgroundWindowMask
_fullPlatformWindowSession = _CPWindowFullPlatformWindowSessionMake(_windowView, [self contentRectForFrameRect:[self frame]], [self hasShadow], [self level]);
var fullPlatformWindowViewClass = [[self class] _windowViewClassForFullPlatformWindowStyleMask:_styleMask],
windowView = [[fullPlatformWindowViewClass alloc] initWithFrame:CGRectMakeZero() styleMask:_styleMask];
windowView = [[fullPlatformWindowViewClass alloc] initWithFrame:_CGRectMakeZero() styleMask:_styleMask];
[self _setWindowView:windowView];
@@ -1088,7 +1088,7 @@ CPTexturedBackgroundWindowMask
if (_contentView)
[_contentView removeFromSuperview];
var bounds = CGRectMake(0.0, 0.0, CGRectGetWidth(_frame), CGRectGetHeight(_frame));
var bounds = _CGRectMake(0.0, 0.0, _CGRectGetWidth(_frame), _CGRectGetHeight(_frame));
// During init the initial first responder is set to the contentView
// if it hasn't changed in the mean time we need to update that reference
@@ -1152,12 +1152,12 @@ CPTexturedBackgroundWindowMask
*/
- (void)setMinSize:(CGSize)aSize
{
if (CGSizeEqualToSize(_minSize, aSize))
if (_CGSizeEqualToSize(_minSize, aSize))
return;
_minSize = CGSizeCreateCopy(aSize);
_minSize = _CGSizeMakeCopy(aSize);
var size = CGSizeMakeCopy([self frame].size),
var size = _CGSizeMakeCopy([self frame].size),
needsFrameChange = NO;
if (size.width < _minSize.width)
@@ -1192,12 +1192,12 @@ CPTexturedBackgroundWindowMask
*/
- (void)setMaxSize:(CGSize)aSize
{
if (CGSizeEqualToSize(_maxSize, aSize))
if (_CGSizeEqualToSize(_maxSize, aSize))
return;
_maxSize = CGSizeCreateCopy(aSize);
_maxSize = _CGSizeMakeCopy(aSize);
var size = CGSizeMakeCopy([self frame].size),
var size = _CGSizeMakeCopy([self frame].size),
needsFrameChange = NO;
if (size.width > _maxSize.width)
@@ -1253,8 +1253,8 @@ CPTexturedBackgroundWindowMask
{
var bounds = [_windowView bounds];
_shadowView = [[CPView alloc] initWithFrame:CGRectMake(-SHADOW_MARGIN_LEFT, -SHADOW_MARGIN_TOP + SHADOW_DISTANCE,
SHADOW_MARGIN_LEFT + CGRectGetWidth(bounds) + SHADOW_MARGIN_RIGHT, SHADOW_MARGIN_TOP + CGRectGetHeight(bounds) + SHADOW_MARGIN_BOTTOM)];
_shadowView = [[CPView alloc] initWithFrame:_CGRectMake(-SHADOW_MARGIN_LEFT, -SHADOW_MARGIN_TOP + SHADOW_DISTANCE,
SHADOW_MARGIN_LEFT + _CGRectGetWidth(bounds) + SHADOW_MARGIN_RIGHT, SHADOW_MARGIN_TOP + _CGRectGetHeight(bounds) + SHADOW_MARGIN_BOTTOM)];
if (!_CPWindowShadowColor)
{
@@ -1262,17 +1262,17 @@ CPTexturedBackgroundWindowMask
_CPWindowShadowColor = [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices:
[
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow0.png"] size:CGSizeMake(20.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow1.png"] size:CGSizeMake(1.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow2.png"] size:CGSizeMake(19.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow0.png"] size:_CGSizeMake(20.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow1.png"] size:_CGSizeMake(1.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow2.png"] size:_CGSizeMake(19.0, 19.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow3.png"] size:CGSizeMake(20.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow4.png"] size:CGSizeMake(1.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow5.png"] size:CGSizeMake(19.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow3.png"] size:_CGSizeMake(20.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow4.png"] size:_CGSizeMake(1.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow5.png"] size:_CGSizeMake(19.0, 1.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow6.png"] size:CGSizeMake(20.0, 18.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow7.png"] size:CGSizeMake(1.0, 18.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow8.png"] size:CGSizeMake(19.0, 18.0)]
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow6.png"] size:_CGSizeMake(20.0, 18.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow7.png"] size:_CGSizeMake(1.0, 18.0)],
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowShadow8.png"] size:_CGSizeMake(19.0, 18.0)]
]]];
}
@@ -1664,7 +1664,7 @@ CPTexturedBackgroundWindowMask
var size = [self frame].size,
containerSize = [CPPlatform isBrowser] ? [_platformWindow contentBounds].size : [[self screen] visibleFrame].size;
var origin = CGPointMake((containerSize.width - size.width) / 2.0, (containerSize.height - size.height) / 2.0);
var origin = _CGPointMake((containerSize.width - size.width) / 2.0, (containerSize.height - size.height) / 2.0);
if (origin.x < 0.0)
origin.x = 0.0;
@@ -1917,9 +1917,16 @@ CPTexturedBackgroundWindowMask
*/
- (BOOL)canBecomeKeyWindow
{
// In Cocoa only resizable or titled windows return YES here by default. But the main browser window in Cappuccino
// doesn't have these masks even that it's both titled and resizable, so we return YES when isFullPlatformWindow too.
return (_styleMask & CPTitledWindowMask) || (_styleMask & CPResizableWindowMask) || [self isFullPlatformWindow];
/*
In Cocoa only titled windows return YES here by default. But the main browser
window in Cappuccino doesn't have a title bar even that it's both titled and
resizable, so we return YES when isFullPlatformWindow too.
Note that Cocoa will return NO for a non-titled, resizable window. The Cocoa documention
says it will return YES if there is a "resize bar", but in practice
that is not the same as the resizable mask.
*/
return (_styleMask & CPTitledWindowMask) || [self isFullPlatformWindow];
}
/*!
@@ -2284,11 +2291,12 @@ CPTexturedBackgroundWindowMask
*/
- (BOOL)canBecomeMainWindow
{
// FIXME: Also check if we can resize and titlebar.
if ([self isVisible])
return YES;
return NO;
// Note that the Cocoa documentation says that this method returns YES if
// the window is visible and has a title bar or a "resize mechanism". It turns
// out a "resize mechanism" is not the same as having the resize mask set.
// In practice a window must have a title bar to become main, but we make
// an exception for a full platform window.
return ([self isVisible] && ((_styleMask & CPTitledWindowMask) || _isFullPlatformWindow));
}
/*!
@@ -2449,7 +2457,7 @@ CPTexturedBackgroundWindowMask
- (void)_noteToolbarChanged
{
var frame = CGRectMakeCopy([self frame]),
var frame = _CGRectMakeCopy([self frame]),
newFrame;
[_windowView noteToolbarChanged];
@@ -2458,7 +2466,7 @@ CPTexturedBackgroundWindowMask
newFrame = [_platformWindow visibleFrame];
else
{
newFrame = CGRectMakeCopy([self frame]);
newFrame = _CGRectMakeCopy([self frame]);
newFrame.origin = frame.origin;
}
@@ -2493,10 +2501,10 @@ CPTexturedBackgroundWindowMask
// Position the sheet above the contentRect.
var attachedSheet = [self attachedSheet];
var contentRect = [[self contentView] frame],
sheetFrame = CGRectMakeCopy([attachedSheet frame]);
sheetFrame = _CGRectMakeCopy([attachedSheet frame]);
sheetFrame.origin.y = CGRectGetMinY(_frame) + CGRectGetMinY(contentRect);
sheetFrame.origin.x = CGRectGetMinX(_frame) + FLOOR((CGRectGetWidth(_frame) - CGRectGetWidth(sheetFrame)) / 2.0);
sheetFrame.origin.y = _CGRectGetMinY(_frame) + _CGRectGetMinY(contentRect);
sheetFrame.origin.x = _CGRectGetMinX(_frame) + FLOOR((_CGRectGetWidth(_frame) - _CGRectGetWidth(sheetFrame)) / 2.0);
[attachedSheet setFrame:sheetFrame display:YES animate:NO];
}
@@ -2654,8 +2662,8 @@ CPTexturedBackgroundWindowMask
var originx = frame.origin.x + FLOOR((frame.size.width - sheetFrame.size.width) / 2),
originy = frame.origin.y + [[self contentView] frame].origin.y,
startFrame = CGRectMake(originx, originy, sheetFrame.size.width, 0),
endFrame = CGRectMake(originx, originy, sheetFrame.size.width, sheetFrame.size.height);
startFrame = _CGRectMake(originx, originy, sheetFrame.size.width, 0),
endFrame = _CGRectMake(originx, originy, sheetFrame.size.width, sheetFrame.size.height);
[[CPNotificationCenter defaultCenter] postNotificationName:CPWindowWillBeginSheetNotification object:self];
@@ -2688,7 +2696,7 @@ CPTexturedBackgroundWindowMask
{
var sheet = _sheetContext["sheet"],
startFrame = [sheet frame],
endFrame = CGRectMakeCopy(startFrame);
endFrame = _CGRectMakeCopy(startFrame);
if (_sheetContext["isOpening"])
{
@@ -3138,10 +3146,10 @@ var keyViewComparator = function(lhs, rhs, context)
return;
var frame = [_platformWindow contentBounds],
newFrame = CGRectMakeCopy(_frame),
dX = (CGRectGetWidth(frame) - aSize.width) /
newFrame = _CGRectMakeCopy(_frame),
dX = (_CGRectGetWidth(frame) - aSize.width) /
(((_autoresizingMask & CPWindowMinXMargin) ? 1 : 0) + (_autoresizingMask & CPWindowWidthSizable ? 1 : 0) + (_autoresizingMask & CPWindowMaxXMargin ? 1 : 0)),
dY = (CGRectGetHeight(frame) - aSize.height) /
dY = (_CGRectGetHeight(frame) - aSize.height) /
((_autoresizingMask & CPWindowMinYMargin ? 1 : 0) + (_autoresizingMask & CPWindowHeightSizable ? 1 : 0) + (_autoresizingMask & CPWindowMaxYMargin ? 1 : 0));
if (_autoresizingMask & CPWindowMinXMargin)
@@ -3288,7 +3296,7 @@ var keyViewComparator = function(lhs, rhs, context)
- (BOOL)containsPoint:(CGPoint)aPoint
{
return CGRectContainsPoint(_frame, aPoint);
return _CGRectContainsPoint(_frame, aPoint);
}
- (BOOL)_isValidMousePoint:(CGPoint)aPoint
@@ -3297,7 +3305,7 @@ var keyViewComparator = function(lhs, rhs, context)
// outside the window's frame for non-full platform windows.
var mouseFrame = (!_isFullPlatformWindow && (_styleMask & CPResizableWindowMask) && (CPWindowResizeStyle === CPWindowResizeStyleModern)) ? _CGRectInset(_frame, -CPWindowResizeSlop, -CPWindowResizeSlop) : _frame;
return CGRectContainsPoint(mouseFrame, aPoint);
return _CGRectContainsPoint(mouseFrame, aPoint);
}
@end
@@ -3361,8 +3369,8 @@ var interpolate = function(fromValue, toValue, progress)
{
_window = aWindow;
_targetFrame = CGRectMakeCopy(aTargetFrame);
_startFrame = CGRectMakeCopy([_window frame]);
_targetFrame = _CGRectMakeCopy(aTargetFrame);
_startFrame = _CGRectMakeCopy([_window frame]);
}
return self;
@@ -3384,10 +3392,11 @@ var interpolate = function(fromValue, toValue, progress)
if (value == 1.0)
_window._isAnimating = NO;
var newFrame = CGRectMake(interpolate(CGRectGetMinX(_startFrame), CGRectGetMinX(_targetFrame), value),
interpolate(CGRectGetMinY(_startFrame), CGRectGetMinY(_targetFrame), value),
interpolate(CGRectGetWidth(_startFrame), CGRectGetWidth(_targetFrame), value),
interpolate(CGRectGetHeight(_startFrame), CGRectGetHeight(_targetFrame), value));
var newFrame = _CGRectMake(
interpolate(_CGRectGetMinX(_startFrame), _CGRectGetMinX(_targetFrame), value),
interpolate(_CGRectGetMinY(_startFrame), _CGRectGetMinY(_targetFrame), value),
interpolate(_CGRectGetWidth(_startFrame), _CGRectGetWidth(_targetFrame), value),
interpolate(_CGRectGetHeight(_startFrame), _CGRectGetHeight(_targetFrame), value));
[_window setFrame:newFrame display:YES animate:NO];
}
+77 -31
View File
@@ -204,61 +204,107 @@ var _CPWindowViewResizeIndicatorImage = nil,
- (int)resizeRegionForPoint:(CGPoint)aPoint
{
/*
There are 8 possible resize rects, 1 for each side and 1 for each corner.
If the window is fixed width (minSize.width === maxSize.width), there
are 2 possible resize rects: top and bottom.
If the window is fixed height (minSize.height === maxSize.height), there
are 2 possible resize rects: left and right.
Otherwise there are 8 possible resize rects, 1 for each side and 1 for each corner.
The four corner rects are the same size, and the top/bottom and left/right
rects are the same size. So to save calculations, we can just create
3 rects and move them around to do hit testing. Start with the corners
and then do left/right and top/bottom.
*/
var frame = [[self window] frame],
var wind = [self window],
frame = [wind frame],
rect,
minSize = [wind minSize],
maxSize = [wind maxSize],
isFixedWidth = minSize.width === maxSize.width,
isFixedHeight = minSize.height === maxSize.height;
if (isFixedWidth)
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
frame.size.width + (CPWindowResizeSlop * 2),
CPWindowResizeSlop * 2);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTop;
rect.origin.y = _CGRectGetMaxY(frame) - CPWindowResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottom;
}
else if (isFixedHeight)
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
CPWindowResizeSlop * 2,
frame.size.height + (CPWindowResizeSlop * 2));
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionLeft;
rect.origin.x = _CGRectGetMaxX(frame) - CPWindowResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionRight;
}
else
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
_CPWindowViewCornerResizeRectWidth + CPWindowResizeSlop,
_CPWindowViewCornerResizeRectWidth + CPWindowResizeSlop);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTopLeft;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTopLeft;
rect.origin.x = _CGRectGetMaxX(frame) - _CPWindowViewCornerResizeRectWidth;
rect.origin.x = _CGRectGetMaxX(frame) - _CPWindowViewCornerResizeRectWidth;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTopRight;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTopRight;
rect.origin.y = _CGRectGetMaxY(frame) - _CPWindowViewCornerResizeRectWidth;
rect.origin.y = _CGRectGetMaxY(frame) - _CPWindowViewCornerResizeRectWidth;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomRight;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomRight;
rect.origin.x = frame.origin.x - CPWindowResizeSlop;
rect.origin.x = frame.origin.x - CPWindowResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomLeft;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomLeft;
rect = _CGRectMake(rect.origin.x,
frame.origin.y + _CPWindowViewCornerResizeRectWidth,
CPWindowResizeSlop * 2,
_CGRectGetHeight(frame) - (_CPWindowViewCornerResizeRectWidth * 2));
rect = _CGRectMake(rect.origin.x,
frame.origin.y + _CPWindowViewCornerResizeRectWidth,
CPWindowResizeSlop * 2,
_CGRectGetHeight(frame) - (_CPWindowViewCornerResizeRectWidth * 2));
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionLeft;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionLeft;
rect.origin.x = _CGRectGetMaxX(frame) - CPWindowResizeSlop;
rect.origin.x = _CGRectGetMaxX(frame) - CPWindowResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionRight;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionRight;
rect = _CGRectMake(frame.origin.x + _CPWindowViewCornerResizeRectWidth,
frame.origin.y - CPWindowResizeSlop,
_CGRectGetWidth(frame) - (_CPWindowViewCornerResizeRectWidth * 2),
CPWindowResizeSlop * 2);
rect = _CGRectMake(frame.origin.x + _CPWindowViewCornerResizeRectWidth,
frame.origin.y - CPWindowResizeSlop,
_CGRectGetWidth(frame) - (_CPWindowViewCornerResizeRectWidth * 2),
CPWindowResizeSlop * 2);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTop;
rect.origin.y = _CGRectGetMaxY(frame) - CPWindowResizeSlop;
rect.origin.y = _CGRectGetMaxY(frame) - CPWindowResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottom;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottom;
}
return _CPWindowViewResizeRegionNone;
}
+1
View File
@@ -76,6 +76,7 @@ CPWindowPositionFlexibleTop = 1 << 22;
if (_minSize)
[theWindow setMinSize:_minSize];
if (_maxSize)
[theWindow setMaxSize:_maxSize];
+8
View File
@@ -389,6 +389,14 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
return YES;
}
/*!
Normally untitled windows cannot become main, but popovers can.
*/
- (BOOL)canBecomeMainWindow
{
return [self isVisible];
}
/*!
Called when the window is losing focus.
*/
+1 -1
View File
@@ -197,7 +197,7 @@ var _CPToolTipHeight = 24.0,
- (void)showToolTip
{
var mousePosition = [[CPApp currentEvent] globalLocation],
nativeRect = [[[CPApp mainWindow] platformWindow] nativeContentRect];
nativeRect = [[CPPlatformWindow primaryPlatformWindow] nativeContentRect];
mousePosition.y += 20;
+8 -1
View File
@@ -375,7 +375,14 @@ var CPRunLoopLastNativeRunLoop = 0;
//initiate a new window.setTimeout if there are any timers
if (_nextTimerFireDatesForModes[aMode] !== nil)
_nativeTimersForModes[aMode] = window.setNativeTimeout(function() { _effectiveDate = nextFireDate; _nativeTimersForModes[aMode] = nil; ++CPRunLoopLastNativeRunLoop; [self limitDateForMode:aMode]; _effectiveDate = nil; }, MAX(0, [nextFireDate timeIntervalSinceNow] * 1000));
_nativeTimersForModes[aMode] = window.setNativeTimeout(function()
{
_effectiveDate = nextFireDate;
_nativeTimersForModes[aMode] = nil;
++CPRunLoopLastNativeRunLoop;
[self limitDateForMode:aMode];
_effectiveDate = nil;
}, MAX(0, [nextFireDate timeIntervalSinceNow] * 1000));
}
// Run loop performers
+16 -2
View File
@@ -245,13 +245,27 @@ var _CPTimerBridgeTimer = function(codeOrFunction, aDelay, shouldRepeat, functio
theFunction = nil;
if (typeof codeOrFunction === "string")
theFunction = function() { new Function(codeOrFunction)(); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; }
{
theFunction = function()
{
new Function(codeOrFunction)();
if (!shouldRepeat)
CPTimersForTimeoutIDs[timeoutID] = nil;
}
}
else
{
if (!functionArgs)
functionArgs = [];
theFunction = function() { codeOrFunction.apply(window, functionArgs); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; }
theFunction = function()
{
codeOrFunction.apply(window, functionArgs);
if (!shouldRepeat)
CPTimersForTimeoutIDs[timeoutID] = nil;
}
}
// A call such as setTimeout(f) is technically invalid but browsers seem to treat it as setTimeout(f, 0), so so will we.
+2 -2
View File
@@ -254,8 +254,8 @@ var CPURLURLStringKey = @"CPURLURLStringKey",
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeObject:_baseURL forKey:CPURLBaseURLKey];
[aCoder encodeObject:_string forKey:CPURLURLStringKey];
[aCoder encodeObject:self._baseURL forKey:CPURLBaseURLKey];
[aCoder encodeObject:self._string forKey:CPURLURLStringKey];
}
@end
+1
View File
@@ -250,6 +250,7 @@ var CPURLConnectionDelegate = nil;
{
var response = [[CPHTTPURLResponse alloc] initWithURL:URL];
[response _setStatusCode:statusCode];
[response _setAllResponseHeaders:_HTTPRequest.getAllResponseHeaders()];
[_delegate connection:self didReceiveResponse:response];
}
}
+42 -2
View File
@@ -72,11 +72,34 @@ URL
*/
@implementation CPHTTPURLResponse : CPURLResponse
{
int _statusCode;
int _statusCode;
CPString _allResponseHeaders;
CPDictionary _responseHeaders;
}
+ (CPDictionary)parseHTTPHeaders:(CPString)headersString
{
var r = [CPMutableDictionary dictionary];
if (headersString)
{
var headerLines = headersString.split('\r\n'),
count = headerLines.length;
while (count--)
{
var headerLine = headerLines[count],
index = headerLine.indexOf(': ');
if (index !== CPNotFound)
[r setValue:headerLine.substring(index + 2) forKey:headerLine.substring(0, index)];
}
}
return r;
}
/* @ignore */
- (id)_setStatusCode:(int)aStatusCode
- (void)_setStatusCode:(int)aStatusCode
{
_statusCode = aStatusCode;
}
@@ -89,4 +112,21 @@ URL
return _statusCode;
}
- (void)_setAllResponseHeaders:(CPString)responseHeadersString
{
_allResponseHeaders = responseHeadersString;
}
/*!
Return the HTTP response headers.
*/
- (CPDictionary)allHeaderFields
{
// Lazily parse the headers.
if (!_responseHeaders)
_responseHeaders = [[self class] parseHTTPHeaders:_allResponseHeaders];
return _responseHeaders;
}
@end
-1
View File
@@ -90,7 +90,6 @@ var globalResults = [];
- (void)testRunModalForWindow
{
var aWindow = [[CPWindow alloc] init];
[app runModalForWindow:aWindow];
[self assertTrue:[aWindow isKeyWindow] message:@"A window must be made key when it's run modally"];
+1 -1
View File
@@ -181,7 +181,7 @@
- (void)testTypeMasks
{
var button = [[CPButton alloc] initWithFrame:CGRectMakeZero()];
button = [[CPButton alloc] initWithFrame:CGRectMakeZero()];
// The default mask should be that of CPMomentaryPushInButton.
[self assert:CPPushInButtonMask | CPGrayButtonMask | CPBackgroundButtonMask equals:[button highlightsBy]];
+4 -3
View File
@@ -154,8 +154,9 @@
- (void)testTableColumn
{
var tableView = [CPTableView new],
tableColumn = [[CPTableColumn alloc] initWithIdentifier:"A Column"],
arrayController = [CPArrayController new];
tableColumn = [[CPTableColumn alloc] initWithIdentifier:"A Column"];
arrayController = [CPArrayController new];
[tableView addTableColumn:tableColumn];
@@ -401,4 +402,4 @@
return valueB;
}
@end
@end
+2 -1
View File
@@ -243,9 +243,10 @@
- (void)testContentBinding
{
var contentBindingTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"A"],
delegate = [ContentBindingTableDelegate new];
tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"A"];
[contentBindingTable addTableColumn:tableColumn];
[delegate setTester:self];
[contentBindingTable setDelegate:delegate];
+5 -4
View File
@@ -65,7 +65,7 @@
- (void)testDirectIVarObservation
{
var bob = [[PersonTester alloc] init];
bob = [[PersonTester alloc] init];
[bob addObserver:self forKeyPath:@"phoneNumber" options:nil context:@"testDirectIVarObservation"];
@@ -446,8 +446,9 @@
- (void)testSettersReplacedOnce
{
var bob = [[PersonTester alloc] init],
betty = [CPObject new];
var betty = [CPObject new];
bob = [[PersonTester alloc] init];
[bob addObserver:self forKeyPath:@"name" options:nil context:@"testSettersReplacedOnce"];
@@ -470,7 +471,7 @@
- (void)testNestedNotifications
{
var bob = [[PersonTester alloc] init];
bob = [[PersonTester alloc] init];
[bob willChangeValueForKey:@"name"];
[self assertTrue:bob._willChangeMessageCounter[@"name"] === 1];
-1
View File
@@ -4,7 +4,6 @@
@implementation CPSetTest : OJTestCase
{
CPSet set;
}
- (void)assertSet:(CPSet)aSet onlyHasObjects:(CPArray)objects
+22
View File
@@ -0,0 +1,22 @@
@import <Foundation/CPURLResponse.j>
@implementation CPURLConnectionTest : OJTestCase
{
}
- (void)testParseHTTPHeaders
{
var testHeader = "Server: gunicorn/0.17.1\r\nDate: Fri, 11 Jan 2013 10:32:43 GMT\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nVary: Accept, Cookie\r\nContent-Type: application/json; charset=utf-8\r\nCache-Control: no-cache\r\n",
parsed = [CPHTTPURLResponse parseHTTPHeaders:testHeader];
[self assert:@"gunicorn/0.17.1" equals:[parsed valueForKey:@"Server"]];
[self assert:@"Fri, 11 Jan 2013 10:32:43 GMT" equals:[parsed valueForKey:@"Date"]];
[self assert:@"close" equals:[parsed valueForKey:@"Connection"]];
[self assert:@"chunked" equals:[parsed valueForKey:@"Transfer-Encoding"]];
[self assert:@"Accept, Cookie" equals:[parsed valueForKey:@"Vary"]];
[self assert:@"application/json; charset=utf-8" equals:[parsed valueForKey:@"Content-Type"]];
[self assert:@"no-cache" equals:[parsed valueForKey:@"Cache-Control"]];
[self assert:7 equals:[[parsed allKeys] count]];
}
@end
File diff suppressed because one or more lines are too long
@@ -0,0 +1,59 @@
/*
* AppController.j
* CPSegmentedControlTest
*
* Created by You on January 4, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
@outlet CPSegmentedControl segmentedControl1;
@outlet CPSegmentedControl segmentedControl2;
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
}
- (void)awakeFromCib
{
[theWindow setFullPlatformWindow:YES];
}
- (IBAction)addSegment:(id)aSender
{
var n = [segmentedControl1 segmentCount];
[segmentedControl1 setSegmentCount:n + 1];
[segmentedControl1 setLabel:@"" + n + 1 forSegment:n];
[segmentedControl2 setSegmentCount:n + 1];
[segmentedControl2 setLabel:@"" + n + 1 forSegment:n];
}
- (IBAction)addSegmentWithFixedSize:(id)aSender
{
var n = [segmentedControl1 segmentCount];
[segmentedControl1 setSegmentCount:n + 1];
[segmentedControl1 setLabel:@"" + n + 1 forSegment:n];
[segmentedControl1 setWidth:100 forSegment:n];
[segmentedControl2 setSegmentCount:n + 1];
[segmentedControl2 setLabel:@"" + n + 1 forSegment:n];
[segmentedControl2 setWidth:100 forSegment:n];
}
- (IBAction)removeSegment:(id)aSender
{
var n = [segmentedControl1 segmentCount];
[segmentedControl1 setSegmentCount:n - 1];
[segmentedControl2 setSegmentCount:n - 1];
}
@end
@@ -0,0 +1,500 @@
<?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>archiveVersion</key>
<string>1</string>
<key>classes</key>
<dict/>
<key>objectVersion</key>
<string>46</string>
<key>objects</key>
<dict>
<key>031E4C438E885E73CAF8F095</key>
<dict>
<key>children</key>
<array>
<string>516D43C09BCF54EA7B027D03</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Sources</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>078D4BE08F1637A95D02423E</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.h</string>
<key>name</key>
<string>xcc_general_include.h</string>
<key>path</key>
<string>.XcodeSupport/xcc_general_include.h</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>32F240828F06C24BACC9C62B</key>
<dict>
<key>fileRef</key>
<string>B7B84A02A45ECE89FFB2D63E</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>516D43C09BCF54EA7B027D03</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>?</string>
<key>name</key>
<string>AppController.j</string>
<key>path</key>
<string>AppController.j</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>574D4419AEFA1A577855B344</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.h</string>
<key>name</key>
<string>_Users_Tonio_Desktop_CPSegmentedControlTest_AppController.h</string>
<key>path</key>
<string>.XcodeSupport/_Users_Tonio_Desktop_CPSegmentedControlTest_AppController.h</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>9EEC4488135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC44CB13574A0B00615446</string>
<string>9EEC4496135749D200615446</string>
<string>FC904786B1947C20F37E2DA1</string>
<string>031E4C438E885E73CAF8F095</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC448A135749D200615446</key>
<dict>
<key>attributes</key>
<dict>
<key>LastUpgradeCheck</key>
<string>0440</string>
<key>ORGANIZATIONNAME</key>
<string>280 North, Inc.</string>
</dict>
<key>buildConfigurationList</key>
<string>9EEC448D135749D200615446</string>
<key>compatibilityVersion</key>
<string>Xcode 3.2</string>
<key>developmentRegion</key>
<string>English</string>
<key>hasScannedForEncodings</key>
<string>0</string>
<key>isa</key>
<string>PBXProject</string>
<key>knownRegions</key>
<array>
<string>en</string>
</array>
<key>mainGroup</key>
<string>9EEC4488135749D200615446</string>
<key>productRefGroup</key>
<string>9EEC4494135749D200615446</string>
<key>projectDirPath</key>
<string></string>
<key>projectRoot</key>
<string></string>
<key>targets</key>
<array>
<string>9EEC4492135749D200615446</string>
</array>
</dict>
<key>9EEC448D135749D200615446</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>9EEC44C3135749D300615446</string>
<string>9EEC44C4135749D300615446</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>9EEC448F135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>32F240828F06C24BACC9C62B</string>
</array>
<key>isa</key>
<string>PBXSourcesBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4490135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>9EEC4498135749D200615446</string>
</array>
<key>isa</key>
<string>PBXFrameworksBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4491135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>9EEC44CC13574A0B00615446</string>
</array>
<key>isa</key>
<string>PBXResourcesBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4492135749D200615446</key>
<dict>
<key>buildConfigurationList</key>
<string>9EEC44C5135749D300615446</string>
<key>buildPhases</key>
<array>
<string>9EEC448F135749D200615446</string>
<string>9EEC4490135749D200615446</string>
<string>9EEC4491135749D200615446</string>
</array>
<key>buildRules</key>
<array/>
<key>dependencies</key>
<array/>
<key>isa</key>
<string>PBXNativeTarget</string>
<key>name</key>
<string>Another</string>
<key>productName</key>
<string>Another</string>
<key>productReference</key>
<string>9EEC4493135749D200615446</string>
<key>productType</key>
<string>com.apple.product-type.application</string>
</dict>
<key>9EEC4493135749D200615446</key>
<dict>
<key>explicitFileType</key>
<string>wrapper.application</string>
<key>includeInIndex</key>
<string>0</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>path</key>
<string>Another.app</string>
<key>sourceTree</key>
<string>BUILT_PRODUCTS_DIR</string>
</dict>
<key>9EEC4494135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC4493135749D200615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Products</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC4496135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC4497135749D200615446</string>
<string>9EEC4499135749D300615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Frameworks</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC4497135749D200615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>Cocoa.framework</string>
<key>path</key>
<string>System/Library/Frameworks/Cocoa.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC4498135749D200615446</key>
<dict>
<key>fileRef</key>
<string>9EEC4497135749D200615446</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>9EEC4499135749D300615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC449A135749D300615446</string>
<string>9EEC449B135749D300615446</string>
<string>9EEC449C135749D300615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Other Frameworks</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC449A135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>AppKit.framework</string>
<key>path</key>
<string>System/Library/Frameworks/AppKit.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC449B135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>CoreData.framework</string>
<key>path</key>
<string>System/Library/Frameworks/CoreData.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC449C135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>Foundation.framework</string>
<key>path</key>
<string>System/Library/Frameworks/Foundation.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC44C3135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ARCHS</key>
<string>$(ARCHS_STANDARD_32_64_BIT)</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_OPTIMIZATION_LEVEL</key>
<string>0</string>
<key>GCC_PREPROCESSOR_DEFINITIONS</key>
<string>DEBUG</string>
<key>GCC_SYMBOLS_PRIVATE_EXTERN</key>
<string>NO</string>
<key>GCC_VERSION</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.6</string>
<key>ONLY_ACTIVE_ARCH</key>
<string>YES</string>
<key>SDKROOT</key>
<string>macosx</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>9EEC44C4135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ARCHS</key>
<string>$(ARCHS_STANDARD_32_64_BIT)</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_VERSION</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.6</string>
<key>SDKROOT</key>
<string>macosx</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>9EEC44C5135749D300615446</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>9EEC44C6135749D300615446</string>
<string>9EEC44C7135749D300615446</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>9EEC44C6135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>COMBINE_HIDPI_IMAGES</key>
<string>YES</string>
<key>COPY_PHASE_STRIP</key>
<string>NO</string>
<key>GCC_DYNAMIC_NO_PIC</key>
<string>NO</string>
<key>GCC_ENABLE_OBJC_EXCEPTIONS</key>
<string>YES</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Another/Another-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>Another/Another-Info.plist</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>9EEC44C7135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>COMBINE_HIDPI_IMAGES</key>
<string>YES</string>
<key>COPY_PHASE_STRIP</key>
<string>YES</string>
<key>DEBUG_INFORMATION_FORMAT</key>
<string>dwarf-with-dsym</string>
<key>GCC_ENABLE_OBJC_EXCEPTIONS</key>
<string>YES</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Another/Another-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>Another/Another-Info.plist</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>9EEC44CB13574A0B00615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>folder</string>
<key>name</key>
<string>CappuccinoResources</string>
<key>path</key>
<string>Resources</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC44CC13574A0B00615446</key>
<dict>
<key>fileRef</key>
<string>9EEC44CB13574A0B00615446</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>B7B84A02A45ECE89FFB2D63E</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.objc</string>
<key>name</key>
<string>_Users_Tonio_Desktop_CPSegmentedControlTest_AppController.m</string>
<key>path</key>
<string>.XcodeSupport/_Users_Tonio_Desktop_CPSegmentedControlTest_AppController.m</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>FC904786B1947C20F37E2DA1</key>
<dict>
<key>children</key>
<array>
<string>078D4BE08F1637A95D02423E</string>
<string>574D4419AEFA1A577855B344</string>
<string>B7B84A02A45ECE89FFB2D63E</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Classes</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
</dict>
<key>rootObject</key>
<string>9EEC448A135749D200615446</string>
</dict>
</plist>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:CPSegmentedControlTest.xcodeproj">
</FileRef>
</Workspace>
@@ -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>CPSegmentedControlTest</string>
</dict>
</plist>
@@ -0,0 +1,94 @@
/*
* Jakefile
* CPSegmentedControlTest
*
* Created by You on January 4, 2013.
* Copyright 2013, 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 ("CPSegmentedControlTest", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "CPSegmentedControlTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPSegmentedControlTest");
task.setIdentifier("com.yourcompany.CPSegmentedControlTest");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPSegmentedControlTest");
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", ["CPSegmentedControlTest"], 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", "CPSegmentedControlTest", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "CPSegmentedControlTest", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "CPSegmentedControlTest"));
OS.system(["press", "-f", FILE.join("Build", "Release", "CPSegmentedControlTest"), FILE.join("Build", "Deployment", "CPSegmentedControlTest")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "CPSegmentedControlTest"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPSegmentedControlTest"), FILE.join("Build", "Desktop", "CPSegmentedControlTest", "CPSegmentedControlTest.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "CPSegmentedControlTest", "CPSegmentedControlTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPSegmentedControlTest"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,107 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
CPSegmentedControlTest
Created by You on January 4, 2013.
Copyright 2013, 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>CPSegmentedControlTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPSegmentedControlTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
CPSegmentedControlTest
Created by You on January 4, 2013.
Copyright 2013, 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>CPSegmentedControlTest</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 CPSegmentedControlTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPSegmentedControlTest
*
* Created by You on January 4, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
File diff suppressed because one or more lines are too long
@@ -61,6 +61,7 @@
<string key="NSFrame">{{211, 127}, {58, 17}}</string>
<reference key="NSSuperview" ref="498010630"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="659066666">
@@ -126,6 +127,7 @@
<string key="NSFrame">{{80, 86}, {163, 38}}</string>
<reference key="NSSuperview" ref="718842956"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -304,6 +306,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{80, 86}, {163, 38}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1531,6 +1534,178 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<string key="NSName">_NSMainMenu</string>
</object>
<object class="NSWindowTemplate" id="76259803">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{500, 551}, {322, 211}}</string>
<int key="NSWTFlags">1946158080</int>
<string key="NSWindowTitle">Resize Horizontally Only</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMaxSize">{7000, 211}</string>
<string key="NSWindowContentMinSize">{10, 211}</string>
<object class="NSView" key="NSWindowView" id="616027014">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMatrix" id="149375179">
<reference key="NSNextResponder" ref="616027014"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{80, 86}, {163, 38}}</string>
<reference key="NSSuperview" ref="616027014"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSNumRows">2</int>
<int key="NSNumCols">1</int>
<object class="NSMutableArray" key="NSCells">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButtonCell" id="767518330">
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Modern resize style</string>
<reference key="NSSupport" ref="971980961"/>
<reference key="NSControlView" ref="149375179"/>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<reference key="NSAlternateImage" ref="615197625"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<object class="NSButtonCell" id="209817942">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Legacy resize style</string>
<reference key="NSSupport" ref="971980961"/>
<reference key="NSControlView" ref="149375179"/>
<int key="NSTag">1</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
<string key="NSSize">{18, 18}</string>
<object class="NSMutableArray" key="NSReps">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
</object>
</object>
<reference key="NSColor" ref="183942557"/>
</object>
<reference key="NSAlternateImage" ref="615197625"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<string key="NSCellSize">{163, 18}</string>
<string key="NSIntercellSpacing">{4, 2}</string>
<int key="NSMatrixFlags">1151868928</int>
<string key="NSCellClass">NSActionCell</string>
<object class="NSButtonCell" key="NSProtoCell" id="1025434314">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Radio</string>
<reference key="NSSupport" ref="971980961"/>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
<string key="NSSize">{18, 18}</string>
<object class="NSMutableArray" key="NSReps">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
</object>
</object>
<reference key="NSColor" ref="183942557"/>
</object>
<reference key="NSAlternateImage" ref="615197625"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
<reference key="NSSelectedCell" ref="767518330"/>
<reference key="NSBackgroundColor" ref="74024457"/>
<reference key="NSCellBackgroundColor" ref="231639559"/>
<reference key="NSFont" ref="971980961"/>
<bool key="NSAutorecalculatesCellSize">YES</bool>
</object>
</object>
<string key="NSFrameSize">{322, 211}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="149375179"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{10, 233}</string>
<string key="NSMaxSize">{7000, 233}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -1567,6 +1742,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">610</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">resizeStyleDidChange:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="149375179"/>
</object>
<int key="connectionID">617</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2569,6 +2752,50 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="203617632"/>
<reference key="parent" ref="27132974"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">611</int>
<reference key="object" ref="76259803"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="616027014"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">612</int>
<reference key="object" ref="616027014"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="149375179"/>
</object>
<reference key="parent" ref="76259803"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">613</int>
<reference key="object" ref="149375179"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1025434314"/>
<reference ref="767518330"/>
<reference ref="209817942"/>
</object>
<reference key="parent" ref="616027014"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">614</int>
<reference key="object" ref="1025434314"/>
<reference key="parent" ref="149375179"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">615</int>
<reference key="object" ref="767518330"/>
<reference key="parent" ref="149375179"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">616</int>
<reference key="object" ref="209817942"/>
<reference key="parent" ref="149375179"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2721,6 +2948,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>607.IBPluginDependency</string>
<string>608.IBPluginDependency</string>
<string>609.IBPluginDependency</string>
<string>611.IBPluginDependency</string>
<string>611.IBWindowTemplateEditedContentRect</string>
<string>611.NSWindowTemplate.visibleAtLaunch</string>
<string>612.IBPluginDependency</string>
<string>613.IBPluginDependency</string>
<string>614.IBPluginDependency</string>
<string>615.IBPluginDependency</string>
<string>616.IBPluginDependency</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2870,6 +3105,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{303, 221}, {480, 360}}</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -2884,7 +3127,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">610</int>
<int key="maxID">617</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+3 -3
View File
@@ -22,13 +22,13 @@ function cleanup() {
var status;
status = OS.system(["capp", "gen", "ToolsTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"capp gen failed"];
[self assert:0 equals:status message:"capp gen failed"];
status = OS.system(["press", "-f", "ToolsTestApp", "PressTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"press failed"];
[self assert:0 equals:status message:"press failed"];
status = OS.system(["flatten", "-f", "ToolsTestApp", "FlattenTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"flatten failed"];
[self assert:0 equals:status message:"flatten failed"];
}
- (void)tearDown
+1 -1
View File
@@ -40,6 +40,7 @@ extern NSString * const XCCListeningStartNotification;
NSString *XCodeSupportProjectName;
NSString *XCodeTemplatePBXPath;
NSString *profilePath;
NSString *shellPath;
NSString *PBXModifierScriptPath;
NSURL *currentProjectURL;
NSURL *XCodeSupportProject;
@@ -99,4 +100,3 @@ extern NSString * const XCCListeningStartNotification;
- (NSDate*)lastModificationDateForPath:(NSString *)path;
@end
+35 -12
View File
@@ -73,21 +73,44 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
[self configure];
if([fm fileExistsAtPath:[@"~/.bash_profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bash_profile" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.profile" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.bashrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bashrc" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.zshrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.zshrc" stringByExpandingTildeInPath];
NSString* myShell = [[[NSProcessInfo processInfo] environment] objectForKey:@"SHELL"];
if (myShell)
{
shellPath = myShell;
}
else
{
NSAlert *alert = [NSAlert alertWithMessageText:@"Cannot find any valid profile file."
shellPath = @"/bin/bash";
}
if([shellPath isEqualToString:@"/bin/bash"])
{
if([fm fileExistsAtPath:[@"~/.bash_profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bash_profile" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.bashrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bashrc" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.profile" stringByExpandingTildeInPath];
else
profilePath = @"";
}
else if ([shellPath isEqualToString:@"/bin/zsh"])
{
if([fm fileExistsAtPath:[@"~/.zshrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.zshrc" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.profile" stringByExpandingTildeInPath];
else
profilePath = @"";
}
else
{
NSAlert *alert = [NSAlert alertWithMessageText:@"Shell not recognized."
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@"Neither ~/.bash_profile, ~/.profile, ~/.bashrc nor ~/.zshrc can be found.\n\nWithout this XcodeCapp cannot locate nib2cib.\n\nIf you notice any errors or strange behaviour, please look at the system log for messages and open a ticket."];
informativeTextWithFormat:@"You are running %@ as your shell, which is not supported. Please change your shell to either BASH or ZSH.", shellPath];
[alert runModal];
profilePath = @"";
}
@@ -415,8 +438,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
NSNumber *status;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/bash"];
[task setLaunchPath:shellPath];
[task setArguments: arguments];
[task setStandardOutput:[NSPipe pipe]];
[task launch];
+1 -1
View File
@@ -119,7 +119,7 @@ function main(args)
"\n@end\n";
ObjectiveCSource +=
"#import \"" + outputHeaderURL.absoluteString().replace(/\\/g,'/').replace( /.*\//, '' ) + "\"" +
"#import \"" + outputHeaderURL.absoluteString().replace(/\\/g,'/').replace(/(.*\/)/g, '') + "\"" +
"\n@implementation " + class_getName(aClass) +
"\n@end\n";
});
+1
View File
@@ -22,6 +22,7 @@
@import <AppKit/CPMenuItem.j>
@import "NSButton.j"
@import "NSEvent.j"
@import "NSMenu.j"