update signatures to match Apple (#120)

This commit is contained in:
Riccardo 2021-10-26 16:17:45 +02:00 committed by GitHub
parent 5e837b6858
commit 58359b8de3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

View file

@ -59,17 +59,19 @@ enum
NSTextStorageEditedCharacters = 2
};
typedef NSUInteger NSTextStorageEditedOptions;
/*
* The NSTextStorage
*/
@interface NSTextStorage : NSMutableAttributedString
{
NSRange _editedRange;
int _editedDelta;
NSInteger _editedDelta;
NSMutableArray *_layoutManagers;
id _delegate;
unsigned _editedMask;
unsigned _editCount;
NSTextStorageEditedOptions _editedMask;
NSUInteger _editCount;
}
- (void) addLayoutManager: (GSLayoutManager*)obj;
@ -98,7 +100,7 @@ enum
*
* the changeInLength is, well, positive if you added characters, negative
* if you removed characters. */
- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta;
- (void) edited: (NSTextStorageEditedOptions)mask range: (NSRange)old changeInLength: (NSInteger)delta;
/*
* This method is called to process the editing once it's finished.
@ -138,9 +140,9 @@ enum
* The delegate can use the following methods when it receives a
* notification that a change was made. The methods tell him what
* kind of change was made. */
- (unsigned) editedMask;
- (NSTextStorageEditedOptions) editedMask;
- (NSRange) editedRange;
- (int) changeInLength;
- (NSInteger) changeInLength;
- (void) setDelegate: (id)delegate;
- (id) delegate;

View file

@ -141,7 +141,7 @@ static NSNotificationCenter *nc = nil;
* The range argument to edited:... is the range in the original string
* (before the edit).
*/
- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta
- (void) edited: (NSTextStorageEditedOptions)mask range: (NSRange)old changeInLength: (NSInteger)delta
{
NSDebugLLog(@"NSText", @"edited:range:changeInLength: called");
@ -191,9 +191,9 @@ static NSNotificationCenter *nc = nil;
- (void) processEditing
{
NSRange r;
int original_delta;
NSInteger original_delta;
unsigned int i;
unsigned length;
NSUInteger length;
NSDebugLLog(@"NSText", @"processEditing called in NSTextStorage.");
@ -258,8 +258,8 @@ static NSNotificationCenter *nc = nil;
* correct values
*/
NSRange editedRange = _editedRange;
int editedDelta = _editedDelta;
unsigned editedMask = _editedMask;
NSInteger editedDelta = _editedDelta;
NSTextStorageEditedOptions editedMask = _editedMask;
/*
* edited values reset to be used again in the next pass.
@ -289,7 +289,7 @@ static NSNotificationCenter *nc = nil;
* during processEditing... editedRange.location will be NSNotFound if
* nothing has been edited.
*/
- (unsigned) editedMask
- (NSTextStorageEditedOptions) editedMask
{
return _editedMask;
}
@ -299,7 +299,7 @@ static NSNotificationCenter *nc = nil;
return _editedRange;
}
- (int) changeInLength
- (NSInteger) changeInLength
{
return _editedDelta;
}