foxygit / doom Log in
commit d109ab268f7c7d140bf76d30b4526ef836e070fe
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Jan 9 18:38:48 2010 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Jan 9 18:38:48 2010 +0000

    Hook in AppController as delegate for application, add file associations
    to property list file.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1792
---
 pkg/osx/AppController.m                            |   1 +
 pkg/osx/Info.plist.in                              |  30 +++++++++++++++++++++
 .../Contents/Resources/launcher.nib/classes.nib    |   6 +++++
 .../Contents/Resources/launcher.nib/info.nib       |   4 +--
 .../Resources/launcher.nib/keyedobjects.nib        | Bin 17192 -> 17360 bytes
 5 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/pkg/osx/AppController.m b/pkg/osx/AppController.m
index 81dc56a9..bf72af63 100644
--- a/pkg/osx/AppController.m
+++ b/pkg/osx/AppController.m
@@ -76,6 +76,7 @@

 - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
 {
+    printf("File selected to open: '%s'\n", [fileName UTF8String]);
     return NO;
 }

diff --git a/pkg/osx/Info.plist.in b/pkg/osx/Info.plist.in
index a7a33b84..8b19777f 100644
--- a/pkg/osx/Info.plist.in
+++ b/pkg/osx/Info.plist.in
@@ -26,5 +26,35 @@
 	<string>NSApplication</string>
 	<key>NSMainNibFile</key>
 	<string>launcher</string>
+
+        <!-- file associations: -->
+
+        <key>CFBundleDocumentTypes</key>
+        <array>
+                <dict>
+                        <key>CFBundleTypeName</key>
+                        <string>Doom WAD file</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>app.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>wad</string>
+                        </array>
+                </dict>
+                <dict>
+                        <key>CFBundleTypeName</key>
+                        <string>Dehacked patch</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>app.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>deh</string>
+                        </array>
+                </dict>
+        </array>
 </dict>
 </plist>
diff --git a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
index 9092e44b..3ff47e71 100644
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
+++ b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
@@ -1,5 +1,11 @@
 {
     IBClasses = (
+        {
+            CLASS = AppController;
+            LANGUAGE = ObjC;
+            OUTLETS = {launcherManager = id; };
+            SUPERCLASS = NSObject;
+        },
         {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
         {
             ACTIONS = {closeConfigWindow = id; openConfigWindow = id; };
diff --git a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
index 63067b23..aecf812a 100644
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
+++ b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>IBDocumentLocation</key>
-	<string>172 70 612 260 0 0 1440 878 </string>
+	<string>170 140 612 260 0 0 1440 878 </string>
 	<key>IBEditorPositions</key>
 	<dict>
 		<key>29</key>
@@ -13,9 +13,9 @@
 	<string>446.1</string>
 	<key>IBOpenObjects</key>
 	<array>
+		<integer>21</integer>
 		<integer>29</integer>
 		<integer>227</integer>
-		<integer>21</integer>
 	</array>
 	<key>IBSystem Version</key>
 	<string>8S2167</string>
diff --git a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib
index 85980d2d..345ce976 100644
Binary files a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib and b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib differ