]> code.delx.au - gnu-emacs/blobdiff - src/macfns.c
*** empty log message ***
[gnu-emacs] / src / macfns.c
index 617167dfc467295010ee8aecd9717b47684f105b..f9a5f051eb4667b975763707fe1f96bfe879ff63 100644 (file)
@@ -210,15 +210,6 @@ void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object,
-                                     Lisp_Object));
-void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object,
-                                     Lisp_Object));
-static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
-                                                            Lisp_Object,
-                                                            Lisp_Object,
-                                                            char *, char *,
-                                                            int));
 
 extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
 
@@ -1033,7 +1024,7 @@ Lisp_Object
 x_to_mac_color (colorname)
      char * colorname;
 {
-  register Lisp_Object tail, ret = Qnil;
+  register Lisp_Object ret = Qnil;
 
   BLOCK_INPUT;
 
@@ -1368,7 +1359,6 @@ x_set_mouse_color (f, arg, oldval)
      Lisp_Object arg, oldval;
 {
   struct x_output *x = f->output_data.x;
-  Display *dpy = FRAME_MAC_DISPLAY (f);
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
   Cursor hourglass_cursor, horizontal_drag_cursor;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
@@ -1897,7 +1887,7 @@ x_set_scroll_bar_default_width (f)
   int wid = FRAME_COLUMN_WIDTH (f);
 
 #ifdef MAC_OSX
-  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16;  /* Aqua scroll bars.  */
+  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH;
   FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
                                      wid - 1) / wid;
 #else /* not MAC_OSX */
@@ -1911,6 +1901,24 @@ x_set_scroll_bar_default_width (f)
 #endif /* not MAC_OSX */
 }
 
+void
+mac_set_scroll_bar_width (f, arg, oldval)
+     struct frame *f;
+     Lisp_Object arg, oldval;
+{
+#ifdef MAC_OSX
+  if (INTEGERP (arg) && XINT (arg) > 0)
+    {
+      if (XINT (arg) < (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH
+                       + MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) / 2)
+       XSETINT (arg, MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH);
+      else
+       XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH);
+    }
+#endif
+  x_set_scroll_bar_width (f, arg, oldval);
+}
+
 \f
 /* Subroutines of creating a frame.  */
 
@@ -2378,7 +2386,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
   struct mac_display_info *dpyinfo = NULL;
   Lisp_Object parent;
   struct kboard *kb;
-  static int x_frame_count = 2;  /* begins at 2 because terminal frame is F1 */
 
   check_mac ();
 
@@ -2901,23 +2908,25 @@ If omitted or nil, that stands for the selected frame's display.  */)
   BLOCK_INPUT;
   err = Gestalt (gestaltSystemVersion, &response);
   if (err == noErr)
-    if (response >= 0x00001040)
-      {
-       err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
-       if (err == noErr)
-         err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
-       if (err == noErr)
-         err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
-      }
-    else
-      {
-       bugfix = response & 0xf;
-       response >>= 4;
-       minor = response & 0xf;
-       response >>= 4;
-       /* convert BCD to int */
-       major = response - (response >> 4) * 6;
-      }
+    {
+      if (response >= 0x00001040)
+       {
+         err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
+         if (err == noErr)
+           err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
+         if (err == noErr)
+           err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
+       }
+      else
+       {
+         bugfix = response & 0xf;
+         response >>= 4;
+         minor = response & 0xf;
+         response >>= 4;
+         /* convert BCD to int */
+         major = response - (response >> 4) * 6;
+       }
+    }
   UNBLOCK_INPUT;
 
   if (err != noErr)
@@ -3201,6 +3210,14 @@ DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
   return Qnil;
 }
 
+/* x_sync is a no-op on Mac.  */
+
+void
+x_sync (f)
+     FRAME_PTR f;
+{
+}
+
 \f
 /***********************************************************************
                            Window properties
@@ -3582,6 +3599,7 @@ x_create_tip_frame (dpyinfo, parms, text)
 
   check_mac ();
 
+  parms = Fcopy_alist (parms);
 
 #ifdef MULTI_KBOARD
   kb = dpyinfo->kboard;
@@ -4177,7 +4195,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories.  */)
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char filename[MAXPATHLEN];
-  int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
   static NavEventUPP mac_nav_event_callbackUPP = NULL;
 
   GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
@@ -4373,7 +4390,7 @@ frame_parm_handler mac_frame_parm_handlers[] =
   x_set_menu_bar_lines,
   x_set_mouse_color,
   x_explicitly_set_name,
-  x_set_scroll_bar_width,
+  mac_set_scroll_bar_width,
   x_set_title,
   x_set_unsplittable,
   x_set_vertical_scroll_bars,