From 7c831fa19d1e812d80aaddca093bac3b265e283e Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Sat, 19 Jan 2013 16:51:56 +0700 Subject: [PATCH] capp_lint flags deprecated CPPoint/Rect/Size types/functions - Changed to corresponding CG types/functions in all files - Fixed some demo app bugs --- AppKit/CPBox.j | 18 +++++------ AppKit/CPBrowser.j | 4 +-- AppKit/CPColorPanel.j | 16 +++++----- AppKit/CPColorPicker.j | 8 ++--- AppKit/CPDragServer.j | 2 +- AppKit/CPEvent.j | 12 ++++---- AppKit/CPFont.j | 4 +-- AppKit/CPImage.j | 2 +- AppKit/CPLevelIndicator.j | 2 +- AppKit/CPMenu/_CPMenuWindow.j | 2 +- AppKit/CPOutlineView.j | 10 +++---- AppKit/CPPopover.j | 2 +- AppKit/CPRuleEditor/CPRuleEditor.j | 6 ++-- .../CPRuleEditor/_CPRuleEditorPopUpButton.j | 4 +-- AppKit/CPRuleEditor/_CPRuleEditorViewSlice.j | 4 +-- .../CPRuleEditor/_CPRuleEditorViewSliceRow.j | 6 ++-- AppKit/CPScrollView.j | 2 +- AppKit/CPSearchField.j | 4 +-- AppKit/CPSegmentedControl.j | 2 +- AppKit/CPShadow.j | 6 ++-- AppKit/CPSplitView.j | 4 +-- AppKit/CPTableView.j | 14 ++++----- AppKit/CPTokenField.j | 12 ++++---- AppKit/CPToolbar.j | 2 +- AppKit/CPView.j | 10 +++---- AppKit/CPWebView.j | 8 ++--- AppKit/CPWindow/_CPDocModalWindowView.j | 2 +- AppKit/CPWindow/_CPHUDWindowView.j | 2 +- AppKit/CPWindow/_CPStandardWindowView.j | 2 +- AppKit/CPWindow/_CPTitleableWindowView.j | 2 +- AppKit/CPWindow/_CPWindowView.j | 2 +- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 8 ++--- AppKit/Themes/Aristo/ThemeDescriptors.j | 30 +++++++++---------- AppKit/Themes/Default/AppController.j | 16 +++++----- AppKit/_CPAutocompleteMenu.j | 2 +- AppKit/_CPToolTip.j | 18 +++++------ Foundation/CPCoder.j | 4 +-- Tests/Manual/AttachedSheet/AppController.j | 29 +++++++++--------- Tests/Manual/AttachedSheet/index-debug.html | 6 ++-- .../AttachedSheet2/SheetWindowController.j | 10 +++---- Tests/Manual/CPBoxTest/AppController.j | 4 +-- .../Manual/CPOutlineViewTest/AppController.j | 4 +-- .../Manual/CPRuleEditorCibTest/RuleControls.j | 6 ++-- Tests/Manual/CPScrollView/AppController.j | 2 +- Tests/Manual/CPScrollView2/AppController.j | 8 ++--- Tests/Manual/CPToolTip/AppController.j | 20 ++++++------- Tests/Manual/CPToolbarTest/AppController.j | 4 +-- .../CPWindowMovableTest/AppController.j | 6 ++-- .../SmartFoldersDemo/BadgedOutlineView.j | 2 +- Tools/capp_lint/capp_lint | 9 +++++- Tools/nib2cib/NSTableColumn.j | 4 +-- 51 files changed, 186 insertions(+), 182 deletions(-) diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index 10ba4ac00..4b9f181a5 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -84,7 +84,7 @@ CPBelowBottom = 6; + (id)themeAttributes { - return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], 1.0, 3.0, CPSizeMakeZero(), 6.0, [CPNull null], CPSizeMakeZero()] + return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], 1.0, 3.0, CGSizeMakeZero(), 6.0, [CPNull null], CGSizeMakeZero()] forKeys:[ @"background-color", @"border-color", @"border-width", @@ -95,7 +95,7 @@ CPBelowBottom = 6; @"content-margin"]]; } -- (id)initWithFrame:(CPRect)frameRect +- (id)initWithFrame:(CGRect)frameRect { self = [super initWithFrame:frameRect]; @@ -123,7 +123,7 @@ CPBelowBottom = 6; @return the border rectangle of the box */ -- (CPRect)borderRect +- (CGRect)borderRect { return [self bounds]; } @@ -287,12 +287,12 @@ CPBelowBottom = 6; _contentView = aView; } -- (CPSize)contentViewMargins +- (CGSize)contentViewMargins { return [self valueForThemeAttribute:@"content-margin"]; } -- (void)setContentViewMargins:(CPSize)size +- (void)setContentViewMargins:(CGSize)size { if (size.width < 0 || size.height < 0) [CPException raise:CPGenericException reason:@"Margins must be positive"]; @@ -301,7 +301,7 @@ CPBelowBottom = 6; [self setNeedsDisplay:YES]; } -- (void)setFrameFromContentFrame:(CPRect)aRect +- (void)setFrameFromContentFrame:(CGRect)aRect { var offset = [self _titleHeightOffset], borderWidth = [self borderWidth], @@ -370,7 +370,7 @@ CPBelowBottom = 6; case CPAtTop: case CPAboveTop: case CPBelowTop: - [_titleView setFrameOrigin:CPPointMake(5.0, 0.0)]; + [_titleView setFrameOrigin:CGPointMake(5.0, 0.0)]; [_titleView setAutoresizingMask:CPViewNotSizable]; break; @@ -378,7 +378,7 @@ CPBelowBottom = 6; case CPAtBottom: case CPBelowBottom: var h = [_titleView frameSize].height; - [_titleView setFrameOrigin:CPPointMake(5.0, [self frameSize].height - h)]; + [_titleView setFrameOrigin:CGPointMake(5.0, [self frameSize].height - h)]; [_titleView setAutoresizingMask:CPViewMinYMargin]; break; } @@ -422,7 +422,7 @@ CPBelowBottom = 6; } } -- (void)drawRect:(CPRect)rect +- (void)drawRect:(CGRect)rect { if (_borderType === CPNoBorder) return; diff --git a/AppKit/CPBrowser.j b/AppKit/CPBrowser.j index 235b90028..ba193f1ba 100644 --- a/AppKit/CPBrowser.j +++ b/AppKit/CPBrowser.j @@ -809,13 +809,13 @@ return [_browser canDragRowsWithIndexes:rowIndexes inColumn:[_browser columnOfTableView:self] withEvent:[CPApp currentEvent]]; } -- (CPImage)dragImageForRowsWithIndexes:(CPIndexSet)dragRows tableColumns:(CPArray)theTableColumns event:(CPEvent)dragEvent offset:(CPPointPointer)dragImageOffset +- (CPImage)dragImageForRowsWithIndexes:(CPIndexSet)dragRows tableColumns:(CPArray)theTableColumns event:(CPEvent)dragEvent offset:(CGPointPointer)dragImageOffset { return [_browser draggingImageForRowsWithIndexes:dragRows inColumn:[_browser columnOfTableView:self] withEvent:dragEvent offset:dragImageOffset] || [super dragImageForRowsWithIndexes:dragRows tableColumns:theTableColumns event:dragEvent offset:dragImageOffset]; } -- (CPView)dragViewForRowsWithIndexes:(CPIndexSet)dragRows tableColumns:(CPArray)theTableColumns event:(CPEvent)dragEvent offset:(CPPoint)dragViewOffset +- (CPView)dragViewForRowsWithIndexes:(CPIndexSet)dragRows tableColumns:(CPArray)theTableColumns event:(CPEvent)dragEvent offset:(CGPoint)dragViewOffset { var count = theTableColumns.length; while (count--) diff --git a/AppKit/CPColorPanel.j b/AppKit/CPColorPanel.j index 0f595a4b5..3c6cb781c 100644 --- a/AppKit/CPColorPanel.j +++ b/AppKit/CPColorPanel.j @@ -250,8 +250,8 @@ CPColorPickerViewHeight = 370; var height = (TOOLBAR_HEIGHT + 10 + PREVIEW_HEIGHT + 5 + SWATCH_HEIGHT + 32), bounds = [[self contentView] bounds]; - [view setFrameSize:CPSizeMake(bounds.size.width - 10, bounds.size.height - height)]; - [view setFrameOrigin:CPPointMake(5, height)]; + [view setFrameSize:CGSizeMake(bounds.size.width - 10, bounds.size.height - height)]; + [view setFrameOrigin:CGPointMake(5, height)]; } [_currentView removeFromSuperview]; @@ -421,7 +421,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; CPCookie _swatchCookie; } -- (id)initWithFrame:(CPRect)aFrame +- (id)initWithFrame:(CGRect)aFrame { self = [super initWithFrame:aFrame]; @@ -439,7 +439,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; for (var i = 0; i < 50; i++) { // FIXME: http://280north.lighthouseapp.com/projects/13294-cappuccino/tickets/25-implement-cpbox - var view = [[CPView alloc] initWithFrame:CPRectMake(13 * i + 1, 1, 12, 12)], + var view = [[CPView alloc] initWithFrame:CGRectMake(13 * i + 1, 1, 12, 12)], fillView = [[CPView alloc] initWithFrame:CGRectInset([view bounds], 1.0, 1.0)]; [view setBackgroundColor:whiteColor]; @@ -594,7 +594,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; CPColorPanel _colorPanel; } -- (id)initWithFrame:(CPRect)aFrame +- (id)initWithFrame:(CGRect)aFrame { self = [super initWithFrame:aFrame]; @@ -635,7 +635,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; [[CPPasteboard pasteboardWithName:CPDragPboard] declareTypes:[CPColorDragType] owner:self]; - var bounds = CPRectMake(0, 0, 15, 15); + var bounds = CGRectMake(0, 0, 15, 15); // FIXME: http://280north.lighthouseapp.com/projects/13294-cappuccino/tickets/25-implement-cpbox var dragView = [[CPView alloc] initWithFrame:bounds], @@ -647,8 +647,8 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; [dragView addSubview:dragFillView]; [self dragView:dragView - at:CPPointMake(point.x - bounds.size.width / 2.0, point.y - bounds.size.height / 2.0) - offset:CPPointMake(0.0, 0.0) + at:CGPointMake(point.x - bounds.size.width / 2.0, point.y - bounds.size.height / 2.0) + offset:CGPointMake(0.0, 0.0) event:anEvent pasteboard:nil source:self diff --git a/AppKit/CPColorPicker.j b/AppKit/CPColorPicker.j index af6ecd051..39451d0cf 100644 --- a/AppKit/CPColorPicker.j +++ b/AppKit/CPColorPicker.j @@ -228,7 +228,7 @@ float _radius; } -- (id)initWithFrame:(CPRect)aFrame +- (id)initWithFrame:(CGRect)aFrame { if (self = [super initWithFrame:aFrame]) { @@ -275,13 +275,13 @@ #endif } -- (void)setFrameSize:(CPSize)aSize +- (void)setFrameSize:(CGSize)aSize { [super setFrameSize:aSize]; [self setWheelSize:aSize]; } -- (void)setWheelSize:(CPSize)aSize +- (void)setWheelSize:(CGSize)aSize { var min = MIN(aSize.width, aSize.height); @@ -359,7 +359,7 @@ _angle = [self radiansToDegrees:angle]; _distance = (distance / _radius) * 100.0; - [_crosshair setFrameOrigin:CPPointMake(COS(angle) * distance + midX - 2.0, SIN(angle) * distance + midY - 2.0)]; + [_crosshair setFrameOrigin:CGPointMake(COS(angle) * distance + midX - 2.0, SIN(angle) * distance + midY - 2.0)]; } - (void)setPositionToColor:(CPColor)aColor diff --git a/AppKit/CPDragServer.j b/AppKit/CPDragServer.j index 09d8f3f8e..b8697c018 100644 --- a/AppKit/CPDragServer.j +++ b/AppKit/CPDragServer.j @@ -74,7 +74,7 @@ var CPDragServerSource = nil, - (unsigned)draggingSourceOperationMask */ -- (CPPoint)draggingLocation +- (CGPoint)draggingLocation { return [[CPDragServer sharedDragServer] draggingLocation]; } diff --git a/AppKit/CPEvent.j b/AppKit/CPEvent.j index 9ec1ad97a..c958b49d9 100644 --- a/AppKit/CPEvent.j +++ b/AppKit/CPEvent.j @@ -196,7 +196,7 @@ var _CPEventPeriodicEventPeriod = 0, @implementation CPEvent : CPObject { CPEventType _type; - CPPoint _location; + CGPoint _location; unsigned _modifierFlags; CPTimeInterval _timestamp; CPGraphicsContext _context; @@ -315,13 +315,13 @@ var _CPEventPeriodicEventPeriod = 0, } /* @ignore */ -- (id)_initMouseEventWithType:(CPEventType)anEventType location:(CPPoint)aPoint modifierFlags:(unsigned)modifierFlags +- (id)_initMouseEventWithType:(CPEventType)anEventType location:(CGPoint)aPoint modifierFlags:(unsigned)modifierFlags timestamp:(CPTimeInterval)aTimestamp windowNumber:(int)aWindowNumber context:(CPGraphicsContext)aGraphicsContext eventNumber:(int)anEventNumber clickCount:(int)aClickCount pressure:(float)aPressure { if (self = [self _initWithType:anEventType]) { - _location = CPPointCreateCopy(aPoint); + _location = CGPointCreateCopy(aPoint); _modifierFlags = modifierFlags; _timestamp = aTimestamp; _context = aGraphicsContext; @@ -335,13 +335,13 @@ var _CPEventPeriodicEventPeriod = 0, } /* @ignore */ -- (id)_initKeyEventWithType:(CPEventType)anEventType location:(CPPoint)aPoint modifierFlags:(unsigned int)modifierFlags +- (id)_initKeyEventWithType:(CPEventType)anEventType location:(CGPoint)aPoint modifierFlags:(unsigned int)modifierFlags timestamp:(CPTimeInterval)aTimestamp windowNumber:(int)aWindowNumber context:(CPGraphicsContext)aGraphicsContext characters:(CPString)characters charactersIgnoringModifiers:(CPString)unmodCharacters isARepeat:(BOOL)isARepeat keyCode:(unsigned short)code { if (self = [self _initWithType:anEventType]) { - _location = CPPointCreateCopy(aPoint); + _location = CGPointCreateCopy(aPoint); _modifierFlags = modifierFlags; _timestamp = aTimestamp; _context = aGraphicsContext; @@ -362,7 +362,7 @@ var _CPEventPeriodicEventPeriod = 0, { if (self = [self _initWithType:anEventType]) { - _location = CPPointCreateCopy(aPoint); + _location = CGPointCreateCopy(aPoint); _modifierFlags = modifierFlags; _timestamp = aTimestamp; _context = aGraphicsContext; diff --git a/AppKit/CPFont.j b/AppKit/CPFont.j index 6b63f6933..aa91ac694 100644 --- a/AppKit/CPFont.j +++ b/AppKit/CPFont.j @@ -281,7 +281,7 @@ following: that dynamically tracks the current system font size. @return the requested system font */ -+ (CPFont)systemFontOfSize:(CPSize)aSize ++ (CPFont)systemFontOfSize:(CGSize)aSize { return _CPSystemFont(aSize === 0 ? _CPFontSystemFontSize : aSize, NO); } @@ -293,7 +293,7 @@ following: that dynamically tracks the current system font size. @return the requested bold system font */ -+ (CPFont)boldSystemFontOfSize:(CPSize)aSize ++ (CPFont)boldSystemFontOfSize:(CGSize)aSize { return _CPSystemFont(aSize === 0 ? _CPFontSystemFontSize : aSize, YES); } diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index fe3aec239..8d440a23d 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -118,7 +118,7 @@ function CPAppKitImage(aFilename, aSize) if (self) { - _size = CPSizeCreateCopy(aSize); + _size = CGSizeCreateCopy(aSize); _filename = aFilename; _loadStatus = CPImageLoadStatusInitialized; } diff --git a/AppKit/CPLevelIndicator.j b/AppKit/CPLevelIndicator.j index 8ae219b2e..59fc3c6b4 100644 --- a/AppKit/CPLevelIndicator.j +++ b/AppKit/CPLevelIndicator.j @@ -183,7 +183,7 @@ CPRatingLevelIndicatorStyle = 3; return _isEditable; } -- (CPView)hitTest:(CPPoint)aPoint +- (CPView)hitTest:(CGPoint)aPoint { // Don't swallow clicks when displayed in a table. if (![self isEditable]) diff --git a/AppKit/CPMenu/_CPMenuWindow.j b/AppKit/CPMenu/_CPMenuWindow.j index bc7726ac5..b2c465ef8 100644 --- a/AppKit/CPMenu/_CPMenuWindow.j +++ b/AppKit/CPMenu/_CPMenuWindow.j @@ -357,7 +357,7 @@ var STICKY_TIME_INTERVAL = 500; - (_CPManagerScrollingState)scrollingStateForPoint:(CGPoint)aGlobalLocation { var frame = [self frame]; - if (!CPRectContainsPoint(frame,aGlobalLocation) || ![self canScroll]) + if (!CGRectContainsPoint(frame,aGlobalLocation) || ![self canScroll]) return _CPMenuManagerScrollingStateNone; // If we're at or above of the top scroll indicator... diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index 203552eea..3107e7b5d 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -1053,7 +1053,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, @ignore We need to offset the dataview and add the disclosure triangle. */ -- (CPView)_dragViewForColumn:(int)theColumnIndex event:(CPEvent)theDragEvent offset:(CPPointPointer)theDragViewOffset +- (CPView)_dragViewForColumn:(int)theColumnIndex event:(CPEvent)theDragEvent offset:(CGPointPointer)theDragViewOffset { var dragView = [[_CPColumnDragView alloc] initWithLineColor:[self gridColor]], tableColumn = [[self tableColumns] objectAtIndex:theColumnIndex], @@ -1186,7 +1186,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, /*! @ignore */ -- (id)_parentItemForUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex atMouseOffset:(CPPoint)theOffset +- (id)_parentItemForUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex atMouseOffset:(CGPoint)theOffset { if (_shouldRetargetItem) return _retargetedItem; @@ -1216,7 +1216,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, /*! @ignore */ -- (CPRect)_rectForDropHighlightViewBetweenUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex offset:(CPPoint)theOffset +- (CGRect)_rectForDropHighlightViewBetweenUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex offset:(CGPoint)theOffset { // Call super and the update x to reflect the current indentation level var rect = [super _rectForDropHighlightViewBetweenUpperRow:theUpperRowIndex andLowerRow:theLowerRowIndex offset:theOffset], @@ -1729,7 +1729,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt return [_outlineView._outlineViewDataSource outlineView:_outlineView writeItems:items toPasteboard:thePasteboard]; } -- (int)_childIndexForDropOperation:(CPTableViewDropOperation)theDropOperation row:(int)theRow offset:(CPPoint)theOffset +- (int)_childIndexForDropOperation:(CPTableViewDropOperation)theDropOperation row:(int)theRow offset:(CGPoint)theOffset { if (_outlineView._shouldRetargetChildIndex) return _outlineView._retargedChildIndex; @@ -1753,7 +1753,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt return childIndex; } -- (void)_parentItemForDropOperation:(CPTableViewDropOperation)theDropOperation row:(int)theRow offset:(CPPoint)theOffset +- (void)_parentItemForDropOperation:(CPTableViewDropOperation)theDropOperation row:(int)theRow offset:(CGPoint)theOffset { if (theDropOperation === CPTableViewDropAbove) return [_outlineView _parentItemForUpperRow:theRow - 1 andLowerRow:theRow atMouseOffset:theOffset] diff --git a/AppKit/CPPopover.j b/AppKit/CPPopover.j index 2125a499a..98d80f4b7 100644 --- a/AppKit/CPPopover.j +++ b/AppKit/CPPopover.j @@ -135,7 +135,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0, @param aSize the desired size */ -- (void)setContentSize:(CPSize)aSize +- (void)setContentSize:(CGSize)aSize { [[_contentViewController view] setFrameSize:aSize]; } diff --git a/AppKit/CPRuleEditor/CPRuleEditor.j b/AppKit/CPRuleEditor/CPRuleEditor.j index ab6b703d0..88e3b1abc 100644 --- a/AppKit/CPRuleEditor/CPRuleEditor.j +++ b/AppKit/CPRuleEditor/CPRuleEditor.j @@ -2066,7 +2066,7 @@ TODO: implement [super setNeedsDisplay:flag]; } -- (void)setFrameSize:(CPSize)size +- (void)setFrameSize:(CGSize)size { [self setNeedsDisplay:YES]; @@ -2262,7 +2262,7 @@ TODO: implement return [CPIndexSet indexSetWithIndex:CPDragOperationMove]; } -- (void)draggedView:(CPView)dragView endedAt:(CPPoint)aPoint operation:(CPDragOperation)operation +- (void)draggedView:(CPView)dragView endedAt:(CGPoint)aPoint operation:(CPDragOperation)operation { _draggingRows = nil; @@ -2586,7 +2586,7 @@ var dropSeparatorColor = [CPColor colorWithHexString:@"4886ca"]; { } -- (void)drawRect:(CPRect)rect +- (void)drawRect:(CGRect)rect { var context = [[CPGraphicsContext currentContext] graphicsPort]; CGContextSetFillColor(context, dropSeparatorColor); diff --git a/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j b/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j index 2035b5cdf..900869491 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j @@ -69,9 +69,9 @@ else if (CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) return self; } -- (id)hitTest:(CPPoint)point +- (id)hitTest:(CGPoint)point { - if (!CPRectContainsPoint([self frame], point) || ![self sliceIsEditable]) + if (!CGRectContainsPoint([self frame], point) || ![self sliceIsEditable]) return nil; return self; diff --git a/AppKit/CPRuleEditor/_CPRuleEditorViewSlice.j b/AppKit/CPRuleEditor/_CPRuleEditorViewSlice.j index b1966765a..876d4f141 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorViewSlice.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorViewSlice.j @@ -10,7 +10,7 @@ CPRuleEditor _ruleEditor; int _indentation @accessors(property=indentation); int _rowIndex @accessors(property=rowIndex); - CPRect _animationTargetRect @accessors(property=_animationTargetRect); + CGRect _animationTargetRect @accessors(property=_animationTargetRect); BOOL _selected @accessors(getter=_isSelected, setter=_setSelected:); BOOL _lastSelected @accessors(getter=_isLastSelected, setter=_setLastSelected:); CPColor _backgroundColor @accessors(property=backgroundColor); @@ -44,7 +44,7 @@ _selected = select; } -- (void)drawRect:(CPRect)rect +- (void)drawRect:(CGRect)rect { var context = [[CPGraphicsContext currentContext] graphicsPort], bounds = [self bounds], diff --git a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j index 638f6be84..101a99202 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j @@ -473,7 +473,7 @@ var CONTROL_HEIGHT = 16., [self layoutSubviews]; } -- (void)drawRect:(CPRect)rect +- (void)drawRect:(CGRect)rect { [super drawRect:rect]; } @@ -523,9 +523,9 @@ var CONTROL_HEIGHT = 16., return self; } -- (id)hitTest:(CPPoint)point +- (id)hitTest:(CGPoint)point { - if (!CPRectContainsPoint([self frame], point)) + if (!CGRectContainsPoint([self frame], point)) return nil; return [self superview]; diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index d99ec583c..a177d0651 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -1256,7 +1256,7 @@ Notifies the delegate when the scroll view has finished scrolling. #pragma mark - #pragma mark Overrides -- (void)drawRect:(CPRect)aRect +- (void)drawRect:(CGRect)aRect { [super drawRect:aRect]; diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index a2747397e..41d3f3bb9 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -250,7 +250,7 @@ var RECENT_SEARCH_PREFIX = @" "; */ - (CGRect)searchButtonRectForBounds:(CGRect)rect { - var size = [[self valueForThemeAttribute:@"image-search"] size] || CPSizeMakeZero(); + var size = [[self valueForThemeAttribute:@"image-search"] size] || CGSizeMakeZero(); return _CGRectMake(5, (_CGRectGetHeight(rect) - size.height) / 2, size.width, size.height); } @@ -262,7 +262,7 @@ var RECENT_SEARCH_PREFIX = @" "; */ - (CGRect)cancelButtonRectForBounds:(CGRect)rect { - var size = [[self valueForThemeAttribute:@"image-cancel"] size] || CPSizeMakeZero(); + var size = [[self valueForThemeAttribute:@"image-cancel"] size] || CGSizeMakeZero(); return _CGRectMake(_CGRectGetWidth(rect) - size.width - 5, (_CGRectGetHeight(rect) - size.width) / 2, size.height, size.height); } diff --git a/AppKit/CPSegmentedControl.j b/AppKit/CPSegmentedControl.j index 00e0118fb..c0cbed55d 100644 --- a/AppKit/CPSegmentedControl.j +++ b/AppKit/CPSegmentedControl.j @@ -465,7 +465,7 @@ CPSegmentSwitchTrackingMomentary = 2; } else if (aName === "right-segment-bezel") { - return CPRectMake(CGRectGetWidth([self bounds]) - contentInset.right, + return CGRectMake(CGRectGetWidth([self bounds]) - contentInset.right, bezelInset.top, contentInset.right, height); diff --git a/AppKit/CPShadow.j b/AppKit/CPShadow.j index 98a3bf014..34dcdbc5f 100644 --- a/AppKit/CPShadow.j +++ b/AppKit/CPShadow.j @@ -31,7 +31,7 @@ */ @implementation CPShadow : CPObject { - CPSize _offset; + CGSize _offset; float _blurRadius; CPColor _color; @@ -51,7 +51,7 @@ } /* @ignore */ -- (id)_initWithOffset:(CPSize)anOffset blurRadius:(float)aBlurRadius color:(CPColor)aColor +- (id)_initWithOffset:(CGSize)anOffset blurRadius:(float)aBlurRadius color:(CPColor)aColor { self = [super init]; @@ -99,4 +99,4 @@ return _cssString; } -@end \ No newline at end of file +@end diff --git a/AppKit/CPSplitView.j b/AppKit/CPSplitView.j index 374c4211b..3e0913de1 100644 --- a/AppKit/CPSplitView.j +++ b/AppKit/CPSplitView.j @@ -787,7 +787,7 @@ var ShouldSuppressResizeNotifications = 1, [self setNeedsDisplay:YES]; } -- (void)resizeSubviewsWithOldSize:(CPSize)oldSize +- (void)resizeSubviewsWithOldSize:(CGSize)oldSize { if ([_delegate respondsToSelector:@selector(splitView:resizeSubviewsWithOldSize:)]) { @@ -1143,7 +1143,7 @@ The sum of the views and the sum of the dividers should be equal to the size of for (var i = 0, count = [frames count] - 1; i < count; i++) { - var frame = CPRectFromString(frames[i]); + var frame = CGRectFromString(frames[i]); position += frame.size[_sizeComponent]; [self setPosition:position ofDividerAtIndex:i]; diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 3a607ecaf..418fbac46 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -2881,7 +2881,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad // Copy the dataviews add them to a transparent drag view and use that drag view // to make it appear we are dragging images of those rows (as you would do in regular Cocoa) */ -- (CPView)_dragViewForColumn:(int)theColumnIndex event:(CPEvent)theDragEvent offset:(CPPointPointer)theDragViewOffset +- (CPView)_dragViewForColumn:(int)theColumnIndex event:(CPEvent)theDragEvent offset:(CGPointPointer)theDragViewOffset { var dragView = [[_CPColumnDragView alloc] initWithLineColor:[self gridColor]], tableColumn = [[self tableColumns] objectAtIndex:theColumnIndex], @@ -4153,7 +4153,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad if ([self canDragRowsWithIndexes:_draggedRowIndexes atPoint:aPoint] && [_dataSource tableView:self writeRowsWithIndexes:_draggedRowIndexes toPasteboard:pboard]) { var currentEvent = [CPApp currentEvent], - offset = CPPointMakeZero(), + offset = CGPointMakeZero(), tableColumns = [_tableColumns objectsAtIndexes:_exposedColumns]; // We deviate from the default Cocoa implementation here by asking for a view in stead of an image @@ -4175,8 +4175,8 @@ Your delegate can implement this method to avoid subclassing the tableview to ad } var bounds = [view bounds], - viewLocation = CPPointMake(aPoint.x - CGRectGetWidth(bounds) / 2 + offset.x, aPoint.y - CGRectGetHeight(bounds) / 2 + offset.y); - [self dragView:view at:viewLocation offset:CPPointMakeZero() event:[CPApp currentEvent] pasteboard:pboard source:self slideBack:YES]; + viewLocation = CGPointMake(aPoint.x - CGRectGetWidth(bounds) / 2 + offset.x, aPoint.y - CGRectGetHeight(bounds) / 2 + offset.y); + [self dragView:view at:viewLocation offset:CGPointMakeZero() event:[CPApp currentEvent] pasteboard:pboard source:self slideBack:YES]; _startTrackingPoint = nil; return NO; @@ -4355,7 +4355,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad // If there is no (the default) or to little inter cell spacing we create some room for the CPTableViewDropAbove indicator // This probably doesn't work if the row height is smaller than or around 5.0 if ([self intercellSpacing].height < 5.0) - rowRect = CPRectInset(rowRect, 0.0, 5.0 - [self intercellSpacing].height); + rowRect = CGRectInset(rowRect, 0.0, 5.0 - [self intercellSpacing].height); // If the altered row rect contains the drag point we show the drop on // We don't show the drop on indicator if we are dragging below the last row @@ -4403,7 +4403,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad /*! @ignore */ -- (CPRect)_rectForDropHighlightViewOnRow:(int)theRowIndex +- (CGRect)_rectForDropHighlightViewOnRow:(int)theRowIndex { if (theRowIndex >= [self numberOfRows]) theRowIndex = [self numberOfRows] - 1; @@ -4414,7 +4414,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad /*! @ignore */ -- (CPRect)_rectForDropHighlightViewBetweenUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex offset:(CPPoint)theOffset +- (CGRect)_rectForDropHighlightViewBetweenUpperRow:(int)theUpperRowIndex andLowerRow:(int)theLowerRowIndex offset:(CGPoint)theOffset { if (theLowerRowIndex > [self numberOfRows]) theLowerRowIndex = [self numberOfRows]; diff --git a/AppKit/CPTokenField.j b/AppKit/CPTokenField.j index a16a77af2..637863d73 100755 --- a/AppKit/CPTokenField.j +++ b/AppKit/CPTokenField.j @@ -95,7 +95,7 @@ var CPScrollDestinationNone = 0, return [CPDictionary dictionaryWithObject:_CGInsetMakeZero() forKey:@"editor-inset"]; } -- (id)initWithFrame:(CPRect)frame +- (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { @@ -998,8 +998,8 @@ var CPScrollDestinationNone = 0, var contentRect = _CGRectMakeCopy([contentView bounds]), contentOrigin = contentRect.origin, contentSize = contentRect.size, - offset = CPPointMake(contentOrigin.x, contentOrigin.y), - spaceBetweenTokens = CPSizeMake(2.0, 2.0), + offset = CGPointMake(contentOrigin.x, contentOrigin.y), + spaceBetweenTokens = CGSizeMake(2.0, 2.0), isEditing = [[self window] firstResponder] == self, tokenToken = [_CPTokenFieldToken new], font = [self currentValueForThemeAttribute:@"font"], @@ -1281,11 +1281,11 @@ var CPScrollDestinationNone = 0, return NO; } -- (id)initWithFrame:(CPRect)frame +- (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - _deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:CPRectMakeZero()]; + _deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:CGRectMakeZero()]; [self addSubview:_deleteButton]; [self setEditable:NO]; @@ -1375,7 +1375,7 @@ var CPScrollDestinationNone = 0, buttonOffset = [_deleteButton currentValueForThemeAttribute:@"offset"], buttonSize = [_deleteButton currentValueForThemeAttribute:@"min-size"]; - [_deleteButton setFrame:_CGRectMake(CPRectGetMaxX(frame) - buttonOffset.x, CPRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)]; + [_deleteButton setFrame:_CGRectMake(CGRectGetMaxX(frame) - buttonOffset.x, CGRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)]; } } diff --git a/AppKit/CPToolbar.j b/AppKit/CPToolbar.j index 30a13dc8b..492092309 100644 --- a/AppKit/CPToolbar.j +++ b/AppKit/CPToolbar.j @@ -269,7 +269,7 @@ var CPToolbarsByIdentifier = nil, - (CGRect)_toolbarViewFrame { var height = _desiredHeight || (_sizeMode != CPToolbarSizeModeSmall ? [_toolbarView valueForThemeAttribute:@"regular-size-height"] : [_toolbarView valueForThemeAttribute:@"small-size-height"]); - return CPRectMake(0.0, 0.0, 1200.0, height); + return CGRectMake(0.0, 0.0, 1200.0, height); } /* @ignore */ diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 9abfa56fe..1e066480f 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -1528,7 +1528,7 @@ var CPViewFlags = { }, @param aPoint the point to test @return returns the containing view, or nil if the point is not contained */ -- (CPView)hitTest:(CPPoint)aPoint +- (CPView)hitTest:(CGPoint)aPoint { if (_isHidden || !_hitTests || !_CGRectContainsPoint(_frame, aPoint)) return nil; @@ -2049,7 +2049,7 @@ setBoundsOrigin: @param aSourceObject the drag operation controller @param slideBack Whether the view should 'slide back' if the drag is rejected */ -- (void)dragView:(CPView)aView at:(CPPoint)aLocation offset:(CPSize)mouseOffset event:(CPEvent)anEvent pasteboard:(CPPasteboard)aPasteboard source:(id)aSourceObject slideBack:(BOOL)slideBack +- (void)dragView:(CPView)aView at:(CGPoint)aLocation offset:(CGSize)mouseOffset event:(CPEvent)anEvent pasteboard:(CPPasteboard)aPasteboard source:(id)aSourceObject slideBack:(BOOL)slideBack { [_window dragView:aView at:[self convertPoint:aLocation toView:nil] offset:mouseOffset event:anEvent pasteboard:aPasteboard source:aSourceObject slideBack:slideBack]; } @@ -2099,7 +2099,7 @@ setBoundsOrigin: Draws the receiver into \c aRect. This method should be overridden by subclasses. @param aRect the area that should be drawn into */ -- (void)drawRect:(CPRect)aRect +- (void)drawRect:(CGRect)aRect { } @@ -2119,7 +2119,7 @@ setBoundsOrigin: Marks the area denoted by \c aRect as dirty, and initiates a redraw on it. @param aRect the area that needs to be redrawn */ -- (void)setNeedsDisplayInRect:(CPRect)aRect +- (void)setNeedsDisplayInRect:(CGRect)aRect { if (!(_viewClassFlags & CPViewHasCustomDrawRect)) return; @@ -2167,7 +2167,7 @@ setBoundsOrigin: Draws the receiver into the area defined by \c aRect. @param aRect the area to be drawn */ -- (void)displayRect:(CPRect)aRect +- (void)displayRect:(CGRect)aRect { [self viewWillDraw]; diff --git a/AppKit/CPWebView.j b/AppKit/CPWebView.j index 57717d744..85dac3c7a 100644 --- a/AppKit/CPWebView.j +++ b/AppKit/CPWebView.j @@ -126,7 +126,7 @@ CPWebViewAppKitScrollMaxPollCount = 3; BOOL _drawsBackground; } -- (id)initWithFrame:(CPRect)frameRect frameName:(CPString)frameName groupName:(CPString)groupName +- (id)initWithFrame:(CGRect)frameRect frameName:(CPString)frameName groupName:(CPString)groupName { if (self = [self initWithFrame:frameRect]) { @@ -136,7 +136,7 @@ CPWebViewAppKitScrollMaxPollCount = 3; return self; } -- (id)initWithFrame:(CPRect)aFrame +- (id)initWithFrame:(CGRect)aFrame { if (self = [super initWithFrame:aFrame]) { @@ -157,7 +157,7 @@ CPWebViewAppKitScrollMaxPollCount = 3; return self; } -- (id)_initDOMWithFrame:(CPRect)aFrame +- (id)_initDOMWithFrame:(CGRect)aFrame { _ignoreLoadStart = YES; _ignoreLoadEnd = YES; @@ -221,7 +221,7 @@ CPWebViewAppKitScrollMaxPollCount = 3; [self addSubview:_scrollView]; } -- (void)setFrameSize:(CPSize)aSize +- (void)setFrameSize:(CGSize)aSize { [super setFrameSize:aSize]; [self _resizeWebFrame]; diff --git a/AppKit/CPWindow/_CPDocModalWindowView.j b/AppKit/CPWindow/_CPDocModalWindowView.j index 6915d3446..143f71eb4 100644 --- a/AppKit/CPWindow/_CPDocModalWindowView.j +++ b/AppKit/CPWindow/_CPDocModalWindowView.j @@ -18,7 +18,7 @@ forKeys:[ @"body-color", @"height-shadow"]]; } -- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask +- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask { self = [super initWithFrame:aFrame styleMask:aStyleMask]; diff --git a/AppKit/CPWindow/_CPHUDWindowView.j b/AppKit/CPWindow/_CPHUDWindowView.j index a1a97acbc..34358a7e2 100644 --- a/AppKit/CPWindow/_CPHUDWindowView.j +++ b/AppKit/CPWindow/_CPHUDWindowView.j @@ -64,7 +64,7 @@ return frameRect; } -- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask +- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask { self = [super initWithFrame:aFrame styleMask:aStyleMask]; diff --git a/AppKit/CPWindow/_CPStandardWindowView.j b/AppKit/CPWindow/_CPStandardWindowView.j index d5a2a0085..2ac4599a1 100644 --- a/AppKit/CPWindow/_CPStandardWindowView.j +++ b/AppKit/CPWindow/_CPStandardWindowView.j @@ -122,7 +122,7 @@ @"unsaved-image-highlighted-button"]]; } -- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask +- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask { self = [super initWithFrame:aFrame styleMask:aStyleMask]; diff --git a/AppKit/CPWindow/_CPTitleableWindowView.j b/AppKit/CPWindow/_CPTitleableWindowView.j index 263f928b9..e4622baef 100644 --- a/AppKit/CPWindow/_CPTitleableWindowView.j +++ b/AppKit/CPWindow/_CPTitleableWindowView.j @@ -57,7 +57,7 @@ return frameRect; } -- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask +- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask { self = [super initWithFrame:aFrame styleMask:aStyleMask]; diff --git a/AppKit/CPWindow/_CPWindowView.j b/AppKit/CPWindow/_CPWindowView.j index e051ee9d5..769a734f8 100644 --- a/AppKit/CPWindow/_CPWindowView.j +++ b/AppKit/CPWindow/_CPWindowView.j @@ -138,7 +138,7 @@ var _CPWindowViewCornerResizeRectWidth = 10, return frameRect; } -- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask +- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask { self = [super initWithFrame:aFrame]; diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index c7b6233ea..e7c008189 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -1453,7 +1453,7 @@ var resizeTimer = nil; } /* @ignore */ -- (id)_dragHitTest:(CPPoint)aPoint pasteboard:(CPPasteboard)aPasteboard +- (id)_dragHitTest:(CGPoint)aPoint pasteboard:(CPPasteboard)aPasteboard { var levels = _windowLevels, layers = _windowLayers, @@ -1507,17 +1507,17 @@ var resizeTimer = nil; return StopContextMenuDOMEventPropagation; } -- (CPWindow)_mouseHitTest:(CPPoint)location +- (CPWindow)_mouseHitTest:(CGPoint)location { return [self _hitTest:location withTest:@selector(_isValidMousePoint:)] } -- (CPWindow)hitTest:(CPPoint)location +- (CPWindow)hitTest:(CGPoint)location { return [self _hitTest:location withTest:@selector(containsPoint:)] } -- (CPWindow)_hitTest:(CPPoint)location withTest:(SEL)aTest +- (CPWindow)_hitTest:(CGPoint)location withTest:(SEL)aTest { if (self._only) return self._only; diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index 264752295..409d2549b 100755 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -713,8 +713,8 @@ var themedButtonValues = nil, [@"knob-color", knobColorDark, CPThemeStateVertical | CPThemeStateScrollerKnobDark], [@"increment-line-color", [CPNull null], CPThemeStateVertical], [@"decrement-line-color", [CPNull null], CPThemeStateVertical], - [@"decrement-line-size", CPSizeMakeZero(), CPThemeStateVertical], - [@"increment-line-size", CPSizeMakeZero(), CPThemeStateVertical], + [@"decrement-line-size", CGSizeMakeZero(), CPThemeStateVertical], + [@"increment-line-size", CGSizeMakeZero(), CPThemeStateVertical], // Legacy [@"scroller-width", 14.0, CPThemeStateVertical | CPThemeStateScrollViewLegacy], @@ -732,8 +732,8 @@ var themedButtonValues = nil, [@"knob-color", knobColorLegacy, CPThemeStateVertical | CPThemeStateScrollViewLegacy | CPThemeStateScrollerKnobDark], [@"increment-line-color", incrementColorLegacy, CPThemeStateVertical | CPThemeStateScrollViewLegacy], [@"decrement-line-color", decrementColorLegacy, CPThemeStateVertical | CPThemeStateScrollViewLegacy], - [@"decrement-line-size", CPSizeMake(14.0, 11.0), CPThemeStateVertical | CPThemeStateScrollViewLegacy], - [@"increment-line-size", CPSizeMake(14.0, 11.0), CPThemeStateVertical | CPThemeStateScrollViewLegacy] + [@"decrement-line-size", CGSizeMake(14.0, 11.0), CPThemeStateVertical | CPThemeStateScrollViewLegacy], + [@"increment-line-size", CGSizeMake(14.0, 11.0), CPThemeStateVertical | CPThemeStateScrollViewLegacy] ]; [self registerThemeValues:themedVerticalScrollerValues forView:scroller]; @@ -831,8 +831,8 @@ var themedButtonValues = nil, [@"knob-color", knobColor], [@"knob-color", knobColorLight, CPThemeStateScrollerKnobLight], [@"knob-color", knobColorDark, CPThemeStateScrollerKnobDark], - [@"decrement-line-size", CPSizeMakeZero()], - [@"increment-line-size", CPSizeMakeZero()], + [@"decrement-line-size", CGSizeMakeZero()], + [@"increment-line-size", CGSizeMakeZero()], // Legacy [@"scroller-width", 14.0, CPThemeStateScrollViewLegacy], @@ -848,8 +848,8 @@ var themedButtonValues = nil, [@"knob-color", knobColorLegacy, CPThemeStateScrollViewLegacy | CPThemeStateScrollerKnobDark], [@"increment-line-color", incrementColorLegacy, CPThemeStateScrollViewLegacy], [@"decrement-line-color", decrementColorLegacy, CPThemeStateScrollViewLegacy], - [@"decrement-line-size", CPSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy], - [@"increment-line-size", CPSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy] + [@"decrement-line-size", CGSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy], + [@"increment-line-size", CGSizeMake(11.0, 14.0), CPThemeStateScrollViewLegacy] ]; [self registerThemeValues:themedHorizontalScrollerValues forView:scroller]; @@ -1957,7 +1957,7 @@ var themedButtonValues = nil, + (_CPToolTipWindowView)themedTooltip { - var toolTipView = [[_CPToolTipWindowView alloc] initWithFrame:CPRectMakeZero() styleMask:_CPToolTipWindowMask], + var toolTipView = [[_CPToolTipWindowView alloc] initWithFrame:CGRectMakeZero() styleMask:_CPToolTipWindowMask], themeValues = [ @@ -2069,10 +2069,10 @@ var themedButtonValues = nil, [@"border-width", 1.0], [@"border-color", [CPColor colorWithHexString:@"B7B7B7"]], [@"corner-radius", 3.0], - [@"inner-shadow-offset", CPSizeMakeZero()], + [@"inner-shadow-offset", CGSizeMakeZero()], [@"inner-shadow-color", [CPColor blackColor]], [@"inner-shadow-size", 6.0], - [@"content-margin", CPSizeMakeZero()] + [@"content-margin", CGSizeMakeZero()] ]; [self registerThemeValues:themeValues forView:box]; @@ -2283,8 +2283,8 @@ var themedButtonValues = nil, themeValues = [ - [@"close-image-size", CPSizeMake(18.0, 18.0)], - [@"close-image-origin", CPPointMake(6.0,4.0)], + [@"close-image-size", CGSizeMake(18.0, 18.0)], + [@"close-image-origin", CGPointMake(6.0,4.0)], [@"close-image", closeImage], [@"close-active-image", closeActiveImage], [@"bezel-color", HUDBezelColor], @@ -2382,8 +2382,8 @@ var themedButtonValues = nil, [@"minimize-image-button" ,minimizeButtonImage], [@"minimize-image-highlighted-button" ,minimizeButtonImageHighlighted], - [@"close-image-size", CPSizeMake(16.0, 16.0)], - [@"close-image-origin", CPPointMake(8.0, 10.0)], + [@"close-image-size", CGSizeMake(16.0, 16.0)], + [@"close-image-origin", CGPointMake(8.0, 10.0)], [@"resize-indicator", resizeIndicator], [@"attached-sheet-shadow-color", sheetShadow], diff --git a/AppKit/Themes/Default/AppController.j b/AppKit/Themes/Default/AppController.j index 66ea14d1a..5595e64b1 100644 --- a/AppKit/Themes/Default/AppController.j +++ b/AppKit/Themes/Default/AppController.j @@ -27,9 +27,9 @@ var horizontalTrackColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices: [ - [_CPCibCustomResource imageResourceWithName:"horizontal-track-left.png" size:CPSizeMake(2.0, 4.0)], - [_CPCibCustomResource imageResourceWithName:"horizontal-track-center.png" size:CPSizeMake(1.0, 4.0)], - [_CPCibCustomResource imageResourceWithName:"horizontal-track-right.png" size:CPSizeMake(2.0, 4.0)] + [_CPCibCustomResource imageResourceWithName:"horizontal-track-left.png" size:CGSizeMake(2.0, 4.0)], + [_CPCibCustomResource imageResourceWithName:"horizontal-track-center.png" size:CGSizeMake(1.0, 4.0)], + [_CPCibCustomResource imageResourceWithName:"horizontal-track-right.png" size:CGSizeMake(2.0, 4.0)] ] isVertical:NO]], horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)]; @@ -37,8 +37,8 @@ [horizontalSlider setTrackWidth:4.0]; [horizontalSlider setHorizontalTrackColor:horizontalTrackColor]; - var knobColor = [CPColor colorWithPatternImage:[_CPCibCustomResource imageResourceWithName:"knob.png" size:CPSizeMake(11.0, 11.0)]], - knobHighlightedColor = [CPColor colorWithPatternImage:[_CPCibCustomResource imageResourceWithName:"knob-highlighted.png" size:CPSizeMake(12.0, 12.0)]]; + var knobColor = [CPColor colorWithPatternImage:[_CPCibCustomResource imageResourceWithName:"knob.png" size:CGSizeMake(11.0, 11.0)]], + knobHighlightedColor = [CPColor colorWithPatternImage:[_CPCibCustomResource imageResourceWithName:"knob-highlighted.png" size:CGSizeMake(12.0, 12.0)]]; [horizontalSlider setKnobSize:CGSizeMake(12.0, 12.0)]; [horizontalSlider setKnobColor:knobColor]; @@ -50,9 +50,9 @@ var verticalTrackColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices: [ - [_CPCibCustomResource imageResourceWithName:"vertical-track-top.png" size:CPSizeMake(4.0, 2.0)], - [_CPCibCustomResource imageResourceWithName:"vertical-track-center.png" size:CPSizeMake(4.0, 1.0)], - [_CPCibCustomResource imageResourceWithName:"vertical-track-bottom.png" size:CPSizeMake(4.0, 2.0)] + [_CPCibCustomResource imageResourceWithName:"vertical-track-top.png" size:CGSizeMake(4.0, 2.0)], + [_CPCibCustomResource imageResourceWithName:"vertical-track-center.png" size:CGSizeMake(4.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"vertical-track-bottom.png" size:CGSizeMake(4.0, 2.0)] ] isVertical:YES]], verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)]; diff --git a/AppKit/_CPAutocompleteMenu.j b/AppKit/_CPAutocompleteMenu.j index 8e5c0b402..a58071ea0 100644 --- a/AppKit/_CPAutocompleteMenu.j +++ b/AppKit/_CPAutocompleteMenu.j @@ -69,7 +69,7 @@ var _CPAutocompleteMenuMaximumHeight = 307; [scrollView setHasHorizontalScroller:NO]; [contentView addSubview:scrollView]; - tableView = [[_CPNonFirstResponderTableView alloc] initWithFrame:CPRectMakeZero()]; + tableView = [[_CPNonFirstResponderTableView alloc] initWithFrame:CGRectMakeZero()]; var tableColumn = [CPTableColumn new]; [tableColumn setResizingMask:CPTableColumnAutoresizingMask]; diff --git a/AppKit/_CPToolTip.j b/AppKit/_CPToolTip.j index b0bfb1f9c..a8383228a 100644 --- a/AppKit/_CPToolTip.j +++ b/AppKit/_CPToolTip.j @@ -103,7 +103,7 @@ var _CPToolTipHeight = 24.0, @param aText the wanted text @return CPArray containing the computer toolTipSize and textFrameSize */ -+ (CPSize)computeCorrectSize:(CPSize)aToolTipSize text:(CPString)aText ++ (CGSize)computeCorrectSize:(CGSize)aToolTipSize text:(CPString)aText { var font = [CPFont systemFontOfSize:_CPToolTipFontSize], textFrameSizeSingleLine = [aText sizeWithFont:font], @@ -156,7 +156,7 @@ var _CPToolTipHeight = 24.0, */ - (id)initWithString:(CPString)aString styleMask:(unsigned)aStyleMask { - var toolTipFrame = CPRectMake(0.0, 0.0, 250.0, _CPToolTipHeight), + var toolTipFrame = CGRectMake(0.0, 0.0, 250.0, _CPToolTipHeight), layout = [_CPToolTip computeCorrectSize:toolTipFrame.size text:aString], textFrameSize = layout[1]; @@ -171,7 +171,7 @@ var _CPToolTipHeight = 24.0, [_content setLineBreakMode:CPLineBreakByCharWrapping]; [_content setAlignment:CPJustifiedTextAlignment]; [_content setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; - [_content setFrameOrigin:CPPointMake(0.0, 0.0)]; + [_content setFrameOrigin:CGPointMake(0.0, 0.0)]; [_content setFrameSize:textFrameSize]; [_content setTextShadowOffset:CGSizeMake(0.0, 1.0)]; [_content setTextColor:[[[CPTheme defaultTheme] attributeWithName:@"color" forClass:_CPToolTipWindowView] value]]; @@ -203,19 +203,15 @@ var _CPToolTipHeight = 24.0, if (mousePosition.x < 0) mousePosition.x = 5; - if (mousePosition.x + CPRectGetWidth([self frame]) > nativeRect.size.width) - mousePosition.x = nativeRect.size.width - CPRectGetWidth([self frame]) - 5; + if (mousePosition.x + CGRectGetWidth([self frame]) > nativeRect.size.width) + mousePosition.x = nativeRect.size.width - CGRectGetWidth([self frame]) - 5; if (mousePosition.y < 0) mousePosition.y = 5; - if (mousePosition.y + CPRectGetHeight([self frame]) > nativeRect.size.height) - mousePosition.y = mousePosition.y - CPRectGetHeight([self frame]) - 40; + if (mousePosition.y + CGRectGetHeight([self frame]) > nativeRect.size.height) + mousePosition.y = mousePosition.y - CGRectGetHeight([self frame]) - 40; [self setFrameOrigin:mousePosition]; [self orderFront:nil]; } @end - - - - diff --git a/Foundation/CPCoder.j b/Foundation/CPCoder.j index dddcf6f3b..d02d918e0 100644 --- a/Foundation/CPCoder.j +++ b/Foundation/CPCoder.j @@ -80,7 +80,7 @@ Encodes a point @param aPoint the point to be encoded. */ -- (void)encodePoint:(CPPoint)aPoint +- (void)encodePoint:(CGPoint)aPoint { [self encodeNumber:aPoint.x]; [self encodeNumber:aPoint.y]; @@ -100,7 +100,7 @@ Encodes a CGSize @param aSize the size to be encoded */ -- (void)encodeSize:(CPSize)aSize +- (void)encodeSize:(CGSize)aSize { [self encodeNumber:aSize.width]; [self encodeNumber:aSize.height]; diff --git a/Tests/Manual/AttachedSheet/AppController.j b/Tests/Manual/AttachedSheet/AppController.j index fc0bc34cb..af78d341f 100644 --- a/Tests/Manual/AttachedSheet/AppController.j +++ b/Tests/Manual/AttachedSheet/AppController.j @@ -10,35 +10,36 @@ @implementation AppController : CPObject { - CPWindow window; + CPWindow wind; CPWindow sheet; CPTextField textField; } - (void)applicationDidFinishLaunching:(CPNotification)aNotification { - window = [[CPWindow alloc] initWithContentRect:CGRectMake(100,100,500,300) styleMask:CPResizableWindowMask], - contentView = [window contentView]; + wind = [[CPWindow alloc] initWithContentRect:CGRectMake(100, 100, 500, 300) styleMask:CPTitledWindowMask | CPResizableWindowMask]; + [wind setMinSize:CGSizeMake(300, 200)]; + [wind setTitle:@"Untitled"]; - [window setMinSize:CGSizeMake(300, 200)]; - sheet = [[CPWindow alloc] initWithContentRect:CGRectMake(0,0,300,100) styleMask:CPDocModalWindowMask | CPResizableWindowMask]; + sheet = [[CPWindow alloc] initWithContentRect:CGRectMake(0, 0, 300, 100) styleMask:CPDocModalWindowMask | CPResizableWindowMask]; [sheet setMinSize:CGSizeMake(300,100)]; var sheetContent = [sheet contentView]; - textField = [[CPTextField alloc] initWithFrame:CGRectMake(10,30,280,30)]; + textField = [[CPTextField alloc] initWithFrame:CGRectMake(10, 30, 280, 30)]; [textField setEditable:YES]; [textField setBezeled:YES]; [textField setAutoresizingMask:CPViewWidthSizable]; - var okButton = [[CPButton alloc] initWithFrame:CGRectMake(230,70,50,24)]; + var buttonHeight = [[CPTheme defaultTheme] valueForAttributeWithName:@"min-size" forClass:CPButton].height, + okButton = [[CPButton alloc] initWithFrame:CGRectMake(230, 70, 50, buttonHeight)]; [okButton setTitle:"OK"]; [okButton setTarget:self]; [okButton setTag:1]; [okButton setAction:@selector(closeSheet:)]; [okButton setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin]; - var cancelButton = [[CPButton alloc] initWithFrame:CGRectMake(120,70,100,24)]; + var cancelButton = [[CPButton alloc] initWithFrame:CGRectMake(120, 70, 100, buttonHeight)]; [cancelButton setTitle:"Cancel"]; [cancelButton setTarget:self]; [cancelButton setTag:0]; @@ -49,13 +50,13 @@ [sheetContent addSubview:okButton]; [sheetContent addSubview:cancelButton]; - var displayButton = [[CPButton alloc] initWithFrame:CGRectMake(200,150,100,24)]; + var displayButton = [[CPButton alloc] initWithFrame:CGRectMake(200, 150, 100, buttonHeight)]; [displayButton setTitle:"Display Sheet"]; [displayButton setTarget:self]; [displayButton setAction:@selector(displaySheet:)]; - [contentView addSubview:displayButton]; + [[wind contentView] addSubview:displayButton]; - [window orderFront:self] + [wind orderFront:self] } - (void)displaySheet:(id)sender @@ -63,7 +64,7 @@ [textField setStringValue:""]; [sheet makeFirstResponder:textField]; - [CPApp beginSheet:sheet modalForWindow:window modalDelegate:self didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) contextInfo:nil]; + [CPApp beginSheet:sheet modalForWindow:wind modalDelegate:self didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) contextInfo:nil]; } - (void)closeSheet:(id)sender @@ -78,7 +79,7 @@ [sheet orderOut:self]; if (returnCode == CPOKButton && [str length] > 0) - [window setTitle:str]; + [wind setTitle:str]; } -@end \ No newline at end of file +@end diff --git a/Tests/Manual/AttachedSheet/index-debug.html b/Tests/Manual/AttachedSheet/index-debug.html index ee9eaa75c..e25104ee0 100644 --- a/Tests/Manual/AttachedSheet/index-debug.html +++ b/Tests/Manual/AttachedSheet/index-debug.html @@ -27,13 +27,13 @@ // DEBUG OPTIONS: // Uncomment to enable printing of backtraces on exceptions: - objj_msgSend_decorate(objj_backtrace_decorator); + //objj_msgSend_decorate(objj_backtrace_decorator); // Uncomment to enable runtime type checking: - objj_msgSend_decorate(objj_typecheck_decorator); + //objj_msgSend_decorate(objj_typecheck_decorator); // Uncomment (along with both above) to print backtraces on type check errors: - objj_typecheck_prints_backtrace = true; + //objj_typecheck_prints_backtrace = true;