Hook in AppController as delegate for application, add file associations to property...
[chocolate-doom.git] / pkg / osx / AppController.m
blobbf72af635c539b8b6a18b1dbb818087c6fb0ae51
1 /* ... */
2 //-----------------------------------------------------------------------------
3 //
4 // Copyright(C) 2009 Simon Howard
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 // 02111-1307, USA.
21 //-----------------------------------------------------------------------------
23 #include "AppController.h"
25 @implementation AppController
27 + (void)initialize
29     NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
31     /*
32      * Register your app's defaults here by adding objects to the
33      * dictionary, eg
34      *
35      * [defaults setObject:anObject forKey:keyForThatObject];
36      *
37      */
39     [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
40     [[NSUserDefaults standardUserDefaults] synchronize];
43 - (id)init
45     if ((self = [super init]))
46     {
47     }
49     return self;
52 - (void)dealloc
54     [super dealloc];
57 - (void)awakeFromNib
59     [[NSApp mainMenu] setTitle:@"ChocolateDoom"];
62 - (void)applicationDidFinishLaunching:(NSNotification *)aNotif
64 // Uncomment if your application is Renaissance-based
65 //  [NSBundle loadGSMarkupNamed:@"Main" owner:self];
68 - (BOOL)applicationShouldTerminate:(id)sender
70     return YES;
73 - (void)applicationWillTerminate:(NSNotification *)aNotif
77 - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
79     printf("File selected to open: '%s'\n", [fileName UTF8String]);
80     return NO;
83 - (void)showPrefPanel:(id)sender
87 @end