src/video/cocoa/SDL_cocoaevents.m
changeset 1936 83946ee0ff1f
parent 1932 dc864bcabcc4
child 1937 05e88d266921
equal deleted inserted replaced
1935:8a9b367a80f3 1936:83946ee0ff1f
    28 @interface NSApplication(NSAppleMenu)
    28 @interface NSApplication(NSAppleMenu)
    29 - (void)setAppleMenu:(NSMenu *)menu;
    29 - (void)setAppleMenu:(NSMenu *)menu;
    30 @end
    30 @end
    31 #endif
    31 #endif
    32 
    32 
    33 @interface SDLApplication : NSApplication
    33 @implementation NSApplication(SDL)
       
    34 - (void)setRunning
    34 {
    35 {
    35 }
       
    36 - (void)finishLaunching;
       
    37 @end
       
    38 
       
    39 @implementation SDLApplication
       
    40 
       
    41 - (void)finishLaunching
       
    42 {
       
    43     [super finishLaunching];
       
    44     _running = 1;
    36     _running = 1;
    45 }
    37 }
    46 
       
    47 @end
    38 @end
    48 
    39 
    49 static NSString *
    40 static NSString *
    50 GetApplicationName(void)
    41 GetApplicationName(void)
    51 {
    42 {
   139         SetFrontProcess(&psn);
   130         SetFrontProcess(&psn);
   140     }
   131     }
   141 
   132 
   142     pool = [[NSAutoreleasePool alloc] init];
   133     pool = [[NSAutoreleasePool alloc] init];
   143     if (NSApp == nil) {
   134     if (NSApp == nil) {
   144         [SDLApplication sharedApplication];
   135         [NSApplication sharedApplication];
   145 
   136 
   146         if ([NSApp mainMenu] == nil) {
   137         if ([NSApp mainMenu] == nil) {
   147             CreateApplicationMenus();
   138             CreateApplicationMenus();
   148         }
   139         }
   149         [NSApp finishLaunching];
   140         [NSApp finishLaunching];
   150     }
   141     }
       
   142     [NSApp setRunning];
   151     [pool release];
   143     [pool release];
   152 }
   144 }
   153 
   145 
   154 void
   146 void
   155 Cocoa_PumpEvents(_THIS)
   147 Cocoa_PumpEvents(_THIS)