mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
first step to get cocoa events
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1857 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
49
Source/Core/DolphinWX/Src/cocoaApp.m
Normal file
49
Source/Core/DolphinWX/Src/cocoaApp.m
Normal file
@ -0,0 +1,49 @@
|
||||
#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];
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user