Merge remote-tracking branch 'cappuccino/master'

This commit is contained in:
daboe01 committed 2018-03-08 15:43:23 +01:00
commit b404b1cf50
72 files changed
+4944 -254

No files matched your search

+5
View File
@@ -35,6 +35,11 @@
CPArray _allowedFileTypes @accessors(property=allowedFileTypes);
}
+ (CPURL)proposedFileURLWithDocumentName:(CPString)aDocumentName
{
return [CPURL URLWithString:aDocumentName];
}
+ (id)savePanel
{
return [[CPSavePanel alloc] init];
+70 -55
View File
@@ -117,6 +117,7 @@ var ShouldSuppressResizeNotifications = 1,
CPArray _DOMDividerElements;
CPString _dividerImagePath;
int _drawingDivider;
BOOL _isTracking;
CPString _autosaveName;
BOOL _shouldAutosave;
@@ -158,6 +159,7 @@ var ShouldSuppressResizeNotifications = 1,
_buttonBars = [];
_shouldAutosave = YES;
_isTracking = NO;
[self _setVertical:YES];
}
@@ -213,6 +215,9 @@ var ShouldSuppressResizeNotifications = 1,
[_subviews[index] setFrame:CGRectMake(0, ROUND((eachSize + dividerThickness) * index), frame.size.width, eachSize)];
}
if (_DOMDividerElements[_drawingDivider])
[self _setupDOMDivider];
[self setNeedsDisplay:YES];
[self _postNotificationDidResize];
@@ -363,9 +368,9 @@ var ShouldSuppressResizeNotifications = 1,
_DOMDividerElements[_drawingDivider].style.backgroundRepeat = "repeat";
CPDOMDisplayServerAppendChild(_DOMElement, _DOMDividerElements[_drawingDivider]);
[self _setupDOMDivider];
}
[self _setupDOMDivider];
CPDOMDisplayServerSetStyleLeftTop(_DOMDividerElements[_drawingDivider], NULL, CGRectGetMinX(aRect), CGRectGetMinY(aRect));
CPDOMDisplayServerSetStyleSize(_DOMDividerElements[_drawingDivider], CGRectGetWidth(aRect), CGRectGetHeight(aRect));
#endif
@@ -452,17 +457,26 @@ var ShouldSuppressResizeNotifications = 1,
return nil;
var point = [self convertPoint:aPoint fromView:[self superview]],
count = [_subviews count] - 1;
dividerIndex = [self _dividerAtPoint:point];
for (var i = 0; i < count; i++)
{
if ([self cursorAtPoint:point hitDividerAtIndex:i])
return self;
}
if (dividerIndex !== CPNotFound)
return self;
return [super hitTest:aPoint];
}
- (CPInteger)_dividerAtPoint:(CGPoint)aPoint
{
var count = [_subviews count] - 1;
for (var i = 0; i < count; i++)
{
if ([self cursorAtPoint:aPoint hitDividerAtIndex:i])
return i;
}
return CPNotFound;
}
/*
Tracks the divider.
@param anEvent the input event
@@ -473,12 +487,13 @@ var ShouldSuppressResizeNotifications = 1,
if (type == CPLeftMouseUp)
{
// We disabled autosaving during tracking.
_shouldAutosave = YES;
if (_currentDivider != CPNotFound)
if ([anEvent clickCount] == 2 || (_isTracking && _currentDivider != CPNotFound))
{
// We disabled autosaving during tracking.
_shouldAutosave = YES;
_currentDivider = CPNotFound;
_isTracking = NO;
[self _autosave];
[self _updateResizeCursor:anEvent];
}
@@ -488,59 +503,55 @@ var ShouldSuppressResizeNotifications = 1,
if (type == CPLeftMouseDown)
{
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil],
count = [_subviews count] - 1;
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
_currentDivider = [self _dividerAtPoint:point];
_currentDivider = CPNotFound;
var frame = [_subviews[_currentDivider] frame],
startPosition = frame.origin[_originComponent] + frame.size[_sizeComponent];
for (var i = 0; i < count; i++)
if ([anEvent clickCount] == 2 &&
[self _delegateRespondsToSplitViewCanCollapseSubview] &&
[self _delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex])
{
var frame = [_subviews[i] frame],
startPosition = frame.origin[_originComponent] + frame.size[_sizeComponent];
var minPosition = [self minPossiblePositionOfDividerAtIndex:_currentDivider],
maxPosition = [self maxPossiblePositionOfDividerAtIndex:_currentDivider],
preCollapsePosition = [_preCollapsePositions objectForKey:"" + _currentDivider] || 0;
if ([self cursorAtPoint:point hitDividerAtIndex:i])
if ([self _sendDelegateSplitViewCanCollapseSubview:_subviews[_currentDivider]] && [self _sendDelegateSplitViewShouldCollapseSubview:_subviews[_currentDivider] forDoubleClickOnDividerAtIndex:_currentDivider])
{
if ([anEvent clickCount] == 2 &&
[self _delegateRespondsToSplitViewCanCollapseSubview] &&
[self _delegateRespondsToSplitViewshouldCollapseSubviewForDoubleClickOnDividerAtIndex])
{
var minPosition = [self minPossiblePositionOfDividerAtIndex:i],
maxPosition = [self maxPossiblePositionOfDividerAtIndex:i],
preCollapsePosition = [_preCollapsePositions objectForKey:"" + i] || 0;
if ([self _sendDelegateSplitViewCanCollapseSubview:_subviews[i]] && [self _sendDelegateSplitViewShouldCollapseSubview:_subviews[i] forDoubleClickOnDividerAtIndex:i])
{
if ([self isSubviewCollapsed:_subviews[i]])
[self setPosition:preCollapsePosition ? preCollapsePosition : (minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:i];
else
[self setPosition:minPosition ofDividerAtIndex:i];
}
else if ([self _sendDelegateSplitViewCanCollapseSubview:_subviews[i + 1]] && [self _sendDelegateSplitViewShouldCollapseSubview:_subviews[i + 1] forDoubleClickOnDividerAtIndex:i])
{
if ([self isSubviewCollapsed:_subviews[i + 1]])
[self setPosition:preCollapsePosition ? preCollapsePosition : (minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:i];
else
[self setPosition:maxPosition ofDividerAtIndex:i];
}
}
if ([self isSubviewCollapsed:_subviews[_currentDivider]])
[self setPosition:preCollapsePosition ? preCollapsePosition : (minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:_currentDivider];
else
{
_currentDivider = i;
_initialOffset = startPosition - point[_originComponent];
// Don't autosave during a resize. We'll wait until it's done.
_shouldAutosave = NO;
[self _postNotificationWillResize];
}
[self setPosition:minPosition ofDividerAtIndex:_currentDivider];
}
else if ([self _sendDelegateSplitViewCanCollapseSubview:_subviews[_currentDivider + 1]] && [self _sendDelegateSplitViewShouldCollapseSubview:_subviews[_currentDivider + 1] forDoubleClickOnDividerAtIndex:_currentDivider])
{
if ([self isSubviewCollapsed:_subviews[_currentDivider + 1]])
[self setPosition:preCollapsePosition ? preCollapsePosition : (minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:_currentDivider];
else
[self setPosition:maxPosition ofDividerAtIndex:_currentDivider];
}
}
else
{
_initialOffset = startPosition - point[_originComponent];
// Don't autosave during a resize. We'll wait until it's done.
_shouldAutosave = NO;
[self _postNotificationWillResize];
}
if (_currentDivider === CPNotFound)
return;
}
else if (type == CPLeftMouseDragged && _currentDivider != CPNotFound)
{
if (!_isTracking)
{
// Don't autosave during a resize. We'll wait until it's done.
_shouldAutosave = NO;
[self _postNotificationWillResize];
_isTracking = YES;
}
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
[self setPosition:(point[_originComponent] + _initialOffset) ofDividerAtIndex:_currentDivider];
@@ -553,8 +564,11 @@ var ShouldSuppressResizeNotifications = 1,
- (void)mouseDown:(CPEvent)anEvent
{
// FIXME: This should not trap events if not on a divider!
[self trackDivider:anEvent];
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil],
dividerIndex = [self _dividerAtPoint:point];
if (dividerIndex !== CPNotFound)
[self trackDivider:anEvent];
}
- (void)viewDidMoveToWindow
@@ -1193,7 +1207,7 @@ The sum of the views and the sum of the dividers should be equal to the size of
[self removeAllTrackingAreas];
var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow;
for (var i = 0; i < _subviews.length - 1; i++)
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self effectiveRectOfDividerAtIndex:i]
options:options
@@ -1438,6 +1452,7 @@ var CPSplitViewDelegateKey = "CPSplitViewDelegateKey",
_currentDivider = CPNotFound;
_shouldAutosave = YES;
_isTracking = NO;
_DOMDividerElements = [];
+1
View File
@@ -40,6 +40,7 @@
@protocol CPTextDelegate <CPObject>
@optional
- (BOOL)textShouldBeginEditing:(CPText)aTextObject;
- (BOOL)textShouldEndEditing:(CPText)aTextObject;
- (void)textDidBeginEditing:(CPNotification)aNotification;
+9 -3
View File
@@ -873,12 +873,18 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if (!CPTextFieldInputDidBlur)
CPTextFieldBlurHandler();
CPTextFieldInputDidBlur = NO;
CPTextFieldInputResigning = NO;
if (element.parentNode == _DOMElement)
element.parentNode.removeChild(element);
// Previosly, we unflagged CPTextFieldInputDidBlur and CPTextFieldInputResigning before
// the call to removeChild. This resulted in DOM exceptions in Chrome under certain conditions.
// See https://stackoverflow.com/questions/21926083/failed-to-execute-removechild-on-node
// for why we need to unflag CPTextFieldInputDidBlur and CPTextFieldInputResigning
// only after removing the element.
CPTextFieldInputDidBlur = NO;
CPTextFieldInputResigning = NO;
CPTextFieldInputIsActive = NO;
if (document.attachEvent)
+1 -4
View File
@@ -168,10 +168,7 @@ CPLineMovesUp = 4;
- (void)setTextView:(CPTextView)aTextView
{
if (_textView)
{
[self _removeAllLines];
[_textView setTextContainer:nil];
}
_textView = aTextView;
@@ -252,4 +249,4 @@ var CPTextContainerSizeKey = @"CPTextContainerSizeKey",
[aCoder encodeObject:_layoutManager forKey:CPTextContainerLayoutManagerKey];
}
@end
@end
+186 -54
View File
@@ -43,6 +43,7 @@
@protocol CPTextViewDelegate <CPTextDelegate>
@optional
- (BOOL)textView:(CPTextView)aTextView doCommandBySelector:(SEL)aSelector;
- (BOOL)textView:(CPTextView)aTextView shouldChangeTextInRange:(CPRange)affectedCharRange replacementString:(CPString)replacementString;
- (CPDictionary)textView:(CPTextView)textView shouldChangeTypingAttributes:(CPDictionary)oldTypingAttributes toAttributes:(CPDictionary)newTypingAttributes;
@@ -94,13 +95,16 @@ CPSelectByWord = 1;
CPSelectByParagraph = 2;
var kDelegateRespondsTo_textShouldBeginEditing = 1 << 0,
kDelegateRespondsTo_textView_doCommandBySelector = 1 << 1,
kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange = 1 << 2,
kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString = 1 << 3,
kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes = 1 << 4,
kDelegateRespondsTo_textView_textDidChange = 1 << 5,
kDelegateRespondsTo_textView_didChangeSelection = 1 << 6,
kDelegateRespondsTo_textView_didChangeTypingAttributes = 1 << 7;
kDelegateRespondsTo_textShouldEndEditing = 1 << 1
kDelegateRespondsTo_textView_doCommandBySelector = 1 << 2,
kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange = 1 << 3,
kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString = 1 << 4,
kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes = 1 << 5,
kDelegateRespondsTo_textView_textDidChange = 1 << 6,
kDelegateRespondsTo_textView_didChangeSelection = 1 << 7,
kDelegateRespondsTo_textView_didChangeTypingAttributes = 1 << 8,
kDelegateRespondsTo_textView_textDidBeginEditing = 1 << 9,
kDelegateRespondsTo_textView_textDidEndEditing = 1 << 10;
@class _CPCaret;
@@ -152,6 +156,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
CPTimer _scrollingTimer;
CPString _placeholderString;
BOOL _firstResponderButNotEditingYet;
CPRange _mouseDownOldSelection;
}
+ (Class)_binderClassForBinding:(CPString)aBinding
@@ -264,6 +272,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
[super _removeObservers];
[self _setObserveWindowKeyNotifications:NO];
[self _removeDelegateObservers];
}
- (void)_addObservers
@@ -274,7 +283,53 @@ var kDelegateRespondsTo_textShouldBeginEditing
[super _addObservers];
[self _setObserveWindowKeyNotifications:YES];
[self _startObservingClipView];
[self _addDelegateObservers];
}
- (void)_addDelegateObservers
{
if (!_delegate) return;
var nc = [CPNotificationCenter defaultCenter];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidBeginEditing)
[nc addObserver:_delegate selector:@selector(textDidBeginEditing:) name:CPTextDidBeginEditingNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidChange)
[nc addObserver:_delegate selector:@selector(textDidChange:) name:CPTextDidChangeNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidEndEditing)
[nc addObserver:_delegate selector:@selector(textDidEndEditing:) name:CPTextDidEndEditingNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeSelection)
[nc addObserver:_delegate selector:@selector(textViewDidChangeSelection:) name:CPTextViewDidChangeSelectionNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeTypingAttributes)
[nc addObserver:_delegate selector:@selector(textViewDidChangeTypingAttributes:) name:CPTextViewDidChangeTypingAttributesNotification object:self];
}
- (void)_removeDelegateObservers
{
if (!_delegate) return;
var nc = [CPNotificationCenter defaultCenter];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidBeginEditing)
[nc removeObserver:_delegate name:CPTextDidBeginEditingNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidChange)
[nc removeObserver:_delegate name:CPTextDidChangeNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidEndEditing)
[nc removeObserver:_delegate name:CPTextDidEndEditingNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeSelection)
[nc removeObserver:_delegate name:CPTextViewDidChangeSelectionNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeTypingAttributes)
[nc removeObserver:_delegate name:CPTextViewDidChangeTypingAttributesNotification object:self];
}
- (void)_startObservingClipView
{
if (!_observedClipView)
@@ -358,7 +413,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)_windowDidResignKey:(CPNotification)aNotification
{
if (![[self window] isKeyWindow])
[self resignFirstResponder];
[self _resignFirstResponder];
}
- (void)_windowDidBecomeKey:(CPNotification)aNotification
@@ -452,17 +507,33 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (BOOL)becomeFirstResponder
{
[super becomeFirstResponder];
_firstResponderButNotEditingYet = YES;
[self _becomeFirstResponder];
return YES;
}
- (BOOL)resignFirstResponder
- (void)_resignFirstResponder
{
[self _reverseSetBinding];
[_caret stopBlinking];
[self setNeedsDisplay:YES];
[_CPNativeInputManager cancelCurrentInputSessionIfNeeded];
}
- (BOOL)resignFirstResponder
{
if (_firstResponderButNotEditingYet)
_firstResponderButNotEditingYet = NO;
else
{
if ([self _sendDelegateTextShouldEndEditing])
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextDidEndEditingNotification object:self];
else
return NO;
}
[self _resignFirstResponder];
return YES;
}
@@ -479,6 +550,8 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (aDelegate === _delegate)
return;
[self _removeDelegateObservers];
_delegateRespondsToSelectorMask = 0;
_delegate = aDelegate;
@@ -493,12 +566,21 @@ var kDelegateRespondsTo_textShouldBeginEditing
if ([_delegate respondsToSelector:@selector(textViewDidChangeTypingAttributes:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_didChangeTypingAttributes;
if ([_delegate respondsToSelector:@selector(textDidBeginEditing:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_textDidBeginEditing;
if ([_delegate respondsToSelector:@selector(textDidEndEditing:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_textDidEndEditing;
if ([_delegate respondsToSelector:@selector(textView:doCommandBySelector:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_doCommandBySelector;
if ([_delegate respondsToSelector:@selector(textShouldBeginEditing:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textShouldBeginEditing;
if ([_delegate respondsToSelector:@selector(textShouldEndEditing:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textShouldEndEditing;
if ([_delegate respondsToSelector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange;
@@ -507,6 +589,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
if ([_delegate respondsToSelector:@selector(textView:shouldChangeTypingAttributes:toAttributes:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes;
if (_superview)
[self _addDelegateObservers];
}
}
@@ -643,9 +728,21 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)didChangeText
{
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextDidChangeNotification object:self];
}
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_textDidChange)
[_delegate textDidChange:[[CPNotification alloc] initWithName:CPTextDidChangeNotification object:self userInfo:nil]];
- (BOOL)_didBeginEditing
{
if (_firstResponderButNotEditingYet)
{
if ([self _sendDelegateTextShouldBeginEditing])
{
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextDidBeginEditingNotification object:self];
_firstResponderButNotEditingYet = NO;
} else
return NO;
}
return YES;
}
- (BOOL)shouldChangeTextInRange:(CPRange)aRange replacementString:(CPString)aString
@@ -653,7 +750,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (![self isEditable])
return NO;
return [self _sendDelegateTextShouldBeginEditing] && [self _sendDelegateShouldChangeTextInRange:aRange replacementString:aString];
return [self _sendDelegateShouldChangeTextInRange:aRange replacementString:aString];
}
@@ -685,7 +782,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
var isAttributed = [aString isKindOfClass:CPAttributedString],
string = isAttributed ? [aString string]:aString;
if (![self shouldChangeTextInRange:CPMakeRangeCopy(_selectionRange) replacementString:string])
if (![self _didBeginEditing] || ![self shouldChangeTextInRange:CPMakeRangeCopy(_selectionRange) replacementString:string])
return;
if (!isAttributed)
@@ -787,53 +884,80 @@ var kDelegateRespondsTo_textShouldBeginEditing
}
}
/*!
Sets the selection to a range of characters in response to user action.
@param range The range of characters to select. This range must begin and end on glyph boundaries and not split base glyphs and their nonspacing marks.
*/
- (void)setSelectedRange:(CPRange)range
{
[_CPNativeInputManager cancelCurrentInputSessionIfNeeded];
[self setSelectedRange:range affinity:0 stillSelecting:NO];
}
/*!
Sets the selection to a range of characters in response to user action.
@param range The range of characters to select. This range must begin and end on glyph boundaries and not split base glyphs and their nonspacing marks.
@param affinity The selection affinity for the selection. See selectionAffinity for more information about how affinities work.
@param selecting YES to behave appropriately for a continuing selection where the user is still dragging the mouse, NO otherwise. If YES, the receiver doesn’t send notifications or remove the marking from its marked text. If NO, the receiver posts an NSTextViewDidChangeSelectionNotification to the default notification center and removes the marking from marked text if the new selection is greater than the marked region.
*/
- (void)setSelectedRange:(CPRange)range affinity:(CPSelectionAffinity)affinity stillSelecting:(BOOL)selecting
{
[self _setSelectedRange:range affinity:affinity stillSelecting:selecting overwriteTypingAttributes:YES];
}
/*!
Sets the selection to a range of characters in response to user action.
@param range The range of characters to select. This range must begin and end on glyph boundaries and not split base glyphs and their nonspacing marks.
@param affinity The selection affinity for the selection. See selectionAffinity for more information about how affinities work.
@param selecting YES to behave appropriately for a continuing selection where the user is still dragging the mouse, NO otherwise. If YES, the receiver doesn’t send notifications or remove the marking from its marked text. If NO, the receiver posts an NSTextViewDidChangeSelectionNotification to the default notification center and removes the marking from marked text if the new selection is greater than the marked region.
@param doOverwrite YES to override typing attributes. NO to not override.
*/
- (void)_setSelectedRange:(CPRange)range affinity:(CPSelectionAffinity)affinity stillSelecting:(BOOL)selecting overwriteTypingAttributes:(BOOL)doOverwrite
{
var maxRange = CPMakeRange(0, [_layoutManager numberOfCharacters]);
var maxRange = CPMakeRange(0, [_layoutManager numberOfCharacters]),
newSelectionRange;
range = CPIntersectionRange(maxRange, range);
if (!selecting && [self _delegateRespondsToWillChangeSelectionFromCharacterRangeToCharacterRange])
{
_selectionRange = [self _sendDelegateWillChangeSelectionFromCharacterRange:_selectionRange toCharacterRange:range];
newSelectionRange = [self _sendDelegateWillChangeSelectionFromCharacterRange:_selectionRange toCharacterRange:range];
}
else
{
_selectionRange = CPMakeRangeCopy(range);
_selectionRange = [self selectionRangeForProposedRange:_selectionRange granularity:[self selectionGranularity]];
newSelectionRange = [self selectionRangeForProposedRange:range granularity:[self selectionGranularity]];
}
if (_selectionRange.length)
[_layoutManager invalidateDisplayForGlyphRange:_selectionRange];
var isNewSelection = !CPEqualRanges(newSelectionRange, _selectionRange);
if (isNewSelection)
_selectionRange = newSelectionRange;
if (newSelectionRange.length)
{
if (isNewSelection)
[_layoutManager invalidateDisplayForGlyphRange:newSelectionRange];
}
else
[self setNeedsDisplay:YES];
if (!selecting)
{
if ([self _isFirstResponder])
[self updateInsertionPointStateAndRestartTimer:((_selectionRange.length === 0) && ![_caret isBlinking])];
[self updateInsertionPointStateAndRestartTimer:((newSelectionRange.length === 0) && ![_caret isBlinking])];
if (doOverwrite && _placeholderString === nil)
// If there is no new selection but the pervious mouseDown has saved a selection we check against the saved selection instead
if (!isNewSelection && _mouseDownOldSelection)
isNewSelection = !CPEqualRanges(newSelectionRange, _mouseDownOldSelection);
if (doOverwrite && _placeholderString === nil && isNewSelection)
[self setTypingAttributes:[_textStorage attributesAtIndex:CPMaxRange(range) effectiveRange:nil]];
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextViewDidChangeSelectionNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeSelection)
[_delegate textViewDidChangeSelection:[[CPNotification alloc] initWithName:CPTextViewDidChangeSelectionNotification object:self userInfo:nil]];
}
if (!selecting && _selectionRange.length > 0)
if (!selecting && newSelectionRange.length > 0)
[_CPNativeInputManager focusForClipboardOfTextView:self];
}
@@ -917,18 +1041,18 @@ var kDelegateRespondsTo_textShouldBeginEditing
{
var fraction = [],
point = [self convertPoint:point fromView:nil];
// convert to container coordinate
point.x -= _textContainerOrigin.x;
point.y -= _textContainerOrigin.y;
var index = [_layoutManager glyphIndexForPoint:point inTextContainer:_textContainer fractionOfDistanceThroughGlyph:fraction];
if (index === CPNotFound)
index = [_layoutManager numberOfCharacters];
else if (fraction[0] > 0.5)
index++;
return index;
}
- (CGPoint)_characterIndexFromEvent:(CPEvent)event
@@ -951,9 +1075,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
[_CPNativeInputManager cancelCurrentInputSessionIfNeeded];
[_caret setVisibility:NO];
_startTrackingLocation = [self _characterIndexFromEvent:event];
var granularities = [CPNotFound, CPSelectByCharacter, CPSelectByWord, CPSelectByParagraph];
[self setSelectionGranularity:granularities[[event clickCount]]];
@@ -966,20 +1090,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
placeholderFrame = CGRectIntersection([_layoutManager boundingRectForGlyphRange:placeholderRange inTextContainer:_textContainer], _frame),
rangeToHide = CPMakeRange(0, _selectionRange.location - lineBeginningIndex),
dragPlaceholder;
// hide the left part of the first line of the selection that is not included
[placeholderString addAttribute:CPForegroundColorAttributeName
value:[CPColor colorWithRed:1 green:1 blue:1 alpha:0]
range:rangeToHide];
_movingSelection = CPMakeRange(_startTrackingLocation, 0);
dragPlaceholder = [[CPTextView alloc] initWithFrame:placeholderFrame];
[dragPlaceholder._textStorage replaceCharactersInRange:CPMakeRange(0, 0) withAttributedString:placeholderString];
[dragPlaceholder setBackgroundColor:[CPColor colorWithRed:1 green:1 blue:1 alpha:0]];
[dragPlaceholder setAlphaValue:0.5];
var stringForPasting = [_textStorage attributedSubstringFromRange:CPMakeRangeCopy(_selectionRange)],
richData = [_CPRTFProducer produceRTF:stringForPasting documentAttributes:@{}],
draggingPasteboard = [CPPasteboard pasteboardWithName:CPDragPboard];
@@ -994,17 +1118,19 @@ var kDelegateRespondsTo_textShouldBeginEditing
pasteboard:draggingPasteboard
source:self
slideBack:YES];
return;
}
var setRange = CPMakeRange(_startTrackingLocation, 0);
if ([event modifierFlags] & CPShiftKeyMask)
setRange = _MakeRangeFromAbs(_startTrackingLocation < _MidRange(_selectionRange) ? CPMaxRange(_selectionRange) : _selectionRange.location, _startTrackingLocation);
else
_scrollingTimer = [CPTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(_supportScrolling:) userInfo:nil repeats:YES]; // fixme: only start if we are in the scrolling areas
// Save old selection so we can only send textViewDidChangeTypingAttribute notification when selection is changed on mouse up.
_mouseDownOldSelection = _selectionRange;
[self setSelectedRange:setRange affinity:0 stillSelecting:YES];
}
@@ -1020,7 +1146,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (_movingSelection)
return;
var oldRange = [self selectedRange],
index = [self _characterIndexFromEvent:event];
@@ -1047,6 +1173,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
_previousSelectionGranularity = [self selectionGranularity];
[self setSelectionGranularity:CPSelectByCharacter];
[self setSelectedRange:[self selectedRange] affinity:0 stillSelecting:NO];
_mouseDownOldSelection = nil;
var point = [_layoutManager locationForGlyphAtIndex:[self selectedRange].location];
_stickyXLocation = point.x;
@@ -1470,7 +1597,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)_deleteForRange:(CPRange)changedRange
{
if (![self shouldChangeTextInRange:changedRange replacementString:@""])
if (![self _didBeginEditing] || ![self shouldChangeTextInRange:changedRange replacementString:@""])
return;
changedRange = CPIntersectionRange(CPMakeRange(0, [_layoutManager numberOfCharacters]), changedRange);
@@ -1592,11 +1719,11 @@ var kDelegateRespondsTo_textShouldBeginEditing
[self _enrichEssentialTypingAttributes:_typingAttributes];
}
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextViewDidChangeTypingAttributesNotification
object:self];
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextViewDidChangeTypingAttributesNotification object:self];
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_didChangeTypingAttributes)
[_delegate textViewDidChangeTypingAttributes:[[CPNotification alloc] initWithName:CPTextViewDidChangeTypingAttributesNotification object:self userInfo:nil]];
// We always clear the saved selection range from the last mouse down event here.
// This is normally done in mouseUp: but this is if that event was never sent.
_mouseDownOldSelection = nil;
}
- (CPDictionary)_attributesForFontPanel
@@ -1739,7 +1866,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)underline:(id)sender
{
if (![self shouldChangeTextInRange:_selectionRange replacementString:nil])
if (![self _didBeginEditing] || ![self shouldChangeTextInRange:_selectionRange replacementString:nil])
return;
if (!CPEmptyRange(_selectionRange))
@@ -2040,7 +2167,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
{
var point = [info draggingLocation],
location = [self _characterIndexFromRawPoint:CGPointCreateCopy(point)];
_movingSelection = CPMakeRange(location, 0);
[_caret _drawCaretAtLocation:_movingSelection.location];
[_caret setVisibility:YES];
@@ -2053,11 +2180,11 @@ var kDelegateRespondsTo_textShouldBeginEditing
{
var location = [self convertPoint:[aSender draggingLocation] fromView:nil],
pasteboard = [aSender draggingPasteboard];
if ([pasteboard availableTypeFromArray:[CPRTFPboardType, CPStringPboardType]])
{
[_caret setVisibility:NO];
if (CPLocationInRange(_movingSelection.location, _selectionRange))
{
[self setSelectedRange:_movingSelection];
@@ -2082,7 +2209,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
[self insertText:dataForPasting];
}, 0);
}
if ([pasteboard availableTypeFromArray:[CPColorDragType]])
[self setTextColor:[CPKeyedUnarchiver unarchiveObjectWithData:[pasteboard dataForType:CPColorDragType]] range:_selectionRange];
}
@@ -2156,6 +2283,14 @@ var kDelegateRespondsTo_textShouldBeginEditing
return [_delegate textShouldBeginEditing:self];
}
- (BOOL)_sendDelegateTextShouldEndEditing
{
if (!(_delegateRespondsToSelectorMask & kDelegateRespondsTo_textShouldEndEditing))
return YES;
return [_delegate textShouldEndEditing:self];
}
- (BOOL)_sendDelegateShouldChangeTextInRange:(CPRange)aRange replacementString:(CPString)aString
{
if (!(_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString))
@@ -2166,7 +2301,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (CPDictionary)_sendDelegateShouldChangeTypingAttributes:(CPDictionary)typingAttributes toAttributes:(CPDictionary)attributes
{
if (!(_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_doCommandBySelector))
if (!(_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes))
return [CPDictionary dictionary];
return [_delegate textView:self shouldChangeTypingAttributes:typingAttributes toAttributes:attributes];
@@ -2399,7 +2534,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
_caretTimer = nil;
}
}
- (void)_drawCaretAtLocation:(int)aLoc
{
var rect = [_textView._layoutManager boundingRectForGlyphRange:CPMakeRange(aLoc, 1) inTextContainer:_textView._textContainer];
@@ -2732,6 +2867,3 @@ var _CPCopyPlaceholder = '-';
}
@end
+3 -3
View File
@@ -113,13 +113,13 @@ var hexTable = [];
- (CPNumber)script
{
return [CPNumber numberWithInt: script];
return [CPNumber numberWithInt:script];
}
- (CPNumber)underline
{
if (underline != 0)
return [CPNumber numberWithInteger: underline];
return [CPNumber numberWithInt:underline];
else
return nil;
}
@@ -127,7 +127,7 @@ var hexTable = [];
- (CPNumber)strikethrough
{
if (strikethrough != 0)
return [CPNumber numberWithInteger: strikethrough];
return [CPNumber numberWithInt:strikethrough];
else
return nil;
}
+4 -6
View File
@@ -1,5 +1,5 @@
/*
RTFProducer.j
_CPRTFProducer.j
Serialize CPAttributedString to a RTF String
@@ -189,11 +189,9 @@ function _points2twips(a) { return (a) * 20.0; }
if (val)
{
var size = [val sizeValue];
detail = [CPString stringWithFormat:@"\\paperw%d \\paperh%d",
_points2twips(size.width),
_points2twips(size.height)];
_points2twips(val.width),
_points2twips(val.height)];
result += detail;
}
@@ -612,4 +610,4 @@ function _points2twips(a) { return (a) * 20.0; }
output += trailerString;
return output;
}
@end
@end
+12 -4
View File
@@ -523,17 +523,25 @@ CPTokenFieldDeleteButtonType = 1;
var element = [self _inputElement];
CPTokenFieldInputResigning = YES;
element.blur();
if (CPTokenFieldInputIsActive)
element.blur();
if (!CPTokenFieldInputDidBlur)
CPTokenFieldBlurHandler();
CPTokenFieldInputDidBlur = NO;
CPTokenFieldInputResigning = NO;
if (element.parentNode == [_tokenScrollView documentView]._DOMElement)
element.parentNode.removeChild(element);
// Previosly, we unflagged CPTokenFieldInputDidBlur and CPTokenFieldInputResigning before
// the call to removeChild. This may result in DOM exceptions in Chrome under certain conditions.
// See https://stackoverflow.com/questions/21926083/failed-to-execute-removechild-on-node
// for why we need to unflag CPTokenFieldInputDidBlur and CPTokenFieldInputResigning
// only after removing the element.
CPTokenFieldInputDidBlur = NO;
CPTokenFieldInputResigning = NO;
CPTokenFieldInputIsActive = NO;
if (document.attachEvent)
+1 -1
View File
@@ -37,7 +37,7 @@ appKitTask = framework ("AppKit", function(appKitTask)
appKitTask.setCompilerFlags("-O2 " + INCLUDES);
}
else
appKitTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
appKitTask.setCompilerFlags("-DDEBUG -g -S --inline-msg-send " + INCLUDES);
});
$BUILD_CJS_CAPPUCCINO_APPKIT = FILE.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "AppKit");
Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 B

After

Width:  |  Height:  |  Size: 3.6 KiB

+15 -23
View File
@@ -508,9 +508,7 @@ var themedButtonValues = nil,
orientation: PatternIsVertical
}),
trackColorLegacy = PatternColor("scroller-legacy-vertical-track-center.png", 14.0, 1.0),
incrementColorLegacy = PatternColor("scroller-legacy-vertical-track-bottom.png", 14.0, 11.0),
decrementColorLegacy = PatternColor("scroller-legacy-vertical-track-top.png", 14.0, 11.0),
trackColorLegacy = PatternColor("scroller-legacy-vertical-track-center.png", 14.0, 1.0),
knobColor = PatternColor(
"scroller-vertical-knob{style}{position}.png",
@@ -535,7 +533,7 @@ var themedButtonValues = nil,
[@"minimum-knob-length", 21.0, CPThemeStateVertical],
// Overlay
[@"scroller-width", 9.0, CPThemeStateVertical],
[@"scroller-width", 14.0, CPThemeStateVertical],
[@"knob-inset", CGInsetMake(2.0, 0.0, 0.0, 0.0), CPThemeStateVertical],
[@"track-inset", CGInsetMake(2.0, 0.0, 2.0, 0.0), CPThemeStateVertical],
[@"track-border-overlay", 12.0, CPThemeStateVertical],
@@ -553,7 +551,7 @@ var themedButtonValues = nil,
// Legacy
[@"scroller-width", 14.0, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"knob-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"knob-inset", CGInsetMake(0.0, 2.0, 0.0, 2.0), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"track-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"track-border-overlay", 0.0, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
@@ -562,13 +560,11 @@ var themedButtonValues = nil,
[@"knob-slot-color", trackColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy, CPThemeStateSelected, CPThemeStateScrollerKnobDark]],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobDark]],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobLight]],
[@"knob-color", knobColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"knob-color", knobColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobLight]],
[@"knob-color", knobColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobDark]],
[@"increment-line-color", incrementColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"decrement-line-color", decrementColorLegacy, [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"decrement-line-size", CGSizeMake(14.0, 11.0), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"increment-line-size", CGSizeMake(14.0, 11.0), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]]
[@"knob-color", knobColor["dark"], [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"increment-line-color", [CPNull null], [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"decrement-line-color", [CPNull null], [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"decrement-line-size", CGSizeMakeZero(), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]],
[@"increment-line-size", CGSizeMakeZero(), [CPThemeStateVertical, CPThemeStateScrollViewLegacy]]
];
[self registerThemeValues:themedVerticalScrollerValues forView:scroller];
@@ -588,9 +584,7 @@ var themedButtonValues = nil,
orientation: PatternIsHorizontal
}),
trackColorLegacy = PatternColor("scroller-legacy-horizontal-track-center.png", 1.0, 14.0),
incrementColorLegacy = PatternColor("scroller-legacy-horizontal-track-right.png", 11.0, 14.0),
decrementColorLegacy = PatternColor("scroller-legacy-horizontal-track-left.png", 11.0, 14.0),
trackColorLegacy = PatternColor("scroller-legacy-horizontal-track-center.png", 1.0, 14.0),
knobColor = PatternColor(
"scroller-horizontal-knob{style}{position}.png",
@@ -631,20 +625,18 @@ var themedButtonValues = nil,
// Legacy
[@"scroller-width", 14.0, CPThemeStateScrollViewLegacy],
[@"knob-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateScrollViewLegacy],
[@"knob-inset", CGInsetMake(2.0, 0.0, 2.0, 0.0), CPThemeStateScrollViewLegacy],
[@"track-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateScrollViewLegacy],
[@"track-border-overlay", 0.0, CPThemeStateScrollViewLegacy],
[@"knob-slot-color", trackColorLegacy, CPThemeStateScrollViewLegacy],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateScrollViewLegacy, CPThemeStateSelected]],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobLight]],
[@"knob-slot-color", trackColorLegacy, [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobDark]],
[@"knob-color", knobColorLegacy, CPThemeStateScrollViewLegacy],
[@"knob-color", knobColorLegacy, [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobLight]],
[@"knob-color", knobColorLegacy, [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobDark]],
[@"increment-line-color", incrementColorLegacy, CPThemeStateScrollViewLegacy],
[@"decrement-line-color", decrementColorLegacy, CPThemeStateScrollViewLegacy],
[@"decrement-line-size", CGSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy],
[@"increment-line-size", CGSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy]
[@"knob-color", knobColor["@"], CPThemeStateScrollViewLegacy],
[@"knob-color", knobColor["light"], [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobLight]],
[@"knob-color", knobColor["dark"], [CPThemeStateScrollViewLegacy, CPThemeStateScrollerKnobDark]],
[@"decrement-line-size", CGSizeMakeZero(), CPThemeStateScrollViewLegacy],
[@"increment-line-size", CGSizeMakeZero(), CPThemeStateScrollViewLegacy]
];
[self registerThemeValues:themedHorizontalScrollerValues forView:scroller];
+2 -1
View File
@@ -836,7 +836,8 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
- (void)setSelectedRange:(CPRange)aRange
{
#if PLATFORM(DOM)
[[[self window] platformWindow] setSelectedRange:aRange inElement:_DOMTextElement];
if (_DOMTextElement)
[[[self window] platformWindow] setSelectedRange:aRange inElement:_DOMTextElement];
#endif
}
+3 -6
View File
@@ -82,8 +82,7 @@
*/
- (void)encodePoint:(CGPoint)aPoint
{
[self encodeNumber:aPoint.x];
[self encodeNumber:aPoint.y];
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
@@ -92,8 +91,7 @@
*/
- (void)encodeRect:(CGRect)aRect
{
[self encodePoint:aRect.origin];
[self encodeSize:aRect.size];
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
@@ -102,8 +100,7 @@
*/
- (void)encodeSize:(CGSize)aSize
{
[self encodeNumber:aSize.width];
[self encodeNumber:aSize.height];
_CPRaiseInvalidAbstractInvocation(self, _cmd);
}
/*!
+1 -1
View File
@@ -209,7 +209,7 @@
[[self mutableArrayValueForKeyPath:aKeyPath] removeObjectsAtIndexes:indexes];
else if (changeKind === CPKeyValueChangeReplacement)
[[self mutableArrayValueForKeyPath:aKeyPath] replaceObjectAtIndexes:indexes withObjects:newValue];
[[self mutableArrayValueForKeyPath:aKeyPath] replaceObjectsAtIndexes:indexes withObjects:newValue];
}
else
{
+1 -1
View File
@@ -336,7 +336,7 @@ FIXME: Do we need this?
- (id)initWithCoder:(CPCoder)aCoder
{
return [aCoder decodeNumber];
return [aCoder decodeObjectForKey:@"self"];
}
- (void)encodeWithCoder:(CPCoder)aCoder
@@ -220,7 +220,7 @@ var CPSelectorNameKey = @"CPSelectorName",
{
if ([object isKindOfClass:[CPDictionary class]])
return [object objectForKey:anIndex];
else ([object isKindOfClass:[CPArray class]])
else if ([object isKindOfClass:[CPArray class]])
return [object objectAtIndex:anIndex];
[CPException raise:CPInvalidArgumentException reason:@"object[#] requires a CPDictionary or CPArray"];
@@ -70,7 +70,7 @@
return result;
}
- (BOOL)isEqual:(id)object;
- (BOOL)isEqual:(id)object
{
if (self === object)
return YES;
+1 -1
View File
@@ -53,7 +53,7 @@ foundationTask = framework ("Foundation", function(foundationTask)
if ($CONFIGURATION === "Release")
foundationTask.setCompilerFlags("-O2 " + INCLUDES);
else
foundationTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
foundationTask.setCompilerFlags("-DDEBUG -g -S --inline-msg-send " + INCLUDES);
});
$BUILD_CJS_FOUNDATION = FILE.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "Foundation");
+1
View File
@@ -772,6 +772,7 @@ var STATIC_MAGIC_NUMBER = "@STATIC",
MARKER_TEXT = "t",
MARKER_IMPORT_STD = 'I',
MARKER_IMPORT_LOCAL = 'i';
MARKER_SOURCE_MAP = 'S';
function decompileStaticFile(/*Bundle*/ aBundle, /*String*/ aString, /*String*/ aPath)
{
+7 -6
View File
@@ -310,18 +310,18 @@ var XML_XML = "xml",
#define FIRST_CHILD(anXMLNode) (anXMLNode.firstChild)
#define NEXT_SIBLING(anXMLNode) (anXMLNode.nextSibling)
#define PARENT_NODE(anXMLNode) (anXMLNode.parentNode)
#define DOCUMENT_ELEMENT(aDocument) (aDocument.documentElement)
#define DOCUMENT_ELEMENT(aDocument) (aDocument && aDocument.documentElement)
#define HAS_ATTRIBUTE_VALUE(anXMLNode, anAttributeName, aValue) (anXMLNode.getAttribute(anAttributeName) === aValue)
#define IS_OF_TYPE(anXMLNode, aType) (NODE_NAME(anXMLNode) === aType)
#define IS_PLIST(anXMLNode) IS_OF_TYPE(anXMLNode, PLIST_PLIST)
#define IS_WHITESPACE(anXMLNode) (NODE_TYPE(anXMLNode) === 8 || NODE_TYPE(anXMLNode) === 3)
#define IS_WHITESPACE(anXMLNode) (NODE_TYPE(anXMLNode) === 8 || NODE_TYPE(anXMLNode) === 3 || NODE_TYPE(anXMLNode) === 7)
#define IS_DOCUMENTTYPE(anXMLNode) (NODE_TYPE(anXMLNode) === 10)
#define PLIST_NEXT_SIBLING(anXMLNode) while ((anXMLNode = NEXT_SIBLING(anXMLNode)) && IS_WHITESPACE(anXMLNode));
#define PLIST_FIRST_CHILD(anXMLNode) { anXMLNode = FIRST_CHILD(anXMLNode); if (anXMLNode !== NULL && IS_WHITESPACE(anXMLNode)) PLIST_NEXT_SIBLING(anXMLNode) }
#define PLIST_FIRST_CHILD(anXMLNode) { anXMLNode = FIRST_CHILD(anXMLNode); if (anXMLNode != NULL && IS_WHITESPACE(anXMLNode)) PLIST_NEXT_SIBLING(anXMLNode) }
var textContent = function(nodes)
{
@@ -544,15 +544,16 @@ CFPropertyList.propertyListFromXML = function(/*String | XMLNode*/ aStringOrXMLN
XMLNode = parseXML(aStringOrXMLNode);
// Skip over DOCTYPE and so forth.
while (IS_OF_TYPE(XMLNode, XML_DOCUMENT) || IS_OF_TYPE(XMLNode, XML_XML))
while (XMLNode && (IS_OF_TYPE(XMLNode, XML_DOCUMENT) || IS_OF_TYPE(XMLNode, XML_XML))) {
PLIST_FIRST_CHILD(XMLNode);
}
// Skip over the DOCTYPE... see a pattern?
if (IS_DOCUMENTTYPE(XMLNode))
if (XMLNode && IS_DOCUMENTTYPE(XMLNode))
PLIST_NEXT_SIBLING(XMLNode);
// If this is not a PLIST, bail.
if (!IS_PLIST(XMLNode))
if (!XMLNode || !IS_PLIST(XMLNode))
return NULL;
var key = "",
@@ -193,6 +193,11 @@ function resolveFlags(args)
else if (argument.indexOf("-G") === 0)
objjcFlags.generate = true;
else if (argument.indexOf("--inline-msg-send") === 0)
{
// This option is if you only want to inline message send functions and not compress
objjcFlags.inlineMsgSendFunctions = true;
}
else
filePaths.push(argument);
}
+25 -11
View File
@@ -27,7 +27,7 @@ var ExecutableUnloadedFileDependencies = 0,
ExecutableCantStartLoadYetFileDependencies = 3,
AnonymousExecutableCount = 0;
function Executable(/*String*/ aCode, /*Array*/ fileDependencies, /*CFURL|String*/ aURL, /*Function*/ aFunction, /*ObjJCompiler*/aCompiler, /*Dictionary*/ aFilenameTranslateDictionary)
function Executable(/*String*/ aCode, /*Array*/ fileDependencies, /*CFURL|String*/ aURL, /*Function*/ aFunction, /*ObjJCompiler*/aCompiler, /*Dictionary*/ aFilenameTranslateDictionary, /* Base64 String */ sourceMap)
{
if (arguments.length === 0)
return this;
@@ -41,6 +41,9 @@ function Executable(/*String*/ aCode, /*Array*/ fileDependencies, /*CFURL|String
this._fileDependencies = fileDependencies;
this._filenameTranslateDictionary = aFilenameTranslateDictionary;
if (sourceMap)
this._base64EncodedSourceMap = sourceMap;
// This is a little hacky but if fileDependencies is null we can start loading file dependencies yet
if (!fileDependencies)
{
@@ -148,6 +151,12 @@ Executable.prototype.toMarkedString = function()
for (; index < count; ++index)
markedString += dependencies[index].toMarkedString();
var sourceMap = this._base64EncodedSourceMap;
if (sourceMap) {
markedString += MARKER_SOURCE_MAP + ";" + sourceMap.length + ";" + sourceMap;
}
var code = this.code();
return markedString + MARKER_TEXT + ";" + code.length + ";" + code;
@@ -179,7 +188,7 @@ Executable.prototype.execute = function()
this.setCode(this._compiler.compilePass2(), this._compiler.map());
if (FileExecutable.printWarningsAndErrors(this._compiler, exports.messageOutputFormatInXML))
if (FileExecutable.printWarningsAndErrors(this._compiler, exports.messageOutputFormatInXML))
throw "Compilation error";
this._compiler = null;
@@ -211,6 +220,7 @@ Executable.prototype.setCode = function(code, sourceMap)
this._code = code;
var parameters = this.functionParameters().join(",");
var sourceMapBase64;
#if COMMONJS
if (typeof system !== "undefined" && system.engine === "rhino")
@@ -222,6 +232,9 @@ Executable.prototype.setCode = function(code, sourceMap)
{
#endif
#if DEBUG
// Check if base64 source map is available
sourceMapBase64 = this._base64EncodedSourceMap;
// "//# sourceURL=" at the end lets us name our eval'd files for debuggers, etc.
// * WebKit: http://pmuellr.blogspot.com/2009/06/debugger-friendly.html
// * Firebug: http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
@@ -229,22 +242,23 @@ Executable.prototype.setCode = function(code, sourceMap)
var absoluteString = this.URL().absoluteString();
code += "/**/\n//# sourceURL=" + absoluteString + "s";
if (sourceMap)
{
// The new Function constructor will add a function header before the first line
// The compiler adds a new line as the first character to the code to get the spurce
// mapping correct. We have to remove it here
code = code.substring(2);
var sourceMapBase64;
if (typeof btoa === 'function')
sourceMapBase64 = btoa(UTF16ToUTF8(sourceMap));
else if (typeof Buffer === 'function')
sourceMapBase64 = new Buffer(sourceMap).toString("base64");
}
if (sourceMapBase64)
code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + sourceMapBase64;
if (sourceMapBase64) {
// The new Function constructor will add a function header before the first line
// The compiler adds two newlines as the first character to the code to get the source
// mapping correct. We have to remove it here. As Javascript engines adds diffentent
// amount of lines at the top we need to calculate how many.
code = code.substring(exports.ObjJCompiler.numberOfLinesAtTopOfFunction());
this._base64EncodedSourceMap = sourceMapBase64;
code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + sourceMapBase64;
}
//} else {
// // Firebug only does it for "eval()", not "new Function()". Ugh. Slower.
+7 -3
View File
@@ -248,7 +248,8 @@ function decompile(/*String*/ aString, /*CFURL*/ aURL)
*/
var marker = NULL,
code = "",
dependencies = [];
dependencies = [],
sourceMap;
while (marker = stream.getMarker())
{
@@ -262,14 +263,17 @@ function decompile(/*String*/ aString, /*CFURL*/ aURL)
else if (marker === MARKER_IMPORT_LOCAL)
dependencies.push(new FileDependency(new CFURL(text), YES));
else if (marker === MARKER_SOURCE_MAP)
sourceMap = text;
}
var fn = FileExecutable._lookupCachedFunction(aURL);
if (fn)
return new Executable(code, dependencies, aURL, fn);
return new Executable(code, dependencies, aURL, fn, null, null, sourceMap);
return new Executable(code, dependencies, aURL);
return new Executable(code, dependencies, aURL, null, null, null, sourceMap);
}
var FunctionCache = { };
+1
View File
@@ -46,6 +46,7 @@
#include "CFBundle.js"
#include "StaticResource.js"
#include "Preprocessor.js"
#include "source-map.js"
#include "acorn.js"
#include "acornwalk.js"
#include "ObjJAcornCompiler.js"
+64 -11
View File
@@ -16,7 +16,7 @@
(function(mod)
{
mod(exports.ObjJCompiler || (exports.ObjJCompiler = {}), exports.acorn || acorn, (exports.acorn || acorn).walk, typeof sourceMap != "undefined" ? sourceMap : null); // Plain browser env
mod(exports.ObjJCompiler || (exports.ObjJCompiler = {}), exports.acorn || acorn, (exports.acorn || acorn).walk, typeof exports.sourceMap != "undefined" ? exports.sourceMap : (typeof module != "undefined" && typeof module.exports === "object" ? module.exports : null)); // Plain browser env
})(function(exports, acorn, walk, sourceMap)
{
"use strict";
@@ -821,6 +821,28 @@ exports.compileFileDependencies = function(/*String*/ aString, /*CFURL*/ aURL, o
return new ObjJAcornCompiler(aString, aURL, options);
}
/*!
This function is used to calculate the number of lines that is added when a 'new Function(...) call is used.
This is used to make sure source maps are correct
Currently Safari is adding one line and Chrome and Firefox is adding two lines.
We calculate this by creating a function and counts the number of new lines at the top of the function
The result is cached so we only need to make the calculation once.
*/
exports.numberOfLinesAtTopOfFunction = function() {
var f = new Function("x", "return x;");
var fString = f.toString();
var index = fString.indexOf("return x;");
var firstPart = fString.substring(0, index);
var numberOfLines = (firstPart.match(/\n/g) || []).length;
ObjJAcornCompiler.numberOfLinesAtTopOfFunction = function() {
return numberOfLines;
}
return numberOfLines;
}
ObjJAcornCompiler.prototype.compilePass2 = function()
{
var options = this.options;
@@ -1005,7 +1027,7 @@ exports.parseGccCompilerFlags = function(/* String */ compilerFlags)
if (argument.indexOf("-g") === 0)
objjcFlags.includeMethodFunctionNames = true;
else if (argument.indexOf("-O") === 0) {
objjcFlags.inlineMsgSendFunctions = true;
objjcFlags.compress = true; // This is not used in the compiler option dictionary but we add it here as it is also done if compiling from command line.
// FIXME: currently we are sending in '-O2' when we want InlineMsgSend. Here we only check if it is '-O...'.
// Maybe we should have some other option for this
if (argument.length > 2)
@@ -1031,6 +1053,11 @@ exports.parseGccCompilerFlags = function(/* String */ compilerFlags)
(objjcFlags.includeFiles || (objjcFlags.includeFiles = [])).push(includeUrl);
}
else if (argument.indexOf("--inline-msg-send") === 0)
{
// This option is if you only want to inline message send functions
objjcFlags.inlineMsgSendFunctions = true;
}
/* else if (argument.indexOf("-I") === 0) {
var includeUrl = argument.substring(2),
firstChar = includeUrl && includeUrl.charCodeAt(0);
@@ -1427,7 +1454,7 @@ ExpressionStatement: function(node, st, c, format) {
generate = compiler.generate && !format;
if (generate) compiler.jsBuffer.concat(indentation);
c(node.expression, st, "Expression");
if (generate) compiler.jsBuffer.concat(";\n");
if (generate) compiler.jsBuffer.concat(";\n", node);
},
IfStatement: function(node, st, c, format) {
var compiler = st.compiler,
@@ -1994,7 +2021,7 @@ VariableDeclaration: function(node, st, c, format) {
}
}
}
if (generate && !format && !st.isFor) buffer.concat(";\n"); // Don't add ';' if this is a for statement but do it if this is a statement
if (generate && !format && !st.isFor) buffer.concat(";\n", node); // Don't add ';' if this is a for statement but do it if this is a statement
},
ThisExpression: function(node, st, c) {
var compiler = st.compiler;
@@ -2149,7 +2176,7 @@ BinaryExpression: function(node, st, c, format) {
if (generate) {
var buffer = compiler.jsBuffer;
buffer.concatFormat(format ? format.beforeOperator : " ");
buffer.concat(node.operator);
buffer.concat(node.operator, node);
buffer.concatFormat(format ? format.afterOperator : " ");
}
(generate && nodePrecedence(node, node.right, true) ? surroundExpression(c) : c)(node.right, st, "Expression");
@@ -2315,7 +2342,7 @@ MemberExpression: function(node, st, c) {
if (generate)
compiler.jsBuffer.concat(computed ? "[" : ".", node);
st.secondMemberExpression = !computed;
// No parentheses when it is computed, '[' amd ']' are the same thing.
// No parentheses when it is computed, '[' and ']' are the same thing.
(generate && !computed && nodePrecedence(node, node.property) ? surroundExpression(c) : c)(node.property, st, "Expression");
st.secondMemberExpression = false;
if (generate && computed)
@@ -2369,7 +2396,7 @@ Identifier: function(node, st, c) {
st.addMaybeWarning(message);
}
}
if (generate) compiler.jsBuffer.concat(identifier, node, "self");
if (generate) compiler.jsBuffer.concat(identifier, node, identifier === "self" ? "self" : null);
},
// Use this when there should not be a look up to issue warnings or add 'self.' before ivars
IdentifierName: function(node, st, c) {
@@ -3315,7 +3342,8 @@ MessageSendExpression: function(node, st, c) {
firstSelector = selectors[0],
selector = firstSelector ? firstSelector.name : "", // There is always at least one selector
parameters = node.parameters,
generateObjJ = compiler.options.generateObjJ;
options = compiler.options,
generateObjJ = options.generateObjJ;
// Put together the selector. Maybe this should be done in the parser...
for (var i = 0; i < argumentsLength; i++) {
@@ -3438,10 +3466,12 @@ MessageSendExpression: function(node, st, c) {
}
buffer.concat("]");
} else {
var selectorJSPath;
if (generate && !node.superObject) {
if (!inlineMsgSend) {
if (totalNoOfParameters < 4) {
buffer.concat("" + totalNoOfParameters, null);
buffer.concat("" + totalNoOfParameters, node);
}
}
@@ -3451,12 +3481,35 @@ MessageSendExpression: function(node, st, c) {
} else {
buffer.concat("(___r" + st.receiverLevel, node);
}
// Only do this if source map is enabled and we have an identifier
if (options.sourceMap && nodeObject.type === "Identifier") {
// Get target expression for sourcemap to allow hovering selector to show method function. Create new buffer to write in.
compiler.jsBuffer = new StringBuffer();
c(nodeObject, st, "Expression");
var aTarget = compiler.jsBuffer.toString();
selectorJSPath = aTarget + ".isa.method_dtable[\"" + selector + "\"]"
// Restored buffer so everything will continue as usually.
compiler.jsBuffer = buffer;
}
}
buffer.concat(", \"", node);
buffer.concat(selector); // FIXME: sel_getUid(selector + "") ? This FIXME is from the old preprocessor compiler
buffer.concat(", ", node);
if (selectorJSPath) {
buffer.concat("(", node);
for (var i = 0; i < selectors.length; i++) {
var nextSelector = selectors[i];
if (nextSelector) {
buffer.concat(selectorJSPath, nextSelector);
buffer.concat(", ", node);
}
}
}
buffer.concat("\"", node);
buffer.concat(selector, node); // FIXME: sel_getUid(selector + "") ? This FIXME is from the old preprocessor compiler
buffer.concat(selectorJSPath ? "\")" : "\"", node);
if (nodeArguments) for (var i = 0; i < nodeArguments.length; i++)
{
var argument = nodeArguments[i];
+21 -25
View File
@@ -738,13 +738,13 @@
if (macroCurrentLine) this.line += macroCurrentLine;
var macroCurrentLineStart = locationOffset.column;
// Only add column offset if we are on the first line
if (macroCurrentLineStart) this.column += tokPosMacroOffset - (tokCurLine === 0 ? macroCurrentLineStart : 0);
if (macroCurrentLineStart) this.column += tokPosMacroOffset - (tokCurLine === 1 ? macroCurrentLineStart : 0);
}
}
}
function PositionOffset(line, column) {
this.line = line;
this.line = line - 1; // Line start on one so we have to convert it to an offset
this.column = column;
if (preprocessStackLastItem) {
var macro = preprocessStackLastItem.macro;
@@ -893,10 +893,6 @@
last = ch;
ch = input.charCodeAt(++tokPos);
}
if (options.locations) {
++tokCurLine;
tokLineStart = tokPos;
}
}
// Called at the start of the parse and after every token. Skips
@@ -1320,6 +1316,8 @@
// We don't want to concatenate tokens when creating macros
preprocessDontConcatenate = true;
// Get position offset now as ´tokCurLine´ and ´tokLineStart´ points to next token.
var positionOffset = options.locations && new PositionOffset(tokCurLine, tokLineStart);
var macroIdentifier = preprocessGetIdent();
// '(' Must follow directly after identifier to be a valid macro with parameters
if (input.charCodeAt(macroIdentifierEnd) === 40) { // '('
@@ -1332,10 +1330,12 @@
if (!first) preprocessExpect(_comma, "Expected ',' between macro parameters"); else first = false;
parameters.push(preprocessEat(_dotdotdot) ? variadic = true && "__VA_ARGS__" : preprocessGetIdent());
if (preprocessEat(_dotdotdot)) variadic = true;
// Get a new position offset as macro has parameters. This is needed if line has escaped (backslash) newline
positionOffset = options.locations && new PositionOffset(tokCurLine, tokLineStart);
}
}
var start = preTokStart;
var positionOffset = options.locations && new PositionOffset(tokCurLine, tokLineStart);
while(preTokType !== _eol && preTokType !== _eof)
preprocessReadToken();
@@ -1532,18 +1532,13 @@
if (allowEndOfLineToken) {
var r;
if (code === 13) {
r = finishOp(_eol, input.charCodeAt(tokPos+1) === 10 ? 2 : 1, finisher);
} else if (code === 10 || code === 8232 || code === 8233) {
r = finishOp(_eol, 1, finisher);
} else {
return false;
if (code === 13 || code === 10 || code === 8232 || code === 8233) {
if (options.locations) {
++tokCurLine;
tokLineStart = tokPos;
}
return finishOp(_eol, (code === 13 && input.charCodeAt(tokPos+1) === 10) ? 2 : 1, finisher);
}
if (options.locations) {
++tokCurLine;
tokLineStart = tokPos;
}
return r;
}
return false;
@@ -1613,8 +1608,8 @@
// Skip whitespaces sometimes without line breaks
// Returns true if it stops at a line break.
function preprocessSkipSpace(skipComments, skipEOL) {
var ch = onlySkipSpace(!skipEOL);
function preprocessSkipSpace(dontSkipComments, skipEOL) {
var ch = onlySkipSpace(!skipEOL, false, dontSkipComments);
// Can't see that this line break test is used anymore
//lineBreak.lastIndex = 0;
//var match = lineBreak.exec(input.slice(tokPos, tokPos + 2));
@@ -1670,7 +1665,9 @@
if (!preprocessToken && !preNotSkipping && code !== 35) { // '#'
// If we are skipping take the whole line if the token does not start with '#' (preprocess tokens)
preprocesSkipRestOfLine();
return preprocessFinishToken(_preprocessSkipLine, input.slice(preTokStart, tokPos++));
preprocessFinishToken(_preprocessSkipLine, input.slice(preTokStart, tokPos));
preprocessSkipSpace(true, true); // Don't skip comments and skip EOL
return;
} else if (preprocessMacroParameterListMode && code !== 41 && code !== 44) { // ')', ','
var parenLevel = 0;
// If we are parsing a macro parameter list parentheses within each argument must balance
@@ -1723,7 +1720,7 @@
preTokEnd = overrideTokEnd || tokPos;
if (type !== _eol) firstTokEnd = preTokEnd;
//tokRegexpAllowed = type.beforeExpr;
var ch = preprocessSkipSpace(false, skipEOL); // Dont skip comments
var ch = preprocessSkipSpace(false, skipEOL); // Skip comments
if (ch === 35 && options.preprocess && !preprocessDontConcatenate && input.charCodeAt(tokPos + 1) === 35) { // '##'
var val1 = val != null ? val : type.keyword || type.type;
tokPos += 2;
@@ -1765,7 +1762,7 @@
preTokType = type;
preTokVal = val;
firstTokEnd = preTokEnd = tokPos;
preprocessSkipSpace(true); // 'true' for skip comments
preprocessSkipSpace(true); // 'true' for don't skip comments
}
// Continue to the next token.
@@ -2426,7 +2423,7 @@
inputLen = macroString.length;
tokPosMacroOffset = macro.start;
tokPos = 0;
tokCurLine = 0;
tokCurLine = 1;
tokLineStart = 0;
firstTokEnd = 0;
localLastEnd = 0;
@@ -2634,7 +2631,6 @@
// Test whether a semicolon can be inserted at the current position.
function canInsertSemicolon() {
//if (lastEnd !== localLastEnd) print("lastEnd: " + lastEnd + ", localLastEnd: " + localLastEnd);
return !options.strictSemicolons &&
(tokType === _eof || tokType === _braceR || newline.test(lastEndInput.slice(lastEnd, lastEndOfFile || tokFirstStart)) ||
(nodeMessageSendObjectExpression && options.objj) || lastEndOfFile != null);
File diff suppressed because it is too large. Load diff
+119 -19
View File
@@ -48,26 +48,91 @@
- (void)testTextViewSelectionRange
{
//TODO : uncomment once ojtest will be up to date on travis
var range;
//
//[delegateSpy selector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:) times:1 arguments:[textView, CPMakeRange(0,0), CPMakeRange(0, 18)]];
//[delegateSpy selector:@selector(textViewDidChangeSelection:) times:1];
//[textView selectAll:self];
//range = [[textView selectedRanges] firstObject];
//[self assert:0 equals:range.location];
//[self assert:18 equals:range.length];
// [delegateSpy verifyThatAllExpectationsHaveBeenMet];
//
//
// [delegateSpy reset];
// [delegateSpy selector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:) times:1 arguments:[textView, CPMakeRange(0, 18), CPMakeRange(3, 6)]];
// [delegateSpy selector:@selector(textViewDidChangeSelection:) times:1];
//[textView setSelectedRange:CPMakeRange(3, 6)];
//range = [[textView selectedRanges] firstObject];
//[self assert:3 equals:range.location];
//[self assert:6 equals:range.length];
// [delegateSpy verifyThatAllExpectationsHaveBeenMet];
[delegateSpy selector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:) times:1 arguments:[textView, CPMakeRange(0,0), CPMakeRange(0, 18)]];
[delegateSpy selector:@selector(textViewDidChangeSelection:) times:1];
[delegateSpy selector:@selector(textView:shouldChangeTypingAttributes:toAttributes:) times:1];
[delegateSpy selector:@selector(textViewDidChangeTypingAttributes:) times:1];
[delegateSpy selector:@selector(textDidChange:) times:0];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:0];
[delegateSpy selector:@selector(textDidBeginEditing:) times:0];
[delegateSpy selector:@selector(textShouldEndEditing:) times:0];
[delegateSpy selector:@selector(textDidEndEditing:) times:0];
[textView selectAll:self];
range = [[textView selectedRanges] firstObject];
[self assert:0 equals:range.location];
[self assert:18 equals:range.length];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
[delegateSpy reset];
[delegateSpy selector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:) times:1 arguments:[textView, CPMakeRange(0, 18), CPMakeRange(3, 6)]];
[delegateSpy selector:@selector(textViewDidChangeSelection:) times:1];
[delegateSpy selector:@selector(textView:shouldChangeTypingAttributes:toAttributes:) times:1];
[delegateSpy selector:@selector(textViewDidChangeTypingAttributes:) times:1];
[delegateSpy selector:@selector(textDidChange:) times:0];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:0];
[delegateSpy selector:@selector(textDidBeginEditing:) times:0];
[delegateSpy selector:@selector(textShouldEndEditing:) times:0];
[delegateSpy selector:@selector(textDidEndEditing:) times:0];
[textView setSelectedRange:CPMakeRange(3, 6)];
range = [[textView selectedRanges] firstObject];
[self assert:3 equals:range.location];
[self assert:6 equals:range.length];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
// When selecting the same range again textView:shouldChangeTypingAttributes:toAttributes: or textViewDidChangeTypingAttributes: should not be triggered
[delegateSpy reset];
[delegateSpy selector:@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:) times:1 arguments:[textView, CPMakeRange(3, 6), CPMakeRange(3, 6)]];
[delegateSpy selector:@selector(textViewDidChangeSelection:) times:1];
[delegateSpy selector:@selector(textView:shouldChangeTypingAttributes:toAttributes:) times:0];
[delegateSpy selector:@selector(textViewDidChangeTypingAttributes:) times:0];
[delegateSpy selector:@selector(textDidChange:) times:0];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:0];
[delegateSpy selector:@selector(textDidBeginEditing:) times:0];
[delegateSpy selector:@selector(textShouldEndEditing:) times:0];
[delegateSpy selector:@selector(textDidEndEditing:) times:0];
[textView setSelectedRange:CPMakeRange(3, 6)];
range = [[textView selectedRanges] firstObject];
[self assert:3 equals:range.location];
[self assert:6 equals:range.length];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
}
- (void)testTextDidChange
{
[delegateSpy selector:@selector(textDidChange:) times:1];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:0];
[delegateSpy selector:@selector(textDidBeginEditing:) times:0];
[delegateSpy selector:@selector(textShouldEndEditing:) times:0];
[delegateSpy selector:@selector(textDidEndEditing:) times:0];
[textView setString:@"New text"];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
}
- (void)testTextBeginEditing
{
[delegateSpy selector:@selector(textDidChange:) times:1];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:1];
[delegateSpy selector:@selector(textDidBeginEditing:) times:1];
[delegateSpy selector:@selector(textShouldEndEditing:) times:0];
[delegateSpy selector:@selector(textDidEndEditing:) times:0];
[self assertTrue:[theWindow makeFirstResponder:textView]];
[textView insertText:@"New text"];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
}
- (void)testTextEndEditing
{
[self assertTrue:[theWindow makeFirstResponder:textView]];
[textView insertText:@"New text"];
[delegateSpy selector:@selector(textDidChange:) times:0];
[delegateSpy selector:@selector(textShouldBeginEditing:) times:0];
[delegateSpy selector:@selector(textDidBeginEditing:) times:0];
[delegateSpy selector:@selector(textShouldEndEditing:) times:1];
[delegateSpy selector:@selector(textDidEndEditing:) times:1];
[self assertFalse:[theWindow makeFirstResponder:nil]];
[delegateSpy verifyThatAllExpectationsHaveBeenMet];
}
@end
@@ -79,9 +144,44 @@
return newSelectedCharRange;
}
- (CPDictionary)textView:(CPTextView)textView shouldChangeTypingAttributes:(CPDictionary)oldTypingAttributes toAttributes:(CPDictionary)newTypingAttributes
{
return newTypingAttributes;
}
- (void)textViewDidChangeSelection:(CPNotification)aNotification
{
}
- (void)textViewDidChangeTypingAttributes:(CPNotification)aNotification
{
}
- (void)textDidChange:(CPNotification)aNotification
{
}
- (BOOL)textShouldBeginEditing:(CPText)aTextObject
{
return YES;
}
- (void)textDidBeginEditing:(CPNotification)aNotification
{
}
- (BOOL)textShouldEndEditing:(CPText)aTextObject
{
return YES;
}
- (void)textDidEndEditing:(CPNotification)aNotification
{
}
@end
+17 -7
View File
@@ -27,7 +27,8 @@
- (void)awakeFromCib
{
[splitViewA setDelegate:self];
[splitViewB setDelegate:self];
[splitViewC setDelegate:self];
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
@@ -36,12 +37,6 @@
[theWindow setFullPlatformWindow:YES];
}
- (BOOL)splitView:(CPSplitView)splitView shouldAdjustSizeOfSubview:(CPView)subview
{
var subviews = [splitView subviews];
return (subview !== [subviews objectAtIndex:1]);
}
- (@action)deleteAutosave:(id)sender
{
[splitViewA deleteAutosave];
@@ -84,5 +79,20 @@
console.error(@"splitViewWillResizeSubviews")
}
- (BOOL)splitView:(CPSplitView)splitView shouldAdjustSizeOfSubview:(CPView)subview
{
var subviews = [splitView subviews];
return (subview !== [subviews objectAtIndex:1]);
}
- (BOOL)splitView:(CPSplitView)splitView canCollapseSubview:(CPView)subview
{
return subview == [[splitView subviews] objectAtIndex:0];
}
- (BOOL)splitView:(CPSplitView)splitView shouldCollapseSubview:(CPView)subview forDoubleClickOnDividerAtIndex:(CPInteger)dividerIndex
{
return dividerIndex == 0;
}
@end
@@ -0,0 +1,125 @@
/*
* AppController.j
* CPTextViewDelegateAndNotifications
*
* Created by Martin Carlberg on December 22, 2017.
* Copyright 2017, Oops AB All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "NotificationStatistics.j"
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
CPArray notificationStatistics @accessors;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
[self setNotificationStatistics: @[
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textView:shouldChangeTextInRange:replacementString:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textView:doCommandBySelector:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textViewDidChangeSelection:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textView:shouldChangeTypingAttributes:toAttributes:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textViewDidChangeTypingAttributes:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textShouldBeginEditing:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textShouldEndEditing:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textDidBeginEditing:))],
[NotificationStatistics notificationStatisticsWithName:CPStringFromSelector(@selector(textDidEndEditing:))],
]];
self.globalOrder = 0;
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
self.globalOrder = 0;
}
- (IBAction)resetStatistics:(id)sender {
self.globalOrder = 0;
for (var i = 0, array = [self notificationStatistics]; i < array.length; i++) {
var ns = array[i];
[ns setOrder:0];
[ns setCount:0];
}
}
- (NotificationStatistics)notificationStatisticsWithName:(CPString)aName
{
for (var i = 0, array = [self notificationStatistics]; i < array.length; i++) {
var ns = array[i];
if ([ns.name isEqualToString:aName]) {
return ns;
}
}
return nil;
}
- (void)registerNotificationWithSelector:(SEL)selector
{
var ns = [self notificationStatisticsWithName:CPStringFromSelector(selector)];
if (ns) {
[ns setCount:[ns count] + 1];
[ns setOrder:self.globalOrder += 1];
}
}
- (CPRange)textView:(CPTextView)textView willChangeSelectionFromCharacterRange:(CPRange)oldSelectedCharRange toCharacterRange:(CPRange)newSelectedCharRange {
[self registerNotificationWithSelector:_cmd];
return newSelectedCharRange;
}
- (BOOL)textView:(CPTextView)textView shouldChangeTextInRange:(CPRange)affectedCharRange replacementString:(CPString)replacementString {
[self registerNotificationWithSelector:_cmd];
return YES;
}
- (BOOL)textView:(CPTextView)textView doCommandBySelector:(SEL)commandSelector {
[self registerNotificationWithSelector:_cmd];
return NO;
}
- (CPDictionary)textView:(CPTextView)textView shouldChangeTypingAttributes:(CPDictionary)oldTypingAttributes toAttributes:(CPDictionary)newTypingAttributes {
[self registerNotificationWithSelector:_cmd];
return newTypingAttributes;
}
- (void)textViewDidChangeSelection:(CPNotification)notification {
[self registerNotificationWithSelector:_cmd];
}
- (void)textViewDidChangeTypingAttributes:(CPNotification)notification {
[self registerNotificationWithSelector:_cmd];
}
- (BOOL)textShouldBeginEditing:(CPText)textObject {
[self registerNotificationWithSelector:_cmd];
return YES;
}
- (BOOL)textShouldEndEditing:(CPText)textObject {
[self registerNotificationWithSelector:_cmd];
return YES;
}
- (void)textDidBeginEditing:(CPNotification)notification {
[self registerNotificationWithSelector:_cmd];
}
- (void)textDidEndEditing:(CPNotification)notification {
[self registerNotificationWithSelector:_cmd];
}
@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>CPTextViewDelegateAndNotifications</string>
<key>CPBundleVersion</key>
<string>1.0</string>
<key>CPHumanReadableCopyright</key>
<string>Copyright © 2017, Your Company All rights reserved.</string>
</dict>
</plist>
@@ -0,0 +1,172 @@
/*
* Jakefile
* CPTextViewDelegateAndNotifications
*
* Created by You on December 22, 2017.
* Copyright 2017, 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 = "CPTextViewDelegateAndNotifications";
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", "CPTextViewDelegateAndNotifications.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPTextViewDelegateAndNotifications");
task.setIdentifier("com.yourcompany.CPTextViewDelegateAndNotifications");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPTextViewDelegateAndNotifications");
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 -S --inline-msg-send");
else
task.setCompilerFlags("-O2");
});
task ("default", [projectName], function()
{
printResults(configuration);
});
task ("build", ["default"], function()
{
updateApplicationSize();
});
task ("debug", function()
{
configuration = ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
configuration = 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")
});
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", 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 (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", 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", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
}
function addBundleFileSizes(bundlePath, totalBytes)
{
var bundleName = FILE.basename(bundlePath),
environment = bundleName === "Foundation" ? "Objj" : "Browser",
bundlePath = FILE.join(bundlePath, environment + ".environment");
if (FILE.isDirectory(bundlePath))
{
var filename = bundleName + ".sj",
filePath = new FILE.Path(FILE.join(bundlePath, filename));
if (filePath.exists())
totalBytes.executable += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt"));
if (filePath.exists())
totalBytes.data += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt"));
if (filePath.exists())
totalBytes.mhtml += filePath.size();
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt"));
if (filePath.exists())
totalBytes.mhtml += filePath.size();
}
}
@@ -0,0 +1,33 @@
/*
* NotificationStatistics.j
* CPTextViewDelegateAndNotifications
*
* Created by Martin Carlberg on December 22, 2017.
* Copyright 2017, Oops AB All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation NotificationStatistics : CPObject {
CPString name @accessors;
CPUInteger order @accessors;
CPUInteger count @accessors;
}
+ (id)notificationStatisticsWithName:(CPString)aName
{
return [[NotificationStatistics alloc] initWithName:aName];
}
- (id)initWithName:(CPString)aName
{
self = [super init];
if (self) {
[self setName: aName];
[self setOrder:0];
[self setCount:0];
}
return self;
}
@end
@@ -0,0 +1,4 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;149E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;158E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;171E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;3;103E;D;K;6Line truncated
 
The Call order column tells in which order they are called. It is an increasing global number for each call to a delegate method or notification message.
The Number of calls column show how many times this method or message has been sent.S;13;AppControllerD;K;10;$classnameS;15;_CPManagedProxyK;8;$classesA;S;15;_CPManagedProxyS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;466E;K;27;CPManagedProxyEntityNameKeyD;K;6;CP$UIDd;1;0E;K;31;CPManagedProxyFetchPredicateKeyD;K;6;CP$UIDd;1;0E;E;S;16;{{0, 0}, {0, 0}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;E;E;S;5;colorD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;E;E;S;15;{218, 10000000}D;K;10;$classnameS;15;CPLayoutManagerK;8;$classesA;S;15;CPLayoutManagerS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;474E;K;29;CPLayoutManagerTextStorageKeyD;K;6;CP$UIDd;3;520E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;282E;E;E;D;K;6;$classD;K;6;CP$UIDd;3;352E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;521E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;471E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;337E;E;D;K;6;$classD;K;6;CP$UIDd;3;352E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;522E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;471E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;337E;E;S;21;{{1, 354}, {550, 23}}S;19;{{0, 0}, {550, 23}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;163E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;20;{{0, 352}, {14, 25}}S;18;{{0, 0}, {14, 25}}S;10;cornerviewD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;D;K;6;CP$UIDd;3;282E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;523E;D;K;6;CP$UIDd;3;523E;D;K;6;CP$UIDd;3;523E;D;K;6;CP$UIDd;3;282E;E;E;D;K;10;$classnameS;5;CPCibK;8;$classesA;S;5;CPCibS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;490E;K;16;CPCibDataFileKeyD;K;6;CP$UIDd;3;524E;E;D;K;6;$classD;K;6;CP$UIDd;3;490E;K;16;CPCibDataFileKeyD;K;6;CP$UIDd;3;525E;E;D;K;6;$classD;K;6;CP$UIDd;3;490E;K;16;CPCibDataFileKeyD;K;6;CP$UIDd;3;526E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;528E;E;E;S;12;columnHeaderD;K;6;$classD;K;6;CP$UIDd;3;412E;K;13;CPFontNameKeyD;K;6;CP$UIDd;3;504E;K;13;CPFontSizeKeyD;K;6;CP$UIDd;3;452E;K;15;CPFontIsBoldKeyD;K;6;CP$UIDd;3;239E;K;17;CPFontIsItalicKeyD;K;6;CP$UIDd;3;241E;K;17;CPFontIsSystemKeyD;K;6;CP$UIDd;3;239E;E;D;K;6;$classD;K;6;CP$UIDd;3;352E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;529E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;471E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;337E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;36;Delegate method or Notification nameS;41;controlSizeRegular+editable+tableDataViewD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;531E;E;E;S;9;Text Celld;4;3072S;28;_CPFontSystemFacePlaceholderD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;532E;D;K;6;CP$UIDd;3;532E;D;K;6;CP$UIDd;3;532E;D;K;6;CP$UIDd;3;282E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;533E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;10;Call orderD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;534E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;535E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;15;Number of callsD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;536E;E;E;S;5;imageD;K;10;$classnameS;6;CPNullK;8;$classesA;S;6;CPNullS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;515E;E;S;11;highlightedD;K;6;$classD;K;6;CP$UIDd;3;412E;K;13;CPFontNameKeyD;K;6;CP$UIDd;3;537E;K;13;CPFontSizeKeyD;K;6;CP$UIDd;3;538E;K;15;CPFontIsBoldKeyD;K;6;CP$UIDd;3;241E;K;17;CPFontIsItalicKeyD;K;6;CP$UIDd;3;241E;K;17;CPFontIsSystemKeyD;K;6;CP$UIDd;3;241E;E;D;K;10;$classnameS;13;CPTextStorageK;8;$classesA;S;13;CPTextStorageS;25;CPMutableAttributedStringS;18;CPAttributedStringS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;519E;K;24;CPAttributedStringStringD;K;6;CP$UIDd;3;240E;K;24;CPAttributedStringRangesD;K;6;CP$UIDd;3;539E;K;28;CPAttributedStringAttributesD;K;6;CP$UIDd;3;540E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;334E;D;K;6;CP$UIDd;3;282E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;541E;D;K;6;CP$UIDd;3;541E;D;K;6;CP$UIDd;3;541E;D;K;6;CP$UIDd;3;282E;E;E;f;3;0.8S;8712;MjgwTlBMSVNUOzEuMDtEO0s7NDskdG9wRDtLOzE4O0NQQ2liT2JqZWN0RGF0YUtleUQ7Szs2O0NQJFVJRGQ7MTsyRTtFO0s7ODskb2JqZWN0c0E7Uzs1OyRudWxsRDtLOzEwOyRjbGFzc25hbWVTOzE2O19DUENpYk9iamVjdERhdGFLOzg7JGNsYXNzZXNBO1M7MTY7X0NQQ2liT2JqZWN0RGF0YVM7ODtDUE9iamVjdEU7RTtEO0s7NjskY2xhc3NEO0s7NjtDUCRVSURkOzE7MUU7SzsyODtfQ1BDaWJPYmplY3REYXRhTmFtZXNLZXlzS2V5RDtLOzY7Q1AkVUlEZDsxOzBFO0s7MzA7X0NQQ2liT2JqZWN0RGF0YU5hbWVzVmFsdWVzS2V5RDtLOzY7Q1AkVUlEZDLine truncated
@@ -0,0 +1,503 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="450" id="451"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29" userLabel="MainMenu">
<items>
<menuItem title="NewApplication" id="56">
<menu key="submenu" title="NewApplication" systemMenu="apple" id="57">
<items>
<menuItem title="About NewApplication" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="236">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
<menuItem isSeparatorItem="YES" id="143">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit NewApplication" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-3" id="449"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83">
<menu key="submenu" title="File" id="81">
<items>
<menuItem title="New" keyEquivalent="n" id="82">
<connections>
<action selector="newDocument:" target="-1" id="373"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="72">
<connections>
<action selector="openDocument:" target="-1" id="374"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="124">
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
<items>
<menuItem title="Clear Menu" id="126">
<connections>
<action selector="clearRecentDocuments:" target="-1" id="127"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="79">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Close" keyEquivalent="w" id="73">
<connections>
<action selector="performClose:" target="-1" id="193"/>
</connections>
</menuItem>
<menuItem title="Save" keyEquivalent="s" id="75">
<connections>
<action selector="saveDocument:" target="-1" id="362"/>
</connections>
</menuItem>
<menuItem title="Save As…" keyEquivalent="S" id="80">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="saveDocumentAs:" target="-1" id="363"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" id="112">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="217">
<menu key="submenu" title="Edit" id="205">
<items>
<menuItem title="Undo" keyEquivalent="z" id="207">
<connections>
<action selector="undo:" target="-1" id="223"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="215">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="redo:" target="-1" id="231"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="206">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Cut" keyEquivalent="x" id="199">
<connections>
<action selector="cut:" target="-1" id="228"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="197">
<connections>
<action selector="copy:" target="-1" id="224"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="203">
<connections>
<action selector="paste:" target="-1" id="226"/>
</connections>
</menuItem>
<menuItem title="Delete" id="202">
<connections>
<action selector="delete:" target="-1" id="235"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="198">
<connections>
<action selector="selectAll:" target="-1" id="232"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="214">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Find" id="218">
<menu key="submenu" title="Find" id="220">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
<connections>
<action selector="performFindPanelAction:" target="-1" id="241"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208"/>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221"/>
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="216">
<menu key="submenu" title="Spelling and Grammar" id="200">
<items>
<menuItem title="Show Spelling…" keyEquivalent=":" id="204">
<connections>
<action selector="showGuessPanel:" target="-1" id="230"/>
</connections>
</menuItem>
<menuItem title="Check Spelling" keyEquivalent=";" id="201">
<connections>
<action selector="checkSpelling:" target="-1" id="225"/>
</connections>
</menuItem>
<menuItem title="Check Spelling While Typing" id="219">
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="346">
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="348">
<menu key="submenu" title="Substitutions" id="349">
<items>
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
</connections>
</menuItem>
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="211">
<menu key="submenu" title="Speech" id="212">
<items>
<menuItem title="Start Speaking" id="196">
<connections>
<action selector="startSpeaking:" target="-1" id="233"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="195">
<connections>
<action selector="stopSpeaking:" target="-1" id="227"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="295">
<menu key="submenu" title="View" id="296">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="-1" id="366"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="298">
<connections>
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="24">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="23">
<connections>
<action selector="performMiniaturize:" target="-1" id="37"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="239">
<connections>
<action selector="performZoom:" target="-1" id="240"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="92">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Bring All to Front" id="5">
<connections>
<action selector="arrangeInFront:" target="-1" id="39"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="103">
<menu key="submenu" title="Help" id="106">
<items>
<menuItem title="NewApplication Help" keyEquivalent="?" id="111">
<connections>
<action selector="showHelp:" target="-1" id="360"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
<point key="canvasLocation" x="120" y="359"/>
</menu>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="858" height="573"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<view key="contentView" misplaced="YES" id="372">
<rect key="frame" x="0.0" y="0.0" width="858" height="573"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView misplaced="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="pkG-9p-L1p">
<rect key="frame" x="20" y="20" width="235" height="424"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<clipView key="contentView" id="EiI-ee-zCR">
<rect key="frame" x="1" y="1" width="218" height="422"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView importsGraphics="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="nUr-pg-zDx">
<rect key="frame" x="0.0" y="0.0" width="218" height="422"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="218" height="422"/>
<size key="maxSize" width="463" height="10000000"/>
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="delegate" destination="450" id="2RS-z0-999"/>
</connections>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="RLI-ow-1u2">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="KgG-pv-JKw">
<rect key="frame" x="219" y="1" width="15" height="422"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<scrollView misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="oV3-St-RDT">
<rect key="frame" x="286" y="67" width="552" height="377"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="4G8-Fm-Isb">
<rect key="frame" x="1" y="0.0" width="550" height="376"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" autosaveName="NotificationStatistics" rowSizeStyle="automatic" headerView="7tf-PJ-zK5" viewBased="YES" id="2KG-kQ-cpM">
<rect key="frame" x="0.0" y="0.0" width="550" height="353"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="" width="316" minWidth="40" maxWidth="1000" id="k8O-E6-x6h">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Delegate method or Notification name">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="dcx-tu-bTu">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView misplaced="YES" id="DQw-W7-XIz">
<rect key="frame" x="1" y="1" width="316" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="phx-UH-hQH">
<rect key="frame" x="0.0" y="0.0" width="316" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="PwH-1T-aU0">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<connections>
<binding destination="DQw-W7-XIz" name="value" keyPath="objectValue.name" id="PaH-0y-yEa"/>
</connections>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="phx-UH-hQH" id="uKc-cR-Bhw"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
<tableColumn identifier="" width="117" minWidth="10" maxWidth="3.4028234663852886e+38" id="bwc-2R-1Du">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Call order">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="n8r-c2-apm">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView misplaced="YES" id="ZgP-Mi-KmX">
<rect key="frame" x="320" y="1" width="117" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="01B-8B-a03">
<rect key="frame" x="0.0" y="0.0" width="117" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="mVi-7F-HQf">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<connections>
<binding destination="ZgP-Mi-KmX" name="value" keyPath="objectValue.order" id="HWU-4L-lvh"/>
</connections>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="01B-8B-a03" id="xlW-wW-cKf"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
<tableColumn identifier="" width="108" minWidth="10" maxWidth="3.4028234663852886e+38" id="cRC-bG-ngq">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Number of calls">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="XOd-z8-Ye0">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView misplaced="YES" id="Nis-LS-J2r">
<rect key="frame" x="440" y="1" width="108" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="asb-V9-wBZ">
<rect key="frame" x="0.0" y="0.0" width="108" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="Ee5-H2-1UN">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<connections>
<binding destination="Nis-LS-J2r" name="value" keyPath="objectValue.count" id="pk4-2L-iZx"/>
</connections>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="asb-V9-wBZ" id="q3w-4g-0WX"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
</tableColumns>
<connections>
<binding destination="gam-xN-1Lo" name="content" keyPath="arrangedObjects" id="8oG-xo-sWz"/>
</connections>
</tableView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="GO1-vn-D6b">
<rect key="frame" x="1" y="119" width="223" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="Acv-DO-UnI">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="7tf-PJ-zK5">
<rect key="frame" x="0.0" y="0.0" width="550" height="23"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<button verticalHuggingPriority="750" misplaced="YES" id="R6K-jS-lkH">
<rect key="frame" x="280" y="13" width="108" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Reset stats" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="2MD-k0-PMk">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="resetStatistics:" target="450" id="HJn-kg-XwG"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="obI-bJ-c88">
<rect key="frame" x="18" y="460" width="822" height="99"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" allowsUndo="NO" sendsActionOnEndEditing="YES" id="p4W-vb-EYI">
<font key="font" metaFont="system"/>
<string key="title">This test application will track delegate methods and notification messages from the CPTextView to the left below.
 
The Call order column tells in which order they are called. It is an increasing global number for each call to a delegate method or notification message.
The Number of calls column show how many times this method or message has been sent.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<point key="canvasLocation" x="-21" y="-228.5"/>
</window>
<customObject id="450" customClass="AppController">
<connections>
<outlet property="theWindow" destination="371" id="459"/>
</connections>
</customObject>
<arrayController objectClassName="NotificationStatistics" editable="NO" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" clearsFilterPredicateOnInsertion="NO" id="gam-xN-1Lo">
<connections>
<binding destination="450" name="contentArray" keyPath="self.notificationStatistics" id="wRu-Y1-zDw"/>
</connections>
</arrayController>
<userDefaultsController representsSharedInstance="YES" id="MG9-sm-bR3"/>
</objects>
</document>
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
CPTextViewDelegateAndNotifications
Created by You on December 22, 2017.
Copyright 2017, 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>CPTextViewDelegateAndNotifications</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
// The below will tell the compiler to generate debug symbols, type signatures and not inline objj_msgSend functions.
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
//
// Debug symbols will give each Objective-J method a Javascript function name. Without a name it will be very hard to find
// the methods in the debugger.
// Type Signatures will give type information to the Objective-J runtime for instance variables and methods.
// Inline objj_msgSend will give a speed increase but decorators will not work. Check below on debug options for
// more information on decorators.
//
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "SourceMap", "InlineMsgSend"];
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:
// Decorators will only work when the code is compiled without the compiler option 'InlineMsgSend'. Check above.
// 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: 0;
}
#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,166 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
CPTextViewDelegateAndNotifications
Created by You on December 22, 2017.
Copyright 2017, 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>CPTextViewDelegateAndNotifications</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
// The below will tell the compiler to not generate debug symbols but will generate type signatures and inline objj_msgSend functions.
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures"/*, "SourceMap"*/, "InlineMsgSend"];
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: 0;
}
#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
* CPTextViewDelegateAndNotifications
*
* Created by You on December 22, 2017.
* Copyright 2017, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -38,7 +38,7 @@ app (projectName, function(task)
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
task.setCompilerFlags("-DDEBUG -g -S --inline-msg-send");
else
task.setCompilerFlags("-O2");
});
@@ -44,7 +44,7 @@
// more information on decorators.
//
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures"/*, "InlineMsgSend"*/];
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "SourceMap", "InlineMsgSend"];
var progressBar = null;
@@ -36,7 +36,7 @@
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures", "InlineMsgSend"];
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures"/*, "SourceMap"*/, "InlineMsgSend"];
var progressBar = null;
@@ -110,7 +110,7 @@ var frameworkTask = framework (productName, function(frameworkTask)
//frameworkTask.setEnvironments([browserEnvironment]);
if (configuration === "Debug")
frameworkTask.setCompilerFlags("-DDEBUG -g");
frameworkTask.setCompilerFlags("-DDEBUG -g -S --inline-msg-send");
else
frameworkTask.setCompilerFlags("-O2");
});
@@ -38,7 +38,7 @@ app (projectName, function(task)
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
task.setCompilerFlags("-DDEBUG -g -S --inline-msg-send");
else
task.setCompilerFlags("-O2");
});
@@ -44,7 +44,7 @@
// more information on decorators.
//
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures"/*, "InlineMsgSend"*/];
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "SourceMap", "InlineMsgSend"];
var progressBar = null;
@@ -36,7 +36,7 @@
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures", "InlineMsgSend"];
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures"/*, "SourceMap"*/, "InlineMsgSend"];
var progressBar = null;
+5
View File
@@ -26,6 +26,7 @@
@import "NSCell.j"
@import "NSControl.j"
@global NIB_CONNECTION_EQUIVALENCY_TABLE
@implementation CPTextField (NSCoding)
@@ -82,6 +83,10 @@
if (self)
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
// If we have bindings/connections connected to the text field cell make sure they are replaced
NIB_CONNECTION_EQUIVALENCY_TABLE[[cell UID]] = self;
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}