1 #include <Foundation/Foundation.h>
2 #include <AppKit/AppKit.h>
5 @interface perl_SDLMain : NSObject
8 @interface SDLApplication : NSApplication
11 static jmp_buf jmpbuf;
13 @implementation perl_SDLMain
15 - (void) applicationDidFinishLaunching: (NSNotification *) note
17 fprintf(stderr,"Finished launching\n");
23 extern void setApplicationMenu(void);
24 extern void setupWindowMenu(void);
26 static NSAutoreleasePool* pool = NULL;
27 static perl_SDLMain* perl_sdlMain = NULL;
33 // Allocate pool so Cocoa can refcount
34 pool = [[NSAutoreleasePool alloc] init];
36 // Create the application
37 [SDLApplication sharedApplication];
39 [NSApp setMainMenu: [[NSMenu alloc] init]];
40 // setApplicationMenu();
43 perl_sdlMain = [[perl_SDLMain alloc] init];
44 [NSApp setDelegate: perl_sdlMain];
46 // fprintf(stderr,"Calling [NSapp run]\n");
47 // if (0 == setjmp(jmpbuf)) {
50 // fprintf(stderr, "Returned from that nasty [NSApp run]");
57 [perl_sdlMain release];