]> code.delx.au - gnu-emacs/blobdiff - src/macfns.c
(selection-coding-system): Fix docstring.
[gnu-emacs] / src / macfns.c
index 51787067c290ec5cb65576c7bc3a265e5153c938..9cb9e3e04966632730f14562ad2238610895e474 100644 (file)
@@ -51,6 +51,14 @@ Boston, MA 02110-1301, USA.  */
 
 extern void free_frame_menubar ();
 
+#if TARGET_API_MAC_CARBON
+
+/* Carbon version info */
+
+static Lisp_Object Vmac_carbon_version_string;
+
+#endif /* TARGET_API_MAC_CARBON */
+
 /* Non-zero means we're allowed to display an hourglass cursor.  */
 
 int display_hourglass_p;
@@ -243,7 +251,7 @@ typedef struct colormap_t
   char *name;
 } colormap_t;
 
-colormap_t mac_color_map[] =
+static const colormap_t mac_color_map[] =
 {
   { RGB_TO_ULONG(255, 250, 250), "snow" },
   { RGB_TO_ULONG(248, 248, 255), "ghost white" },
@@ -1001,7 +1009,7 @@ colormap_t mac_color_map[] =
 
 Lisp_Object
 mac_color_map_lookup (colorname)
-     char *colorname;
+     const char *colorname;
 {
   Lisp_Object ret = Qnil;
   int i;
@@ -2253,9 +2261,6 @@ mac_window (f)
                   kWindowStandardDocumentAttributes
 #ifdef MAC_OSX
                   | kWindowToolbarButtonAttribute
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-                  | kWindowAsyncDragAttribute
-#endif
 #endif
                   , &r, &FRAME_MAC_WINDOW (f));
   if (FRAME_MAC_WINDOW (f))
@@ -4345,13 +4350,14 @@ If ONLY-DIR-P is non-nil, the user can only select directories.  */)
      (prompt, dir, default_filename, mustmatch, only_dir_p)
      Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
 {
-  struct frame *f = SELECTED_FRAME ();
   Lisp_Object file = Qnil;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char filename[MAXPATHLEN];
   static NavEventUPP mac_nav_event_callbackUPP = NULL;
 
+  check_mac ();
+
   GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
   CHECK_STRING (prompt);
   CHECK_STRING (dir);
@@ -4720,6 +4726,22 @@ such a font.  This is especially effective for such large fonts as
 Chinese, Japanese, and Korean.  */);
   Vx_pixel_size_width_font_regexp = Qnil;
 
+#if TARGET_API_MAC_CARBON
+  DEFVAR_LISP ("mac-carbon-version-string", &Vmac_carbon_version_string,
+    doc: /* Version info for Carbon API.  */);
+  {
+    OSErr err;
+    UInt32 response;
+    char carbon_version[16] = "Unknown";
+
+    err = Gestalt (gestaltCarbonVersion, &response);
+    if (err == noErr)
+      sprintf (carbon_version, "%u.%u.%u",
+              (response >> 8) & 0xf, (response >> 4) & 0xf, response & 0xf);
+    Vmac_carbon_version_string = build_string (carbon_version);
+  }
+#endif /* TARGET_API_MAC_CARBON */
+
   /* X window properties.  */
   defsubr (&Sx_change_window_property);
   defsubr (&Sx_delete_window_property);