diff --git a/ChangeLog b/ChangeLog index 0e9808f36..5aae2a1d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2013-02-17 Fred Kiefer + + * Headers/AppKit/NSBrowser.h + * Headers/AppKit/NSClipView.h + * Headers/AppKit/NSComboBox.h + * Headers/AppKit/NSComboBoxCell.h + * Headers/AppKit/NSForm.h + * Headers/AppKit/NSFormCell.h + * Headers/AppKit/NSParagraphStyle.h + * Source/NSAttributedString.m + * Source/NSBrowser.m + * Source/NSClipView.m + * Source/NSComboBox.m + * Source/NSComboBoxCell.m + * Source/NSForm.m + * Source/NSFormCell.m + * Source/NSParagraphStyle.m + More CGFloat, NSUInteger and NSInteger changes. + 2013-02-16 Fred Kiefer * Headers/AppKit/NSDragging.h diff --git a/Headers/AppKit/NSBrowser.h b/Headers/AppKit/NSBrowser.h index a6bfbf005..dcdae5420 100644 --- a/Headers/AppKit/NSBrowser.h +++ b/Headers/AppKit/NSBrowser.h @@ -42,12 +42,13 @@ //@class NSBox; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) -typedef enum _NSBrowserColumnResizingType +enum _NSBrowserColumnResizingType { NSBrowserNoColumnResizing, NSBrowserAutoColumnResizing, NSBrowserUserColumnResizing -} NSBrowserColumnResizingType; +}; +typedef NSUInteger NSBrowserColumnResizingType; #endif @interface NSBrowser : NSControl @@ -88,12 +89,12 @@ typedef enum _NSBrowserColumnResizingType NSRect _scrollerRect; int _alphaNumericalLastColumn; int _maxVisibleColumns; - float _minColumnWidth; + CGFloat _minColumnWidth; int _lastColumnLoaded; int _firstVisibleColumn; int _lastVisibleColumn; NSString *_columnsAutosaveName; - NSBrowserColumnResizingType _columnResizing; + NSBrowserColumnResizingType _columnResizing; } // @@ -155,14 +156,14 @@ typedef enum _NSBrowserColumnResizingType // Setting the NSBrowser's Appearance // - (NSInteger) maxVisibleColumns; -- (NSInteger) minColumnWidth; +- (CGFloat) minColumnWidth; - (BOOL) separatesColumns; - (void) setMaxVisibleColumns: (NSInteger)columnCount; -- (void) setMinColumnWidth: (NSInteger)columnWidth; +- (void) setMinColumnWidth: (CGFloat)columnWidth; - (void) setSeparatesColumns: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) -- (float) columnWidthForColumnContentWidth: (float)columnContentWidth; -- (float) columnContentWidthForColumnWidth: (float)columnWidth; +- (CGFloat) columnWidthForColumnContentWidth: (CGFloat)columnContentWidth; +- (CGFloat) columnContentWidthForColumnWidth: (CGFloat)columnWidth; #endif // @@ -260,8 +261,8 @@ typedef enum _NSBrowserColumnResizingType - (void) setColumnResizingType:(NSBrowserColumnResizingType) type; - (BOOL) prefersAllColumnUserResizing; - (void) setPrefersAllColumnUserResizing: (BOOL)flag; -- (float) widthOfColumn: (NSInteger)column; -- (void) setWidth: (float)columnWidth ofColumn: (NSInteger)columnIndex; +- (CGFloat) widthOfColumn: (NSInteger)column; +- (void) setWidth: (CGFloat)columnWidth ofColumn: (NSInteger)columnIndex; // // Autosave names @@ -304,11 +305,11 @@ typedef enum _NSBrowserColumnResizingType - (void) browserWillScroll: (NSBrowser *)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) -- (float) browser: (NSBrowser *)browser - shouldSizeColumn: (NSInteger)column - forUserResize: (BOOL)flag - toWidth: (float)width; -- (float) browser: (NSBrowser *)browser +- (CGFloat) browser: (NSBrowser *)browser + shouldSizeColumn: (NSInteger)column + forUserResize: (BOOL)flag + toWidth: (CGFloat)width; +- (CGFloat) browser: (NSBrowser *)browser sizeToFitWidthOfColumn: (NSInteger)column; - (void) browserColumnConfigurationDidChange: (NSNotification *)notification; #endif diff --git a/Headers/AppKit/NSClipView.h b/Headers/AppKit/NSClipView.h index d9e89fd9f..85a5534a1 100644 --- a/Headers/AppKit/NSClipView.h +++ b/Headers/AppKit/NSClipView.h @@ -79,21 +79,6 @@ - (BOOL)drawsBackground; #endif -/* Overridden NSView methods */ -- (BOOL)acceptsFirstResponder; -- (BOOL)isFlipped; -- (void)rotateByAngle:(float)angle; -- (void)scaleUnitSquareToSize:(NSSize)newUnitSize; -- (void)setBoundsOrigin:(NSPoint)aPoint; -- (void)setBoundsRotation:(float)angle; -- (void)setBoundsSize:(NSSize)aSize; -- (void)setFrameSize:(NSSize)aSize; -- (void)setFrameOrigin:(NSPoint)aPoint; -- (void)setFrameRotation:(float)angle; -- (void)translateOriginToPoint:(NSPoint)aPoint; -- (void)viewBoundsChanged:(NSNotification*)aNotification; -- (void)viewFrameChanged:(NSNotification*)aNotification; - @end #endif /* _GNUstep_H_NSClipView */ diff --git a/Headers/AppKit/NSComboBox.h b/Headers/AppKit/NSComboBox.h index 5b769a4d7..ae5015872 100644 --- a/Headers/AppKit/NSComboBox.h +++ b/Headers/AppKit/NSComboBox.h @@ -45,8 +45,8 @@ - (NSSize) intercellSpacing; - (void) setIntercellSpacing: (NSSize)aSize; -- (float) itemHeight; -- (void) setItemHeight: (float)itemHeight; +- (CGFloat) itemHeight; +- (void) setItemHeight: (CGFloat)itemHeight; - (NSInteger) numberOfVisibleItems; - (void) setNumberOfVisibleItems: (NSInteger)visibleItems; diff --git a/Headers/AppKit/NSComboBoxCell.h b/Headers/AppKit/NSComboBoxCell.h index 3735ec526..8b0d3d7bb 100644 --- a/Headers/AppKit/NSComboBoxCell.h +++ b/Headers/AppKit/NSComboBoxCell.h @@ -62,8 +62,8 @@ - (NSSize)intercellSpacing; - (void)setIntercellSpacing:(NSSize)aSize; -- (float)itemHeight; -- (void)setItemHeight:(float)itemHeight; +- (CGFloat)itemHeight; +- (void)setItemHeight:(CGFloat)itemHeight; - (NSInteger)numberOfVisibleItems; - (void)setNumberOfVisibleItems:(NSInteger)visibleItems; diff --git a/Headers/AppKit/NSForm.h b/Headers/AppKit/NSForm.h index 4182462ca..2363061ee 100644 --- a/Headers/AppKit/NSForm.h +++ b/Headers/AppKit/NSForm.h @@ -47,7 +47,7 @@ - (NSFormCell*)insertEntry:(NSString*)title atIndex:(NSInteger)index; - (void)removeEntryAtIndex:(NSInteger)index; -- (void)setInterlineSpacing:(float)spacing; +- (void)setInterlineSpacing:(CGFloat)spacing; // // Finding Indices diff --git a/Headers/AppKit/NSFormCell.h b/Headers/AppKit/NSFormCell.h index 33400b572..b955fbba2 100644 --- a/Headers/AppKit/NSFormCell.h +++ b/Headers/AppKit/NSFormCell.h @@ -54,12 +54,12 @@ - (void)setTitle:(NSString*)aString; - (void)setTitleAlignment:(NSTextAlignment)mode; - (void)setTitleFont:(NSFont*)fontObject; -- (void)setTitleWidth:(float)width; +- (void)setTitleWidth:(CGFloat)width; - (NSString*)title; - (NSTextAlignment)titleAlignment; - (NSFont*)titleFont; -- (float)titleWidth; -- (float)titleWidth:(NSSize)aSize; +- (CGFloat)titleWidth; +- (CGFloat)titleWidth:(NSSize)aSize; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // diff --git a/Headers/AppKit/NSParagraphStyle.h b/Headers/AppKit/NSParagraphStyle.h index 256ae1e15..3cf8f353f 100644 --- a/Headers/AppKit/NSParagraphStyle.h +++ b/Headers/AppKit/NSParagraphStyle.h @@ -43,20 +43,22 @@ typedef enum _NSTextTabType { NSDecimalTabStopType } NSTextTabType; -typedef enum _NSLineBreakMode { /* What to do with long lines */ +enum _NSLineBreakMode { /* What to do with long lines */ NSLineBreakByWordWrapping = 0, /* Wrap at word boundaries, default */ NSLineBreakByCharWrapping, /* Wrap at character boundaries */ NSLineBreakByClipping, /* Simply clip */ NSLineBreakByTruncatingHead, /* Truncate at head of line: "...wxyz" */ NSLineBreakByTruncatingTail, /* Truncate at tail of line: "abcd..." */ NSLineBreakByTruncatingMiddle /* Truncate middle of line: "ab...yz" */ -} NSLineBreakMode; +}; +typedef NSUInteger NSLineBreakMode; -typedef enum _NSWritingDirection { +enum _NSWritingDirection { NSWritingDirectionNaturalDirection, NSWritingDirectionLeftToRight, NSWritingDirectionRightToLeft -} NSWritingDirection; +}; +typedef NSInteger NSWritingDirection; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; @@ -70,13 +72,13 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; float _location; } -- (id) initWithType: (NSTextTabType)type location: (float)loc; -- (float) location; +- (id) initWithType: (NSTextTabType)type location: (CGFloat)loc; +- (CGFloat) location; - (NSTextTabType) tabStopType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (id) initWithTextAlignment: (NSTextAlignment)align - location: (float)loc + location: (CGFloat)loc options: (NSDictionary *)options; - (NSTextAlignment) alignment; - (NSDictionary *) options; @@ -115,12 +117,12 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; * Can't be negative. This value is included in the line fragment * heights in layout manager. */ -- (float) lineSpacing; +- (CGFloat) lineSpacing; /* * Distance between the bottom of this paragraph and top of next. */ -- (float) paragraphSpacing; +- (CGFloat) paragraphSpacing; - (NSTextAlignment) alignment; @@ -132,18 +134,18 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; /* * Distance from margin to front edge of paragraph */ -- (float) headIndent; +- (CGFloat) headIndent; /* * Distance from margin to back edge of paragraph; if negative or 0, * from other margin */ -- (float) tailIndent; +- (CGFloat) tailIndent; /* * Distance from margin to edge appropriate for text direction */ -- (float) firstLineHeadIndent; +- (CGFloat) firstLineHeadIndent; /* * Distance from margin to tab stops @@ -155,12 +157,12 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; * of ascenders; basically the line fragment height. Does not include * lineSpacing (which is added after this computation). */ -- (float) minimumLineHeight; +- (CGFloat) minimumLineHeight; /* * 0 implies no maximum. */ -- (float) maximumLineHeight; +- (CGFloat) maximumLineHeight; - (NSLineBreakMode) lineBreakMode; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) @@ -173,12 +175,12 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; - (NSWritingDirection) baseWritingDirection; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) -- (float) defaultTabInterval; -- (float) lineHeightMultiple; -- (float) paragraphSpacingBefore; +- (CGFloat) defaultTabInterval; +- (CGFloat) lineHeightMultiple; +- (CGFloat) paragraphSpacingBefore; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) -- (int) headerLevel; +- (NSInteger) headerLevel; - (float) hyphenationFactor; - (NSArray *) textBlocks; - (NSArray *) textLists; @@ -191,15 +193,15 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; { } -- (void) setLineSpacing: (float)aFloat; -- (void) setParagraphSpacing: (float)aFloat; +- (void) setLineSpacing: (CGFloat)aFloat; +- (void) setParagraphSpacing: (CGFloat)aFloat; - (void) setAlignment: (NSTextAlignment)newAlignment; -- (void) setFirstLineHeadIndent: (float)aFloat; -- (void) setHeadIndent: (float)aFloat; -- (void) setTailIndent: (float)aFloat; +- (void) setFirstLineHeadIndent: (CGFloat)aFloat; +- (void) setHeadIndent: (CGFloat)aFloat; +- (void) setTailIndent: (CGFloat)aFloat; - (void) setLineBreakMode: (NSLineBreakMode)mode; -- (void) setMinimumLineHeight: (float)aFloat; -- (void) setMaximumLineHeight: (float)aFloat; +- (void) setMinimumLineHeight: (CGFloat)aFloat; +- (void) setMaximumLineHeight: (CGFloat)aFloat; - (void) addTabStop: (NSTextTab*)anObject; - (void) removeTabStop: (NSTextTab*)anObject; - (void) setTabStops: (NSArray*)array; @@ -209,12 +211,12 @@ APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; - (void) setBaseWritingDirection: (NSWritingDirection)direction; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) -- (void) setDefaultTabInterval: (float)interval; -- (void) setLineHeightMultiple: (float)factor; -- (void) setParagraphSpacingBefore: (float)spacing; +- (void) setDefaultTabInterval: (CGFloat)interval; +- (void) setLineHeightMultiple: (CGFloat)factor; +- (void) setParagraphSpacingBefore: (CGFloat)spacing; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) -- (void) setHeaderLevel: (int)level; +- (void) setHeaderLevel: (NSInteger)level; - (void) setHyphenationFactor: (float)factor; - (void) setTextBlocks: (NSArray *)blocks; - (void) setTextLists: (NSArray *)lists; diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index 927a6ca77..d3e419457 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -409,7 +409,7 @@ create_error(int code, NSString* desc) withinRange: (NSRange)aRange { NSString *str = [self string]; - unsigned length = [str length]; + NSUInteger length = [str length]; NSRange scanRange; NSRange startRange; @@ -453,7 +453,7 @@ create_error(int code, NSString* desc) - (NSRange) doubleClickAtIndex: (NSUInteger)location { NSString *str = [self string]; - unsigned length = [str length]; + NSUInteger length = [str length]; NSRange scanRange; NSRange startRange; NSRange endRange; @@ -557,10 +557,10 @@ create_error(int code, NSString* desc) } - (NSUInteger) nextWordFromIndex: (NSUInteger)location - forward: (BOOL)isForward + forward: (BOOL)isForward { NSString *str = [self string]; - unsigned length = [str length]; + NSUInteger length = [str length]; NSRange range; if (location > length) @@ -1118,7 +1118,7 @@ documentAttributes: (NSDictionary **)dict if ((textBlocks != nil) && [textBlocks containsObject: block]) { NSRange newEffRange; - unsigned len = [self length]; + NSUInteger len = [self length]; while ((effRange.location > 0) && style && textBlocks) { @@ -1174,7 +1174,7 @@ documentAttributes: (NSDictionary **)dict if ((textLists != nil) && [textLists containsObject: list]) { NSRange newEffRange; - unsigned len = [self length]; + NSUInteger len = [self length]; while ((effRange.location > 0) && style && textLists) { @@ -1246,7 +1246,7 @@ BOOL containsTable(NSArray *textBlocks, NSTextTable *table) if ((textBlocks != nil) && containsTable(textBlocks, table)) { NSRange newEffRange; - unsigned len = [self length]; + NSUInteger len = [self length]; while ((effRange.location > 0) && style && textBlocks) { @@ -1370,7 +1370,7 @@ BOOL containsTable(NSArray *textBlocks, NSTextTable *table) range: (NSRange)range { NSFont *font; - unsigned loc = range.location; + NSUInteger loc = range.location; NSRange effRange; NSFontManager *fm = [NSFontManager sharedFontManager]; @@ -1406,7 +1406,7 @@ BOOL containsTable(NSArray *textBlocks, NSTextTable *table) range: (NSRange)range { id value; - unsigned loc = range.location; + NSUInteger loc = range.location; if (NSMaxRange(range) > [self length]) { @@ -1470,8 +1470,8 @@ static NSMutableDictionary *cachedCSets = nil; font: (NSFont*)baseFont fromList: (NSArray *)fonts { - unsigned int count; - unsigned int i; + NSUInteger count; + NSUInteger i; if (cachedCSets == nil) { @@ -1554,9 +1554,9 @@ static NSMutableDictionary *cachedCSets = nil; NSFont *font = nil; NSCharacterSet *charset = nil; NSRange fontRange = NSMakeRange(NSNotFound, 0); - unsigned int i; - unsigned int lastMax; - unsigned int start; + NSUInteger i; + NSUInteger lastMax; + NSUInteger start; unichar chars[64]; CREATE_AUTORELEASE_POOL(pool); @@ -1582,7 +1582,7 @@ static NSMutableDictionary *cachedCSets = nil; if (i >= lastMax) { - unsigned int dist; + NSUInteger dist; start = lastMax; dist = MIN(64, NSMaxRange(range) - start); @@ -1622,7 +1622,7 @@ static NSMutableDictionary *cachedCSets = nil; - (void) fixParagraphStyleAttributeInRange: (NSRange)range { NSString *str = [self string]; - unsigned loc = range.location; + NSUInteger loc = range.location; NSRange r; if (NSMaxRange (range) > [self length]) @@ -1635,7 +1635,7 @@ static NSMutableDictionary *cachedCSets = nil; { NSParagraphStyle *style; NSRange found; - unsigned end; + NSUInteger end; /* Extend loc to take in entire paragraph if necessary. */ r = [str lineRangeForRange: NSMakeRange (loc, 1)]; @@ -1697,8 +1697,8 @@ static NSMutableDictionary *cachedCSets = nil; - (void) fixAttachmentAttributeInRange: (NSRange)range { NSString *string = [self string]; - unsigned location = range.location; - unsigned end = NSMaxRange (range); + NSUInteger location = range.location; + NSUInteger end = NSMaxRange (range); cache_init (); @@ -1718,8 +1718,8 @@ static NSMutableDictionary *cachedCSets = nil; if ([attr objectForKey: NSAttachmentAttributeName] != nil) { unichar buf[eRange.length]; - unsigned pos = 0; - unsigned start = eRange.location; + NSUInteger pos = 0; + NSUInteger start = eRange.location; // Leave only one character with the attachment [string getCharacters: buf range: eRange]; @@ -1769,8 +1769,8 @@ static NSMutableDictionary *cachedCSets = nil; - (void) updateAttachmentsFromPath: (NSString *)path { NSString *string = [self string]; - unsigned location = 0; - unsigned end = [string length]; + NSUInteger location = 0; + NSUInteger end = [string length]; cache_init (); @@ -1865,7 +1865,7 @@ static NSMutableDictionary *cachedCSets = nil; range: (NSRange)range { id value; - unsigned loc = range.location; + NSUInteger loc = range.location; if (NSMaxRange(range) > [self length]) { diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 143b73d20..c65e2d623 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -59,7 +59,7 @@ #import "GSGuiPrivate.h" /* Cache */ -static float scrollerWidth; // == [NSScroller scrollerWidth] +static CGFloat scrollerWidth; // == [NSScroller scrollerWidth] static NSTextFieldCell *titleCell; #define NSBR_COLUMN_SEP 4 @@ -78,7 +78,7 @@ static NSTextFieldCell *titleCell; NSScrollView *_columnScrollView; NSMatrix *_columnMatrix; NSString *_columnTitle; - float _width; + CGFloat _width; } - (void) setIsLoaded: (BOOL)flag; @@ -230,8 +230,8 @@ static NSTextFieldCell *titleCell; // Private NSBrowser methods // @interface NSBrowser (Private) -- (NSString *) _getTitleOfColumn: (int)column; -- (void) _performLoadOfColumn: (int)column; +- (NSString *) _getTitleOfColumn: (NSInteger)column; +- (void) _performLoadOfColumn: (NSInteger)column; - (void) _remapColumnSubviews: (BOOL)flag; - (void) _setColumnTitlesNeedDisplay; @end @@ -305,7 +305,7 @@ static NSTextFieldCell *titleCell; */ - (id) selectedCell { - int i; + NSInteger i; NSMatrix *matrix; // Nothing selected @@ -344,7 +344,7 @@ static NSTextFieldCell *titleCell; */ - (NSArray *) selectedCells { - int i; + NSInteger i; NSMatrix *matrix; // Nothing selected @@ -448,7 +448,7 @@ static NSTextFieldCell *titleCell; method in which the following code is integrated (for speed) */ - (id) loadedCellAtRow: (NSInteger)row - column: (NSInteger)column + column: (NSInteger)column { NSMatrix *matrix; NSCell *cell; @@ -553,10 +553,10 @@ static NSTextFieldCell *titleCell; - (BOOL) setPath: (NSString *)path { NSMutableArray *subStrings; - unsigned numberOfSubStrings; - unsigned indexOfSubStrings; - NSInteger column; - BOOL useDelegate = NO; + NSUInteger numberOfSubStrings; + NSUInteger indexOfSubStrings; + NSInteger column; + BOOL useDelegate = NO; if ([_browserDelegate respondsToSelector: @selector(browser:selectCellWithString:inColumn:)]) @@ -581,7 +581,7 @@ static NSTextFieldCell *titleCell; if ([path hasPrefix: _pathSeparator]) { - int i; + NSUInteger i; /* * If the path begins with a separator, start at column 0. * Otherwise start at the currently selected column. @@ -593,9 +593,9 @@ static NSTextFieldCell *titleCell; * specified path is already partially selected. If this is the * case, we can avoid redrawing those columns. */ - for (i = 0; i <= _lastColumnLoaded && (unsigned)i < numberOfSubStrings; i++) + for (i = 0; i <= _lastColumnLoaded && i < numberOfSubStrings; i++) { - NSString *c = [[self selectedCellInColumn: i] stringValue]; + NSString *c = [[self selectedCellInColumn: i] stringValue]; if ([c isEqualToString: [subStrings objectAtIndex: i]]) { @@ -798,9 +798,9 @@ static NSTextFieldCell *titleCell; */ - (void) addColumn { - int i; + NSInteger i; - if ((unsigned)(_lastColumnLoaded + 1) >= [_browserColumns count]) + if ((NSUInteger)(_lastColumnLoaded + 1) >= [_browserColumns count]) { i = [_browserColumns indexOfObject: [self _createColumn]]; } @@ -896,7 +896,7 @@ static NSTextFieldCell *titleCell; */ - (NSInteger) columnOfMatrix: (NSMatrix *)matrix { - int i, count; + NSInteger i, count; // Loop through columns and compare matrixes count = [_browserColumns count]; @@ -913,7 +913,7 @@ static NSTextFieldCell *titleCell; /** Returns the index of the last column with a selected item. */ - (NSInteger) selectedColumn { - int i; + NSInteger i; NSMatrix *matrix; for (i = _lastColumnLoaded; i >= 0; i--) @@ -921,7 +921,7 @@ static NSTextFieldCell *titleCell; if (!(matrix = [self matrixInColumn: i])) continue; if ([matrix selectedCell]) - return i; + return i; } return -1; @@ -940,7 +940,7 @@ static NSTextFieldCell *titleCell; */ - (void) setLastColumn: (NSInteger)column { - int i, count; + NSInteger i, count; NSBrowserColumn *bc; NSScrollView *sc; @@ -1015,7 +1015,7 @@ static NSTextFieldCell *titleCell; */ - (void) validateVisibleColumns { - int i; + NSInteger i; // If delegate doesn't care, just return if (![_browserDelegate respondsToSelector: @@ -1135,7 +1135,7 @@ static NSTextFieldCell *titleCell; { if (_allowsEmptySelection != flag) { - int i; + NSInteger i; _allowsEmptySelection = flag; for (i = 0; i <= _lastColumnLoaded; i++) @@ -1160,7 +1160,7 @@ static NSTextFieldCell *titleCell; { if (_allowsMultipleSelection != flag) { - int i; + NSInteger i; NSMatrixMode mode; _allowsMultipleSelection = flag; @@ -1229,7 +1229,7 @@ static NSTextFieldCell *titleCell; /**

