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:
Fred Kiefer 2013-02-16 21:37:29 +00:00
parent 270baf4037
commit 7ef53c8232
12 changed files with 196 additions and 186 deletions

View file

@ -1,3 +1,18 @@
2013-02-16 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSDragging.h
* Headers/AppKit/NSInputManager.h
* Headers/AppKit/NSLayoutManager.h
* Headers/AppKit/NSRulerView.h
* Headers/AppKit/NSText.h
* Headers/AppKit/NSTextView.h
* Source/NSInputManager.m
* Source/NSLayoutManager.m
* Source/NSText.m
* Source/NSTextView.m
* Source/NSTextView_actions.m
More CGFloat, NSUInteger and NSInteger changes.
2013-02-16 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSWindowDecorationView.h

View file

@ -50,7 +50,7 @@ enum _NSDragOperation {
NSDragOperationEvery = UINT_MAX
};
typedef unsigned int NSDragOperation;
typedef NSUInteger NSDragOperation;
@protocol NSDraggingInfo

View file

@ -40,7 +40,7 @@
@class NSImage;
@protocol NSTextInput
- (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange;
- (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange;
- (BOOL) hasMarkedText;
- (NSRange) markedRange;
- (NSRange) selectedRange;
@ -49,8 +49,8 @@
- (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange;
- (unsigned int) characterIndexForPoint: (NSPoint)thePoint;
- (long) conversationIdentifier;
- (NSUInteger) characterIndexForPoint: (NSPoint)thePoint;
- (NSInteger) conversationIdentifier;
- (void) doCommandBySelector: (SEL)aSelector;
- (NSRect) firstRectForCharacterRange: (NSRange)theRange;
- (void) insertText: (id)aString;

View file

@ -122,9 +122,9 @@ typedef enum {
- (unsigned int) glyphIndexForPoint: (NSPoint)aPoint
inTextContainer: (NSTextContainer *)aTextContainer;
- (unsigned int) glyphIndexForPoint: (NSPoint)point
- (NSUInteger) glyphIndexForPoint: (NSPoint)point
inTextContainer: (NSTextContainer *)container
fractionOfDistanceThroughGlyph: (float *)partialFraction;
fractionOfDistanceThroughGlyph: (CGFloat *)partialFraction;
/*

View file

@ -159,13 +159,13 @@ typedef enum {
- (BOOL)rulerView: (NSRulerView *)aRulerView
shouldRemoveMarker: (NSRulerMarker *)aMarker;
- (float)rulerView: (NSRulerView *)aRulerView
willAddMarker: (NSRulerMarker *)aMarker
atLocation: (float)location;
- (CGFloat)rulerView: (NSRulerView *)aRulerView
willAddMarker: (NSRulerMarker *)aMarker
atLocation: (CGFloat)location;
- (float)rulerView: (NSRulerView *)aRulerView
willMoveMarker: (NSRulerMarker *)aMarker
toLocation: (float)location;
- (CGFloat)rulerView: (NSRulerView *)aRulerView
willMoveMarker: (NSRulerMarker *)aMarker
toLocation: (CGFloat)location;
- (void)rulerView: (NSRulerView *)aRulerView
willSetClientView: (NSView *)newClient;

View file

@ -286,7 +286,7 @@ enum {
@interface NSText (GNUstepExtensions)
- (unsigned) textLength; /* PRIMITIVE */
- (NSUInteger) textLength; /* PRIMITIVE */
@end

View file

@ -46,22 +46,23 @@
@class NSRulerView,NSRulerMarker;
typedef enum _NSSelectionGranularity {
enum _NSSelectionGranularity {
NSSelectByCharacter = 0,
NSSelectByWord = 1,
NSSelectByParagraph = 2,
} NSSelectionGranularity;
};
typedef NSUInteger NSSelectionGranularity;
/* TODO: this looks like a mosx extension, not a GNUstep extension. should
double-check */
typedef enum _NSSelectionAffinity {
enum _NSSelectionAffinity {
NSSelectionAffinityUpstream = 0,
NSSelectionAffinityDownstream = 1,
} NSSelectionAffinity;
};
typedef NSUInteger NSSelectionAffinity;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
typedef enum _NSFindPanelAction
enum _NSFindPanelAction
{
NSFindPanelActionShowFindPanel = 1,
NSFindPanelActionNext,
@ -76,7 +77,8 @@ typedef enum _NSFindPanelAction
NSFindPanelActionSelectAll,
NSFindPanelActionSelectAllInSelection
#endif
} NSFindPanelAction;
};
typedef NSUInteger NSFindPanelAction;
#endif
/*
@ -162,14 +164,12 @@ therefore be stored in the NSLayoutManager to avoid problems.
/* shared by all text views attached to one NSTextStorage */
int _spellCheckerDocumentTag;
NSInteger _spellCheckerDocumentTag;
NSColor *_backgroundColor;
NSSize _minSize;
NSSize _maxSize;
/* The following is the object used when posting notifications.
It is usually `self' - but in the case of multiple textviews
@ -177,7 +177,6 @@ therefore be stored in the NSLayoutManager to avoid problems.
might or might not be `self'. This must *not* be retained. */
NSTextView *_notifObject;
/* other members of the text network */
NSTextContainer *_textContainer;
NSLayoutManager *_layoutManager;
@ -204,7 +203,6 @@ therefore be stored in the NSLayoutManager to avoid problems.
BOOL _drawInsertionPointNow;
//#endif
/* Stores the insertion point rect - updated by
updateInsertionPointStateAndRestartTimer: - we must make sure we
call the method every time that the insertion point rect might
@ -218,12 +216,13 @@ therefore be stored in the NSLayoutManager to avoid problems.
NSLayoutManager tries to maintain the original horizontal position when
moving up/down.)
*/
unsigned int _originalInsertionPointCharacterIndex;
NSUInteger _originalInsertionPointCharacterIndex;
/*
0=no information (_originalInsertionPointCharacterIndex undefined)
1=horizontal
2=vertical
* GSInsertionPointMovementDirection
* 0=no information (_originalInsertionPointCharacterIndex undefined)
* 1=horizontal
* 2=vertical
*/
int _currentInsertionPointMovementDirection;
@ -485,26 +484,6 @@ user/programmatic changes of the text.
@interface NSTextView (leftovers)
/*** Ruler support ***/
-(void) rulerView: (NSRulerView *)ruler didMoveMarker: (NSRulerMarker *)marker;
-(void) rulerView: (NSRulerView *)ruler didRemoveMarker: (NSRulerMarker *)marker;
-(void) rulerView: (NSRulerView *)ruler didAddMarker: (NSRulerMarker *)marker;
-(BOOL) rulerView: (NSRulerView *)ruler shouldMoveMarker: (NSRulerMarker *)marker;
-(BOOL) rulerView: (NSRulerView *)ruler shouldRemoveMarker: (NSRulerMarker *)marker;
-(BOOL) rulerView: (NSRulerView *)ruler shouldAddMarker: (NSRulerMarker *)marker;
-(float) rulerView: (NSRulerView *)ruler
willMoveMarker: (NSRulerMarker *)marker
toLocation: (float)location;
-(float) rulerView: (NSRulerView *)ruler
willAddMarker: (NSRulerMarker *)marker
atLocation: (float)location;
-(void) rulerView: (NSRulerView *)ruler
handleMouseDown: (NSEvent *)event;
/*** Fine display control ***/
/* Like -setNeedsDisplayInRect: (NSView), bit if flag is YES, won't do any
@ -542,8 +521,8 @@ already been laid out. */
-(NSImage *) dragImageForSelectionWithEvent: (NSEvent *)event
origin: (NSPoint *)origin; /* mosx */
-(unsigned int) dragOperationForDraggingInfo: (id <NSDraggingInfo>)dragInfo
type: (NSString *)type; /* mosx */
-(NSDragOperation) dragOperationForDraggingInfo: (id <NSDraggingInfo>)dragInfo
type: (NSString *)type; /* mosx */
-(BOOL) dragSelectionWithEvent: (NSEvent *)event
offset: (NSSize)mouseOffset
slideBack: (BOOL)slideBack; /* mosx */
@ -580,7 +559,7 @@ already been laid out. */
/*** Spell checking ***/
-(int) spellCheckerDocumentTag;
-(NSInteger) spellCheckerDocumentTag;
/*** Smart copy/paste/delete support ***/
@ -606,7 +585,7 @@ already been laid out. */
-(void) setTypingAttributes: (NSDictionary *)attrs;
- (void) clickedOnLink: (id)link
atIndex: (unsigned int)charIndex;
atIndex: (NSUInteger)charIndex;
-(void) updateRuler;
-(void) updateFontPanel;
@ -632,10 +611,10 @@ already been laid out. */
- (void) complete: (id)sender;
- (NSArray *) completionsForPartialWordRange: (NSRange)range
indexOfSelectedItem: (int *)index;
indexOfSelectedItem: (NSInteger *)index;
- (void) insertCompletion: (NSString *)word
forPartialWordRange: (NSRange)range
movement: (int)movement
movement: (NSInteger)movement
isFinal: (BOOL)flag;
- (void) performFindPanelAction: (id)sender;
@ -683,12 +662,12 @@ layout manager. */
-(void) textView: (NSTextView *)textView
clickedOnCell: (id <NSTextAttachmentCell>)cell
inRect: (NSRect)cellFrame
atIndex: (unsigned)charIndex;
atIndex: (NSUInteger)charIndex;
-(BOOL) textView: (NSTextView *)textView clickedOnLink: (id)link;
-(BOOL) textView: (NSTextView *)textView
clickedOnLink: (id)link
atIndex: (unsigned)charIndex;
atIndex: (NSUInteger)charIndex;
-(void) textView: (NSTextView *)textView
doubleClickedOnCell: (id <NSTextAttachmentCell>)cell
@ -696,16 +675,17 @@ doubleClickedOnCell: (id <NSTextAttachmentCell>)cell
-(void) textView: (NSTextView *)textView
doubleClickedOnCell: (id <NSTextAttachmentCell>)cell
inRect: (NSRect)cellFrame
atIndex: (unsigned)charIndex;
atIndex: (NSUInteger)charIndex;
-(void) textView: (NSTextView *)view
draggedCell: (id <NSTextAttachmentCell>)cell
inRect: (NSRect)rect event:(NSEvent *)event;
inRect: (NSRect)rect
event:(NSEvent *)event;
-(void) textView: (NSTextView *)view
draggedCell: (id <NSTextAttachmentCell>)cell
inRect: (NSRect)rect
event: (NSEvent *)event
atIndex: (unsigned)charIndex;
atIndex: (NSUInteger)charIndex;
-(NSRange) textView: (NSTextView *)textView
willChangeSelectionFromCharacterRange: (NSRange)oldSelectedCharRange
@ -729,10 +709,10 @@ replacementString will be nil. */
- (NSArray *) textView: (NSTextView *)textView
completions: (NSArray *)words
forPartialWordRange: (NSRange)range
indexOfSelectedItem: (int *)index;
indexOfSelectedItem: (NSInteger *)index;
- (NSString *) textView: (NSTextView *)textView
willDisplayToolTip: (NSString *)tooltip
forCharacterAtIndex: (unsigned int)index;
forCharacterAtIndex: (NSUInteger)index;
- (void) textViewDidChangeTypingAttributes: (NSNotification *)notification;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)

View file

@ -770,12 +770,12 @@ static NSInputManager *currentInputManager = nil;
return nil;
}
- (unsigned int) characterIndexForPoint: (NSPoint)thePoint
- (NSUInteger) characterIndexForPoint: (NSPoint)thePoint
{
return 0;
}
- (long) conversationIdentifier
- (NSInteger) conversationIdentifier
{
return 0;
}

View file

@ -635,15 +635,15 @@ line frag rect. */
TODO: decide on behavior wrt. invisible glyphs and pointer far away from
anything visible
*/
-(unsigned int) glyphIndexForPoint: (NSPoint)point
inTextContainer: (NSTextContainer *)container
fractionOfDistanceThroughGlyph: (float *)partialFraction
-(NSUInteger) glyphIndexForPoint: (NSPoint)point
inTextContainer: (NSTextContainer *)container
fractionOfDistanceThroughGlyph: (CGFloat *)partialFraction
{
int i;
textcontainer_t *tc;
linefrag_t *lf;
linefrag_point_t *lp;
float dummy;
CGFloat dummy;
if (!partialFraction)
partialFraction = &dummy;
@ -654,7 +654,7 @@ anything visible
if (i == num_textcontainers)
{
NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__);
return -1;
return NSNotFound;
}
[self _doLayoutToContainer: i point: point];
@ -681,7 +681,14 @@ anything visible
if (i > 0)
{
*partialFraction = 1.0;
return lf->pos - 1;
if (lf->pos == 0)
{
return NSNotFound;
}
else
{
return lf->pos - 1;
}
}
else
{
@ -713,7 +720,15 @@ anything visible
if (i == tc->num_linefrags)
{
*partialFraction = 1.0;
return tc->pos + tc->length - 1; /* TODO: this should return the correct thing even if the container is empty */
/* TODO: this should return the correct thing even if the container is empty */
if (tc->pos + tc->length == 0)
{
return NSNotFound;
}
else
{
return tc->pos + tc->length - 1;
}
}
/* only interested in x from here on */

View file

@ -78,7 +78,8 @@ static Class concrete;
/*
* Getting and Setting Contents
*/
- (void) replaceCharactersInRange: (NSRange)aRange withRTF: (NSData *)rtfData
- (void) replaceCharactersInRange: (NSRange)aRange
withRTF: (NSData *)rtfData
{
NSAttributedString *attr;
@ -146,24 +147,24 @@ old text. */
/*
* old OpenStep methods doing the same
*/
- (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData
- (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData
{
[self replaceCharactersInRange: aRange withRTFD: rtfdData];
[self replaceCharactersInRange: aRange withRTFD: rtfdData];
}
- (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData
- (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData
{
[self replaceCharactersInRange: aRange withRTF: rtfData];
[self replaceCharactersInRange: aRange withRTF: rtfData];
}
- (void) replaceRange: (NSRange)aRange withString: (NSString*)aString
- (void) replaceRange: (NSRange)aRange withString: (NSString*)aString
{
[self replaceCharactersInRange: aRange withString: aString];
[self replaceCharactersInRange: aRange withString: aString];
}
- (void) setText: (NSString*)aString range: (NSRange)aRange
- (void) setText: (NSString*)aString range: (NSRange)aRange
{
[self replaceCharactersInRange: aRange withString: aString];
[self replaceCharactersInRange: aRange withString: aString];
}
- (void) setText: (NSString*)aString
@ -652,7 +653,7 @@ old text. */
@implementation NSText (GNUstepExtensions)
/* PRIMITIVE */
- (unsigned) textLength
- (NSUInteger) textLength
{
[self subclassResponsibility: _cmd];
return 0;

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;

View file

@ -175,11 +175,11 @@ static NSString *killBuffer = @"";
inRange: (NSRange)r
using: (NSNumber*(*)(NSNumber*))func
{
unsigned int i;
NSUInteger i;
NSRange e, r2;
id current, new;
if (![self shouldChangeTextInRange: r replacementString: nil])
if (![self shouldChangeTextInRange: r replacementString: nil])
return;
[_textStorage beginEditing];
@ -830,7 +830,7 @@ added to the selection (1,3).
return NSMaxRange(range);
}
- (unsigned int) _movementEnd
- (NSUInteger) _movementEnd
{
NSRange range = [self selectedRange];
@ -840,12 +840,12 @@ added to the selection (1,3).
return NSMaxRange(range);
}
- (void) _moveTo: (unsigned int)cindex
- (void) _moveTo: (NSUInteger)cindex
select: (BOOL)select
{
if (select)
{
unsigned int anchor = [self _movementEnd];
NSUInteger anchor = [self _movementEnd];
if (anchor < cindex)
{
@ -867,9 +867,9 @@ added to the selection (1,3).
[self scrollRangeToVisible: NSMakeRange(cindex, 0)];
}
- (void) _moveFrom: (unsigned int)cindex
- (void) _moveFrom: (NSUInteger)cindex
direction: (GSInsertionPointMovementDirection)direction
distance: (float)distance
distance: (CGFloat)distance
select: (BOOL)select
{
int new_direction;
@ -907,7 +907,7 @@ added to the selection (1,3).
}
- (void) _move: (GSInsertionPointMovementDirection)direction
distance: (float)distance
distance: (CGFloat)distance
select: (BOOL)select
{
[self _moveFrom: [self _movementOrigin]
@ -923,10 +923,10 @@ added to the selection (1,3).
* it should only be used when moving a literal direction such as left right
* up or down, not directions like forward, backward, beginning or end
*/
- (unsigned int) _characterIndexForSelectedRange: (NSRange)range
direction: (GSInsertionPointMovementDirection)direction
- (NSUInteger) _characterIndexForSelectedRange: (NSRange)range
direction: (GSInsertionPointMovementDirection)direction
{
unsigned int cIndex;
NSUInteger cIndex;
NSParagraphStyle *parStyle;
NSWritingDirection writingDirection;
@ -975,7 +975,7 @@ check if there was a reason for that.
- (void) moveUp: (id)sender
{
NSRange range = [self selectedRange];
unsigned int cIndex = [self _characterIndexForSelectedRange:range
NSUInteger cIndex = [self _characterIndexForSelectedRange:range
direction:GSInsertionPointMoveUp];
[self _moveFrom: cIndex
@ -994,7 +994,7 @@ check if there was a reason for that.
- (void) moveDown: (id)sender
{
NSRange range = [self selectedRange];
unsigned int cIndex = [self _characterIndexForSelectedRange: range
NSUInteger cIndex = [self _characterIndexForSelectedRange: range
direction: GSInsertionPointMoveDown];
[self _moveFrom: cIndex
direction: GSInsertionPointMoveDown
@ -1015,7 +1015,7 @@ check if there was a reason for that.
if (range.length)
{
unsigned int cIndex;
NSUInteger cIndex;
cIndex = [self _characterIndexForSelectedRange: range
direction:GSInsertionPointMoveLeft];
@ -1023,7 +1023,6 @@ check if there was a reason for that.
}
else
{
[self _move: GSInsertionPointMoveLeft
distance: 0.0
select: NO];
@ -1055,7 +1054,7 @@ check if there was a reason for that.
if (range.length)
{
unsigned int cIndex;
NSUInteger cIndex;
cIndex = [self _characterIndexForSelectedRange: range
direction: GSInsertionPointMoveRight];
@ -1080,18 +1079,18 @@ check if there was a reason for that.
if (writingDirection == NSWritingDirectionRightToLeft)
{
[self moveBackwardAndModifySelection: sender];
[self moveBackwardAndModifySelection: sender];
}
else
{
[self moveForwardAndModifySelection: sender];
[self moveForwardAndModifySelection: sender];
}
}
- (void) moveBackward: (id)sender
{
NSRange range = [self selectedRange];
unsigned int to = range.location;
NSUInteger to = range.location;
if (range.length == 0 && to)
{
@ -1104,7 +1103,7 @@ check if there was a reason for that.
- (void) moveBackwardAndModifySelection: (id)sender
{
unsigned int to = [self _movementOrigin];
NSUInteger to = [self _movementOrigin];
if (to == 0)
return;
@ -1116,7 +1115,7 @@ check if there was a reason for that.
- (void) moveForward: (id)sender
{
NSRange range = [self selectedRange];
unsigned int to = NSMaxRange(range);
NSUInteger to = NSMaxRange(range);
if (range.length == 0 && to != [_textStorage length])
{
@ -1129,7 +1128,7 @@ check if there was a reason for that.
- (void) moveForwardAndModifySelection: (id)sender
{
unsigned int to = [self _movementOrigin];
NSUInteger to = [self _movementOrigin];
if (to == [_textStorage length])
return;
@ -1141,8 +1140,8 @@ check if there was a reason for that.
- (void) moveWordBackward: (id)sender
{
NSRange range = [self selectedRange];
unsigned int newLocation;
unsigned int cIndex = range.location;
NSUInteger newLocation;
NSUInteger cIndex = range.location;
newLocation = [_textStorage nextWordFromIndex: cIndex
forward: NO];
@ -1152,7 +1151,7 @@ check if there was a reason for that.
- (void) moveWordBackwardAndModifySelection: (id)sender
{
unsigned int newLocation;
NSUInteger newLocation;
newLocation = [_textStorage nextWordFromIndex: [self _movementOrigin]
forward: NO];
@ -1162,8 +1161,8 @@ check if there was a reason for that.
- (void) moveWordForward: (id)sender
{
unsigned newLocation;
unsigned int cIndex = NSMaxRange([self selectedRange]);
NSUInteger newLocation;
NSUInteger cIndex = NSMaxRange([self selectedRange]);
newLocation = [_textStorage nextWordFromIndex: cIndex
forward: YES];
@ -1173,7 +1172,7 @@ check if there was a reason for that.
- (void) moveWordForwardAndModifySelection: (id)sender
{
unsigned newLocation;
NSUInteger newLocation;
newLocation = [_textStorage nextWordFromIndex: [self _movementOrigin]
forward: YES];
@ -1230,11 +1229,11 @@ check if there was a reason for that.
if (writingDirection == NSWritingDirectionRightToLeft)
{
[self moveWordBackward: sender];
[self moveWordBackward: sender];
}
else
{
[self moveWordForward: sender];
[self moveWordForward: sender];
}
}
@ -1249,11 +1248,11 @@ check if there was a reason for that.
if (writingDirection == NSWritingDirectionRightToLeft)
{
[self moveWordBackwardAndModifySelection: sender];
[self moveWordBackwardAndModifySelection: sender];
}
else
{
[self moveWordForwardAndModifySelection: sender];
[self moveWordForwardAndModifySelection: sender];
}
}
@ -1285,7 +1284,6 @@ check if there was a reason for that.
{
NSRange aRange = [self selectedRange];
aRange = [[_textStorage string] lineRangeForRange:
NSMakeRange(aRange.location, 0)];
[self _moveTo: aRange.location
@ -1305,9 +1303,9 @@ check if there was a reason for that.
- (void) _moveToEndOfParagraph: (id)sender modify:(BOOL)flag
{
NSRange aRange;
unsigned newLocation;
unsigned maxRange;
unsigned int cIndex;
NSUInteger newLocation;
NSUInteger maxRange;
NSUInteger cIndex;
if (flag)
{
@ -1381,7 +1379,7 @@ and layout is left-to-right */
- (void) moveToBeginningOfLine: (id)sender
{
NSRange range = [self selectedRange];
unsigned int cIndex = range.location;
NSUInteger cIndex = range.location;
[self _moveFrom: cIndex
direction: GSInsertionPointMoveLeft
@ -1398,7 +1396,7 @@ and layout is left-to-right */
- (void) moveToEndOfLine: (id)sender
{
unsigned int cIndex = NSMaxRange([self selectedRange]);
NSUInteger cIndex = NSMaxRange([self selectedRange]);
[self _moveFrom: cIndex
direction: GSInsertionPointMoveRight
@ -1421,10 +1419,10 @@ and layout is left-to-right */
*/
- (void) _pageDown: (id)sender modify: (BOOL)flag
{
float scrollDelta;
float oldOriginY;
float newOriginY;
unsigned int cIndex;
CGFloat scrollDelta;
CGFloat oldOriginY;
CGFloat newOriginY;
NSUInteger cIndex;
if (flag)
{
@ -1474,10 +1472,10 @@ and layout is left-to-right */
*/
- (void) _pageUp: (id)sender modify:(BOOL)flag
{
float scrollDelta;
float oldOriginY;
float newOriginY;
unsigned int cIndex;
CGFloat scrollDelta;
CGFloat oldOriginY;
CGFloat newOriginY;
NSUInteger cIndex;
if (flag)
{
@ -1592,7 +1590,7 @@ and layout is left-to-right */
- (void) selectLine: (id)sender
{
unsigned int start, end, cindex;
NSUInteger start, end, cindex;
cindex = [self _movementOrigin];
start = [_layoutManager characterIndexMoving: GSInsertionPointMoveLeft