summaryrefslogtreecommitdiff
path: root/macosx/PcsxrController.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/PcsxrController.m')
-rw-r--r--macosx/PcsxrController.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m
index 987d9820..d284354d 100644
--- a/macosx/PcsxrController.m
+++ b/macosx/PcsxrController.m
@@ -2,6 +2,8 @@
#import "PcsxrController.h"
#import "ConfigurationController.h"
#import "EmuThread.h"
+#import "PcsxrMemCardHandler.h"
+#import "PcsxrPluginHandler.h"
#include "psxcommon.h"
#include "plugins.h"
#include "misc.h"
@@ -447,4 +449,28 @@ NSString *saveStatePath;
return NO;
}
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ NSString *utiFile = [[NSWorkspace sharedWorkspace] typeOfFile:filename error:nil];
+ if(UTTypeEqual((CFStringRef)@"com.codeplex.pcsxr.plugin", (CFStringRef)utiFile)) {
+ PcsxrPluginHandler *hand = [[PcsxrPluginHandler alloc] init];
+ BOOL isHandled = [hand handleFile:filename];
+ [hand release];
+ return isHandled;
+ } else if(UTTypeEqual((CFStringRef)@"com.codeplex.pcsxr.memcard", (CFStringRef)utiFile)) {
+ PcsxrMemCardHandler *hand = [[PcsxrMemCardHandler alloc] init];
+ BOOL isHandled = [hand handleFile:filename];
+ [hand release];
+ return isHandled;
+ } else if(UTTypeEqual((CFStringRef)@"com.codeplex.pcsxr.freeze", (CFStringRef)utiFile)) {
+ //TODO: handle freeze states
+ return NO;
+ } else if(UTTypeEqual((CFStringRef)@"com.codeplex.pcsxr.mdfdisc", (CFStringRef)utiFile) || UTTypeEqual((CFStringRef)@"com.apple.disk-image-ndif", (CFStringRef)utiFile) || UTTypeEqual((CFStringRef)@"public.iso-image", (CFStringRef)utiFile)) {
+ //TODO: handle ISOs and family
+ return NO;
+ } else {
+ return NO;
+ }
+}
+
@end