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

@ -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> 2013-02-16 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSWindowDecorationView.h * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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