Changeset 5002

Show
Ignore:
Timestamp:
10/24/07 03:15:20 (9 months ago)
Author:
morris
Message:

Clean up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredAdditions/trunk/NSEvent-WIAdditions.h

    r4958 r5002  
    2727 */ 
    2828 
    29 @interface NSEvent(WIEventAdditions) 
    30  
    3129#ifndef NSEscapeFunctionKey 
    3230#define NSEscapeFunctionKey                     27 
    3331#endif 
    3432 
     33@interface NSEvent(WIEventAdditions) 
    3534 
    3635- (unichar)character; 
  • WiredAdditions/trunk/NSFileManager-WIAdditions.m

    r4798 r5002  
    113113        BOOL    isDirectory; 
    114114 
    115         return [self fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory
     115        return ([self fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory)
    116116} 
    117117 
  • WiredAdditions/trunk/NSObject-WIAdditions.h

    r4874 r5002  
    3131+ (NSBundle *)bundle; 
    3232- (NSBundle *)bundle; 
     33 
     34+ (void)cancelPreviousPerformRequestsWithTarget:(id)target selector:(SEL)selector; 
    3335 
    3436- (void)performSelector:(SEL)selector afterDelay:(NSTimeInterval)delay; 
  • WiredAdditions/trunk/NSObject-WIAdditions.m

    r4957 r5002  
    4747#pragma mark - 
    4848 
     49+ (void)cancelPreviousPerformRequestsWithTarget:(id)target selector:(SEL)selector { 
     50        [NSObject cancelPreviousPerformRequestsWithTarget:target selector:selector object:NULL]; 
     51} 
     52 
     53 
     54#pragma mark - 
     55 
    4956- (void)performSelector:(SEL)selector afterDelay:(NSTimeInterval)delay { 
    5057        [self performSelector:selector withObject:NULL afterDelay:delay]; 
     
    5461 
    5562- (void)performSelectorOnce:(SEL)selector afterDelay:(NSTimeInterval)delay { 
    56         [self performSelectorOnce:selector withObject:NULL afterDelay:delay]; 
     63        [NSObject cancelPreviousPerformRequestsWithTarget:self selector:selector object:NULL]; 
     64        [self performSelector:selector withObject:NULL afterDelay:delay]; 
    5765} 
    5866 
  • WiredAdditions/trunk/NSString-WIAdditions.m

    r4960 r5002  
    5454        CFRelease(uuid); 
    5555 
    56         return [(NSString *)string autorelease]; 
     56        return [(NSString *) string autorelease]; 
    5757} 
    5858 
  • WiredAdditions/trunk/NSThread-WIAdditions.m

    r4438 r5002  
    3232 
    3333 
    34 @interface NSThread(Private) 
    35  
    36 + (void)_setMainThread; 
    37  
    38 @end 
    39  
    40  
    4134@implementation NSThread(WIThreadAdditions) 
    4235 
    4336+ (void)load { 
    44         [NSThread _setMainThread]; 
     37        WIMainThread = [NSThread currentThread]; 
    4538} 
    4639 
  • WiredAdditions/trunk/NSWindow-WIAdditions.h

    r4988 r5002  
    3232 
    3333- (BOOL)isOnScreen; 
    34 - (float)toolbarHeight; 
     34- (CGFloat)toolbarHeight; 
    3535 
    3636- (void)setPropertiesFromDictionary:(NSDictionary *)dictionary; 
  • WiredAdditions/trunk/NSWindow-WIAdditions.m

    r4988 r5002  
    5151 
    5252 
    53 - (float)toolbarHeight { 
     53- (CGFloat)toolbarHeight { 
    5454        NSToolbar       *toolbar; 
    5555         
  • WiredAdditions/trunk/WIApplication.h

    r4438 r5002  
    2828 
    2929@interface WIApplication : NSApplication { 
    30         NSTimeInterval                                                                         _terminationDelay
    31          
    32         IBOutlet NSWindow                                                                       *_releaseNotesWindow; 
    33         IBOutlet NSTextView                                                                    *_releaseNotesTextView
     30        IBOutlet NSWindow                              *_releaseNotesWindow
     31        IBOutlet NSTextView                            *_releaseNotesTextView; 
     32 
     33        NSTimeInterval                                 _terminationDelay
    3434} 
    35  
    36  
    37 #define WIApplicationDidChangeActiveNotification                @"WIApplicationDidChangeActiveNotification" 
    38 #define WIApplicationDidChangeFlagsNotification                 @"WIApplicationDidChangeFlagsNotification" 
    39  
    4035 
    4136- (NSApplicationTerminateReply)runTerminationDelayPanelWithTimeInterval:(NSTimeInterval)delay; 
     
    4439 
    4540@end 
     41 
     42 
     43#define WIApplicationDidChangeActiveNotification                @"WIApplicationDidChangeActiveNotification" 
     44#define WIApplicationDidChangeFlagsNotification                 @"WIApplicationDidChangeFlagsNotification" 
  • WiredAdditions/trunk/WIEventQueue.h

    r4971 r5002  
    4949 
    5050 
    51 #define WIEventFileDeleteNotification                   @"WIEventFileDeleteNotification" 
    52 #define WIEventFileWriteNotification                    @"WIEventFileWriteNotification" 
    53 #define WIEventFileExtendNotification                   @"WIEventFileExtendNotification" 
    54 #define WIEventFileAttributeChangeNotification  @"WIEventFileAttributeChangeNotification" 
    55 #define WIEventFileLinkCountChangeNotification  @"WIEventFileLinkCountChangeNotification" 
    56 #define WIEventFileRenameNotification                   @"WIEventFileRenameNotification" 
    57 #define WIEventFileRevokeNotification                   @"WIEventFileRevokeNotification" 
    58  
    59  
    6051+ (WIEventQueue *)sharedQueue; 
    6152 
     
    6657 
    6758@end 
     59 
     60 
     61#define WIEventFileDeleteNotification                   @"WIEventFileDeleteNotification" 
     62#define WIEventFileWriteNotification                    @"WIEventFileWriteNotification" 
     63#define WIEventFileExtendNotification                   @"WIEventFileExtendNotification" 
     64#define WIEventFileAttributeChangeNotification  @"WIEventFileAttributeChangeNotification" 
     65#define WIEventFileLinkCountChangeNotification  @"WIEventFileLinkCountChangeNotification" 
     66#define WIEventFileRenameNotification                   @"WIEventFileRenameNotification" 
     67#define WIEventFileRevokeNotification                   @"WIEventFileRevokeNotification" 
  • WiredAdditions/trunk/WIGraphView.m

    r4438 r5002  
    191191        NSInteger               i, inPoints, outPoints; 
    192192         
    193         // --- draw background 
    194193        [_canvas setSize:rect.size]; 
    195194        [_canvas lockFocus]; 
     
    198197        [_canvas unlockFocus]; 
    199198         
    200         // --- get sizes 
    201199        inPoints = [_inData count]; 
    202200        outPoints = [_outData count]; 
    203201         
    204         // --- get in data range 
    205202        if(inPoints < rect.size.width / 3.0) { 
    206203                inData = _inData; 
     
    213210        } 
    214211         
    215         // --- get out data range 
    216212        if(outPoints < rect.size.width / 3.0) { 
    217213                outData = _outData; 
     
    224220        } 
    225221         
    226         // --- get maximum values 
    227222        inMax = inPoints > 0 ? [[inData maximumNumber] doubleValue] : 0.0; 
    228223        outMax = outPoints > 0 ? [[outData maximumNumber] doubleValue] : 0.0; 
     
    230225         
    231226        if(outPoints > 0) { 
    232                 // --- set initial out point, starting at right side 
    233227                height = max > 0.0 
    234228                        ? (rect.size.height - 1.0) * ([[outData objectAtIndex:0] doubleValue] / max) 
     
    239233                [path moveToPoint:point]; 
    240234 
    241                 // --- connect out points 
    242235                for(i = 1; i < outPoints; i++) { 
    243236                        height = max > 0.0 
     
    251244                [path closePath]; 
    252245 
    253                 // --- draw out 
    254246                [_canvas lockFocus]; 
    255247                [_outColor set]; 
     
    263255         
    264256        if(inPoints > 0.0) { 
    265                 // --- set initial in point, starting at right side 
    266257                height = max > 0.0 
    267258                        ? rect.size.height * ([[inData objectAtIndex:0] doubleValue] / max) 
     
    272263                [path moveToPoint:point]; 
    273264                 
    274                 // --- connect in points 
    275265                for(i = 1; i < inPoints; i++) { 
    276266                        height = max > 0.0 
     
    284274                [path closePath]; 
    285275                 
    286                 // --- draw in 
    287276                [_canvas lockFocus]; 
    288277                [_inColor set]; 
     
    295284        } 
    296285         
    297         // --- draw image 
    298286        [_canvas compositeToPoint:rect.origin operation:NSCompositeSourceOver]; 
    299287} 
  • WiredAdditions/trunk/WIImageViewWithImagePicker.m

    r4837 r5002  
    205205 
    206206- (id)initWithCoder:(NSCoder *)coder { 
    207         if((self = [super initWithCoder:coder])) 
    208                 [self _initImageViewWithImagePicker]; 
     207        self = [super initWithCoder:coder]; 
     208         
     209        [self _initImageViewWithImagePicker]; 
    209210     
    210211        return self; 
     
    214215 
    215216- (id)initWithFrame:(NSRect)frame { 
    216         if((self = [super initWithFrame:frame])) 
    217                 [self _initImageViewWithImagePicker]; 
     217        self = [super initWithFrame:frame]; 
     218         
     219        [self _initImageViewWithImagePicker]; 
    218220 
    219221        return self; 
  • WiredAdditions/trunk/WIProgressIndicator.h

    r4438 r5002  
    3131} 
    3232 
    33  
    3433- (void)setTag:(NSInteger)tag; 
    3534- (NSInteger)tag; 
  • WiredAdditions/trunk/WIReadWriteLock.h

    r4438 r5002  
    4242} 
    4343 
    44  
    4544- (BOOL)tryLockForReading; 
    4645- (BOOL)tryLockForWriting; 
  • WiredAdditions/trunk/WISearchField.m

    r4438 r5002  
    9393 
    9494- (id)initWithFrame:(NSRect)frame { 
    95         if((self = [super initWithFrame:frame])) 
    96                 [self _initSearchField]; 
     95        self = [super initWithFrame:frame]; 
     96 
     97        [self _initSearchField]; 
    9798         
    9899        return self; 
     
    102103 
    103104- (id)initWithCoder:(NSCoder *)coder { 
    104         if((self = [super initWithCoder:coder]))         
    105                 [self _initSearchField]; 
     105        self = [super initWithCoder:coder]; 
     106                 
     107        [self _initSearchField]; 
    106108         
    107109        return self; 
  • WiredAdditions/trunk/WISplitView.h

    r4438 r5002  
    3131} 
    3232 
    33  
    3433- (void)setAutosaveName:(NSString *)value; 
    3534- (NSString *)autosaveName; 
  • WiredAdditions/trunk/WISplitView.m

    r4438 r5002  
    3838 
    3939@end 
    40  
    4140 
    4241 
     
    8483 
    8584- (id)initWithFrame:(NSRect)rect { 
    86         if((self = [super initWithFrame:rect])) 
    87                 [self _initSplitView]; 
     85        self = [super initWithFrame:rect]; 
     86 
     87        [self _initSplitView]; 
    8888     
    8989        return self; 
     
    9393 
    9494- (id)initWithCoder:(NSCoder *)coder { 
    95         if((self = [super initWithCoder:coder])) 
    96                 [self _initSplitView]; 
     95        self = [super initWithCoder:coder]; 
     96         
     97        [self _initSplitView]; 
    9798     
    9899        return self; 
  • WiredAdditions/trunk/WITextView.h

    r4438 r5002  
    3333} 
    3434 
    35  
    3635- (void)setString:(NSString *)string withFilter:(WITextFilter *)filter; 
    3736- (void)appendString:(NSString *)string withFilter:(WITextFilter *)filter; 
  • WiredAdditions/trunk/WIWindowController.m

    r4956 r5002  
    185185 
    186186- (id)initWithWindow:(NSWindow *)window { 
    187         if((self = [super initWithWindow:window])) 
    188                 [self _initWindowController]; 
    189  
    190         return self; 
    191 
    192  
    193  
    194  
    195 - (id)initWithWindowNibName:(NSString *)windowNibName { 
    196         if((self = [super initWithWindowNibName:windowNibName])) 
    197                 [self _initWindowController]; 
    198          
     187        self = [super initWithWindow:window]; 
     188 
     189        [self _initWindowController]; 
     190 
    199191        return self; 
    200192}