source: trunk/aux/cocotron/win32/cocotron/cocotron-r628.patch @ 12754

Last change on this file since 12754 was 12754, checked in by palter, 11 years ago

Bring us up to Cocotron r628

File size: 4.6 KB
  • Foundation/NSUserDefaults/NSUserDefaults.m

     
    313313}
    314314
    315315-(NSInteger)integerForKey:(NSString *)defaultName {
    316    NSNumber *number=[self objectForKey:defaultName];
     316   id number=[self objectForKey:defaultName];
    317317
    318    return [number isKindOfClass:objc_lookUpClass("NSNumber")]?[number intValue]:0;
     318   return [number isKindOfClass:objc_lookUpClass("NSString")]?[(NSString *)number intValue]:
     319     ([number isKindOfClass:objc_lookUpClass("NSNumber")]?[(NSNumber *)number intValue]:0);
    319320}
    320321
    321322
    322323-(float)floatForKey:(NSString *)defaultName {
    323    NSNumber *number=[self objectForKey:defaultName];
     324   id number=[self objectForKey:defaultName];
    324325
    325    return [number isKindOfClass:objc_lookUpClass("NSNumber")]?[number floatValue]:0.0f;
     326   return [number isKindOfClass:objc_lookUpClass("NSString")]?[(NSString *)number floatValue]:
     327     ([number isKindOfClass:objc_lookUpClass("NSNumber")]?[(NSNumber *)number floatValue]:0.0);
     328
    326329}
    327330
    328331-(void)setObject:value forKey:(NSString *)key {
     
    338341}
    339342
    340343-(void)setInteger:(NSInteger)value forKey:(NSString *)defaultName {
    341    [self setObject:[NSNumber numberWithInteger:value] forKey:defaultName];
     344  [self setObject:[NSString stringWithFormat: @"%d",value] forKey:defaultName];
    342345}
    343346
    344347-(void)setFloat:(float)value forKey:(NSString *)defaultName {
    345    [self setObject:[NSNumber numberWithFloat:value] forKey:defaultName];
     348  [self setObject:[NSString stringWithFormat: @"%f",value] forKey:defaultName];
    346349}
    347350
    348351-(void)removeObjectForKey:(NSString *)key {
  • AppKit/NSApplication.h

     
    99#import <AppKit/NSResponder.h>
    1010#import <AppKit/AppKitExport.h>
    1111#import <AppKit/NSGraphics.h>
     12#import <AppKit/NSWindow.h>
    1213
    13 @class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay;
     14@class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay, NSWindowController, NSDocument;
    1415
    1516APPKIT_EXPORT NSString *NSModalPanelRunLoopMode;
    1617APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode;
     
    209210@end
    210211
    211212@interface NSObject(NSApplication_serviceRequest)
     213
    212214-(BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types;
    213215@end
    214216
  • AppKit/NSApplication.m

     
    2929#import <AppKit/CGWindow.h>
    3030#import <AppKit/NSRaise.h>
    3131#import <objc/message.h>
     32#import <AppKit/NSWindow.h>
    3233
    3334NSString *NSModalPanelRunLoopMode=@"NSModalPanelRunLoopMode";
    3435NSString *NSEventTrackingRunLoopMode=@"NSEventTrackingRunLoopMode";
     
    413414       needsUntitled = [_delegate applicationShouldOpenUntitledFile: self];
    414415   }
    415416
     417   if(needsUntitled && _delegate && [_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) {
     418     needsUntitled = ![_delegate applicationOpenUntitledFile: self];
     419   }
     420                                                 
     421
    416422   if(needsUntitled && controller && ![controller documentClassForType:[controller defaultType]]) {
    417423       needsUntitled = NO;
    418424   }
     
    466472}
    467473
    468474-(void)run {
    469    
    470    NSAutoreleasePool *pool=[NSAutoreleasePool new];
    471    [self finishLaunching];
    472    [pool release];
     475  static BOOL didlaunch = NO;
     476  NSAutoreleasePool *pool;
     477
     478  _isRunning=YES;
     479
     480  if (!didlaunch) {
     481    didlaunch = YES;
     482    pool=[NSAutoreleasePool new];
     483    [self finishLaunching];
     484    [pool release];
     485  }
    473486   
    474    _isRunning=YES;
    475487   
    476488   do {
    477489       pool = [NSAutoreleasePool new];
  • AppKit/NSDocument.m

     
    2121
    2222@implementation NSDocument
    2323
     24static int untitled_document_number = 0;
     25
    2426+(NSArray *)readableTypes {
    2527   int             i;
    2628   NSArray        *knownDocTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDocumentTypes"];
     
    98100      _fileURL=nil;
    99101      _fileType=nil;
    100102      _changeCount=0;
    101       _untitledNumber=0;
     103      _untitledNumber=untitled_document_number++;
    102104      _hasUndoManager=YES;
    103105      _activeEditors=[NSMutableArray new];
    104106    }
     
    344346{
    345347  if(_fileURL==nil)
    346348    {
    347       if(_untitledNumber > 1)
     349      if(_untitledNumber != 0)
    348350        return [NSString stringWithFormat:@"Untitled %d", _untitledNumber];
    349351      else
    350352        return @"Untitled";
Note: See TracBrowser for help on using the repository browser.