diff src/macterm.c @ 46121:2198a6632b2b

In mac: 2002-07-01 Andrew Choi <akochoi@shaw.ca> * Emacs.app/Contents/Resources/Emacs.icns: New file. * Emacs.app/Contents/Info.plist: Add CFBundleDocumentTypes and CFBundleIconFile entries. In src: 2002-07-01 Andrew Choi <akochoi@shaw.ca> * macterm.c (do_ae_open_documents) [MAC_OSX]: Call FSpMakeFSRef and FSRefMakePath to convert FSSpec returned with Apple Event to Posix pathname. (mac_initialize) [TARGET_API_MAC_CARBON]: Call init_required_apple_events and disable the `Quit' menu item provided automatically by the Carbon Toolbox.
author Andrew Choi <akochoi@shaw.ca>
date Mon, 01 Jul 2002 20:02:33 +0000
parents afcf154bf656
children 56be68853618
line wrap: on
line diff
--- a/src/macterm.c	Mon Jul 01 19:55:45 2002 +0000
+++ b/src/macterm.c	Mon Jul 01 20:02:33 2002 +0000
@@ -12123,20 +12123,31 @@
         int i;
         
         /* AE file list is one based so just use that for indexing here.  */
-        for (i = 1; (err == noErr) && (i <= num_files_to_open); i++) {
-          FSSpec fs;
-	  Str255 path_name, unix_path_name;
-
-          err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
-			    (Ptr) &fs, sizeof (fs), &actual_size);
-          if (err != noErr) break;
-
-	  if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
-				      fs.name) &&
-	      mac_to_posix_pathname (path_name, unix_path_name, 255))
-            drag_and_drop_file_list = Fcons (build_string (unix_path_name),
-					     drag_and_drop_file_list);
-        }
+        for (i = 1; (err == noErr) && (i <= num_files_to_open); i++)
+	  {
+	    FSSpec fs;
+	    Str255 path_name, unix_path_name;
+#ifdef MAC_OSX
+	    FSRef fref;
+#endif
+
+	    err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
+			      (Ptr) &fs, sizeof (fs), &actual_size);
+	    if (err != noErr) break;
+
+#ifdef MAC_OSX
+	    err = FSpMakeFSRef (&fs, &fref);
+	    if (err != noErr) break;
+
+	    if (FSRefMakePath (&fref, unix_path_name, 255) == noErr)
+#else
+	    if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
+					fs.name) &&
+		mac_to_posix_pathname (path_name, unix_path_name, 255))
+#endif
+	      drag_and_drop_file_list = Fcons (build_string (unix_path_name),
+					       drag_and_drop_file_list);
+	  }
       }
   }
 
@@ -13142,6 +13153,12 @@
 #endif
 
   mac_initialize_display_info ();
+
+#if TARGET_API_MAC_CARBON
+  init_required_apple_events ();
+
+  DisableMenuCommand (NULL, kHICommandQuit);
+#endif
 }