summaryrefslogtreecommitdiff
path: root/macosx/PcsxrController.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-11 04:11:51 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-11 04:11:51 +0000
commit5174e012aae4d340b373c2d7c5d028d6e849d9f8 (patch)
tree56277e83cbce33072ed0dfe5ee7f3d3d8e32a3c0 /macosx/PcsxrController.m
parent287d77d5995567fcba738c97af558f36e51462ca (diff)
downloadpcsxr-5174e012aae4d340b373c2d7c5d028d6e849d9f8.tar.gz
Rewrote the file handling on Mac OS X.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@73141 e17a0e51-4ae3-4d35-97c3-1a29b211df97
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