Returns the minimum column width in pixels.

See Also: -setMinColumnWidth:

*/ -- (NSInteger) minColumnWidth +- (CGFloat) minColumnWidth { return _minColumnWidth; } @@ -1237,9 +1237,9 @@ static NSTextFieldCell *titleCell; /**

Sets the minimum column width in pixels and adjusts subviews.

See Also: -minColumnWidth

*/ -- (void) setMinColumnWidth: (NSInteger)columnWidth +- (void) setMinColumnWidth: (CGFloat)columnWidth { - float sw; + CGFloat sw; sw = scrollerWidth; // Take the border into account @@ -1292,9 +1292,9 @@ static NSTextFieldCell *titleCell; [self setNeedsDisplay:YES]; } -- (float) columnWidthForColumnContentWidth: (float)columnContentWidth +- (CGFloat) columnWidthForColumnContentWidth: (CGFloat)columnContentWidth { - float cw; + CGFloat cw; cw = columnContentWidth; if (scrollerWidth > cw) @@ -1309,9 +1309,9 @@ static NSTextFieldCell *titleCell; return cw; } -- (float) columnContentWidthForColumnWidth: (float)columnWidth +- (CGFloat) columnContentWidthForColumnWidth: (CGFloat)columnWidth { - float cw; + CGFloat cw; cw = columnWidth; // Take the border into account @@ -1341,7 +1341,7 @@ static NSTextFieldCell *titleCell; _prefersAllColumnUserResizing = flag; } -- (float) widthOfColumn: (NSInteger)column +- (CGFloat) widthOfColumn: (NSInteger)column { NSBrowserColumn *browserColumn; @@ -1350,7 +1350,7 @@ static NSTextFieldCell *titleCell; return browserColumn->_width; } -- (void) setWidth: (float)columnWidth ofColumn: (NSInteger)columnIndex +- (void) setWidth: (CGFloat)columnWidth ofColumn: (NSInteger)columnIndex { NSBrowserColumn *browserColumn; @@ -1863,7 +1863,7 @@ static NSTextFieldCell *titleCell; { NSSize bezelBorderSize = [[GSTheme theme] sizeForBorderType: NSBezelBorder]; NSInteger i, num, columnCount, delta; - float frameWidth; + CGFloat frameWidth; _columnSize.height = _frame.size.height; @@ -1903,7 +1903,7 @@ static NSTextFieldCell *titleCell; if (_minColumnWidth > 0) { - float colWidth = _minColumnWidth + scrollerWidth; + CGFloat colWidth = _minColumnWidth + scrollerWidth; if (_separatesColumns) colWidth += NSBR_COLUMN_SEP; @@ -1947,7 +1947,7 @@ static NSTextFieldCell *titleCell; frameWidth = _frame.size.width - ((columnCount - 1) + (2 * bezelBorderSize.width)); - _columnSize.width = (int)(frameWidth / (float)columnCount); + _columnSize.width = (int)(frameWidth / (CGFloat)columnCount); if (_columnSize.height < 0) _columnSize.height = 0; @@ -2114,7 +2114,7 @@ static NSTextFieldCell *titleCell; NSMutableArray *selectedCells; NSEnumerator *enumerator; NSBrowserCell *cell; - int column, aCount, selectedCellsCount; + NSInteger column, aCount, selectedCellsCount; if ([sender class] != _browserMatrixClass) return; @@ -2355,7 +2355,7 @@ static NSTextFieldCell *titleCell; if (_acceptsArrowKeys) { NSMatrix *matrix; - int selectedColumn; + NSInteger selectedColumn; matrix = (NSMatrix *)[_window firstResponder]; selectedColumn = [self columnOfMatrix:matrix]; @@ -2388,7 +2388,7 @@ static NSTextFieldCell *titleCell; if (_acceptsArrowKeys) { NSMatrix *matrix; - int selectedColumn; + NSInteger selectedColumn; matrix = (NSMatrix *)[_window firstResponder]; selectedColumn = [self columnOfMatrix:matrix]; @@ -2483,9 +2483,9 @@ static NSTextFieldCell *titleCell; { NSMatrix *matrix; NSString *sv; - int i, n, s; - int match; - int selectedColumn; + NSInteger i, n, s; + NSInteger match; + NSInteger selectedColumn; SEL lcarcSel = @selector(loadedCellAtRow:column:); IMP lcarc = [self methodForSelector: lcarcSel]; @@ -2901,7 +2901,7 @@ static NSTextFieldCell *titleCell; { NSBrowserColumn *bc; NSScrollView *sc; - int i, count; + NSUInteger i, count; id firstResponder = nil; BOOL setFirstResponder = NO; @@ -2975,12 +2975,12 @@ static NSTextFieldCell *titleCell; } /* Loads column 'column' (asking the delegate). */ -- (void) _performLoadOfColumn: (int)column +- (void) _performLoadOfColumn: (NSInteger)column { NSBrowserColumn *bc; NSScrollView *sc; NSMatrix *matrix; - int i, rows, cols; + NSInteger i, rows, cols; if (_passiveDelegate) { @@ -3107,7 +3107,7 @@ static NSTextFieldCell *titleCell; } /* Get the title of a column. */ -- (NSString *) _getTitleOfColumn: (int)column +- (NSString *) _getTitleOfColumn: (NSInteger)column { // Ask the delegate for the column title if ([_browserDelegate respondsToSelector: @@ -3190,7 +3190,7 @@ static NSTextFieldCell *titleCell; - (void) setNeedsDisplayInRect: (NSRect)invalidRect { - [super setNeedsDisplayInRect: invalidRect]; + [super setNeedsDisplayInRect: invalidRect]; } @end diff --git a/Source/NSClipView.m b/Source/NSClipView.m index aef7caf6b..d57303e35 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -61,25 +61,25 @@ static inline NSRect integralRect (NSRect rect, NSView *view) output = [view convertRect: rect toView: nil]; rounded = (int)(output.origin.x); - if ((float)rounded != output.origin.x) + if ((CGFloat)rounded != output.origin.x) { output.origin.x = rounded + 1; } rounded = (int)(output.origin.y); - if ((float)rounded != output.origin.y) + if ((CGFloat)rounded != output.origin.y) { output.origin.y = rounded + 1; } rounded = (int)(NSMaxX (output)); - if ((float)rounded != NSMaxX (output)) + if ((CGFloat)rounded != NSMaxX (output)) { output.size.width = rounded - output.origin.x; } rounded = (int)(NSMaxY (output)); - if ((float)rounded != NSMaxY (output)) + if ((CGFloat)rounded != NSMaxY (output)) { output.size.height = rounded - output.origin.y; } @@ -173,7 +173,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view) if (_documentView) { - NSRect df; + NSRect df; [self addSubview: _documentView]; @@ -275,8 +275,6 @@ static inline NSRect integralRect (NSRect rect, NSView *view) scrolling. Then, document view needs to redraw the remaining areas. */ - - /* Common part - which is a first approx of what we could copy... */ intersection = NSIntersectionRect (originalBounds, newBounds); @@ -309,8 +307,8 @@ static inline NSRect integralRect (NSRect rect, NSView *view) origins, both of which should be integers in device space because of the code at the end of constrainScrollPoint:. */ - float dx = newBounds.origin.x - originalBounds.origin.x; - float dy = newBounds.origin.y - originalBounds.origin.y; + CGFloat dx = newBounds.origin.x - originalBounds.origin.x; + CGFloat dy = newBounds.origin.y - originalBounds.origin.y; NSRect redrawRect; /* Copy the intersection to the new position */ @@ -660,7 +658,6 @@ static inline NSRect integralRect (NSRect rect, NSView *view) _isOpaque = YES; } } - } - (void) setDrawsBackground: (BOOL)flag @@ -699,15 +696,15 @@ static inline NSRect integralRect (NSRect rect, NSView *view) } /* Disable rotation of clip view */ -- (void) rotateByAngle: (float)angle +- (void) rotateByAngle: (CGFloat)angle { } -- (void) setBoundsRotation: (float)angle +- (void) setBoundsRotation: (CGFloat)angle { } -- (void) setFrameRotation: (float)angle +- (void) setFrameRotation: (CGFloat)angle { } diff --git a/Source/NSComboBox.m b/Source/NSComboBox.m index e894ea156..baf997495 100644 --- a/Source/NSComboBox.m +++ b/Source/NSComboBox.m @@ -141,7 +141,7 @@ static NSNotificationCenter *nc; /** * Returns the height of the items in the combo box cell list. */ -- (float)itemHeight +- (CGFloat)itemHeight { return [_cell itemHeight]; } @@ -150,7 +150,7 @@ static NSNotificationCenter *nc; * Sets the height of the items in the combo box cell list to * itemHeight. */ -- (void)setItemHeight:(float)itemHeight +- (void)setItemHeight:(CGFloat)itemHeight { [_cell setItemHeight:itemHeight]; } diff --git a/Source/NSComboBoxCell.m b/Source/NSComboBoxCell.m index 8fec9ddda..b17f15e58 100644 --- a/Source/NSComboBoxCell.m +++ b/Source/NSComboBoxCell.m @@ -98,13 +98,13 @@ static NSNotificationCenter *nc; @end @interface NSComboBoxCell (GNUstepPrivate) -- (NSString *) _stringValueAtIndex: (int)index; +- (NSString *) _stringValueAtIndex: (NSInteger)index; - (void) _performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView; - (void) _didClickWithinButton: (id)sender; - (BOOL) _isWantedEvent: (NSEvent *)event; - (GSComboWindow *) _popUp; - (NSRect) _textCellFrame; -- (void) _setSelectedItem: (int)index; +- (void) _setSelectedItem: (NSInteger)index; - (void) _loadButtonCell; - (void) _selectCompleted; @end @@ -207,12 +207,12 @@ static GSComboWindow *gsWindow = nil; { NSSize bsize = [[GSTheme theme] sizeForBorderType: NSLineBorder]; NSSize size; - float itemHeight; - float textCellWidth; - float popUpWidth; + CGFloat itemHeight; + CGFloat textCellWidth; + CGFloat popUpWidth; NSSize intercellSpacing; - int num = [comboBoxCell numberOfItems]; - int max = [comboBoxCell numberOfVisibleItems]; + NSInteger num = [comboBoxCell numberOfItems]; + NSInteger max = [comboBoxCell numberOfVisibleItems]; // Manage table view or browser cells height @@ -562,7 +562,7 @@ static GSComboWindow *gsWindow = nil; - (void) moveDownSelection { - int index = [_tableView selectedRow] + 1; + NSInteger index = [_tableView selectedRow] + 1; if (index > -1 && index < [_tableView numberOfRows]) { @@ -577,7 +577,7 @@ static GSComboWindow *gsWindow = nil; { NSText *textObject = nil; id cv = [_cell controlView]; - int index = [_cell indexOfSelectedItem]; + NSInteger index = [_cell indexOfSelectedItem]; if ([cv isKindOfClass: [NSControl class]]) { @@ -731,7 +731,7 @@ static GSComboWindow *gsWindow = nil; /** * Returns the height of the items in the combo box cell list. */ -- (float) itemHeight +- (CGFloat) itemHeight { return _itemHeight; } @@ -740,9 +740,9 @@ static GSComboWindow *gsWindow = nil; * Sets the height of the items in the combo box cell list to * itemHeight. */ -- (void) setItemHeight: (float)itemHeight +- (void) setItemHeight: (CGFloat)itemHeight { - if (itemHeight > 14) + if (itemHeight > 14.0) _itemHeight = itemHeight; } @@ -1130,7 +1130,7 @@ static GSComboWindow *gsWindow = nil; */ - (id) objectValue { - int index = [self indexOfSelectedItem]; + NSInteger index = [self indexOfSelectedItem]; if (index == -1) { @@ -1182,7 +1182,7 @@ static GSComboWindow *gsWindow = nil; } else { - int index = [self indexOfSelectedItem]; + NSInteger index = [self indexOfSelectedItem]; if (index == -1) { @@ -1268,7 +1268,7 @@ static GSComboWindow *gsWindow = nil; } else { - unsigned int i; + NSInteger i; for (i = 0; i < [self numberOfItems]; i++) { @@ -1281,7 +1281,7 @@ static GSComboWindow *gsWindow = nil; } else { - unsigned int i; + NSUInteger i; for (i = 0; i < [_popUpList count]; i++) { @@ -1740,8 +1740,8 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect) { NSString *myString = [[textObject string] copy]; NSString *more; - unsigned int myStringLength = [myString length]; - unsigned int location, length; + NSUInteger myStringLength = [myString length]; + NSUInteger location, length; NSRange selectedRange = [textObject selectedRange]; if (myStringLength != 0 @@ -1766,7 +1766,7 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect) @implementation NSComboBoxCell (GNUstepPrivate) -- (NSString *) _stringValueAtIndex: (int)index +- (NSString *) _stringValueAtIndex: (NSInteger)index { if (_usesDataSource == NO) { @@ -1869,7 +1869,7 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect) return textCellFrameFromRect(_lastValidFrame); } -- (void) _setSelectedItem: (int)index +- (void) _setSelectedItem: (NSInteger)index { _selectedItem = index; } diff --git a/Source/NSForm.m b/Source/NSForm.m index 9b4c2d4cf..6499fc442 100644 --- a/Source/NSForm.m +++ b/Source/NSForm.m @@ -214,7 +214,7 @@ static Class defaultCellClass = nil; /**

Sets the spacing between all entries to spacing. By default the spacing is 4.

See Also: [NSMatrix-setIntercellSpacing:]

*/ -- (void) setInterlineSpacing: (float)spacing +- (void) setInterlineSpacing: (CGFloat)spacing { [self setIntercellSpacing: NSMakeSize(0, spacing)]; } @@ -356,8 +356,8 @@ static Class defaultCellClass = nil; - (void) calcSize { NSInteger i, count = [self numberOfRows]; - float new_title_width = 0; - float candidate_title_width = 0; + CGFloat new_title_width = 0; + CGFloat candidate_title_width = 0; NSRect rect; // Compute max of title width in the cells diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index d39b91327..bdcb4f949 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -168,7 +168,7 @@ /**

Sets the width of the NSFormCell's title to width. All NSFormCell of the NSForm are updated

See Also: -titleWidth

*/ -- (void)setTitleWidth: (float)width +- (void)setTitleWidth: (CGFloat)width { if (width >= 0) { @@ -243,7 +243,7 @@ // manually with setTitleWidth: disables any alignment with other // cells. // -- (float)titleWidth +- (CGFloat)titleWidth { if (_formcell_auto_title_width == NO) return _displayedTitleWidth; @@ -254,7 +254,7 @@ } } -- (float)titleWidth: (NSSize)aSize +- (CGFloat)titleWidth: (NSSize)aSize { if (_formcell_auto_title_width == NO) return _displayedTitleWidth; diff --git a/Source/NSParagraphStyle.m b/Source/NSParagraphStyle.m index b1c092ec1..11fef8548 100644 --- a/Source/NSParagraphStyle.m +++ b/Source/NSParagraphStyle.m @@ -33,7 +33,7 @@ @implementation NSTextTab -- (id) initWithType: (NSTextTabType)type location: (float)loc +- (id) initWithType: (NSTextTabType)type location: (CGFloat)loc { if ((self = [super init])) { @@ -60,7 +60,7 @@ } - (id) initWithTextAlignment: (NSTextAlignment)align - location: (float)loc + location: (CGFloat)loc options: (NSDictionary *)options { NSTextTabType type; @@ -138,9 +138,9 @@ - (NSUInteger) hash { - unsigned val = (unsigned)_location; + NSUInteger val = (NSUInteger)_location; - val ^= (unsigned)_tabStopType; + val ^= (NSUInteger)_tabStopType; return val; } @@ -157,7 +157,7 @@ return YES; } -- (float) location +- (CGFloat) location { return _location; } @@ -312,7 +312,7 @@ static NSParagraphStyle *defaultStyle = nil; * Can't be negative. This value is included in the line fragment * heights in layout manager. */ -- (float) lineSpacing +- (CGFloat) lineSpacing { return _lineSpacing; } @@ -320,7 +320,7 @@ static NSParagraphStyle *defaultStyle = nil; /* * Distance between the bottom of this paragraph and top of next. */ -- (float) paragraphSpacing +- (CGFloat) paragraphSpacing { return _paragraphSpacing; } @@ -338,7 +338,7 @@ static NSParagraphStyle *defaultStyle = nil; /* * Distance from margin to front edge of paragraph */ -- (float) headIndent +- (CGFloat) headIndent { return _headIndent; } @@ -347,7 +347,7 @@ static NSParagraphStyle *defaultStyle = nil; * Distance from margin to back edge of paragraph; if negative or 0, * from other margin */ -- (float) tailIndent +- (CGFloat) tailIndent { return _tailIndent; } @@ -355,7 +355,7 @@ static NSParagraphStyle *defaultStyle = nil; /* * Distance from margin to edge appropriate for text direction */ -- (float) firstLineHeadIndent +- (CGFloat) firstLineHeadIndent { return _firstLineHeadIndent; } @@ -373,7 +373,7 @@ static NSParagraphStyle *defaultStyle = nil; * of ascenders; basically the line fragment height. Does not include * lineSpacing (which is added after this computation). */ -- (float) minimumLineHeight +- (CGFloat) minimumLineHeight { return _minimumLineHeight; } @@ -381,7 +381,7 @@ static NSParagraphStyle *defaultStyle = nil; /* * 0 implies no maximum. */ -- (float) maximumLineHeight +- (CGFloat) maximumLineHeight { return _maximumLineHeight; } @@ -396,22 +396,22 @@ static NSParagraphStyle *defaultStyle = nil; return _baseDirection; } -- (float) defaultTabInterval +- (CGFloat) defaultTabInterval { return _defaultTabInterval; } -- (float) lineHeightMultiple +- (CGFloat) lineHeightMultiple { return _lineHeightMultiple; } -- (float) paragraphSpacingBefore +- (CGFloat) paragraphSpacingBefore { return _paragraphSpacingBefore; } -- (int) headerLevel +- (NSInteger) headerLevel { return _headerLevel; } @@ -613,13 +613,13 @@ static NSParagraphStyle *defaultStyle = nil; return AUTORELEASE ([[NSParagraphStyle defaultParagraphStyle] mutableCopy]); } -- (void) setLineSpacing: (float)aFloat +- (void) setLineSpacing: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _lineSpacing = aFloat; } -- (void) setParagraphSpacing: (float)aFloat +- (void) setParagraphSpacing: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _paragraphSpacing = aFloat; @@ -630,19 +630,19 @@ static NSParagraphStyle *defaultStyle = nil; _alignment = newAlignment; } -- (void) setFirstLineHeadIndent: (float)aFloat +- (void) setFirstLineHeadIndent: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _firstLineHeadIndent = aFloat; } -- (void) setHeadIndent: (float)aFloat +- (void) setHeadIndent: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _headIndent = aFloat; } -- (void) setTailIndent: (float)aFloat +- (void) setTailIndent: (CGFloat)aFloat { _tailIndent = aFloat; } @@ -652,13 +652,13 @@ static NSParagraphStyle *defaultStyle = nil; _lineBreakMode = mode; } -- (void) setMinimumLineHeight: (float)aFloat +- (void) setMinimumLineHeight: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _minimumLineHeight = aFloat; } -- (void) setMaximumLineHeight: (float)aFloat +- (void) setMaximumLineHeight: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _maximumLineHeight = aFloat; @@ -682,12 +682,12 @@ static NSParagraphStyle *defaultStyle = nil; _baseDirection = direction; } -- (void) setDefaultTabInterval: (float)interval +- (void) setDefaultTabInterval: (CGFloat)interval { _defaultTabInterval = interval; } -- (void) setLineHeightMultiple: (float)factor +- (void) setLineHeightMultiple: (CGFloat)factor { _lineHeightMultiple = factor; } @@ -697,7 +697,7 @@ static NSParagraphStyle *defaultStyle = nil; _paragraphSpacingBefore = spacing; } -- (void) setHeaderLevel: (int)level +- (void) setHeaderLevel: (NSInteger)level { _headerLevel = level; } @@ -724,7 +724,7 @@ static NSParagraphStyle *defaultStyle = nil; - (void) addTabStop: (NSTextTab*)anObject { - unsigned count = [_tabStops count]; + NSUInteger count = [_tabStops count]; if (count == 0) { @@ -734,7 +734,7 @@ static NSParagraphStyle *defaultStyle = nil; { while (count-- > 0) { - NSTextTab *tab; + NSTextTab *tab; tab = [_tabStops objectAtIndex: count]; if ([tab compare: anObject] != NSOrderedDescending) @@ -767,7 +767,7 @@ static NSParagraphStyle *defaultStyle = nil; - (void) setParagraphStyle: (NSParagraphStyle*)obj { - NSMutableParagraphStyle *p = (NSMutableParagraphStyle*)obj; + NSMutableParagraphStyle *p = (NSMutableParagraphStyle*)obj; if (p == self) return;