various arch modifications, mainly for file download support
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageThreads.h"
|
||||
#include "RageLog.h"
|
||||
#include "CommandLineActions.h"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "ProductInfo.h"
|
||||
@@ -69,11 +71,34 @@
|
||||
exit( SM_main(m_iArgc, m_pArgv) );
|
||||
}
|
||||
|
||||
/* From here:
|
||||
* http://www.cocoadev.com/index.pl?HowToRegisterURLHandler */
|
||||
- (void) getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
{
|
||||
const char *url = [[[event paramDescriptorForKeyword:keyDirectObject] stringValue] UTF8String];
|
||||
|
||||
LOG->Info("Parsing URL: %s", url);
|
||||
|
||||
// I'm not sure this handles everything it needs to. - Colby
|
||||
CommandLineActions::CommandLineArgs args;
|
||||
args.argv.push_back(url);
|
||||
|
||||
CommandLineActions::ToProcess.push_back(args);
|
||||
}
|
||||
|
||||
// Called when the internal event loop has just started running.
|
||||
- (void) applicationDidFinishLaunching:(NSNotification *)note
|
||||
{
|
||||
m_bApplicationLaunched = YES;
|
||||
[NSThread detachNewThreadSelector:@selector(startGame:) toTarget:self withObject:nil];
|
||||
|
||||
// Register ourselves as a URL handler.
|
||||
[
|
||||
[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
|
||||
andSelector:@selector(getUrl:withReplyEvent:)
|
||||
forEventClass:kInternetEventClass
|
||||
andEventID:kAEGetURL
|
||||
];
|
||||
}
|
||||
|
||||
- (BOOL) application:(NSApplication *)app openFile:(NSString *)file
|
||||
|
||||
Reference in New Issue
Block a user