2023-04-22 15:11:06 +00:00
|
|
|
//
|
|
|
|
// PSPNSApplicationDelegate.mm
|
|
|
|
// PPSSPP
|
|
|
|
//
|
|
|
|
// Created by Serena on 22/04/2023.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2023-07-06 16:39:13 +00:00
|
|
|
|
2023-04-22 15:11:06 +00:00
|
|
|
#import "PSPNSApplicationDelegate.h"
|
2023-07-06 16:39:13 +00:00
|
|
|
|
|
|
|
#include "Common/System/System.h"
|
2023-04-22 15:11:06 +00:00
|
|
|
#include "Core/SaveState.h"
|
2023-04-22 15:12:42 +00:00
|
|
|
#include "Core/Config.h"
|
2023-04-22 15:11:06 +00:00
|
|
|
|
|
|
|
@implementation PSPNSApplicationDelegate
|
|
|
|
+ (instancetype)sharedAppDelegate {
|
|
|
|
static PSPNSApplicationDelegate *del;
|
|
|
|
static dispatch_once_t onceToken;
|
|
|
|
dispatch_once(&onceToken, ^{
|
|
|
|
del = [PSPNSApplicationDelegate new];
|
|
|
|
});
|
|
|
|
|
|
|
|
return del;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls {
|
|
|
|
NSURL *firstURL = urls.firstObject;
|
|
|
|
if (!firstURL) return; // No URLs, don't do anything
|
|
|
|
|
2023-09-30 09:21:22 +00:00
|
|
|
System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, firstURL.fileSystemRepresentation);
|
2023-04-22 15:11:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSMenu *)applicationDockMenu:(NSApplication *)sender {
|
2024-01-27 10:09:11 +00:00
|
|
|
// TODO: Actually implement a dock menu thingy.
|
2023-04-22 15:11:06 +00:00
|
|
|
for (std::string iso : g_Config.RecentIsos()) {
|
2024-01-27 10:09:11 +00:00
|
|
|
// printf("%s\n", iso.c_str());
|
2023-04-22 15:11:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
@end
|