Merge branch 'refs/heads/master' into new-CFError-CPError

This commit is contained in:
Andrew Hankinson committed 2014-11-25 17:51:41 -05:00
commit 85d80e7ca0
44 files changed
+5774 -414

No files matched your search

+1
View File
@@ -16,3 +16,4 @@ xcuserdata/
Tests/Manual/**/*.xcodeproj
*.sublime-project
*.sublime-workspace
*.tm_properties
+3 -1
View File
@@ -986,7 +986,9 @@ var CPMainCibFile = @"CPMainCibFile",
return;
}
[aSheet._windowView _enableSheet:YES inWindow:aWindow];
if (![aWindow attachedSheet])
[aSheet._windowView _enableSheet:YES inWindow:aWindow];
[aWindow _attachSheet:aSheet modalDelegate:aModalDelegate didEndSelector:didEndSelector contextInfo:contextInfo];
}
+4
View File
@@ -133,7 +133,11 @@
- (void)setButtons:(CPArray)buttons
{
for (var i = [_buttons count] - 1; i >= 0; i--)
{
[_buttons[i] removeFromSuperview];
[_buttons[i] removeObserver:self forKeyPath:@"hidden"];
}
_buttons = [CPArray arrayWithArray:buttons];
+32 -7
View File
@@ -71,6 +71,8 @@ var CPComboBoxTextSubview = @"text",
BOOL _forceSelection;
BOOL _hasVerticalScroller;
CPString _selectedStringValue;
CGSize _intercellSpacing;
float _itemHeight;
BOOL _popUpButtonCausedResign;
}
@@ -140,7 +142,9 @@ var CPComboBoxTextSubview = @"text",
return;
_hasVerticalScroller = flag;
[[_listDelegate scrollView] setHasVerticalScroller:flag];
if (_listDelegate)
[[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
}
- (CGSize)intercellSpacing
@@ -150,7 +154,13 @@ var CPComboBoxTextSubview = @"text",
- (void)setIntercellSpacing:(CGSize)aSize
{
[[_listDelegate tableView] setIntercellSpacing:aSize];
if (_intercellSpacing && CGSizeEqualToSize(aSize, _intercellSpacing))
return;
_intercellSpacing = aSize;
if (_listDelegate)
[[_listDelegate tableView] setIntercellSpacing:_intercellSpacing];
}
- (BOOL)isButtonBordered
@@ -173,10 +183,18 @@ var CPComboBoxTextSubview = @"text",
- (void)setItemHeight:(float)itemHeight
{
[[_listDelegate tableView] setRowHeight:itemHeight];
if (itemHeight === _itemHeight)
return;
// FIXME: This shouldn't be necessary, but CPTableView does not tile after setRowHeight
[[_listDelegate tableView] reloadData];
_itemHeight = itemHeight;
if (_listDelegate)
{
[[_listDelegate tableView] setRowHeight:_itemHeight];
// FIXME: This shouldn't be necessary, but CPTableView does not tile after setRowHeight
[[_listDelegate tableView] reloadData];
}
}
- (int)numberOfVisibleItems
@@ -451,6 +469,9 @@ var CPComboBoxTextSubview = @"text",
// Apply our text style to the list
[_listDelegate setFont:[self font]];
[_listDelegate setAlignment:[self alignment]];
[[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
[[_listDelegate tableView] setIntercellSpacing:_intercellSpacing];
[[_listDelegate tableView] setRowHeight:_itemHeight];
}
- (int)indexOfItemWithObjectValue:(id)anObject
@@ -842,13 +863,17 @@ var CPComboBoxTextSubview = @"text",
- (void)setFont:(CPFont)aFont
{
[super setFont:aFont];
[_listDelegate setFont:aFont];
if (_listDelegate)
[_listDelegate setFont:aFont];
}
- (void)setAlignment:(CPTextAlignment)alignment
{
[super setAlignment:alignment];
[_listDelegate setAlignment:alignment];
if (_listDelegate)
[_listDelegate setAlignment:alignment];
}
#pragma mark Pop Up Button Layout
+4
View File
@@ -78,6 +78,8 @@ CPInputOnInputEventFeature = 30;
CPFileAPIFeature = 31;
CPAltEnterTextAreaFeature = 32;
/*
@@ -100,6 +102,7 @@ var USER_AGENT = "",
// default these features to true
PLATFORM_FEATURES[CPInputTypeCanBeChangedFeature] = YES;
PLATFORM_FEATURES[CPInputSetFontOutsideOfDOM] = YES;
PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = YES;
if (typeof window !== "undefined" && typeof window.navigator !== "undefined")
USER_AGENT = window.navigator.userAgent;
@@ -208,6 +211,7 @@ else if (USER_AGENT.indexOf("Gecko") !== -1) // Must follow KHTML check.
// Some day this might be fixed and should be version prefixed. No known fixed version yet.
PLATFORM_FEATURES[CPInput1PxLeftPadding] = YES;
PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = NO;
// This was supposed to be added in Firefox 22, but when testing with the latest beta as of 2013-06-14
// it does not seem to work. It seems to exhibit the CPJavaScriptPasteRequiresEditableTarget problem,
// and in addition doesn't seem to work with our native copy code either.
+11 -1
View File
@@ -260,10 +260,20 @@ var CPControlBlackColor = [CPColor blackColor];
maxSize = [self currentValueForThemeAttribute:@"max-size"];
if (minSize.width > 0)
{
frameSize.width = MAX(minSize.width, frameSize.width);
if (maxSize.width > 0)
frameSize.width = MIN(maxSize.width, frameSize.width);
}
if (minSize.height > 0)
frameSize.height = minSize.height;
{
frameSize.height = MAX(minSize.height, frameSize.height);
if (maxSize.height > 0)
frameSize.height = MIN(maxSize.height, frameSize.height);
}
[self setFrameSize:frameSize];
}
+1 -1
View File
@@ -410,7 +410,7 @@ _CPMenuWindowAttachedMenuBackgroundStyle = 2;
{
// Don't return indexes of items that aren't visible.
if (!CGRectContainsPoint([_menuClipView bounds], [_menuClipView convertPoint:aPoint fromView:nil]))
return NO;
return CPNotFound;
return [_menuView itemIndexAtPoint:[_menuView convertPoint:aPoint fromView:nil]];
}
+190 -130
View File
@@ -47,9 +47,10 @@ CPTextFieldRoundedBezel = 1; /*! A textfield bezel with rounded corne
CPTextFieldDidFocusNotification = @"CPTextFieldDidFocusNotification";
CPTextFieldDidBlurNotification = @"CPTextFieldDidBlurNotification";
var CPTextFieldDOMInputElement = nil,
CPTextFieldDOMPasswordInputElement = nil,
var CPTextFieldDOMCurrentElement = nil,
CPTextFieldDOMTextAreaElement = nil,
CPTextFieldDOMStandardInputElement = nil,
CPTextFieldDOMPasswordInputElement = nil,
CPTextFieldInputOwner = nil,
CPTextFieldTextDidChangeValue = nil,
CPTextFieldInputResigning = NO,
@@ -142,6 +143,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
// NS-style Display Properties
CPTextFieldBezelStyle _bezelStyle;
BOOL _isBordered;
BOOL _usesSingleLineMode;
BOOL _wraps;
BOOL _scrolls;
}
+ (Class)_binderClassForBinding:(CPString)aBinding
@@ -240,101 +244,112 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[self _sizeToControlSize];
}
#pragma mark -
#pragma mark -
#if PLATFORM(DOM)
- (DOMElement)_inputElement
{
if (!CPTextFieldDOMInputElement)
if (!CPTextFieldDOMTextAreaElement)
{
CPTextFieldDOMInputElement = document.createElement("input");
CPTextFieldDOMInputElement.style.position = "absolute";
CPTextFieldDOMInputElement.style.border = "0px";
CPTextFieldDOMInputElement.style.padding = "0px";
CPTextFieldDOMInputElement.style.margin = "0px";
CPTextFieldDOMInputElement.style.whiteSpace = "pre";
CPTextFieldDOMInputElement.style.background = "transparent";
CPTextFieldDOMInputElement.style.outline = "none";
CPTextFieldDOMTextAreaElement = document.createElement("textarea");
CPTextFieldDOMTextAreaElement.style.position = "absolute";
CPTextFieldDOMTextAreaElement.style.border = "0px";
CPTextFieldDOMTextAreaElement.style.padding = "0px";
CPTextFieldDOMTextAreaElement.style.margin = "0px";
CPTextFieldDOMTextAreaElement.style.background = "transparent";
CPTextFieldDOMTextAreaElement.style.outline = "none";
CPTextFieldDOMTextAreaElement.style.resize = "none";
CPTextFieldDOMTextAreaElement.style.overflow = "hidden";
CPTextFieldDOMTextAreaElement.spellcheck = NO;
}
if (!CPTextFieldDOMStandardInputElement)
{
CPTextFieldDOMStandardInputElement = document.createElement("input");
CPTextFieldDOMStandardInputElement.style.position = "absolute";
CPTextFieldDOMStandardInputElement.style.border = "0px";
CPTextFieldDOMStandardInputElement.style.padding = "0px";
CPTextFieldDOMStandardInputElement.style.margin = "0px";
CPTextFieldDOMStandardInputElement.style.whiteSpace = "pre";
CPTextFieldDOMStandardInputElement.style.background = "transparent";
CPTextFieldDOMStandardInputElement.style.outline = "none";
CPTextFieldDOMStandardInputElement.spellcheck = NO;
}
if (!CPTextFieldDOMPasswordInputElement)
{
CPTextFieldDOMPasswordInputElement = document.createElement("input");
CPTextFieldDOMPasswordInputElement.style.position = "absolute";
CPTextFieldDOMPasswordInputElement.style.border = "0px";
CPTextFieldDOMPasswordInputElement.style.padding = "0px";
CPTextFieldDOMPasswordInputElement.style.margin = "0px";
CPTextFieldDOMPasswordInputElement.style.whiteSpace = "pre";
CPTextFieldDOMPasswordInputElement.style.background = "transparent";
CPTextFieldDOMPasswordInputElement.style.outline = "none";
CPTextFieldDOMPasswordInputElement.type = "password";
CPTextFieldDOMPasswordInputElement.spellcheck = NO;
}
if (!CPTextFieldBlurHandler)
{
CPTextFieldBlurHandler = function(anEvent)
{
return CPTextFieldBlurFunction(
anEvent,
CPTextFieldInputOwner,
CPTextFieldInputOwner ? CPTextFieldInputOwner._DOMElement : nil,
CPTextFieldDOMInputElement,
CPTextFieldDOMCurrentElement,
CPTextFieldInputResigning,
@ref(CPTextFieldInputDidBlur));
};
}
if (CPFeatureIsCompatible(CPInputOnInputEventFeature))
if (!CPTextFieldInputFunction)
{
if (!CPFeatureIsCompatible(CPInputOnInputEventFeature))
return;
CPTextFieldInputFunction = function(anEvent)
{
CPTextFieldInputFunction = function(anEvent)
{
if (!CPTextFieldInputOwner)
return;
if (!CPTextFieldInputOwner)
return;
var cappEvent = [CPEvent keyEventWithType:CPKeyUp
location:CGPointMakeZero()
modifierFlags:0
timestamp:[CPEvent currentTimestamp]
windowNumber:[[CPApp keyWindow] windowNumber]
context:nil
characters:nil
charactersIgnoringModifiers:nil
isARepeat:NO
keyCode:nil];
var cappEvent = [CPEvent keyEventWithType:CPKeyUp
location:CGPointMakeZero()
modifierFlags:0
timestamp:[CPEvent currentTimestamp]
windowNumber:[[CPApp keyWindow] windowNumber]
context:nil
characters:nil
charactersIgnoringModifiers:nil
isARepeat:NO
keyCode:nil];
[CPTextFieldInputOwner keyUp:cappEvent];
[CPTextFieldInputOwner keyUp:cappEvent];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
CPTextFieldDOMInputElement.oninput = CPTextFieldInputFunction;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
// FIXME make this not onblur
CPTextFieldDOMInputElement.onblur = CPTextFieldBlurHandler;
CPTextFieldDOMPasswordInputElement.oninput = CPTextFieldInputFunction;
CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurHandler;
CPTextFieldDOMStandardInputElement = CPTextFieldDOMInputElement;
CPTextFieldDOMStandardInputElement.oninput = CPTextFieldInputFunction;
CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurHandler;
CPTextFieldDOMTextAreaElement.oninput = CPTextFieldInputFunction;
CPTextFieldDOMTextAreaElement.onblur = CPTextFieldBlurHandler;
}
if (CPFeatureIsCompatible(CPInputTypeCanBeChangedFeature))
{
if ([self isSecure])
CPTextFieldDOMInputElement.type = "password";
else
CPTextFieldDOMInputElement.type = "text";
return CPTextFieldDOMInputElement;
}
if ([self isSecure])
{
if (!CPTextFieldDOMPasswordInputElement)
{
CPTextFieldDOMPasswordInputElement = document.createElement("input");
CPTextFieldDOMPasswordInputElement.style.position = "absolute";
CPTextFieldDOMPasswordInputElement.style.border = "0px";
CPTextFieldDOMPasswordInputElement.style.padding = "0px";
CPTextFieldDOMPasswordInputElement.style.margin = "0px";
CPTextFieldDOMPasswordInputElement.style.whiteSpace = "pre";
CPTextFieldDOMPasswordInputElement.style.background = "transparent";
CPTextFieldDOMPasswordInputElement.style.outline = "none";
CPTextFieldDOMPasswordInputElement.type = "password";
CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurHandler;
}
CPTextFieldDOMInputElement = CPTextFieldDOMPasswordInputElement;
}
CPTextFieldDOMCurrentElement = CPTextFieldDOMPasswordInputElement;
else if (_usesSingleLineMode)
CPTextFieldDOMCurrentElement = CPTextFieldDOMStandardInputElement;
else
{
CPTextFieldDOMInputElement = CPTextFieldDOMStandardInputElement;
}
CPTextFieldDOMCurrentElement = CPTextFieldDOMTextAreaElement;
return CPTextFieldDOMInputElement;
return CPTextFieldDOMCurrentElement;
}
#endif
@@ -350,8 +365,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
_sendActionOn = CPKeyUpMask | CPKeyDownMask;
[self setValue:CPLeftTextAlignment forThemeAttribute:@"alignment"];
[self _updateCursor];
}
return self;
@@ -373,8 +386,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if (shouldBeEditable)
_isSelectable = YES;
[self _updateCursor];
if (_isEditable)
[self setThemeState:CPThemeStateEditable];
else
@@ -405,7 +416,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (void)setEnabled:(BOOL)shouldBeEnabled
{
[super setEnabled:shouldBeEnabled];
[self _updateCursor];
// We only allow first responder status if the field is enabled.
if (!shouldBeEnabled && [[self window] firstResponder] === self)
@@ -419,8 +429,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (void)setSelectable:(BOOL)aFlag
{
_isSelectable = aFlag;
[self _updateCursor];
}
/*!
@@ -560,6 +568,24 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
return _textFieldBackgroundColor;
}
/*! @ignore */
- (void)_setUsesSingleLineMode:(BOOL)aFlag
{
_usesSingleLineMode = aFlag;
}
/*! @ignore */
- (void)_setWraps:(BOOL)aFlag
{
_wraps = aFlag;
}
/*! @ignore */
- (void)_setScrolls:(BOOL)aFlag
{
_scrolls = aFlag;
}
/*! @ignore */
- (BOOL)acceptsFirstResponder
{
@@ -615,28 +641,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[self _setCSSStyleForInputElement];
var element = [self _inputElement],
font = [self currentValueForThemeAttribute:@"font"],
contentRect = [self contentRectForBounds:[self bounds]],
left = CGRectGetMinX(contentRect);
var element = [self _inputElement];
element.value = _stringValue;
// If the browser has a built in left padding, compensate for it. We need the input text to be exactly on top of the original text.
if (CPFeatureIsCompatible(CPInput1PxLeftPadding))
left -= 1;
element.style.left = left + "px";
element.style.width = CGRectGetWidth(contentRect) + "px";
element.style.verticalAlign = "top";
element.style.cursor = "auto";
_DOMElement.appendChild(element);
// The font change above doesn't work for some browsers if the element isn't already appendChild'ed.
if (!CPFeatureIsCompatible(CPInputSetFontOutsideOfDOM))
element.style.font = [font cssString];
CPTextFieldInputIsActive = YES;
if (document.attachEvent)
@@ -680,37 +688,18 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
*/
- (void)_setCSSStyleForInputElement
{
#if PLATFORM(DOM)
var element = [self _inputElement],
font = [self currentValueForThemeAttribute:@"font"],
lineHeight = [font defaultLineHeightForFont],
contentRect = [self contentRectForBounds:[self bounds]],
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"];
if ([self hasThemeState:CPTextFieldStatePlaceholder])
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder] cssString];
else
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPThemeStateEditing] cssString];
var element = [self _inputElement],
font = [self currentValueForThemeAttribute:@"font"],
lineHeight = [font defaultLineHeightForFont],
contentRect = [self contentRectForBounds:[self bounds]],
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"],
left = CGRectGetMinX(contentRect);
if (CPFeatureIsCompatible(CPInputSetFontOutsideOfDOM))
element.style.font = [font cssString];
element.style.zIndex = 1000;
switch ([self alignment])
{
case CPCenterTextAlignment:
element.style.textAlign = "center";
break;
case CPRightTextAlignment:
element.style.textAlign = "right";
break;
default:
element.style.textAlign = "left";
}
// If the browser has a built in left padding, compensate for it. We need the input text to be exactly on top of the original text.
if (CPFeatureIsCompatible(CPInput1PxLeftPadding))
left -= 1;
switch (verticalAlign)
{
@@ -731,12 +720,41 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
break;
}
element.style.top = topPoint;
element.style.height = ROUND(lineHeight) + "px";
element.style.lineHeight = ROUND(lineHeight) + "px";
if ([self hasThemeState:CPTextFieldStatePlaceholder])
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder] cssString];
else
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPThemeStateEditing] cssString];
switch ([self alignment])
{
case CPCenterTextAlignment:
element.style.textAlign = "center";
break;
case CPRightTextAlignment:
element.style.textAlign = "right";
break;
default:
element.style.textAlign = "left";
}
var isTextArea = element.nodeName.toUpperCase() == "TEXTAREA";
element.style.zIndex = 1000;
element.style.top = topPoint;
element.style.lineHeight = ROUND(lineHeight) + "px";
element.style.height = isTextArea ? CGRectGetHeight(contentRect) + "px" : ROUND(lineHeight) + "px";;
element.style.width = CGRectGetWidth(contentRect) + "px";
element.style.left = left + "px";
element.style.verticalAlign = "top";
element.style.cursor = "auto";
element.style.font = [font cssString];
if (isTextArea)
element.style.whiteSpace = _wraps ? "pre" : "nowrap";
#endif
}
/*! @ignore */
@@ -930,6 +948,12 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[self textDidChange:[CPNotification notificationWithName:CPControlTextDidChangeNotification object:self userInfo:nil]];
}
- (void)mouseMoved:(CPEvent)anEvent
{
[super mouseMoved:anEvent];
[self _updateCursorForEvent:anEvent];
}
- (void)mouseDown:(CPEvent)anEvent
{
// Don't track! (ever?)
@@ -1100,7 +1124,11 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
range = [self selectedRange],
element = [self _inputElement];
element.value = [element.value stringByReplacingCharactersInRange:[self selectedRange] withString:aCharacter];
// we don't need to do this in case of textarea
// or we will end up with 2 carriage returns
if (aCharacter != CPNewlineCharacter || element.nodeName.toUpperCase() != "TEXTAREA" || !CPFeatureIsCompatible(CPAltEnterTextAreaFeature))
element.value = [element.value stringByReplacingCharactersInRange:[self selectedRange] withString:aCharacter];
[self _setStringValue:element.value];
// NOTE: _stringValue is now the current input element value
@@ -1140,9 +1168,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[super textDidChange:note];
}
- (void)_updateCursor
- (void)_updateCursorForEvent:(CPEvent)anEvent
{
if ([self isEnabled] && ([self isSelectable] || [self isEditable]))
var frame = CGRectMakeCopy([self frame]),
contentInset = [self currentValueForThemeAttribute:@"content-inset"];
frame = [[self superview] convertRectToBase:CGRectInsetByInset(frame, contentInset)];
if ([self isEnabled] && ([self isSelectable] || [self isEditable]) && CGRectContainsPoint(frame, [anEvent locationInWindow]))
{
#if PLATFORM(DOM)
self._DOMElement.style.cursor = "text";
@@ -1940,7 +1973,11 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
CPTextFieldLineBreakModeKey = "CPTextFieldLineBreakModeKey",
CPTextFieldAlignmentKey = "CPTextFieldAlignmentKey",
CPTextFieldBackgroundColorKey = "CPTextFieldBackgroundColorKey",
CPTextFieldPlaceholderStringKey = "CPTextFieldPlaceholderStringKey";
CPTextFieldPlaceholderStringKey = "CPTextFieldPlaceholderStringKey",
CPTextFieldUsesSingleLineMode = "CPTextFieldUsesSingleLineMode",
CPTextFieldWraps = "CPTextFieldWraps",
CPTextFieldScrolls = "CPTextFieldScrolls";
@implementation CPTextField (CPCoding)
@@ -1967,7 +2004,9 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
[self setPlaceholderString:[aCoder decodeObjectForKey:CPTextFieldPlaceholderStringKey]];
[self _updateCursor];
[self _setUsesSingleLineMode:[aCoder decodeBoolForKey:CPTextFieldUsesSingleLineMode]];
[self _setWraps:[aCoder decodeBoolForKey:CPTextFieldWraps]];
[self _setScrolls:[aCoder decodeBoolForKey:CPTextFieldScrolls]];
}
return self;
@@ -1992,6 +2031,10 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
[aCoder encodeInt:[self alignment] forKey:CPTextFieldAlignmentKey];
[aCoder encodeObject:_placeholderString forKey:CPTextFieldPlaceholderStringKey];
[aCoder encodeBool:_usesSingleLineMode forKey:CPTextFieldUsesSingleLineMode];
[aCoder encodeBool:_wraps forKey:CPTextFieldWraps];
[aCoder encodeBool:_scrolls forKey:CPTextFieldScrolls];
}
@end
@@ -2022,6 +2065,23 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
[_source setObjectValue:aValue];
}
- (void)reverseSetValueFor:(CPString)aBinding
{
var destination = [_info objectForKey:CPObservedObjectKey],
keyPath = [_info objectForKey:CPObservedKeyPathKey],
options = [_info objectForKey:CPOptionsKey],
newValue = [self valueForBinding:aBinding],
value = [destination valueForKeyPath:keyPath];
if (CPIsControllerMarker(value) && newValue === nil) return;
newValue = [self reverseTransformValue:newValue withOptions:options];
[self suppressSpecificNotificationFromObject:destination keyPath:keyPath];
[destination setValue:newValue forKeyPath:keyPath];
[self unsuppressSpecificNotificationFromObject:destination keyPath:keyPath];
}
@end
@implementation _CPTextFieldPatternValueBinder : CPValueWithPatternBinding
+1
View File
@@ -210,6 +210,7 @@ var CPViewControllerCachedCibs;
[cibOwner viewControllerDidLoadCib:self];
_isLoading = NO;
_isLazy = NO;
[self _viewDidLoad];
}
else if (_isLazy)
+47 -10
View File
@@ -1846,6 +1846,12 @@ CPTexturedBackgroundWindowMask
if (_leftMouseDownView !== _firstResponder && [_leftMouseDownView acceptsFirstResponder])
[self makeFirstResponder:_leftMouseDownView];
var keyWindow = [CPApp keyWindow];
// This is only when we move from a platform to another one
if ([keyWindow platformWindow] != [self platformWindow])
[self makeKeyAndOrderFront:self];
[CPApp activateIgnoringOtherApps:YES];
var theWindow = [anEvent window],
@@ -2477,7 +2483,7 @@ CPTexturedBackgroundWindowMask
if (currentWindow === self || currentWindow === menuWindow)
continue;
if ([currentWindow isVisible] && [currentWindow canBecomeKeyWindow])
if ([currentWindow isVisible] && [currentWindow canBecomeKeyWindow] && [currentWindow platformWindow] == [keyWindow platformWindow])
{
[currentWindow makeKeyWindow];
break;
@@ -2679,6 +2685,23 @@ CPTexturedBackgroundWindowMask
[attachedSheet setFrame:sheetFrame display:YES animate:NO];
}
- (void)_previousSheetIsClosedNotification:(CPNotification)aNotification
{
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidEndSheetNotification object:self];
var sheet = _sheetContext[@"nextSheet"],
modalDelegate =_sheetContext[@"nextModalDelegate"],
endSelector = _sheetContext[@"nextEndSelector"],
contextInfo = _sheetContext[@"nextContextInfo"];
// Needed, because when the notification CPWindowDidEndSheetNotification is sent, the sheetContext is not up to date...
setTimeout(function()
{
[sheet._windowView _enableSheet:YES inWindow:self];
[self _attachSheet:sheet modalDelegate:modalDelegate didEndSelector:endSelector contextInfo:contextInfo];
}, 0)
}
/*
Starting point for sheet session, called from CPApplication beginSheet:
*/
@@ -2687,9 +2710,24 @@ CPTexturedBackgroundWindowMask
{
if (_sheetContext)
{
[CPException raise:CPInternalInconsistencyException
reason:@"The target window of beginSheet: already has a sheet, did you forget orderOut: ?"];
return;
// Here we wait till the current sheet is closed
if (_sheetContext[@"isClosing"])
{
// Here we save the next sheet to open
_sheetContext[@"nextSheet"] = aSheet;
_sheetContext[@"nextModalDelegate"] = aModalDelegate;
_sheetContext[@"nextEndSelector"] = didEndSelector;
_sheetContext[@"nextContextInfo"] = contextInfo;
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_previousSheetIsClosedNotification:) name:CPWindowDidEndSheetNotification object:self];
return;
}
else
{
[CPException raise:CPInternalInconsistencyException
reason:@"The target window of beginSheet: already has a sheet, did you forget orderOut: ?"];
return;
}
}
_sheetContext = {
@@ -2741,7 +2779,12 @@ CPTexturedBackgroundWindowMask
*/
- (void)_detachSheetWindow
{
if (_sheetContext["isClosing"])
return;
_sheetContext["isAttached"] = NO;
_sheetContext["isClosing"] = YES;
_sheetContext["opened"] = NO;
// A timer seems to be necessary for the animation to work correctly.
// It would be ideal to block here and spin the event loop, until attach is complete.
@@ -2874,12 +2917,6 @@ CPTexturedBackgroundWindowMask
return;
}
if (_sheetContext["isClosing"])
return;
_sheetContext["opened"] = NO;
_sheetContext["isClosing"] = YES;
// The parent window can be orderedOut to disable the sheet animate out, as in Cocoa
if ([self isVisible])
{
+1 -1
View File
@@ -1143,7 +1143,7 @@ var PreventScroll = true;
_mouseDownIsRightClick = button == 2 || (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && button == 0 && modifierFlags & CPControlKeyMask);
if (sourceElement.tagName === "INPUT" && sourceElement != _DOMFocusElement)
if ((sourceElement.tagName === "INPUT" || sourceElement.tagName === "TEXTAREA") && sourceElement != _DOMFocusElement)
{
if ([CPPlatform supportsDragAndDrop])
{
+2 -2
View File
@@ -1820,8 +1820,8 @@ var themedButtonValues = nil,
// The right border inset has to make room for the focus ring and popup button
[@"content-inset", CGInsetMake(8.0, 27.0, 7.0, 8.0), [CPThemeStateBezeled, CPComboBoxStateButtonBordered]],
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), [CPThemeStateBezeled, CPThemeStateEditing]],
[@"content-inset", CGInsetMake(8.0, 27.0, 7.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 27.0, 7.0, 8.0), [CPThemeStateBezeled, CPThemeStateEditing]],
[@"popup-button-size", CGSizeMake(21.0, 23.0), [CPThemeStateBezeled, CPComboBoxStateButtonBordered]],
[@"popup-button-size", CGSizeMake(17.0, 23.0), CPThemeStateBezeled],
+5 -5
View File
@@ -374,7 +374,7 @@ var themedButtonValues = nil,
[@"font", [CPFont boldSystemFontOfSize:11.0]],
[@"min-size", CGSizeMake(32.0, 20.0), CPThemeStateControlSizeSmall],
[@"max-size", CGSizeMake(1.0, 20.0), CPThemeStateControlSizeSmall],
[@"max-size", CGSizeMake(-1.0, 20.0), CPThemeStateControlSizeSmall],
[@"nib2cib-adjustment-frame", CGRectMake(3.0, 4.0, -6.0, 0.0), CPThemeStateControlSizeSmall],
// CPThemeStateControlSizeMini
@@ -386,7 +386,7 @@ var themedButtonValues = nil,
[@"min-size", CGSizeMake(32.0, 16.0), CPThemeStateControlSizeMini],
[@"max-size", CGSizeMake(-1.0, 16.0), CPThemeStateControlSizeMini],
[@"nib2cib-adjustment-frame", CGRectMake(1.0, 10.0, -3.0, 0.0), CPThemeStateControlSizeMini]
[@"nib2cib-adjustment-frame", CGRectMake(1.0, 10.0, -3.0, 0.0), CPThemeStateControlSizeMini]
];
[self registerThemeValues:themeValues forView:button];
@@ -1312,9 +1312,9 @@ var themedButtonValues = nil,
[@"bezel-inset", CGInsetMake(3.0, 5.0, 3.0, 4.0), [CPThemeStateBezeled, CPThemeStateDisabled]],
// The right border inset has to make room for the focus ring and popup button
[@"content-inset", CGInsetMake(9.0, 26.0, 7.0, 10.0), [CPThemeStateBezeled, CPComboBoxStateButtonBordered]],
[@"content-inset", CGInsetMake(9.0, 26.0, 7.0, 10.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(9.0, 24.0, 7.0, 10.0), [CPThemeStateBezeled, CPThemeStateEditing]],
[@"content-inset", CGInsetMake(9.0, 30.0, 7.0, 10.0), [CPThemeStateBezeled, CPComboBoxStateButtonBordered]],
[@"content-inset", CGInsetMake(9.0, 30.0, 7.0, 10.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(9.0, 28.0, 7.0, 10.0), [CPThemeStateBezeled, CPThemeStateEditing]],
[@"popup-button-size", CGSizeMake(21.0, 23.0), [CPThemeStateBezeled, CPComboBoxStateButtonBordered]],
[@"popup-button-size", CGSizeMake(17.0, 23.0), CPThemeStateBezeled],
+1 -1
View File
@@ -229,7 +229,7 @@ var ListColumnIdentifier = @"1";
[self listWillPopUp];
[_panel orderFront:nil];
[[aView window] addChildWindow:_panel ordered:CPWindowAbove];
}
#pragma mark Setting Display Attributes
+66 -9
View File
@@ -68,6 +68,8 @@ with (window)
// runs the objj repl or file provided in args
exports.run = function(args)
{
var multipleFiles = false;
if (args)
{
// we expect args to be in the format:
@@ -79,27 +81,82 @@ exports.run = function(args)
// copy the args since we're going to modify them
var argv = args.slice(1);
if (argv[0] === "--version")
if (argv[0] === "--version" || argv[0] === "-v")
{
print(exports.fullVersionString());
return;
}
while (argv.length && argv[0].indexOf('-I') === 0)
OBJJ_INCLUDE_PATHS.unshift.apply(OBJJ_INCLUDE_PATHS, argv.shift().substr(2).split(':'));
if (argv[0] === "--help" || argv[0] === "-h")
{
print("Usage (objj): " + args[0] + " [options] [--] files...");
print(" -v, --version print the current version of objj");
print(" -I, --objj-include-paths include a specific framework paths")
print(" -h, --help print this help");
print(" -m, --multifiles launch objj on several files")
return;
}
while (argv.length && argv[0].indexOf('-') === 0)
{
switch (argv[0])
{
case "-I":
argv.shift();
OBJJ_INCLUDE_PATHS.unshift.apply(OBJJ_INCLUDE_PATHS, argv.shift().split(":"));
break;
case "-m":
argv.shift();
multipleFiles = true;
break
}
}
}
if (argv && argv.length > 0)
{
var arg0 = argv.shift();
var mainFilePath = FILE.canonical(arg0);
var endCommand = false;
exports.make_narwhal_factory(mainFilePath)(require, { }, module, system, print);
while (argv.length > 0)
{
var arg0 = argv.shift();
var mainFilePath = FILE.canonical(arg0);
if (typeof main === "function")
main([arg0].concat(argv));
if (multipleFiles)
{
// This is needed to process every files passed in args
// Otherwise it would stop when an error is raised or we would like to objj the other given files
try
{
exports.make_narwhal_factory(mainFilePath)(require, { }, module, system, print);
}
catch(e)
{
print("\n" + e);
}
}
else
{
exports.make_narwhal_factory(mainFilePath)(require, { }, module, system, print);
}
require("browser/timeout").serviceTimeouts();
if (typeof main === "function")
{
main([arg0].concat(argv));
endCommand = true;
}
require("browser/timeout").serviceTimeouts();
if (!multipleFiles || endCommand)
break;
ObjectiveJ.Executable.resetCachedFileExecutableSearchers();
ObjectiveJ.StaticResource.resetRootResources();
ObjectiveJ.FileExecutable.resetFileExecutables();
objj_resetRegisterClasses();
}
}
else
{
@@ -35,7 +35,12 @@ function BundleTask(aName, anApplication)
{
Task.apply(this, arguments);
this.setEnvironments([environment.Browser, environment.CommonJS]);
var ignoreCommonJS = system.env["CAPP_IGNORE_COMMONJS_ENV"];
if (ignoreCommonJS && ignoreCommonJS.toLowerCase() == "no" || ignoreCommonJS == "1")
this.setEnvironments([environment.Browser]);
else
this.setEnvironments([environment.Browser, environment.CommonJS]);
this._author = null;
this._email = null;
@@ -399,9 +399,6 @@
_returnCode = 77;
[CPApp endSheet:[self window] returnCode:_returnCode];
if (orderOutAfter)
[[self window] orderOut:nil];
}
//
@@ -519,7 +516,15 @@
// test sheet chaining. it should be possible to start another sheet from didEndSheet,
// but only if we orderOut: the sheet before we called endSheet: This is how cocoa works too.
if (returnCode == 77)
{
var orderOutAfter = [_orderOutAfterCheckbox state];
if (orderOutAfter)
[[self window] orderOut:self];
[self runSheetForWindow:parentWindow];
}
//[self runAlertSheet:parentWindow];
}
@@ -0,0 +1,46 @@
/*
* AppController.j
* CPTextFielMultine
*
* Created by You on November 12, 2014.
* Copyright 2014, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
@outlet CPTextField field1;
@outlet CPTextField field2;
@outlet CPTextField field3;
@outlet CPWindow theWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var s = [field1 frameSize];
s.height = 83;
[field1 setFrameSize:s]
var s = [field2 frameSize];
s.height = 83;
[field2 setFrameSize:s]
var s = [field3 frameSize];
s.height = 83;
[field3 setFrameSize:s]
}
- (void)awakeFromCib
{
[theWindow setFullPlatformWindow:YES];
}
- (IBAction)actionSent:(id)aSender
{
CPLog.debug("action sent from " + aSender);
}
@end
@@ -0,0 +1,14 @@
<?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>CPTextFieldMultiline</string>
<key>CPBundleVersion</key>
<string>1.0</string>
<key>CPHumanReadableCopyright</key>
<string>Copyright © 2014, Your Company All rights reserved.</string>
</dict>
</plist>
+184
View File
@@ -0,0 +1,184 @@
/*
* Jakefile
* CPTextFielMultine
*
* Created by You on November 12, 2014.
* Copyright 2014, 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"),
projectName = "CPTextFielMultine";
app (projectName, function(task)
{
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
if (configuration === "Debug")
ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration);
task.setBuildIntermediatesPath(FILE.join("Build", "CPTextFielMultine.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPTextFielMultine");
task.setIdentifier("com.yourcompany.CPTextFielMultine");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPTextFielMultine");
task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", [projectName], function()
{
printResults(configuration);
});
task ("build", ["default"], function()
{
updateApplicationSize();
});
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", projectName, "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", projectName, "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", projectName));
OS.system(["press", "-f", FILE.join("Build", "Release", projectName), FILE.join("Build", "Deployment", projectName)]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", projectName));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", projectName), FILE.join("Build", "Desktop", projectName, "CPTextFielMultine.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", projectName, "CPTextFielMultine.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, projectName));
print("----------------------------");
}
function updateApplicationSize()
{
print("Calculating application file sizes...");
var contents = FILE.read(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), { charset:"UTF-8" }),
format = CFPropertyList.sniffedFormatOfString(contents),
plist = CFPropertyList.propertyListFromString(contents),
totalBytes = {executable:0, data:0, mhtml:0};
// Get the size of all framework executables and sprite data
var frameworksDir = "Frameworks";
if (ENV["CONFIGURATION"] === "Debug")
frameworksDir = FILE.join(frameworksDir, "Debug");
var frameworks = FILE.list(frameworksDir);
frameworks.forEach(function(framework)
{
if (framework !== "Source")
addBundleFileSizes(FILE.join(frameworksDir, framework), totalBytes);
});
// Read in the default theme name, and attempt to get its size
var themeName = plist.valueForKey("CPDefaultTheme") || "Aristo2",
themePath = nil;
if (themeName === "Aristo" || themeName === "Aristo2")
themePath = FILE.join(frameworksDir, "AppKit", "Resources", themeName + ".blend");
else
themePath = FILE.join("Frameworks", "Resources", themeName + ".blend");
if (FILE.isDirectory(themePath))
addBundleFileSizes(themePath, totalBytes);
// Add sizes for the app
addBundleFileSizes(FILE.join("Build", ENV["CONFIGURATION"], projectName), totalBytes);
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
var dict = new CFMutableDictionary();
dict.setValueForKey("executable", totalBytes.executable);
dict.setValueForKey("data", totalBytes.data);
dict.setValueForKey("mhtml", totalBytes.mhtml);
plist.setValueForKey("CPApplicationSize", dict);
FILE.write(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
}
function addBundleFileSizes(bundlePath, totalBytes)
{
var bundleName = FILE.basename(bundlePath),
environment = bundleName === "Foundation" ? "Objj" : "Browser",
bundlePath = FILE.join(bundlePath, environment + ".environment");
if (FILE.isDirectory(bundlePath))
{
var filename = bundleName + ".sj",
filePath = new FILE.Path(FILE.join(bundlePath, filename));
if (filePath.exists())
totalBytes.executable += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt"));
if (filePath.exists())
totalBytes.data += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt"));
if (filePath.exists())
totalBytes.mhtml += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt"));
if (filePath.exists())
totalBytes.mhtml += filePath.size();
}
}
@@ -0,0 +1,3 @@
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;18E;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;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;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;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;82E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;86E;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;152E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;158E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;176E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;180E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;Line truncated
line 2
line 3S;22;{{20, 215}, {268, 83}}S;19;{{0, 0}, {268, 83}}S;5;LabelS;22;{{21, 193}, {268, 17}}S;20;String value bindingS;22;{{20, 320}, {269, 17}}S;19;{{0, 0}, {269, 17}}S;17;Secure text fieldS;22;{{16, 363}, {276, 22}}S;19;{{0, 0}, {276, 22}}S;6;Line 1S;22;{{20, 344}, {268, 14}}S;19;{{0, 0}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;500E;E;S;40;You should not be able to alt+enter hereS;22;{{21, 396}, {268, 17}}S;22;{{20, 421}, {268, 22}}S;19;{{0, 0}, {268, 22}}S;23;{{298, 320}, {114, 17}}S;19;{{0, 0}, {114, 17}}S;19;Standard text fieldS;23;{{293, 363}, {276, 22}}S;23;{{298, 421}, {268, 22}}S;23;{{298, 396}, {268, 17}}S;23;{{298, 345}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;501E;E;S;36;You should be able to alt+enter hereS;22;{{572, 320}, {73, 17}}S;18;{{0, 0}, {73, 17}}S;9;Combo boxS;23;{{568, 364}, {276, 26}}S;19;{{0, 0}, {276, 26}}S;8;comboboxS;63;bezeled+button-bordered+controlSizeRegular+editable+placeholderD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;502E;D;K;6;CP$UIDd;3;503E;D;K;6;CP$UIDd;3;504E;E;E;d;1;5S;23;{{572, 345}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;505E;E;S;21;{{21, 471}, {73, 17}}S;12;Search fieldS;22;{{21, 496}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;506E;E;S;22;{{20, 518}, {268, 22}}S;11;searchfieldS;55;bezeled+controlSizeRegular+editable+placeholder+roundedd;3;254S;22;{{296, 471}, {67, 17}}S;18;{{0, 0}, {67, 17}}S;11;Token fieldS;23;{{292, 514}, {276, 22}}S;10;tokenfieldS;35;bezeled+controlSizeRegular+editableD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;23;{{296, 496}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;507E;E;S;23;{{572, 514}, {267, 29}}S;19;{{0, 0}, {267, 29}}D;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;508E;E;S;10;datePickerS;35;bezeled+bordered+controlSizeRegularD;K;10;$classnameS;6;CPDateK;8;$classesA;S;6;CPDateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;459E;K;13;CPDateTimeKeyD;K;6;CP$UIDd;3;371E;E;d;3;224D;K;6;$classD;K;6;CP$UIDd;3;459E;K;13;CPDateTimeKeyD;K;6;CP$UIDd;3;509E;E;D;K;6;$classD;K;6;CP$UIDd;3;459E;K;13;CPDateTimeKeyD;K;6;CP$UIDd;3;510E;E;S;22;{{572, 471}, {71, 17}}S;18;{{0, 0}, {71, 17}}S;11;Date pickerS;23;{{572, 496}, {268, 14}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;511E;E;S;23;{{298, 215}, {268, 83}}S;22;{{294, 99}, {276, 83}}S;22;{{298, 20}, {268, 17}}S;17;Wraps, multi lineS;22;{{299, 45}, {268, 49}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;512E;E;S;109;Can add a new line with alt+enter, if the line is bigger than the screen, it should automatically wrap aroundS;23;{{298, 193}, {268, 17}}S;22;{{572, 99}, {276, 83}}S;23;{{576, 215}, {268, 83}}S;22;{{576, 20}, {269, 17}}S;20;Scrolls, single lineS;22;{{577, 45}, {268, 49}}D;K;6;$classD;K;6;CP$UIDd;3;390E;K;4;nameD;K;6;CP$UIDd;3;495E;K;12;defaultValueD;K;6;CP$UIDd;3;496E;K;6;valuesD;K;6;CP$UIDd;3;513E;E;S;116;Cannot add a new line, if the line is bigger than the width of the field, it should continue, scrolling to the rightS;23;{{576, 193}, {268, 17}}S;13;AppControllerS;19;CPMutableDictionaryS;15;backgroundColorD;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;514E;E;D;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;515E;E;D;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;516E;E;D;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;517E;E;S;29;.Helvetica Neue DeskInterfaced;2;13D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;518E;D;K;6;CP$UIDd;3;518E;D;K;6;CP$UIDd;3;518E;D;K;6;CP$UIDd;3;324E;E;E;S;10;text-colorD;K;6;$classD;K;6;CP$UIDd;3;385E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;519E;E;D;K;6;$classD;K;6;CP$UIDd;3;261E;K;10;CP.objectsD;K;11;placeholderD;K;6;CP$UIDd;3;496E;K;6;normalD;K;6;CP$UIDd;3;520E;E;E;d;2;11D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;324E;D;K;6;CP$UIDd;3;324E;D;K;6;CP$UIDd;3;324E;D;K;6;CP$UIDd;3;324E;E;E;D;K;6;$classD;K;6;CP$UIDd;3;261E;K;10;CP.objectsD;K;11;placeholderD;K;6;CP$UIDd;3;496E;K;6;normalD;K;6;CP$UIDd;3;521E;E;E;D;K;6;$classD;K;6;CP$UIDd;3;261E;K;10;CP.objectsD;K;11;placeholderD;K;6;CP$UIDd;3;496E;K;6;normalD;K;6;CP$UIDd;3;522E;E;E;S;6;Item 1S;6;Item 2S;6;Item 3D;K;6;$classD;K;6;CP$UIDd;3;261E;K;10;CP.objectsD;K;11;placeholderD;K;6;CP$UIDd;3;496E;K;6;normalD;K;6;CP$UIDd;3;523E;E;E;D;K;6;$classD;K;6;CP$UIDd;3;261E;K;10;CP.objectsD;K;11;placeholderD;K;6;CPLine truncated
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
CPTextFielMultine
Created by You on November 12, 2014.
Copyright 2014, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<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>CPTextFielMultine</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
var progressBar = null;
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
{
percent = percent * 100;
if (!progressBar)
progressBar = document.getElementById("progress-bar");
if (progressBar)
progressBar.style.width = Math.min(percent, 100) + "%";
}
var loadingHTML =
'<div id="loading">' +
' <div id="loading-text">Loading...</div>' +
' <div id="progress-indicator">' +
' <span id="progress-bar" style="width:0%"></span>' +
' </div>' +
'</div>';
</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">
html, body, h1, p {
margin: 0;
padding: 0;
}
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
#cappuccino-body {
/* Position it absolutely so it will fill the height without content */
position: absolute;
top: 0;
bottom: 0;
width: 100%;
/* Put it at the bottom of the stack so it doesn't interfere with UI */
z-index: -1000;
}
#cappuccino-body .container {
display: table;
margin: 0 auto;
height: 100%;
}
#cappuccino-body .content {
display: table-cell;
height: 100%;
vertical-align: top;
}
#loading {
position: relative;
top: 35%;
}
#loading-text {
height: 1.5em;
color: #555;
font: normal bold 36px/36px Arial, sans-serif;
}
#progress-indicator {
padding: 0px;
height: 16px;
border: 5px solid #555;
border-radius: 18px;
background-color: white;
}
#progress-bar {
position: relative;
top: -1px;
left: -1px;
display: block;
height: 18px;
/* Compensate for moving the bar left 1px to overlap the indicator border */
border-right: 1px solid #555;
background-color: #555;
}
#noscript {
position: relative;
top: 35%;
padding: 1em 1.5em;
border: 5px solid #555;
border-radius: 16px;
background-color: white;
color: #555;
text-align: center;
font: bold 24px Arial, sans-serif;
}
#noscript a {
color: #98c0ff;
text-decoration: none;
}
</style>
</head>
<body>
<div id="cappuccino-body">
<div class="container">
<div class="content">
<script type="text/javascript">
document.write(loadingHTML);
</script>
</div>
</div>
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
<div class="container">
<div class="content">
<div id="noscript">
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
</div>
</div>
</div>
</noscript>
</div>
</body>
</html>
@@ -0,0 +1,161 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
CPTextFielMultine
Created by You on November 12, 2014.
Copyright 2014, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<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>CPTextFielMultine</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
var progressBar = null;
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
{
percent = percent * 100;
if (!progressBar)
progressBar = document.getElementById("progress-bar");
if (progressBar)
progressBar.style.width = Math.min(percent, 100) + "%";
}
var loadingHTML =
'<div id="loading">' +
' <div id="loading-text">Loading...</div>' +
' <div id="progress-indicator">' +
' <span id="progress-bar" style="width:0%"></span>' +
' </div>' +
'</div>';
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
html, body, h1, p {
margin: 0;
padding: 0;
}
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
#cappuccino-body {
/* Position it absolutely so it will fill the height without content */
position: absolute;
top: 0;
bottom: 0;
width: 100%;
/* Put it at the bottom of the stack so it doesn't interfere with UI */
z-index: -1000;
}
#cappuccino-body .container {
display: table;
margin: 0 auto;
height: 100%;
}
#cappuccino-body .content {
display: table-cell;
height: 100%;
vertical-align: top;
}
#loading {
position: relative;
top: 35%;
}
#loading-text {
height: 1.5em;
color: #555;
font: normal bold 36px/36px Arial, sans-serif;
}
#progress-indicator {
padding: 0px;
height: 16px;
border: 5px solid #555;
border-radius: 18px;
background-color: white;
}
#progress-bar {
position: relative;
top: -1px;
left: -1px;
display: block;
height: 18px;
/* Compensate for moving the bar left 1px to overlap the indicator border */
border-right: 1px solid #555;
background-color: #555;
}
#noscript {
position: relative;
top: 35%;
padding: 1em 1.5em;
border: 5px solid #555;
border-radius: 16px;
background-color: white;
color: #555;
text-align: center;
font: bold 24px Arial, sans-serif;
}
#noscript a {
color: #98c0ff;
text-decoration: none;
}
</style>
</head>
<body>
<div id="cappuccino-body">
<div class="container">
<div class="content">
<script type="text/javascript">
document.write(loadingHTML);
</script>
</div>
</div>
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
<div class="container">
<div class="content">
<div id="noscript">
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
</div>
</div>
</div>
</noscript>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPTextFielMultine
*
* Created by You on November 12, 2014.
* Copyright 2014, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
+9
View File
@@ -29,6 +29,15 @@ function cleanup() {
status = OS.system(["flatten", "-f", "ToolsTestApp", "FlattenTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:0 equals:status message:"flatten failed"];
status = OS.system(["objj", "ToolsTestApp/AppController.j"]);
[self assert:0 equals:status message:"objj failed"];
status = OS.system(["objj", "-m", "ToolsTestApp/AppController.j", "ToolsTestApp/AppController.j"]);
[self assert:0 equals:status message:"objj failed with several files"];
status = OS.system(["objj", "-I", "ToolsTestApp/Frameworks", "ToolsTestApp/AppController.j"]);
[self assert:0 equals:status message:"objj failed with options -I"];
}
- (void)tearDown
+1 -1
View File
@@ -2,6 +2,6 @@
require("../common.jake");
// nib2cib uses fontinfo and imagesize and capp uses nib2cib
subtasks(["fontinfo", "imagesize", "nib2cib", "capp", "capp_lint", "dump_theme", "NativeHost", "XcodeCapp"], ["build"/*, "clean", "clobber"*/]);
subtasks(["fontinfo", "imagesize", "nib2cib", "capp", "capp_lint", "dump_theme", "XcodeCapp"], ["build", /*"clean", "clobber"*/]);
subtasks(["fontinfo", "imagesize"], ["clean", "clobber"]);
-10
View File
@@ -1,10 +0,0 @@
#!/bin/sh
PACKAGE_BRANCH="nightly" jake push-packages
code=$?
if [ $code -ne 0 ]; then
echo "NIGHTLY BUILD PUSH FAILED ($code)"
exit $code
else
echo "NIGHTLY BUILD PUSH SUCCEEDED"
fi
-36
View File
@@ -1,36 +0,0 @@
#!/usr/bin/env bash
project_home="$(dirname "$PWD")"
extras="$project_home/ci-extra.sh"
export PATH="$HOME/narwhal/bin:$PATH"
export CAPP_AUTO_UPGRADE="yes"
export CAPP_BUILD="$project_home/build_incremental"
time jake CommonJS test-only
code=$?
if [ $code -ne 0 ]; then
echo "INCREMENTAL BUILD FAILED ($code)"
exit $code
else
echo "INCREMENTAL BUILD SUCCEEDED"
fi
export CAPP_BUILD="$project_home/build_clean"
rm -rf "$CAPP_BUILD"
time jake CommonJS test-only
code=$?
if [ $code -ne 0 ]; then
echo "CLEAN BUILD FAILED ($code)"
exit $code
else
echo "CLEAN BUILD SUCCEEDED"
fi
# run any additional ci commands not common to all branches (like nightly builds)
if [ -f "$extras" ]; then
source "$extras"
fi
exit 0
-6
View File
@@ -1,6 +0,0 @@
Project.configure do |project|
project.email_notifier.emails = ['objjbuild@googlegroups.com']
project.build_command = 'Tools/Scripts/ci.sh'
end
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
jake test-only
@@ -19,7 +19,7 @@
E164FE181720F44B00263CE3 /* parser.j in Resources */ = {isa = PBXBuildFile; fileRef = E164FE171720F44B00263CE3 /* parser.j */; };
E164FE1A1720F49A00263CE3 /* Growl Registration Ticket.growlRegDict in Resources */ = {isa = PBXBuildFile; fileRef = E164FE191720F49A00263CE3 /* Growl Registration Ticket.growlRegDict */; };
E164FE1F1720F51E00263CE3 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FE1D1720F50100263CE3 /* CoreServices.framework */; };
E164FE211720F55600263CE3 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FDF61720EBD600263CE3 /* Growl.framework */; };
E164FE211720F55600263CE3 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FDF61720EBD600263CE3 /* Growl.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
E164FE2F1721A34900263CE3 /* icon-active.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2C1721A34900263CE3 /* icon-active.png */; };
E164FE301721A34900263CE3 /* icon-inactive.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2D1721A34900263CE3 /* icon-inactive.png */; };
E164FE311721A34900263CE3 /* icon-working.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2E1721A34900263CE3 /* icon-working.png */; };
@@ -34,7 +34,7 @@
E171D25F173C168C00210893 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E171D25E173C168C00210893 /* Foundation.framework */; };
E171D262173C168C00210893 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E171D261173C168C00210893 /* main.m */; };
E171D26A173C1ADD00210893 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FE1D1720F50100263CE3 /* CoreServices.framework */; };
E171D26C173C1C8300210893 /* xcc in CopyFiles */ = {isa = PBXBuildFile; fileRef = E171D25D173C168C00210893 /* xcc */; };
E171D26C173C1C8300210893 /* xcc in CopyFiles */ = {isa = PBXBuildFile; fileRef = E171D25D173C168C00210893 /* xcc */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
E17A822D172700B90095CD83 /* XcodeCapp.iconset in Resources */ = {isa = PBXBuildFile; fileRef = E17A822C172700B90095CD83 /* XcodeCapp.iconset */; };
E17B55411732F57700809FFB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17B55401732F57700809FFB /* Quartz.framework */; };
E1A5594A172C5EE20088FB61 /* FindSourceFilesOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */; };
@@ -389,7 +389,7 @@
E164FDC71720E77100263CE3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = "Cappuccino Project";
};
buildConfigurationList = E164FDCA1720E77100263CE3 /* Build configuration list for PBXProject "XcodeCapp" */;
@@ -501,6 +501,7 @@
baseConfigurationReference = E164FDEF1720E7FA00263CE3 /* Debug.xcconfig */;
buildSettings = {
DSTROOT = /;
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
@@ -540,7 +541,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
@@ -576,7 +576,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
+18 -15
View File
@@ -138,21 +138,24 @@ AppController *SharedAppControllerInstance = nil;
- (void)registerDefaultPreferences
{
NSDictionary *appDefaults = @{
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactToInodeMod: @YES,
kDefaultXCCReopenLastProject: @YES,
kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES,
kDefaultXCCAutoOpenErrorsPanelOnCappLint: @YES,
kDefaultXCCAutoShowNotificationOnErrors: @YES,
kDefaultXCCAutoShowNotificationOnCappLint: @YES,
kDefaultXCCProjectHistory: [NSArray new],
kDefaultMaxRecentProjects: @20,
kDefaultLogLevel: [NSNumber numberWithInt:LOG_LEVEL_WARN],
kDefaultAutoOpenXcodeProject: @YES,
kDefaultUseSymlinkWhenCreatingProject: @YES
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactToInodeMod: @YES,
kDefaultXCCReopenLastProject: @YES,
kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES,
kDefaultXCCAutoOpenErrorsPanelOnCappLint: @YES,
kDefaultXCCAutoShowNotificationOnErrors: @YES,
kDefaultXCCAutoShowNotificationOnCappLint: @YES,
kDefaultXCCProjectHistory: [NSArray new],
kDefaultMaxRecentProjects: @20,
kDefaultLogLevel: [NSNumber numberWithInt:LOG_LEVEL_WARN],
kDefaultAutoOpenXcodeProject: @YES,
kDefaultUseSymlinkWhenCreatingProject: @YES,
kDefaultXCCUseDebugFrameworkWithObjj: @YES,
kDefaultXCCShouldProcessObjj: @YES,
kDefaultXCCPanelStyleUtility: @NO
};
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+2 -2
View File
@@ -21,11 +21,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1</string>
<string>3.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.1</string>
<string>3.2</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSUIElement</key>
@@ -45,7 +45,7 @@
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
NSDictionary *info = @{ @"projectId":self.projectId, @"path":self.sourcePath };
NSDictionary *info = @{ @"projectId":self.projectId, @"path":self.sourcePath};
[center postNotificationName:XCCConversionDidStartNotification object:self userInfo:info];
DDLogVerbose(@"Conversion started: %@", self.sourcePath);
@@ -74,7 +74,7 @@
self.xcc.parserPath,
self.projectPath,
self.sourcePath
];
];
notificationTitle = @"Objective-J source processed";
}
@@ -84,21 +84,21 @@
return;
[self.xcc performSelectorOnMainThread:@selector(computeIgnoredPaths) withObject:nil waitUntilDone:NO];
notificationTitle = @"Parsed .xcodecapp-ignore";
notificationMessage = @"Ignored paths updated";
}
// Run the task and get the response if needed
NSInteger status = 0;
if (arguments)
{
if (self.isCancelled)
return;
DDLogVerbose(@"Running processing task: %@", launchPath);
NSDictionary *taskResult = [self.xcc runTaskWithLaunchPath:launchPath
arguments:arguments
returnType:kTaskReturnTypeAny];
@@ -120,7 +120,7 @@
notificationTitle = @"Error converting xib";
NSString *message = [NSString stringWithFormat:@"%@\n%@", self.sourcePath.lastPathComponent, response];
NSDictionary *info =
@{
@"projectId":self.projectId,
@@ -131,7 +131,7 @@
if (self.isCancelled)
return;
[center postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info];
}
else
@@ -152,7 +152,7 @@
[self postErrorNotificationForPath:self.sourcePath line:0 message:response status:status];
}
}
if ([self.xcc shouldShowErrorNotification])
[self notifyUserWithTitle:notificationTitle message:notificationMessage];
}
@@ -160,14 +160,19 @@
{
BOOL showFinalNotification = YES;
if ([self.xcc shouldProcessWithCappLint])
// At this point, we should only detect warnings
if ([self.xcc shouldProcessWithObjjWarnings] && ![self.xcc isXibFile:self.sourcePath])
{
showFinalNotification = [self.xcc checkCappLintForPath:[NSArray arrayWithObject:self.sourcePath]];
if (!showFinalNotification)
[self.xcc showCappLintErrors];
showFinalNotification = [self.xcc checkObjjWarningsForPath:[NSArray arrayWithObject:self.sourcePath]];
[self.xcc showObjjWarnings];
}
if ([self.xcc shouldProcessWithCappLint] && ![self.xcc isXibFile:self.sourcePath])
{
showFinalNotification = [self.xcc checkCappLintForPath:[NSArray arrayWithObject:self.sourcePath]] && showFinalNotification;
[self.xcc showCappLintWarnings];
}
if (showFinalNotification)
[self notifyUserWithTitle:notificationTitle message:notificationMessage];
}
+3
View File
@@ -21,6 +21,8 @@ extern NSString * const kDefaultXCCAutoOpenErrorsPanelOnErrors;
extern NSString * const kDefaultXCCAutoOpenErrorsPanelOnCappLint;
extern NSString * const kDefaultXCCAutoShowNotificationOnErrors;
extern NSString * const kDefaultXCCAutoShowNotificationOnCappLint;
extern NSString * const kDefaultXCCUseDebugFrameworkWithObjj;
extern NSString * const kDefaultXCCShouldProcessObjj;
extern NSString * const kDefaultXCCProjectHistory;
extern NSString * const kDefaultLastOpenedPath;
extern NSString * const kDefaultPathModificationDates;
@@ -29,5 +31,6 @@ extern NSString * const kDefaultLogLevel;
extern NSString * const kDefaultAutoOpenXcodeProject;
extern NSString * const kDefaultUseSymlinkWhenCreatingProject;
extern NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch;
extern NSString * const kDefaultXCCPanelStyleUtility;
#endif
+3
View File
@@ -19,6 +19,8 @@ NSString * const kDefaultXCCAutoOpenErrorsPanelOnErrors = @"XCCAutoOpenErrorsPan
NSString * const kDefaultXCCAutoOpenErrorsPanelOnCappLint = @"XCCAutoOpenErrorsPanelOnCappLint";
NSString * const kDefaultXCCAutoShowNotificationOnErrors = @"XCCAutoOpenShowNotificationErrors";
NSString * const kDefaultXCCAutoShowNotificationOnCappLint = @"XCCAutoShowNotificationOnCappLint";
NSString * const kDefaultXCCUseDebugFrameworkWithObjj = @"XCCUseDebugFrameworkWithObjj";
NSString * const kDefaultXCCShouldProcessObjj = @"XCCShouldProcessObjj";
NSString * const kDefaultXCCProjectHistory = @"XCCProjectHistory";
NSString * const kDefaultLastOpenedPath = @"LastOpenedPath";
NSString * const kDefaultPathModificationDates = @"pathModificationDates";
@@ -27,3 +29,4 @@ NSString * const kDefaultLogLevel = @"logLevel";
NSString * const kDefaultAutoOpenXcodeProject = @"autoOpenXcodeProject";
NSString * const kDefaultUseSymlinkWhenCreatingProject = @"useSymlinkWhenCreatingProject";
NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch = @"updateCappuccinoWithLastVersionOfMasterBranch";
NSString * const kDefaultXCCPanelStyleUtility = @"XCCPanelStyleUtility";
+6 -1
View File
@@ -156,9 +156,14 @@ extern NSString * const XCCCappLintDidEndNotification;
- (NSDictionary*)createProject:(NSString*)aPath;
- (void)showCappLintWarnings;
- (void)showObjjWarnings;
- (BOOL)shouldProcessWithCappLint;
- (BOOL)checkCappLintForPath:(NSArray*)paths;
- (void)showCappLintErrors;
- (BOOL)shouldProcessWithObjjWarnings;
- (BOOL)checkObjjWarningsForPath:(NSArray*)paths;
- (void)updateCappuccino;
+295 -23
View File
@@ -76,6 +76,8 @@ static NSArray *XCCDefaultIgnoredPathPredicates = nil;
NSString * const XCCCappLintDidStartNotification = @"XCCCappLintDidStartNotification";
NSString * const XCCCappLintDidEndNotification = @"XCCCappLintDidEndNotification";
NSString * const XCCObjjDidStartNotification = @"XCCObjjDidStartNotification";
NSString * const XCCObjjDidEndNotification = @"XCCObjjDidEndNotification";
@interface XcodeCapp ()
@@ -1564,6 +1566,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
- (IBAction)openErrorsPanel:(id)aSender
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[self.errorsPanel setFloatingPanel:[[NSUserDefaults standardUserDefaults] boolForKey:kDefaultXCCPanelStyleUtility]];
[self.errorsPanel makeKeyAndOrderFront:nil];
}
@@ -1571,11 +1574,11 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
{
id info = self.errorListController.selection;
NSString *path = [info valueForKey:@"path"];
NSString *path = [info valueForKey:@"realPath"] ? [info valueForKey:@"realPath"] : [info valueForKey:@"path"];
if (path == NSNoSelectionMarker)
return;
if ([self isObjjFile:path])
{
[self openObjjFile:path line:[[info valueForKey:@"line"] intValue]];
@@ -1694,6 +1697,13 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|| [defaults boolForKey:kDefaultXCCAutoShowNotificationOnCappLint];
}
- (BOOL)shouldProcessWithObjjWarnings
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
return ([defaults boolForKey:kDefaultXCCAutoOpenErrorsPanelOnErrors] || [defaults boolForKey:kDefaultXCCAutoShowNotificationOnErrors]) && [defaults boolForKey:kDefaultXCCShouldProcessObjj];
}
- (void)showErrors
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -1704,41 +1714,96 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
}
}
- (void)showCappLintErrors
- (void)showCappLintWarnings
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults boolForKey:kDefaultXCCAutoOpenErrorsPanelOnCappLint] && self.errorList.count)
NSUInteger numberError = [self.errorList count];
NSDictionary *firstError;
NSUInteger i = 0;
for (i = 0; i < numberError; i++)
{
NSDictionary *dict = [self.errorList objectAtIndex:i];
if ([[dict valueForKey:@"type"] isEqualToString: @"capp_lint"])
{
firstError = dict;
break;
}
}
if ([defaults boolForKey:kDefaultXCCAutoOpenErrorsPanelOnCappLint] && firstError)
[self openErrorsPanel:self];
if ([defaults boolForKey:kDefaultXCCAutoShowNotificationOnCappLint])
if ([defaults boolForKey:kDefaultXCCAutoShowNotificationOnCappLint] && firstError)
{
NSUInteger numberError = [self.errorList count];
NSDictionary *error = [self.errorList objectAtIndex:0];
NSString *filename = [error objectForKey:@"path"];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:self.projectId] , @"projectId",
@"Code Style Issues", @"title",
filename.lastPathComponent , @"message",
nil];
[self wantUserNotificationWithInfo:dict];
}
}
- (void)showObjjWarnings
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSUInteger numberError = [self.errorList count];
NSDictionary *firstError;
NSUInteger i = 0;
for (i = 0; i < numberError; i++)
{
NSDictionary *dict = [self.errorList objectAtIndex:i];
if (numberError)
if ([[dict valueForKey:@"type"] isEqualToString: @"objj"])
{
NSDictionary *error = [self.errorList objectAtIndex:0];
NSString *filename = [error objectForKey:@"path"];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:self.projectId] , @"projectId",
@"Code Style Issues", @"title",
filename.lastPathComponent , @"message",
nil];
[self wantUserNotificationWithInfo:dict];
firstError = dict;
break;
}
}
if ([defaults boolForKey:kDefaultXCCAutoOpenErrorsPanelOnErrors] && firstError)
[self openErrorsPanel:self];
if ([defaults boolForKey:kDefaultXCCAutoShowNotificationOnErrors] && firstError)
{
NSDictionary *error = [self.errorList objectAtIndex:0];
NSString *filename = [error objectForKey:@"path"];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:self.projectId] , @"projectId",
@"Compiling Issues", @"title",
filename.lastPathComponent , @"message",
nil];
[self wantUserNotificationWithInfo:dict];
}
}
- (void)pruneProcessingErrorsForProjectPath:(NSString *)path
{
[self pruneProcessingErrorsForProjectPath:path type:nil];
}
- (void)pruneProcessingErrorsForProjectPath:(NSString *)path type:(NSString*)type
{
// Remove all errors for the path being processed
NSIndexSet *matchingErrors = [self.errorList indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop)
{
return [[obj valueForKey:@"path"] isEqualToString:path];
if (type)
return ([[obj valueForKey:@"path"] isEqualToString:path] || [[obj valueForKey:@"realPath"] isEqualToString:path]) && [[obj valueForKey:@"type"] isEqualToString:type];
else
return [[obj valueForKey:@"path"] isEqualToString:path] || [[obj valueForKey:@"realPath"] isEqualToString:path];
}];
[self.errorListController removeObjectsAtArrangedObjectIndexes:matchingErrors];
}
@@ -1758,6 +1823,212 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
return index != NSNotFound;
}
#pragma mark - objjj check
- (NSString*)_getObjjIncludePaths
{
NSRegularExpression *regulareExpressionFramework = [NSRegularExpression regularExpressionWithPattern:@"OBJJ_INCLUDE_PATHS ?= ?\\[\"(.*)\"\\," options:0 error:nil];
NSString *indexPath;
if ([[NSUserDefaults standardUserDefaults] boolForKey:kDefaultXCCUseDebugFrameworkWithObjj])
indexPath = [NSString stringWithFormat:@"%@/index-debug.html", self.projectPath];
else
indexPath = [NSString stringWithFormat:@"%@/index.html", self.projectPath];
NSDictionary *taskResult = [self runTaskWithLaunchPath:@"/bin/cat" arguments:[NSMutableArray arrayWithObject:indexPath] returnType:kTaskReturnTypeAny];
NSString *response = taskResult[@"response"];
NSArray *matches = [regulareExpressionFramework matchesInString:response options:0 range:NSMakeRange(0, [response length])];
for (NSTextCheckingResult *match in matches)
return [NSString stringWithFormat:@"%@/%@", self.projectPath, [response substringWithRange:[match rangeAtIndex:1]]];
return [NSString stringWithFormat:@"%@/%@", self.projectPath ,@"Frameworks/"];
}
- (BOOL)checkObjjWarningsForPath:(NSArray*)paths
{
DDLogVerbose(@"Checking path %@ with objj", paths);
NSUInteger numberOfFiles = [paths count];
NSUInteger i = 0;
NSMutableArray *objjPaths = [NSMutableArray array];
// We only want the objj files
for (i = 0; i < numberOfFiles; i++)
{
NSString *path = [paths objectAtIndex:i];
if ([self isObjjFile:path])
[objjPaths addObject:path];
}
if (![objjPaths count])
return YES;
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidStartNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:XCCObjjDidStartNotification object:self];
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"-I", [self _getObjjIncludePaths], @"-m", nil];
[arguments addObjectsFromArray:objjPaths];
NSDictionary *taskResult = [self runTaskWithLaunchPath:self.executablePaths[@"objj"]
arguments:arguments
returnType:kTaskReturnTypeStdOut];
NSInteger status = [taskResult[@"status"] intValue];
NSString *response = taskResult[@"response"];
if (status == 0 && [response length] == 0)
{
[[NSNotificationCenter defaultCenter] postNotificationName:XCCObjjDidEndNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self];
return YES;
}
NSMutableArray *errors = [NSMutableArray arrayWithArray:[response componentsSeparatedByString:@"\n\n"]];
NSInteger numberOfErrors = [errors count];
NSMutableArray *dicts = [NSMutableArray array];
// When checking of the entire project, we have to be ready to find errors
NSRegularExpression *regulareExpressionFramework = [NSRegularExpression regularExpressionWithPattern:@"([\\S\\s]*)(WARNING|ERROR) line ([0-9]*) in file\\:(.*)\\: ([\\S\\s]*)" options:0 error:nil];
NSString *filePath;
if ([paths count] == 1)
filePath = [paths firstObject];
i = 0;
for (i = 0; i < numberOfErrors; i++)
{
NSMutableString *error = (NSMutableString*)[errors objectAtIndex:i];
NSString *line;
NSString *path;
NSString *messageError;
// We have an extra new line for the first error
if (i == 0)
error = (NSMutableString*)[error substringFromIndex:1];
NSArray *matches = [regulareExpressionFramework matchesInString:error options:0 range:NSMakeRange(0, [error length])];
NSInteger j = 0;
if (![matches count])
{
// This shouldn't happen
DDLogVerbose(@"Error %@ doesn't respect any pattern", error);
path = @"";
line = 0;
messageError = [NSString stringWithFormat:@"Compiling issue at line %@ of file %@:\n%@", line, path.lastPathComponent, error];
}
for (NSTextCheckingResult *match in matches)
{
for (j = 0; j < [match numberOfRanges]; j++)
{
switch (j) {
case 1:
messageError = [error substringWithRange:[match rangeAtIndex:j]];
break;
case 3:
line = [error substringWithRange:[match rangeAtIndex:j]];
break;
case 4:
path = [error substringWithRange:[match rangeAtIndex:j]];
break;
case 5:
messageError = [NSString stringWithFormat:@"Compiling issue at line %@ of file %@:\n%@ \n%@", line, path.lastPathComponent, [error substringWithRange:[match rangeAtIndex:j]], messageError];
break;
default:
break;
}
}
}
// Make sure to delete all the compilations issue form the tableView
[self pruneProcessingErrorsForProjectPath:path type:@"objj"];
// Path and realPath are needed, we can get error on ViewController2.j while checking ViewController.j.
// When recompiling ViewController.j, realPath is used to know which errors have to be erased form the table
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:[line intValue]], @"line",
messageError , @"message",
(filePath ? filePath:path), @"path",
@"objj", @"type",
path , @"realPath",
nil];
// Block to compare dicts
BOOL (^dictComparaison)(id obj, NSUInteger idx, BOOL *stop) = ^(id obj, NSUInteger idx, BOOL *stop){
if ([obj valueForKey:@"line"] == [dict valueForKey:@"line"])
{
// For an unknown reason, trim doesn't work
NSString *messsageObj = [obj valueForKey:@"message"];
NSString *messsageDict = [dict valueForKey:@"message"];
messsageDict = [messsageDict stringByReplacingOccurrencesOfString:@" " withString:@""];
messsageDict = [messsageDict stringByReplacingOccurrencesOfString:@"\n" withString:@""];
messsageObj = [messsageObj stringByReplacingOccurrencesOfString:@" " withString:@""];
messsageObj = [messsageObj stringByReplacingOccurrencesOfString:@"\n" withString:@""];
if ([messsageDict isEqualToString:messsageObj])
{
*stop = YES;
return YES;
}
}
return NO;
};
NSUInteger isInDict = [dicts indexOfObjectPassingTest:dictComparaison];
NSUInteger isInList = [self.errorList indexOfObjectPassingTest:dictComparaison];
// Compiler can show several times the same errors
if (isInDict == NSNotFound && isInList == NSNotFound)
[dicts addObject:dict];
}
[self performSelectorOnMainThread:@selector(objjCompilerDidGenerateError:) withObject:dicts waitUntilDone:YES];
self.isProcessing = NO;
[[NSNotificationCenter defaultCenter] postNotificationName:XCCObjjDidEndNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self];
return NO;
}
- (IBAction)checkProjectWithObjj:(id)sender
{
[self clearErrors:self];
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(objjDidEndNotification:) name:XCCObjjDidEndNotification object:nil];
[self performSelectorInBackground:@selector(checkObjjWarningsForPath:) withObject:self.xCodeCappTargetedFiles];
}
- (void)objjDidEndNotification:(NSNotification*)aNotification
{
[self showObjjWarnings];
[[NSNotificationCenter defaultCenter] removeObserver:self name:XCCObjjDidEndNotification object:nil];
}
- (void)objjCompilerDidGenerateError:(NSArray*)errors
{
[self.errorListController addObjects:errors];
}
#pragma mark - capp_lint
@@ -1773,7 +2044,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
- (void)cappLintDidEndNotification:(NSNotification*)aNotification
{
[self showCappLintErrors];
[self showCappLintWarnings];
[[NSNotificationCenter defaultCenter] removeObserver:self name:XCCCappLintDidEndNotification object:nil];
}
@@ -1840,18 +2111,19 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
NSInteger positionOfSecondColon = [errorWithoutPath rangeOfString:@":"].location;
line = [errorWithoutPath substringToIndex:positionOfSecondColon];
NSString *messageError = [NSString stringWithFormat:@"Code style issue: %@ \n%@", path.lastPathComponent, errorWithoutPath];
NSString *messageError = [NSString stringWithFormat:@"Code style issue at line %@ of file %@:\n%@", line, path.lastPathComponent, errorWithoutPath];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:[line intValue]], @"line",
messageError , @"message",
path, @"path",
@"capp_lint", @"type",
nil];
[dicts addObject:dict];
}
[self performSelectorOnMainThread:@selector(cappLintConversionDidGenerateError:) withObject:dicts waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(cappLintConversionDidGenerateError:) withObject:dicts waitUntilDone:YES];
self.isProcessing = NO;
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self];
File diff suppressed because it is too large. Load diff
@@ -55,13 +55,13 @@ task ("build", ["default"], function()
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
configuration = ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
configuration = ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
@@ -105,7 +105,7 @@ function updateApplicationSize()
{
print("Calculating application file sizes...");
var contents = FILE.read(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), { charset:"UTF-8" }),
var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }),
format = CFPropertyList.sniffedFormatOfString(contents),
plist = CFPropertyList.propertyListFromString(contents),
totalBytes = {executable:0, data:0, mhtml:0};
@@ -113,7 +113,7 @@ function updateApplicationSize()
// Get the size of all framework executables and sprite data
var frameworksDir = "Frameworks";
if (ENV["CONFIGURATION"] === "Debug")
if (configuration === "Debug")
frameworksDir = FILE.join(frameworksDir, "Debug");
var frameworks = FILE.list(frameworksDir);
@@ -137,7 +137,7 @@ function updateApplicationSize()
addBundleFileSizes(themePath, totalBytes);
// Add sizes for the app
addBundleFileSizes(FILE.join("Build", ENV["CONFIGURATION"], projectName), totalBytes);
addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes);
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
@@ -149,7 +149,7 @@ function updateApplicationSize()
plist.setValueForKey("CPApplicationSize", dict);
FILE.write(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
}
function addBundleFileSizes(bundlePath, totalBytes)
@@ -55,13 +55,13 @@ task ("build", ["default"], function()
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
configuration = ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
configuration = ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
@@ -105,7 +105,7 @@ function updateApplicationSize()
{
print("Calculating application file sizes...");
var contents = FILE.read(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), { charset:"UTF-8" }),
var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }),
format = CFPropertyList.sniffedFormatOfString(contents),
plist = CFPropertyList.propertyListFromString(contents),
totalBytes = {executable:0, data:0, mhtml:0};
@@ -113,7 +113,7 @@ function updateApplicationSize()
// Get the size of all framework executables and sprite data
var frameworksDir = "Frameworks";
if (ENV["CONFIGURATION"] === "Debug")
if (configuration === "Debug")
frameworksDir = FILE.join(frameworksDir, "Debug");
var frameworks = FILE.list(frameworksDir);
@@ -137,7 +137,7 @@ function updateApplicationSize()
addBundleFileSizes(themePath, totalBytes);
// Add sizes for the app
addBundleFileSizes(FILE.join("Build", ENV["CONFIGURATION"], projectName), totalBytes);
addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes);
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
@@ -149,7 +149,7 @@ function updateApplicationSize()
plist.setValueForKey("CPApplicationSize", dict);
FILE.write(FILE.join("Build", ENV["CONFIGURATION"], projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
}
function addBundleFileSizes(bundlePath, totalBytes)
+18 -16
View File
@@ -51,6 +51,7 @@
int _lineBreakMode @accessors(readonly, getter=lineBreakMode);
CPFormatter _formatter @accessors(readonly, getter=formatter);
int _tag @accessors(readonly, getter=tag);
BOOL _usesSingleLineMode @accessors(readonly, getter=usesSingleLineMode);
}
- (id)initWithCoder:(CPCoder)aCoder
@@ -62,22 +63,23 @@
var flags = [aCoder decodeIntForKey:@"NSCellFlags"],
flags2 = [aCoder decodeIntForKey:@"NSCellFlags2"];
_state = (flags & 0x80000000) ? CPOnState : CPOffState;
_isHighlighted = (flags & 0x40000000) ? YES : NO;
_isEnabled = (flags & 0x20000000) ? NO : YES;
_isEditable = (flags & 0x10000000) ? YES : NO;
_isBordered = (flags & 0x00800000) ? YES : NO;
_isBezeled = (flags & 0x00400000) ? YES : NO;
_isSelectable = (flags & 0x00200000) ? YES : NO;
_isScrollable = (flags & 0x00100000) ? YES : NO;
_isContinuous = (flags & 0x00080100) ? YES : NO;
_scrolls = (flags & 0x00100000) && (flags & 0x00000040);
_wraps = (flags & 0x00100000 === 0) && (flags & 0x00000040 === 0);
_truncates = !(flags & 0x00100000) && (flags & 0x00000040);
_alignment = (flags2 & 0x1c000000) >> 26;
_lineBreakMode = (flags2 & 0x0E00) >> 9;
_controlSize = (flags2 & 0xE0000) >> 17;
_sendsActionOnEndEditing = (flags2 & 0x00400000) ? YES : NO;
_state = (flags & 0x80000000) ? CPOnState : CPOffState;
_isHighlighted = (flags & 0x40000000) ? YES : NO;
_isEnabled = (flags & 0x20000000) ? NO : YES;
_isEditable = (flags & 0x10000000) ? YES : NO;
_isBordered = (flags & 0x00800000) ? YES : NO;
_isBezeled = (flags & 0x00400000) ? YES : NO;
_isSelectable = (flags & 0x00200000) ? YES : NO;
_isScrollable = (flags & 0x00100000) ? YES : NO;
_isContinuous = (flags & 0x00080100) ? YES : NO;
_scrolls = (flags & 0x00100000) && (flags & 0x00000040) ? YES : NO;
_wraps = !(flags & 0x00100000) && !(flags & 0x00000040) ? YES : NO;
_truncates = (flags & 0x00100000) && !(flags & 0x00000040) ? YES : NO;
_alignment = (flags2 & 0x1c000000) >> 26;
_lineBreakMode = (flags2 & 0x0E00) >> 9;
_controlSize = (flags2 & 0xE0000) >> 17;
_sendsActionOnEndEditing = (flags2 & 0x00400000) ? YES : NO;
_usesSingleLineMode = (flags2 & 0xF4240) ? YES : NO;
_tag = [aCoder decodeIntForKey:@"NSTag"];
+4
View File
@@ -54,6 +54,10 @@
[self setPlaceholderString:[cell placeholderString]];
[self _setUsesSingleLineMode:[cell usesSingleLineMode]];
[self _setWraps:[cell wraps]];
[self _setScrolls:[cell scrolls]];
var textColor = [cell textColor],
defaultColor = [self currentValueForThemeAttribute:@"text-color"];