More CGFloat, NSUInteger and NSInteger changes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36153 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-02-16 21:37:29 +00:00
parent a4abfc354f
commit a7a48ea407
12 changed files with 196 additions and 186 deletions

View file

@ -133,8 +133,8 @@ a new internal method called from NSLayoutManager when text has changed.
Interface for a bunch of internal methods that need to be cleaned up.
*/
@interface NSTextView (GNUstepPrivate)
- (unsigned int) _characterIndexForPoint: (NSPoint)point
respectFraction: (BOOL)respectFraction;
- (NSUInteger) _characterIndexForPoint: (NSPoint)point
respectFraction: (BOOL)respectFraction;
/*
* Used to implement the blinking insertion point
@ -438,7 +438,7 @@ editing is turned on or off.
withFlag: (BOOL)flag
{
NSArray *array;
int i, count;
NSUInteger i, count;
if (IS_SYNCHRONIZING_FLAGS == YES)
{
@ -1156,7 +1156,7 @@ to this method from the text container or layout manager.
*/
- (void) setTextContainer: (NSTextContainer *)container
{
unsigned int i, c;
NSUInteger i, c;
NSArray *tcs;
NSTextView *other;
@ -1224,7 +1224,7 @@ to this method from the text container or layout manager.
- (void) replaceTextContainer: (NSTextContainer *)newContainer
{
NSLayoutManager *lm = _layoutManager;
unsigned int index = [[lm textContainers] indexOfObject: _textContainer];
NSUInteger index = [[lm textContainers] indexOfObject: _textContainer];
NSTextStorage *ts = _textStorage;
RETAIN(self);
@ -1301,7 +1301,7 @@ to make sure syncing is handled properly in all cases.
/* Invoke setDelegate: on all the textviews which share this
delegate. */
NSArray *array;
int i, count;
NSUInteger i, count;
IS_SYNCHRONIZING_DELEGATES = YES;
@ -1645,7 +1645,7 @@ to make sure syncing is handled properly in all cases.
{
id futureFirstResponder;
NSArray *textContainers;
int i, count;
NSUInteger i, count;
futureFirstResponder = [_window _futureFirstResponder];
textContainers = [_layoutManager textContainers];
@ -2072,7 +2072,7 @@ here. */
}
// This method takes screen coordinates as input.
- (unsigned int) characterIndexForPoint: (NSPoint)point
- (NSUInteger) characterIndexForPoint: (NSPoint)point
{
point = [[self window] convertScreenToBase: point];
point = [self convertPoint:point fromView: nil];
@ -2119,9 +2119,9 @@ here. */
NSForegroundColorAttributeName, NSFontAttributeName, nil];
}
- (long int) conversationIdentifier
- (NSInteger) conversationIdentifier
{
return (long int)_textStorage;
return (NSInteger)_textStorage;
}
- (NSRect) firstRectForCharacterRange: (NSRange)theRange
@ -2455,7 +2455,7 @@ the attributes for the range, and do not update the typing attributes.
return [_textStorage string];
}
- (unsigned) textLength
- (NSUInteger) textLength
{
return [_textStorage length];
}
@ -2906,7 +2906,7 @@ Scroll so that the beginning of the range is visible.
{
NSRect rect, r;
NSView *cv;
float width;
CGFloat width;
NSPoint p0, p1;
NSRange ourCharRange;
@ -3062,7 +3062,7 @@ Scroll so that the beginning of the range is visible.
{
/* Otherwise, fill the clip view with text; no blank space on
either side. */
float x;
CGFloat x;
x = p1.x - width;
if (x < rect.origin.x)
@ -3228,7 +3228,7 @@ This method is for user changes; see NSTextView_actions.m.
- (void) changeFont: (id)sender
{
NSRange foundRange;
unsigned int maxSelRange;
NSUInteger maxSelRange;
NSRange aRange= [self rangeForUserCharacterAttributeChange];
NSRange searchRange = aRange;
NSFont *font;
@ -3401,7 +3401,7 @@ This method is for user changes; see NSTextView_actions.m.
}
- (void) clickedOnLink: (id)link
atIndex: (unsigned int)charIndex
atIndex: (NSUInteger)charIndex
{
if (_delegate != nil)
{
@ -3409,7 +3409,7 @@ This method is for user changes; see NSTextView_actions.m.
if ([_delegate respondsToSelector: selector])
{
[_delegate textView: self clickedOnLink: link atIndex: charIndex];
[_delegate textView: self clickedOnLink: link atIndex: charIndex];
}
}
}
@ -3567,11 +3567,11 @@ afterString in order over charRange.
- (NSRange) selectionRangeForProposedRange: (NSRange)proposedCharRange
granularity: (NSSelectionGranularity)gr
{
unsigned index;
NSUInteger index;
NSRange aRange;
NSRange newRange;
NSString *string = [self string];
unsigned length = [string length];
NSUInteger length = [string length];
if (NSMaxRange (proposedCharRange) > length)
{
@ -3647,7 +3647,7 @@ afterString in order over charRange.
displayed selection could have been a temporary selection,
different from the last official one: */
NSRange oldDisplayedRange;
unsigned int length = [_textStorage length];
NSUInteger length = [_textStorage length];
oldDisplayedRange = _layoutManager->_selected_range;
@ -4093,7 +4093,7 @@ Figure out how the additional layout stuff is supposed to work.
fromView: nil];
// Find out what the corresponding text is.
startIndex = [self _characterIndexForPoint: point
respectFraction: NO];
respectFraction: NO];
// Look up what the tooltip text should be.
value = [_textStorage attribute: NSToolTipAttributeName
atIndex: startIndex
@ -4330,7 +4330,7 @@ Figure out how the additional layout stuff is supposed to work.
NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType]
location: [marker markerLocation]];
NSRange range = [self rangeForUserParagraphAttributeChange];
unsigned loc = range.location;
NSUInteger loc = range.location;
NSParagraphStyle *style;
NSMutableParagraphStyle *mstyle;
@ -4391,7 +4391,7 @@ Figure out how the additional layout stuff is supposed to work.
{
NSTextTab *tab = (NSTextTab *)[marker representedObject];
NSRange range = [self rangeForUserParagraphAttributeChange];
unsigned loc = range.location;
NSUInteger loc = range.location;
NSParagraphStyle *style;
NSMutableParagraphStyle *mstyle;
@ -4446,7 +4446,7 @@ Figure out how the additional layout stuff is supposed to work.
NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType]
location: [marker markerLocation]];
NSRange range = [self rangeForUserParagraphAttributeChange];
unsigned loc = range.location;
NSUInteger loc = range.location;
NSParagraphStyle *style;
NSMutableParagraphStyle *mstyle;
@ -4505,7 +4505,7 @@ Figure out how the additional layout stuff is supposed to work.
{
NSPoint point = [ruler convertPoint: [event locationInWindow]
fromView: nil];
float location = point.x;
CGFloat location = point.x;
NSRulerMarker *marker = [[NSRulerMarker alloc]
initWithRulerView: ruler
markerLocation: location
@ -4553,9 +4553,9 @@ shouldRemoveMarker: (NSRulerMarker *)marker
/**
* Return a position for adding by constraining the specified location.
*/
- (float) rulerView: (NSRulerView *)ruler
willAddMarker: (NSRulerMarker *)marker
atLocation: (float)location
- (CGFloat) rulerView: (NSRulerView *)ruler
willAddMarker: (NSRulerMarker *)marker
atLocation: (CGFloat)location
{
NSSize size = [_textContainer containerSize];
@ -4571,9 +4571,9 @@ shouldRemoveMarker: (NSRulerMarker *)marker
/**
* Return a new position by constraining the specified location.
*/
- (float) rulerView: (NSRulerView *)ruler
willMoveMarker: (NSRulerMarker *)marker
toLocation: (float)location
- (CGFloat) rulerView: (NSRulerView *)ruler
willMoveMarker: (NSRulerMarker *)marker
toLocation: (CGFloat)location
{
NSSize size = [_textContainer containerSize];
@ -4668,7 +4668,7 @@ shouldRemoveMarker: (NSRulerMarker *)marker
}
- (int) spellCheckerDocumentTag
- (NSInteger) spellCheckerDocumentTag
{
if (!_spellCheckerDocumentTag)
_spellCheckerDocumentTag = [NSSpellChecker uniqueSpellDocumentTag];
@ -5199,17 +5199,17 @@ other than copy/paste or dragging. */
}
- (void) _updateDragTargetLocation: (id <NSDraggingInfo>)sender
operation: (unsigned int *)flags
operation: (NSDragOperation *)flags
{
if (*flags != NSDragOperationNone)
{
NSPoint dragPoint;
unsigned dragIndex;
NSPoint dragPoint;
NSUInteger dragIndex;
dragPoint = [sender draggingLocation];
dragPoint = [self convertPoint: dragPoint fromView: nil];
dragIndex = [self _characterIndexForPoint: dragPoint
respectFraction: YES];
respectFraction: YES];
if ([sender draggingSource] != self ||
dragIndex <= [self selectedRange].location ||
@ -5237,7 +5237,7 @@ other than copy/paste or dragging. */
NSArray *types = [self readablePasteboardTypes];
NSString *type = [self preferredPasteboardTypeFromArray: [pboard types]
restrictedToTypesFromArray: types];
unsigned int flags = [self dragOperationForDraggingInfo: sender type: type];
NSDragOperation flags = [self dragOperationForDraggingInfo: sender type: type];
if (![type isEqual: NSColorPboardType])
{
@ -5252,7 +5252,7 @@ other than copy/paste or dragging. */
NSArray *types = [self readablePasteboardTypes];
NSString *type = [self preferredPasteboardTypeFromArray: [pboard types]
restrictedToTypesFromArray: types];
unsigned int flags = [self dragOperationForDraggingInfo: sender type: type];
NSDragOperation flags = [self dragOperationForDraggingInfo: sender type: type];
NSPoint dragPoint;
NSRect vRect;
@ -5305,7 +5305,7 @@ other than copy/paste or dragging. */
- (void) draggingExited: (id <NSDraggingInfo>)sender
{
unsigned int flags = NSDragOperationNone;
NSDragOperation flags = NSDragOperationNone;
[self _updateDragTargetLocation: sender operation: &flags];
}
@ -5375,8 +5375,8 @@ other than copy/paste or dragging. */
[self displayIfNeeded];
}
- (unsigned int) dragOperationForDraggingInfo: (id <NSDraggingInfo>)dragInfo
type: (NSString *)type
- (NSDragOperation) dragOperationForDraggingInfo: (id <NSDraggingInfo>)dragInfo
type: (NSString *)type
{
//TODO
return NSDragOperationCopy | NSDragOperationGeneric;
@ -5447,7 +5447,7 @@ other than copy/paste or dragging. */
startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
startIndex = [self _characterIndexForPoint: startPoint
respectFraction: [theEvent clickCount] == 1];
respectFraction: [theEvent clickCount] == 1];
if ([theEvent modifierFlags] & NSShiftKeyMask)
{
@ -5585,8 +5585,9 @@ other than copy/paste or dragging. */
YES if it handles the click, NO if it doesn't
-- and if it doesn't, we need to pass the click
to the next responder. */
if ([_delegate textView: self clickedOnLink: link
atIndex: startIndex])
if ([_delegate textView: self
clickedOnLink: link
atIndex: startIndex])
{
return;
}
@ -5602,10 +5603,10 @@ other than copy/paste or dragging. */
}
chosenRange = [self selectionRangeForProposedRange: proposedRange
granularity: granularity];
granularity: granularity];
if (canDrag)
{
unsigned int mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask;
NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask;
NSEvent *currentEvent;
currentEvent = [_window nextEventMatchingMask: mask
@ -5626,8 +5627,8 @@ other than copy/paste or dragging. */
/* Enter modal loop tracking the mouse */
{
unsigned int mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask
| NSPeriodicMask;
NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask
| NSPeriodicMask;
NSEvent *currentEvent;
NSEvent *lastEvent = nil; /* Last non-periodic event. */
NSDate *distantPast = [NSDate distantPast];
@ -5779,7 +5780,7 @@ static const NSInteger GSSpellingSuggestionMenuItemTag = 1;
- (void) rightMouseDown: (NSEvent *)theEvent
{
int i;
NSUInteger i;
NSMenu *menu = [[self class] defaultMenu];
NSPoint point = [self convertPoint: [theEvent locationInWindow] fromView: nil];
NSUInteger index = [self _characterIndexForPoint: point
@ -5925,8 +5926,8 @@ configuation! */
NSDictionary *attributes;
NSRange aRange = [self rangeForUserCharacterAttributeChange];
NSRange foundRange;
unsigned int location;
unsigned int maxSelRange = NSMaxRange(aRange);
NSUInteger location;
NSUInteger maxSelRange = NSMaxRange(aRange);
if (aRange.location == NSNotFound)
return;
@ -5966,7 +5967,7 @@ configuation! */
}
- (NSArray *) completionsForPartialWordRange: (NSRange)range
indexOfSelectedItem: (int *)index
indexOfSelectedItem: (NSInteger *)index
{
// FIXME
return nil;
@ -5974,7 +5975,7 @@ configuation! */
- (void) insertCompletion: (NSString *)word
forPartialWordRange: (NSRange)range
movement: (int)movement
movement: (NSInteger)movement
isFinal: (BOOL)flag
{
// FIXME
@ -6011,11 +6012,11 @@ configuation! */
TODO: make sure this is only called when _layoutManager is known non-nil,
or add guards
*/
- (unsigned int) _characterIndexForPoint: (NSPoint)point
respectFraction: (BOOL)respectFraction
- (NSUInteger) _characterIndexForPoint: (NSPoint)point
respectFraction: (BOOL)respectFraction
{
unsigned index;
float fraction;
NSUInteger index;
CGFloat fraction;
point.x -= _textContainerOrigin.x;
point.y -= _textContainerOrigin.y;
@ -6032,7 +6033,7 @@ or add guards
fractionOfDistanceThroughGlyph: &fraction];
// FIXME The layoutManager should never return -1.
// Assume that the text is empty if this happens.
if (index == (unsigned int)-1)
if (index == NSNotFound)
return 0;
index = [_layoutManager characterIndexForGlyphAtIndex: index];
@ -6429,7 +6430,7 @@ or add guards
- (NSTextView *) bestTextViewForTextStorage: (NSTextStorage *)aTextStorage
{
int i, j;
NSUInteger i, j;
NSArray *layoutManagers, *textContainers;
NSTextView *tv, *first = nil, *best = nil;
NSWindow *win;