mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-28 18:33:14 +00:00
a255ea66cf
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1857 8ced0084-cf51-0410-be5f-012b33b47a6e
50 lines
1.1 KiB
Objective-C
50 lines
1.1 KiB
Objective-C
#import "cocoaApp.h"
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
@implementation NSApplication(i)
|
|
- (void)appRunning
|
|
{
|
|
_running = 1;
|
|
}
|
|
@end
|
|
|
|
@interface cocoaAppDelegate : NSObject
|
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
|
@end
|
|
|
|
@implementation cocoaAppDelegate : NSObject
|
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
|
{
|
|
return NSTerminateCancel;
|
|
}
|
|
@end
|
|
|
|
void cocoaCreateApp()
|
|
{
|
|
ProcessSerialNumber psn;
|
|
NSAutoreleasePool *pool;
|
|
|
|
if (!GetCurrentProcess(&psn)) {
|
|
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
|
SetFrontProcess(&psn);
|
|
}
|
|
|
|
pool = [[NSAutoreleasePool alloc] init];
|
|
|
|
if (NSApp == nil) {
|
|
[NSApplication sharedApplication];
|
|
//TODO : Create menu
|
|
[NSApp finishLaunching];
|
|
}
|
|
|
|
if ([NSApp delegate] == nil) {
|
|
[NSApp setDelegate:[[cocoaAppDelegate alloc] init]];
|
|
}
|
|
|
|
[NSApp appRunning];
|
|
|
|
[pool release];
|
|
|
|
}
|
|
|