diff options
Diffstat (limited to 'src/SDLMain.m')
| -rw-r--r-- | src/SDLMain.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SDLMain.m b/src/SDLMain.m index b6216af..3298fc2 100644 --- a/src/SDLMain.m +++ b/src/SDLMain.m @@ -9,6 +9,7 @@ #include "SDLMain.h" #include <sys/param.h> /* for MAXPATHLEN */ #include <unistd.h> +#include "defines.h" /* For some reaon, Apple removed setAppleMenu from the headers in 10.4, but the method still is there and works. To avoid warnings, we declare @@ -282,6 +283,21 @@ static void CustomApplicationMain (int argc, char **argv) return TRUE; } +- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +{ + NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]]; + int tempSaveOpen = [[url host] intValue]; + if(tempSaveOpen > 0) + saveURIOpen = tempSaveOpen; +} + +-(void)applicationWillFinishLaunching:(NSNotification *)aNotification +{ + NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; + [appleEventManager setEventHandler:self + andSelector:@selector(handleGetURLEvent:withReplyEvent:) + forEventClass:kInternetEventClass andEventID:kAEGetURL]; +} /* Called when the internal event loop has just started running */ - (void) applicationDidFinishLaunching: (NSNotification *) note |
