mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-14 06:31:27 +00:00
Merge branch 'master' into objj-typedef-and-ivar-checks
+ fixed new warnings from master Conflicts: Foundation/CPNotificationCenter.j
This commit is contained in:
@@ -16,3 +16,4 @@ xcuserdata/
|
||||
Tests/Manual/**/*.xcodeproj
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
*.tm_properties
|
||||
|
||||
@@ -988,7 +988,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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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
@@ -266,10 +266,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];
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
@class CPDatePicker
|
||||
@class _CPDatePickerMonthView
|
||||
@class _CPDatePickerHeaderView
|
||||
@class _CPDatePickerBox
|
||||
|
||||
@global CPApp
|
||||
@global CPSingleDateMode
|
||||
@@ -65,7 +66,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su"
|
||||
_CPDatePickerMonthView _monthView;
|
||||
_CPDatePickerHeaderView _headerView;
|
||||
_CPDatePickerClock _datePickerClock;
|
||||
CPBox _box;
|
||||
_CPDatePickerBox _box;
|
||||
CPDatePicker _datePicker;
|
||||
CPInteger _startSelectionIndex;
|
||||
CPInteger _currentSelectionIndex;
|
||||
@@ -99,7 +100,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su"
|
||||
sizeCalendar = [_datePicker valueForThemeAttribute:@"size-calendar"],
|
||||
sizeClock = [_datePicker valueForThemeAttribute:@"size-clock"];
|
||||
|
||||
_box = [[_DatePickerBox alloc] initWithFrame:CGRectMake(0, 0, sizeCalendar.width, sizeHeader.height + sizeCalendar.height)];
|
||||
_box = [[_CPDatePickerBox alloc] initWithFrame:CGRectMake(0, 0, sizeCalendar.width, sizeHeader.height + sizeCalendar.height)];
|
||||
[_box setDatePicker:_datePicker];
|
||||
|
||||
_headerView = [[_CPDatePickerHeaderView alloc] initWithFrame:CGRectMake(0, 0, sizeHeader.width, sizeHeader.height) datePicker:_datePicker delegate:self];
|
||||
@@ -1268,7 +1269,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su"
|
||||
@end
|
||||
|
||||
|
||||
@implementation _DatePickerBox : CPView
|
||||
@implementation _CPDatePickerBox : CPView
|
||||
{
|
||||
CPDatePicker _datePicker @accessors(property=datePicker);
|
||||
}
|
||||
|
||||
@@ -412,7 +412,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
@@ -48,9 +48,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,
|
||||
@@ -143,6 +144,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
// NS-style Display Properties
|
||||
CPTextFieldBezelStyle _bezelStyle;
|
||||
BOOL _isBordered;
|
||||
BOOL _usesSingleLineMode;
|
||||
BOOL _wraps;
|
||||
BOOL _scrolls;
|
||||
}
|
||||
|
||||
+ (Class)_binderClassForBinding:(CPString)aBinding
|
||||
@@ -241,101 +245,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
|
||||
|
||||
@@ -351,8 +366,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
_sendActionOn = CPKeyUpMask | CPKeyDownMask;
|
||||
|
||||
[self setValue:CPLeftTextAlignment forThemeAttribute:@"alignment"];
|
||||
|
||||
[self _updateCursor];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -374,8 +387,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if (shouldBeEditable)
|
||||
_isSelectable = YES;
|
||||
|
||||
[self _updateCursor];
|
||||
|
||||
if (_isEditable)
|
||||
[self setThemeState:CPThemeStateEditable];
|
||||
else
|
||||
@@ -406,7 +417,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)
|
||||
@@ -420,8 +430,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
- (void)setSelectable:(BOOL)aFlag
|
||||
{
|
||||
_isSelectable = aFlag;
|
||||
|
||||
[self _updateCursor];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -561,6 +569,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
|
||||
{
|
||||
@@ -616,28 +642,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)
|
||||
@@ -681,37 +689,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)
|
||||
{
|
||||
@@ -732,12 +721,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 */
|
||||
@@ -931,6 +949,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?)
|
||||
@@ -1101,7 +1125,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
|
||||
@@ -1141,9 +1169,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";
|
||||
@@ -1941,7 +1974,11 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
|
||||
CPTextFieldLineBreakModeKey = "CPTextFieldLineBreakModeKey",
|
||||
CPTextFieldAlignmentKey = "CPTextFieldAlignmentKey",
|
||||
CPTextFieldBackgroundColorKey = "CPTextFieldBackgroundColorKey",
|
||||
CPTextFieldPlaceholderStringKey = "CPTextFieldPlaceholderStringKey";
|
||||
CPTextFieldPlaceholderStringKey = "CPTextFieldPlaceholderStringKey",
|
||||
CPTextFieldUsesSingleLineMode = "CPTextFieldUsesSingleLineMode",
|
||||
CPTextFieldWraps = "CPTextFieldWraps",
|
||||
CPTextFieldScrolls = "CPTextFieldScrolls";
|
||||
|
||||
|
||||
@implementation CPTextField (CPCoding)
|
||||
|
||||
@@ -1968,7 +2005,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;
|
||||
@@ -1993,6 +2032,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
|
||||
@@ -2023,6 +2066,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
|
||||
|
||||
@@ -210,6 +210,7 @@ var CPViewControllerCachedCibs;
|
||||
[cibOwner viewControllerDidLoadCib:self];
|
||||
|
||||
_isLoading = NO;
|
||||
_isLazy = NO;
|
||||
[self _viewDidLoad];
|
||||
}
|
||||
else if (_isLazy)
|
||||
|
||||
+47
-10
@@ -1852,6 +1852,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],
|
||||
@@ -2483,7 +2489,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;
|
||||
@@ -2685,6 +2691,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:
|
||||
*/
|
||||
@@ -2693,9 +2716,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 = {
|
||||
@@ -2747,7 +2785,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.
|
||||
@@ -2880,12 +2923,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])
|
||||
{
|
||||
|
||||
@@ -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])
|
||||
{
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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],
|
||||
|
||||
+222
-169
@@ -27,174 +27,10 @@
|
||||
@import "CPNull.j"
|
||||
@import "CPSet.j"
|
||||
|
||||
@class _CPNotificationRegistry
|
||||
|
||||
var CPNotificationDefaultCenter = nil;
|
||||
|
||||
/*
|
||||
Mapping of Notification Name to listening object/selector.
|
||||
@ignore
|
||||
*/
|
||||
@implementation _CPNotificationRegistry : CPObject
|
||||
{
|
||||
CPDictionary _objectObservers;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_objectObservers = @{};
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)addObserver:(_CPNotificationObserver)anObserver object:(id)anObject
|
||||
{
|
||||
// If there's no object, then we're listening to this
|
||||
// notification regardless of whom sends it.
|
||||
if (!anObject)
|
||||
anObject = [CPNull null];
|
||||
|
||||
// Grab all the listeners for this notification/object pair
|
||||
var observers = [_objectObservers objectForKey:[anObject UID]];
|
||||
|
||||
if (!observers)
|
||||
{
|
||||
observers = [CPMutableSet set];
|
||||
[_objectObservers setObject:observers forKey:[anObject UID]];
|
||||
}
|
||||
|
||||
// Add this observer.
|
||||
[observers addObject:anObserver];
|
||||
}
|
||||
|
||||
- (void)removeObserver:(id)anObserver object:(id)anObject
|
||||
{
|
||||
var removedKeys = [];
|
||||
|
||||
// This means we're getting rid of EVERY instance of this observer.
|
||||
if (anObject == nil)
|
||||
{
|
||||
var key = nil,
|
||||
keys = [_objectObservers keyEnumerator];
|
||||
|
||||
// Iterate through every set of observers
|
||||
while ((key = [keys nextObject]) !== nil)
|
||||
{
|
||||
var observers = [_objectObservers objectForKey:key],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
if ([observer observer] == anObserver)
|
||||
[observers removeObject:observer];
|
||||
|
||||
if (![observers count])
|
||||
removedKeys.push(key);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var key = [anObject UID],
|
||||
observers = [_objectObservers objectForKey:key],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
if ([observer observer] == anObserver)
|
||||
[observers removeObject:observer];
|
||||
|
||||
if (![observers count])
|
||||
removedKeys.push(key);
|
||||
}
|
||||
|
||||
var count = removedKeys.length;
|
||||
|
||||
while (count--)
|
||||
[_objectObservers removeObjectForKey:removedKeys[count]];
|
||||
}
|
||||
|
||||
- (void)postNotification:(CPNotification)aNotification
|
||||
{
|
||||
// We don't want to erroneously send notifications to observers that get removed
|
||||
// during the posting of this notification, nor observers that get added. The
|
||||
// best way to do this is to make a copy of the current observers (this avoids
|
||||
// new observers from being notified) and double checking every observer against
|
||||
// the current set (this avoids removed observers from receiving notifications).
|
||||
var object = [aNotification object],
|
||||
currentObservers = nil;
|
||||
|
||||
if (object != nil && (currentObservers = [_objectObservers objectForKey:[object UID]]))
|
||||
{
|
||||
var observers = [currentObservers copy],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
{
|
||||
// CPSet containsObject is N(1) so this is a fast check.
|
||||
if ([currentObservers containsObject:observer])
|
||||
[observer postNotification:aNotification];
|
||||
}
|
||||
}
|
||||
|
||||
// Now do the same for the nil object observers...
|
||||
currentObservers = [_objectObservers objectForKey:[[CPNull null] UID]];
|
||||
|
||||
if (!currentObservers)
|
||||
return;
|
||||
|
||||
var observers = [currentObservers copy],
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
{
|
||||
// CPSet containsObject is N(1) so this is a fast check.
|
||||
if ([currentObservers containsObject:observer])
|
||||
[observer postNotification:aNotification];
|
||||
}
|
||||
}
|
||||
|
||||
- (unsigned)count
|
||||
{
|
||||
return [_objectObservers count];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/* @ignore */
|
||||
@implementation _CPNotificationObserver : CPObject
|
||||
{
|
||||
id _observer;
|
||||
SEL _selector;
|
||||
}
|
||||
|
||||
- (id)initWithObserver:(id)anObserver selector:(SEL)aSelector
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
_observer = anObserver;
|
||||
_selector = aSelector;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)observer
|
||||
{
|
||||
return _observer;
|
||||
}
|
||||
|
||||
- (void)postNotification:(CPNotification)aNotification
|
||||
{
|
||||
[_observer performSelector:_selector withObject:aNotification];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/*!
|
||||
@class CPNotificationCenter
|
||||
@ingroup foundation
|
||||
@@ -234,7 +70,8 @@ var CPNotificationDefaultCenter = nil;
|
||||
_namedRegistries = @{};
|
||||
_unnamedRegistry = [[_CPNotificationRegistry alloc] init];
|
||||
}
|
||||
return self;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -247,9 +84,36 @@ var CPNotificationDefaultCenter = nil;
|
||||
*/
|
||||
- (void)addObserver:(id)anObserver selector:(SEL)aSelector name:(CPString)aNotificationName object:(id)anObject
|
||||
{
|
||||
var registry,
|
||||
var registry = [self _registryForNotificationName:aNotificationName],
|
||||
observer = [[_CPNotificationObserver alloc] initWithObserver:anObserver selector:aSelector];
|
||||
|
||||
[registry addObserver:observer object:anObject];
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds an entry to the receiver’s dispatch table with a block, and optional criteria: notification name and sender.
|
||||
@param aNotificationName the name of the notification the observer wants to watch
|
||||
@param anObject the object in the notification the observer wants to watch
|
||||
@param queue is ignored for the moment
|
||||
@param block the block to be executed when the notification is received.
|
||||
*/
|
||||
- (id <CPObject>)addObserverForName:(CPString)aNotificationName object:(id)anObject queue:(id)queue usingBlock:(Function)block
|
||||
{
|
||||
var registry = [self _registryForNotificationName:aNotificationName],
|
||||
observer = [[_CPNotificationObserver alloc] initWithBlock:block];
|
||||
|
||||
[registry addObserver:observer object:anObject];
|
||||
|
||||
return observer;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (_CPNotificationRegistry)_registryForNotificationName:(CPString)aNotificationName
|
||||
{
|
||||
var registry;
|
||||
|
||||
if (aNotificationName == nil)
|
||||
registry = _unnamedRegistry;
|
||||
else if (!(registry = [_namedRegistries objectForKey:aNotificationName]))
|
||||
@@ -258,7 +122,7 @@ var CPNotificationDefaultCenter = nil;
|
||||
[_namedRegistries setObject:registry forKey:aNotificationName];
|
||||
}
|
||||
|
||||
[registry addObserver:observer object:anObject];
|
||||
return registry;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -339,3 +203,192 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
|
||||
[self._unnamedRegistry postNotification:aNotification];
|
||||
[[self._namedRegistries objectForKey:[aNotification name]] postNotification:aNotification];
|
||||
};
|
||||
|
||||
/*
|
||||
Mapping of Notification Name to listening object/selector.
|
||||
@ignore
|
||||
*/
|
||||
@implementation _CPNotificationRegistry : CPObject
|
||||
{
|
||||
CPDictionary _objectObservers;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_objectObservers = @{};
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)addObserver:(_CPNotificationObserver)anObserver object:(id)anObject
|
||||
{
|
||||
// If there's no object, then we're listening to this
|
||||
// notification regardless of whom sends it.
|
||||
if (!anObject)
|
||||
anObject = [CPNull null];
|
||||
|
||||
// Grab all the listeners for this notification/object pair
|
||||
var observers = [_objectObservers objectForKey:[anObject UID]];
|
||||
|
||||
if (!observers)
|
||||
{
|
||||
observers = [CPMutableSet set];
|
||||
[_objectObservers setObject:observers forKey:[anObject UID]];
|
||||
}
|
||||
|
||||
// Add this observer.
|
||||
[observers addObject:anObserver];
|
||||
}
|
||||
|
||||
- (void)removeObserver:(id)anObserver object:(id)anObject
|
||||
{
|
||||
var removedKeys = [];
|
||||
|
||||
// This means we're getting rid of EVERY instance of this observer.
|
||||
if (anObject == nil)
|
||||
{
|
||||
var key = nil,
|
||||
keys = [_objectObservers keyEnumerator];
|
||||
|
||||
// Iterate through every set of observers
|
||||
while ((key = [keys nextObject]) !== nil)
|
||||
{
|
||||
var observers = [_objectObservers objectForKey:key],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
if ([observer observer] == anObserver ||
|
||||
([observer block] && [anObserver respondsToSelector:@selector(block)] && [observer block] == [anObserver block]))
|
||||
[observers removeObject:observer];
|
||||
|
||||
if (![observers count])
|
||||
removedKeys.push(key);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var key = [anObject UID],
|
||||
observers = [_objectObservers objectForKey:key],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
if ([observer observer] == anObserver ||
|
||||
([observer block] && [anObserver respondsToSelector:@selector(block)] && [observer block] == [anObserver block]))
|
||||
[observers removeObject:observer];
|
||||
|
||||
if (![observers count])
|
||||
removedKeys.push(key);
|
||||
}
|
||||
|
||||
var count = removedKeys.length;
|
||||
|
||||
while (count--)
|
||||
[_objectObservers removeObjectForKey:removedKeys[count]];
|
||||
}
|
||||
|
||||
- (void)postNotification:(CPNotification)aNotification
|
||||
{
|
||||
// We don't want to erroneously send notifications to observers that get removed
|
||||
// during the posting of this notification, nor observers that get added. The
|
||||
// best way to do this is to make a copy of the current observers (this avoids
|
||||
// new observers from being notified) and double checking every observer against
|
||||
// the current set (this avoids removed observers from receiving notifications).
|
||||
var object = [aNotification object],
|
||||
currentObservers = nil;
|
||||
|
||||
if (object != nil && (currentObservers = [_objectObservers objectForKey:[object UID]]))
|
||||
{
|
||||
var observers = [currentObservers copy],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
{
|
||||
// CPSet containsObject is N(1) so this is a fast check.
|
||||
if ([currentObservers containsObject:observer])
|
||||
[observer postNotification:aNotification];
|
||||
}
|
||||
}
|
||||
|
||||
// Now do the same for the nil object observers...
|
||||
currentObservers = [_objectObservers objectForKey:[[CPNull null] UID]];
|
||||
|
||||
if (!currentObservers)
|
||||
return;
|
||||
|
||||
var observers = [currentObservers copy],
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
{
|
||||
// CPSet containsObject is N(1) so this is a fast check.
|
||||
if ([currentObservers containsObject:observer])
|
||||
[observer postNotification:aNotification];
|
||||
}
|
||||
}
|
||||
|
||||
- (unsigned)count
|
||||
{
|
||||
return [_objectObservers count];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/* @ignore */
|
||||
@implementation _CPNotificationObserver : CPObject
|
||||
{
|
||||
id _observer;
|
||||
Function _block;
|
||||
SEL _selector;
|
||||
}
|
||||
|
||||
- (id)initWithObserver:(id)anObserver selector:(SEL)aSelector
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
_observer = anObserver;
|
||||
_selector = aSelector;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithBlock:(Function)aBlock
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
_block = aBlock;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)observer
|
||||
{
|
||||
return _observer;
|
||||
}
|
||||
|
||||
- (id)block
|
||||
{
|
||||
return _block;
|
||||
}
|
||||
|
||||
- (void)postNotification:(CPNotification)aNotification
|
||||
{
|
||||
if (_block)
|
||||
{
|
||||
_block(aNotification);
|
||||
return;
|
||||
}
|
||||
|
||||
[_observer performSelector:_selector withObject:aNotification];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -52,6 +52,51 @@ var TestNotification = @"TestNotification";
|
||||
[self assert:8 equals:notificationCount message:@"observer should not be notified"];
|
||||
}
|
||||
|
||||
- (void)testNotifyWithBlocks
|
||||
{
|
||||
var center = [CPNotificationCenter defaultCenter];
|
||||
|
||||
notificationCount = 0;
|
||||
|
||||
var notificationBlock = function(notification){
|
||||
notificationCount += 1;
|
||||
};
|
||||
|
||||
var observer2 = [center addObserverForName:TestNotification object:2 queue:nil usingBlock:notificationBlock],
|
||||
observer25 = [center addObserverForName:TestNotification object:25 queue:nil usingBlock:notificationBlock];
|
||||
|
||||
[center postNotificationName:TestNotification object:self];
|
||||
[self assert:0 equals:notificationCount message:@"observer should only be notified for object '2'"];
|
||||
|
||||
[center postNotificationName:TestNotification object:2];
|
||||
[self assert:1 equals:notificationCount message:@"observer should be notified for object '2'"];
|
||||
|
||||
var observerNil = [center addObserverForName:TestNotification object:nil queue:nil usingBlock:notificationBlock];
|
||||
|
||||
[center postNotificationName:TestNotification object:2];
|
||||
[self assert:3 equals:notificationCount message:@"observer should be notified for object '2' and for any object"];
|
||||
|
||||
[center removeObserver:observer2 name:TestNotification object:2];
|
||||
[center postNotificationName:TestNotification object:2];
|
||||
[self assert:4 equals:notificationCount message:@"observer should be notified only for any object"];
|
||||
|
||||
// At this point we have TestNofication:nil observer and a TestNotification:25 observer.
|
||||
observer2 = [center addObserverForName:nil object:2 queue:nil usingBlock:notificationBlock];
|
||||
|
||||
[center postNotificationName:TestNotification object:2];
|
||||
[self assert:6 equals:notificationCount message:@"observer should be notified for TestNofication and for object '2' (TestNotification)"];
|
||||
[center postNotificationName:@"RandomNotification" object:2];
|
||||
[self assert:7 equals:notificationCount message:@"observer should be notified for object '2' (RandomNotification)"];
|
||||
|
||||
[center removeObserver:observer2];
|
||||
[center removeObserver:observer25];
|
||||
[center removeObserver:observerNil];
|
||||
[center postNotificationName:TestNotification object:nil];
|
||||
[center postNotificationName:TestNotification object:2];
|
||||
[center postNotificationName:TestNotification object:25];
|
||||
[self assert:7 equals:notificationCount message:@"observer should not be notified"];
|
||||
}
|
||||
|
||||
- (void)testAddObserversDuringNotification
|
||||
{
|
||||
var center = [CPNotificationCenter defaultCenter];
|
||||
|
||||
@@ -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>
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
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>
|
||||
@@ -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);
|
||||
}
|
||||
+1
-1
@@ -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"]);
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,6 +0,0 @@
|
||||
Project.configure do |project|
|
||||
|
||||
project.email_notifier.emails = ['objjbuild@googlegroups.com']
|
||||
project.build_command = 'Tools/Scripts/ci.sh'
|
||||
|
||||
end
|
||||
@@ -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;
|
||||
|
||||
@@ -154,7 +154,8 @@ AppController *SharedAppControllerInstance = nil;
|
||||
kDefaultAutoOpenXcodeProject: @YES,
|
||||
kDefaultUseSymlinkWhenCreatingProject: @YES,
|
||||
kDefaultXCCUseDebugFrameworkWithObjj: @YES,
|
||||
kDefaultXCCShouldProcessObjj: @YES
|
||||
kDefaultXCCShouldProcessObjj: @YES,
|
||||
kDefaultXCCPanelStyleUtility: @NO
|
||||
};
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
@@ -158,20 +158,16 @@
|
||||
}
|
||||
else if (!self.xcc.isLoadingProject)
|
||||
{
|
||||
BOOL showFinalNotification = NO;
|
||||
BOOL showFinalNotification = YES;
|
||||
|
||||
// At this point, we should only detect warnings
|
||||
if ([self.xcc shouldProcessWithObjjWarnings])
|
||||
if ([self.xcc shouldProcessWithObjjWarnings] && ![self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
showFinalNotification = [self.xcc checkObjjWarningsForPath:[NSArray arrayWithObject:self.sourcePath]];
|
||||
[self.xcc showObjjWarnings];
|
||||
}
|
||||
else
|
||||
{
|
||||
showFinalNotification = YES;
|
||||
}
|
||||
|
||||
if ([self.xcc shouldProcessWithCappLint])
|
||||
if ([self.xcc shouldProcessWithCappLint] && ![self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
showFinalNotification = [self.xcc checkCappLintForPath:[NSArray arrayWithObject:self.sourcePath]] && showFinalNotification;
|
||||
[self.xcc showCappLintWarnings];
|
||||
|
||||
@@ -31,5 +31,6 @@ extern NSString * const kDefaultLogLevel;
|
||||
extern NSString * const kDefaultAutoOpenXcodeProject;
|
||||
extern NSString * const kDefaultUseSymlinkWhenCreatingProject;
|
||||
extern NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch;
|
||||
extern NSString * const kDefaultXCCPanelStyleUtility;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,4 +28,5 @@ NSString * const kDefaultMaxRecentProjects = @"maxRecentProjects";
|
||||
NSString * const kDefaultLogLevel = @"logLevel";
|
||||
NSString * const kDefaultAutoOpenXcodeProject = @"autoOpenXcodeProject";
|
||||
NSString * const kDefaultUseSymlinkWhenCreatingProject = @"useSymlinkWhenCreatingProject";
|
||||
NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch = @"updateCappuccinoWithLastVersionOfMasterBranch";
|
||||
NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch = @"updateCappuccinoWithLastVersionOfMasterBranch";
|
||||
NSString * const kDefaultXCCPanelStyleUtility = @"XCCPanelStyleUtility";
|
||||
@@ -1566,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];
|
||||
}
|
||||
|
||||
@@ -1573,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]];
|
||||
@@ -1842,9 +1843,9 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
NSArray *matches = [regulareExpressionFramework matchesInString:response options:0 range:NSMakeRange(0, [response length])];
|
||||
|
||||
for (NSTextCheckingResult *match in matches)
|
||||
return [response substringWithRange:[match rangeAtIndex:1]];
|
||||
return [NSString stringWithFormat:@"%@/%@", self.projectPath, [response substringWithRange:[match rangeAtIndex:1]]];
|
||||
|
||||
return @"Frameworks/";
|
||||
return [NSString stringWithFormat:@"%@/%@", self.projectPath ,@"Frameworks/"];
|
||||
}
|
||||
|
||||
- (BOOL)checkObjjWarningsForPath:(NSArray*)paths
|
||||
@@ -1852,15 +1853,26 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
DDLogVerbose(@"Checking path %@ with objj", paths);
|
||||
|
||||
NSUInteger numberOfFiles = [paths count];
|
||||
NSUInteger i = 0;
|
||||
NSMutableArray *objjPaths = [NSMutableArray array];
|
||||
|
||||
if (!numberOfFiles)
|
||||
// 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:paths];
|
||||
[arguments addObjectsFromArray:objjPaths];
|
||||
|
||||
NSDictionary *taskResult = [self runTaskWithLaunchPath:self.executablePaths[@"objj"]
|
||||
arguments:arguments
|
||||
@@ -1879,7 +1891,6 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
NSMutableArray *errors = [NSMutableArray arrayWithArray:[response componentsSeparatedByString:@"\n\n"]];
|
||||
|
||||
NSInteger numberOfErrors = [errors count];
|
||||
NSInteger i = 0;
|
||||
NSMutableArray *dicts = [NSMutableArray array];
|
||||
|
||||
// When checking of the entire project, we have to be ready to find errors
|
||||
@@ -1890,6 +1901,8 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
if ([paths count] == 1)
|
||||
filePath = [paths firstObject];
|
||||
|
||||
i = 0;
|
||||
|
||||
for (i = 0; i < numberOfErrors; i++)
|
||||
{
|
||||
NSMutableString *error = (NSMutableString*)[errors objectAtIndex:i];
|
||||
@@ -1906,8 +1919,12 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
if (![matches count])
|
||||
{
|
||||
DDLogVerbose(@"Error %@ has been ignored by xCodeCapp, the error doesn't respect any pattern", error);
|
||||
continue;
|
||||
// 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)
|
||||
@@ -1950,10 +1967,36 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
path , @"realPath",
|
||||
nil];
|
||||
|
||||
// Compiler can show several times the same errors
|
||||
if (![dicts containsObject:dict] && ![self.errorList containsObject:dict])
|
||||
[dicts addObject:dict];
|
||||
// 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];
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">14A389</string>
|
||||
<string key="IBDocument.SystemVersion">14B17</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6250</string>
|
||||
<string key="IBDocument.AppKitVersion">1343.14</string>
|
||||
<string key="IBDocument.AppKitVersion">1343.15</string>
|
||||
<string key="IBDocument.HIToolboxVersion">755.00</string>
|
||||
<dictionary class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="com.apple.InterfaceBuilder.CocoaPlugin">6250</string>
|
||||
@@ -243,7 +243,7 @@
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="930594929">
|
||||
<nil key="NSNextResponder"/>
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSTextField" id="152451023">
|
||||
@@ -251,6 +251,8 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{164, 20}, {203, 143}}</string>
|
||||
<reference key="NSSuperview" ref="930594929"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="488063721">
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
@@ -287,6 +289,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">266</int>
|
||||
<string key="NSFrame">{{164, 171}, {221, 74}}</string>
|
||||
<reference key="NSSuperview" ref="930594929"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="152451023"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="49688699">
|
||||
@@ -334,6 +337,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</set>
|
||||
<string key="NSFrame">{{17, 108}, {128, 128}}</string>
|
||||
<reference key="NSSuperview" ref="930594929"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="108892689"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSImageCell" key="NSCell" id="906963775">
|
||||
@@ -353,24 +357,26 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{402, 247}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="247765970"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">NO</bool>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="717487982">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{1826, 825}, {550, 237}}</string>
|
||||
<int key="NSWTFlags">1618478080</int>
|
||||
<string key="NSWindowRect">{{890, 663}, {550, 237}}</string>
|
||||
<int key="NSWTFlags">1613759488</int>
|
||||
<string key="NSWindowTitle">Reporting</string>
|
||||
<string key="NSWindowClass">NSPanel</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<string key="NSWindowContentMinSize">{315, 77}</string>
|
||||
<object class="NSView" key="NSWindowView" id="938592555">
|
||||
<nil key="NSNextResponder"/>
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSScrollView" id="396547698">
|
||||
@@ -386,6 +392,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{550, 201}</string>
|
||||
<reference key="NSSuperview" ref="726555181"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="826896045"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
@@ -462,6 +469,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {550, 201}}</string>
|
||||
<reference key="NSSuperview" ref="396547698"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="227701162"/>
|
||||
<reference key="NSDocView" ref="227701162"/>
|
||||
<reference key="NSBGColor" ref="101140578"/>
|
||||
@@ -473,6 +481,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{1, 273}, {512, 16}}</string>
|
||||
<reference key="NSSuperview" ref="396547698"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="824465154"/>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<string key="NSControlAction">_doScroller:</string>
|
||||
@@ -486,6 +495,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{535, 1}, {16, 45}}</string>
|
||||
<reference key="NSSuperview" ref="396547698"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="305528183"/>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<string key="NSControlAction">_doScroller:</string>
|
||||
@@ -496,6 +506,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</array>
|
||||
<string key="NSFrame">{{-1, 35}, {552, 203}}</string>
|
||||
<reference key="NSSuperview" ref="938592555"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="726555181"/>
|
||||
<int key="NSsFlags">133682</int>
|
||||
<reference key="NSVScroller" ref="826896045"/>
|
||||
@@ -511,6 +522,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{352, 8}, {85, 19}}</string>
|
||||
<reference key="NSSuperview" ref="938592555"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="504749152"/>
|
||||
<string key="NSHuggingPriority">{250, 750}</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -539,6 +551,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 8}, {85, 19}}</string>
|
||||
<reference key="NSSuperview" ref="938592555"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="574276998"/>
|
||||
<string key="NSHuggingPriority">{250, 750}</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -563,6 +576,8 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{445, 8}, {85, 19}}</string>
|
||||
<reference key="NSSuperview" ref="938592555"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSHuggingPriority">{250, 750}</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="454979058">
|
||||
@@ -583,19 +598,21 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{550, 237}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="396547698"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{1440, -180}, {1920, 1057}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSMinSize">{315, 99}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">errorPanel</string>
|
||||
<string key="NSFrameAutosaveName"/>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="484209508">
|
||||
<int key="NSWindowStyleMask">3</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{1964, 505}, {369, 473}}</string>
|
||||
<int key="NSWTFlags">1618478080</int>
|
||||
<string key="NSWindowRect">{{534, 231}, {369, 510}}</string>
|
||||
<int key="NSWTFlags">1613235200</int>
|
||||
<string key="NSWindowTitle">Preferences</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
@@ -615,7 +632,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSButton" id="49684265">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 81}, {271, 18}}</string>
|
||||
<string key="NSFrame">{{16, 118}, {271, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="668731100"/>
|
||||
@@ -649,10 +666,10 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSButton" id="668731100">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 51}, {241, 18}}</string>
|
||||
<string key="NSFrame">{{16, 88}, {241, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="59325359"/>
|
||||
<reference key="NSNextKeyView" ref="493786566"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="287093958">
|
||||
<int key="NSCellFlags">-2080374784</int>
|
||||
@@ -671,10 +688,35 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="493786566">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 58}, {260, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="59325359"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="549413473">
|
||||
<int key="NSCellFlags">-2080374784</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Errors & Warnings panel always on top</string>
|
||||
<reference key="NSSupport" ref="986470281"/>
|
||||
<reference key="NSControlView" ref="493786566"/>
|
||||
<int key="NSButtonFlags">1211912448</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="795665759"/>
|
||||
<reference key="NSAlternateImage" ref="989917290"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="497174199">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 109}, {298, 18}}</string>
|
||||
<string key="NSFrame">{{16, 146}, {298, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="49684265"/>
|
||||
@@ -699,7 +741,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSTextField" id="59325359">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{15, 20}, {106, 17}}</string>
|
||||
<string key="NSFrame">{{16, 17}, {106, 17}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="665261882"/>
|
||||
@@ -719,7 +761,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSPopUpButton" id="665261882">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{124, 14}, {56, 26}}</string>
|
||||
<string key="NSFrame">{{125, 11}, {56, 26}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="913026852"/>
|
||||
@@ -794,13 +836,13 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {330, 139}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {330, 176}}</string>
|
||||
<reference key="NSSuperview" ref="359969914"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="497174199"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 303}, {332, 155}}</string>
|
||||
<string key="NSFrame">{{17, 303}, {332, 192}}</string>
|
||||
<reference key="NSSuperview" ref="853177344"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="881981747"/>
|
||||
@@ -1144,12 +1186,12 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSTransparent">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{369, 473}</string>
|
||||
<string key="NSFrameSize">{369, 510}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="359969914"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{1440, -180}, {1920, 1057}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">xcc-prefs</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -1164,7 +1206,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="993549244">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="PDFView" id="921834304">
|
||||
@@ -1176,8 +1218,6 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</set>
|
||||
<string key="NSFrame">{{0, 8}, {716, 654}}</string>
|
||||
<reference key="NSSuperview" ref="993549244"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSViewIsLayerTreeHost">YES</bool>
|
||||
<int key="DisplayMode">1</int>
|
||||
<bool key="PageBreaks">NO</bool>
|
||||
@@ -1186,11 +1226,9 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{716, 662}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="921834304"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -1291,7 +1329,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="NSNextKeyView" ref="231116691"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:21</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">updatingCappuccinoPanel</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -1564,6 +1602,14 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<string key="id">HyN-S0-KXD</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">save:</string>
|
||||
<reference key="source" ref="246574361"/>
|
||||
<reference key="destination" ref="493786566"/>
|
||||
</object>
|
||||
<string key="id">A92-fj-Uci</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">openXcodeProject:</string>
|
||||
@@ -2030,6 +2076,26 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<string key="id">dP2-Fc-one</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.XCCPanelStyleUtility</string>
|
||||
<reference key="source" ref="493786566"/>
|
||||
<reference key="destination" ref="246574361"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="493786566"/>
|
||||
<reference key="NSDestination" ref="246574361"/>
|
||||
<string key="NSLabel">value: values.XCCPanelStyleUtility</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">values.XCCPanelStyleUtility</string>
|
||||
<object class="NSDictionary" key="NSOptions">
|
||||
<string key="NS.key.0">NSValidatesImmediately</string>
|
||||
<boolean value="YES" key="NS.object.0"/>
|
||||
</object>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="id">uUW-Ro-3aA</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.updateCappuccinoWithLastVersionOfMasterBranch</string>
|
||||
@@ -2488,6 +2554,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference ref="497174199"/>
|
||||
<reference ref="59325359"/>
|
||||
<reference ref="665261882"/>
|
||||
<reference ref="493786566"/>
|
||||
</array>
|
||||
<reference key="parent" ref="853177344"/>
|
||||
</object>
|
||||
@@ -2854,6 +2921,19 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="object" ref="112491837"/>
|
||||
<reference key="parent" ref="763458174"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">GDP-7Q-0W5</string>
|
||||
<reference key="object" ref="493786566"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="549413473"/>
|
||||
</array>
|
||||
<reference key="parent" ref="359969914"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">QpC-n8-rmF</string>
|
||||
<reference key="object" ref="549413473"/>
|
||||
<reference key="parent" ref="493786566"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -2885,6 +2965,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<boolean value="NO" key="420.showNotes"/>
|
||||
<string key="537.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="537.showNotes"/>
|
||||
<string key="538.IBPersistedLastKnownCanvasPosition">{182, 582.5}</string>
|
||||
<string key="538.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="538.showNotes"/>
|
||||
<string key="539.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -2895,11 +2976,12 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<boolean value="NO" key="540.showNotes"/>
|
||||
<boolean value="NO" key="541.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="541.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="541.IBPersistedLastKnownCanvasPosition">{239, 248.5}</string>
|
||||
<string key="541.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="541.showNotes"/>
|
||||
<boolean value="YES" key="542.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="YES" key="542.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="542.IBPersistedLastKnownCanvasPosition">{-243.5, 329.5}</string>
|
||||
<boolean value="NO" key="542.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="542.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="542.IBPersistedLastKnownCanvasPosition">{-183.5, 363}</string>
|
||||
<string key="542.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="542.showNotes"/>
|
||||
<boolean value="YES" key="543.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
@@ -3063,6 +3145,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<boolean value="NO" key="839.showNotes"/>
|
||||
<string key="840.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="840.showNotes"/>
|
||||
<reference key="847.IBNSViewMetadataGestureRecognizers" ref="0"/>
|
||||
<string key="847.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference key="847.IBUserGuides" ref="0"/>
|
||||
<boolean value="NO" key="847.showNotes"/>
|
||||
@@ -3084,6 +3167,18 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<boolean value="NO" key="BYW-Rk-rZ4.showNotes"/>
|
||||
<string key="D0i-5i-RLQ.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="E18-tY-KOl.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSMutableDictionary" key="GDP-7Q-0W5.IBAttributePlaceholdersKey">
|
||||
<string key="NS.key.0">ToolTip</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
<string key="name">ToolTip</string>
|
||||
<reference key="object" ref="493786566"/>
|
||||
<string key="toolTip">If this is checked, when a Cappuccino project is opened, the project’s Xcode support project will be opened automatically</string>
|
||||
</object>
|
||||
</object>
|
||||
<boolean value="NO" key="GDP-7Q-0W5.IBNSControlSetsMaxLayoutWidthAtFirstLayoutMetadataKey"/>
|
||||
<string key="GDP-7Q-0W5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference key="GDP-7Q-0W5.IBUserGuides" ref="0"/>
|
||||
<boolean value="NO" key="GDP-7Q-0W5.showNotes"/>
|
||||
<object class="NSMutableDictionary" key="GR3-Dn-qSe.IBAttributePlaceholdersKey">
|
||||
<string key="NS.key.0">ToolTip</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
@@ -3116,6 +3211,8 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<string key="QAd-SJ-XIV.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference key="QAd-SJ-XIV.IBUserGuides" ref="0"/>
|
||||
<boolean value="NO" key="QAd-SJ-XIV.showNotes"/>
|
||||
<string key="QpC-n8-rmF.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="QpC-n8-rmF.showNotes"/>
|
||||
<string key="SNH-t4-Ay7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="SNH-t4-Ay7.showNotes"/>
|
||||
<string key="beY-m1-Aia.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
|
||||
@@ -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
@@ -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"];
|
||||
|
||||
|
||||
@@ -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"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user