diff --git a/Source/NSSound.m b/Source/NSSound.m index 00d2c5c2f..a54e0b9ac 100644 --- a/Source/NSSound.m +++ b/Source/NSSound.m @@ -46,7 +46,7 @@ static NSDictionary *nsmapping = nil; @implementation NSBundle (NSSoundAdditions) -- (NSString *)pathForSoundResource:(NSString *)name +- (NSString *) pathForSoundResource: (NSString *)name { NSString *ext = [name pathExtension]; NSString *path = nil; @@ -75,15 +75,15 @@ static NSDictionary *nsmapping = nil; @protocol GSSoundSvr -- (BOOL)playSound:(id)aSound; +- (BOOL) playSound: (id)aSound; -- (BOOL)stopSoundWithIdentifier:(NSString *)identifier; +- (BOOL) stopSoundWithIdentifier: (NSString *)identifier; -- (BOOL)pauseSoundWithIdentifier:(NSString *)identifier; +- (BOOL) pauseSoundWithIdentifier: (NSString *)identifier; -- (BOOL)resumeSoundWithIdentifier:(NSString *)identifier; +- (BOOL) resumeSoundWithIdentifier: (NSString *)identifier; -- (BOOL)isPlayingSoundWithIdentifier:(NSString *)identifier; +- (BOOL) isPlayingSoundWithIdentifier: (NSString *)identifier; @end @@ -91,32 +91,32 @@ static id the_server = nil; @interface NSSound (PrivateMethods) -+ (id)gsnd; ++ (id) gsnd; -+ (void)localServer:(id)s; ++ (void) localServer: (id)s; -+ (id)lostServer:(NSNotification*)notification; ++ (id) lostServer: (NSNotification*)notification; -- (BOOL)getDataFromFileAtPath:(NSString *)path; +- (BOOL) getDataFromFileAtPath: (NSString *)path; -- (void)setIdentifier:(NSString *)identifier; +- (void) setIdentifier: (NSString *)identifier; -- (NSString *)identifier; +- (NSString *) identifier; -- (float)samplingRate; +- (float) samplingRate; -- (float)frameSize; +- (float) frameSize; -- (long)frameCount; +- (long) frameCount; -- (NSData *)data; +- (NSData *) data; @end @implementation NSSound (PrivateMethods) #ifdef HAVE_AUDIOFILE_H -+ (id)gsnd ++ (id) gsnd { if (the_server == nil) { @@ -234,12 +234,12 @@ static id the_server = nil; return the_server; } -+ (void)localServer:(id)s ++ (void) localServer: (id)s { the_server = s; } -+ (id)lostServer:(NSNotification*)notification ++ (id) lostServer: (NSNotification*)notification { id obj = the_server; @@ -252,7 +252,7 @@ static id the_server = nil; return self; } -- (BOOL)getDataFromFileAtPath:(NSString *)path +- (BOOL) getDataFromFileAtPath: (NSString *)path { AFfilehandle file; AFframecount framesRead; @@ -301,53 +301,53 @@ return NO; \ #else /* No sound software */ -+ (id)gsnd ++ (id) gsnd { return nil; } -+ (void)localServer:(id)s ++ (void) localServer: (id)s { } -+ (id)lostServer:(NSNotification*)notification ++ (id) lostServer: (NSNotification*)notification { return self; } -- (BOOL)getDataFromFileAtPath:(NSString *)path +- (BOOL) getDataFromFileAtPath: (NSString *)path { NSLog(@"NSSound: No sound software installed, cannot get sound"); return NO; } #endif -- (void)setIdentifier:(NSString *)identifier +- (void) setIdentifier: (NSString *)identifier { ASSIGN (uniqueIdentifier, identifier); } -- (NSString *)identifier +- (NSString *) identifier { return uniqueIdentifier; } -- (float)samplingRate +- (float) samplingRate { return samplingRate; } -- (float)frameSize +- (float) frameSize { return frameSize; } -- (long)frameCount +- (long) frameCount { return frameCount; } -- (NSData *)data +- (NSData *) data { return data; } @@ -356,7 +356,7 @@ return NO; \ @implementation NSSound -+ (void)initialize ++ (void) initialize { if (self == [NSSound class]) { @@ -383,7 +383,7 @@ return NO; \ } } -- (void)dealloc +- (void) dealloc { TEST_RELEASE (data); if (name && self == [nameDict objectForKey: name]) @@ -398,7 +398,7 @@ return NO; \ // // Creating an NSSound // -- (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef +- (id) initWithContentsOfFile: (NSString *)path byReference:(BOOL)byRef { self = [super init]; @@ -417,19 +417,19 @@ return NO; \ return self; } -- (id)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef +- (id) initWithContentsOfURL: (NSURL *)url byReference:(BOOL)byRef { onlyReference = byRef; return [self initWithData: [NSData dataWithContentsOfURL: url]]; } -- (id)initWithData:(NSData *)data +- (id) initWithData: (NSData *)data { [self notImplemented: _cmd]; return nil; } -- (id)initWithPasteboard:(NSPasteboard *)pasteboard +- (id) initWithPasteboard: (NSPasteboard *)pasteboard { if ([NSSound canInitWithPasteboard: pasteboard] == YES) { @@ -442,7 +442,7 @@ return NO; \ // // Playing // -- (BOOL)pause +- (BOOL) pause { if (uniqueIdentifier) { @@ -451,12 +451,12 @@ return NO; \ return NO; } -- (BOOL)play +- (BOOL) play { return [[NSSound gsnd] playSound: self]; } -- (BOOL)resume +- (BOOL) resume { if (uniqueIdentifier) { @@ -465,7 +465,7 @@ return NO; \ return NO; } -- (BOOL)stop +- (BOOL) stop { if (uniqueIdentifier) { @@ -474,7 +474,7 @@ return NO; \ return NO; } -- (BOOL)isPlaying +- (BOOL) isPlaying { if (uniqueIdentifier) { @@ -486,7 +486,7 @@ return NO; \ // // Working with pasteboards // -+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard ++ (BOOL) canInitWithPasteboard: (NSPasteboard *)pasteboard { NSArray *pbTypes = [pasteboard types]; NSArray *myTypes = [NSSound soundUnfilteredPasteboardTypes]; @@ -494,12 +494,12 @@ return NO; \ return ([pbTypes firstObjectCommonWithArray: myTypes] != nil); } -+ (NSArray *)soundUnfilteredPasteboardTypes ++ (NSArray *) soundUnfilteredPasteboardTypes { return [NSArray arrayWithObjects: @"NSGeneralPboardType", nil]; } -- (void)writeToPasteboard:(NSPasteboard *)pasteboard +- (void) writeToPasteboard: (NSPasteboard *)pasteboard { NSData *d = [NSArchiver archivedDataWithRootObject: self]; @@ -513,12 +513,12 @@ return NO; \ // // Working with delegates // -- (id)delegate +- (id) delegate { return delegate; } -- (void)setDelegate:(id)aDelegate +- (void) setDelegate: (id)aDelegate { delegate = aDelegate; } @@ -526,32 +526,32 @@ return NO; \ // // Naming Sounds // -+ (id)soundNamed:(NSString *)aName ++ (id) soundNamed: (NSString*)name { - NSString *realName = [nsmapping objectForKey: aName]; + NSString *realName = [nsmapping objectForKey: name]; NSSound *sound; if (realName) { - aName = realName; + name = realName; } - sound = (NSSound *)[nameDict objectForKey: aName]; + sound = (NSSound *)[nameDict objectForKey: name]; if (sound == nil) { - NSString *extension; - NSString *path = nil; - NSBundle *main_bundle; + NSString *extension; + NSString *path = nil; + NSBundle *main_bundle; NSArray *array; - NSString *the_name = aName; + NSString *the_name = name; // FIXME: This should use [NSBundle pathForSoundResource], but this will // only allow soundUnfilteredFileTypes. /* If there is no sound with that name, search in the main bundle */ main_bundle = [NSBundle mainBundle]; - extension = [aName pathExtension]; + extension = [name pathExtension]; if (extension != nil && [extension length] == 0) { @@ -565,14 +565,14 @@ return NO; \ { /* Extension is one of the sound types So remove from the name */ - the_name = [aName stringByDeletingPathExtension]; + the_name = [name stringByDeletingPathExtension]; } else { /* Otherwise extension is not an sound type So leave it alone */ - the_name = aName; + the_name = name; extension = nil; } @@ -655,7 +655,7 @@ return NO; \ if (sound != nil) { - [sound setName: aName]; + [sound setName: name]; RELEASE(sound); sound->onlyReference = YES; } @@ -667,17 +667,17 @@ return NO; \ return sound; } -+ (NSArray *)soundUnfilteredFileTypes ++ (NSArray *) soundUnfilteredFileTypes { return [NSArray arrayWithObjects: @"aiff", @"waw", @"snd", @"au", nil]; } -- (NSString *)name +- (NSString *) name { return name; } -- (BOOL)setName:(NSString *)aName +- (BOOL) setName: (NSString *)aName { BOOL retained = NO; @@ -709,7 +709,7 @@ return NO; \ // // NSCoding // -- (void)encodeWithCoder:(NSCoder *)coder +- (void) encodeWithCoder: (NSCoder *)coder { [coder encodeValueOfObjCType: @encode(BOOL) at: &onlyReference]; [coder encodeObject: name]; @@ -736,7 +736,7 @@ return NO; \ [coder encodeObject: data]; } -- (id)initWithCoder:(NSCoder*)decoder +- (id) initWithCoder: (NSCoder*)decoder { [decoder decodeValueOfObjCType: @encode(BOOL) at: &onlyReference]; @@ -795,7 +795,7 @@ return NO; \ return self; } -- (id)awakeAfterUsingCoder:(NSCoder *)coder +- (id) awakeAfterUsingCoder: (NSCoder *)coder { return self; } @@ -803,7 +803,7 @@ return NO; \ // // NSCopying // -- (id)copyWithZone:(NSZone *)zone +- (id) copyWithZone: (NSZone *)zone { NSSound *newSound = (NSSound *)NSCopyObject(self, 0, zone); diff --git a/Source/NSStepperCell.m b/Source/NSStepperCell.m index b48f269a0..08af77059 100644 --- a/Source/NSStepperCell.m +++ b/Source/NSStepperCell.m @@ -85,9 +85,9 @@ return _increment; } -- (void) setIncrement: (double)newIncrement +- (void) setIncrement: (double)increment { - _increment = newIncrement; + _increment = increment; } diff --git a/Source/NSStringDrawing.m b/Source/NSStringDrawing.m index f223cdb67..2a30647db 100644 --- a/Source/NSStringDrawing.m +++ b/Source/NSStringDrawing.m @@ -1141,42 +1141,41 @@ sizeAttributedString(NSAttributedString *str, NSString *allText, NSRange aRange) } // GNUstep extensions. -- (NSSize) sizeRange: (NSRange) lineRange +- (NSSize) sizeRange: (NSRange)aRange { - return sizeAttributedString(self, [self string], lineRange); + return sizeAttributedString(self, [self string], aRange); } -- (void) drawRange: (NSRange) lineRange atPoint: (NSPoint) point +- (void) drawRange: (NSRange)aRange atPoint: (NSPoint)aPoint { NSGraphicsContext *ctxt = GSCurrentContext(); - drawAttributedString(self, [self string], lineRange, point, NO_R_MARGIN, - ctxt); + drawAttributedString(self, [self string], aRange, aPoint, NO_R_MARGIN, ctxt); } -- (void) drawRange: (NSRange) lineRange inRect: (NSRect)rect +- (void) drawRange: (NSRange)aRange inRect: (NSRect)aRect { NSPoint point; NSView *view = [NSView focusView]; /* FIXME: This is an extremely lossy and temporary workaround for - the fact that we should draw only inside rect. */ + the fact that we should draw only inside aRect. */ NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); - NSRectClip (rect); + NSRectClip (aRect); /* * Since [-drawAtPoint:] positions the top-left corner of the text at * the point, we locate the top-left corner of the rectangle to do the * drawing. */ - point.x = rect.origin.x; + point.x = aRect.origin.x; if ([view isFlipped]) - point.y = rect.origin.y; + point.y = aRect.origin.y; else - point.y = rect.origin.y + rect.size.height; + point.y = aRect.origin.y + aRect.size.height; - drawAttributedString(self, [self string], lineRange, point, rect.size.width, + drawAttributedString(self, [self string], aRange, point, aRect.size.width, ctxt); /* Restore matching the DPSgsave used in the temporary workaround */ DPSgrestore(ctxt); @@ -1230,7 +1229,7 @@ sizeAttributedString(NSAttributedString *str, NSString *allText, NSRange aRange) } // GNUstep extensions. -- (NSSize) sizeRange: (NSRange) lineRange +- (NSSize) sizeRange: (NSRange)lineRange { return sizeAttributedString(self, _textChars, lineRange); }