aboutsummaryrefslogtreecommitdiffstats
path: root/mac/src
diff options
context:
space:
mode:
authorAndrew Choi2001-02-27 14:33:20 +0000
committerAndrew Choi2001-02-27 14:33:20 +0000
commit2e875e36887608b9e677bf4a3b45acfe6041ff06 (patch)
tree35225137b6f6bffc2dd80e1e1fd61f3976cadb56 /mac/src
parentc0cb1027c5273b57e67a989ba91189e7916d5b32 (diff)
downloademacs-2e875e36887608b9e677bf4a3b45acfe6041ff06.tar.gz
emacs-2e875e36887608b9e677bf4a3b45acfe6041ff06.zip
* src/macfns.c: Rename everything containing *busy_cursor* and
similar to *hourglass*. Change IMAGE_POSITIVE_INTEGER_VALUE to IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR throughout. (x_set_font): If font hasn't changed, avoid recomputing faces and other things, as in xfns.c. (Qcancel_timer): New variable. (syms_of_macfns): Rename x-busy-pointer-shape to x-hourglass-pointer-shape, display-busy-cursor to display-hourglass, busy-cursor-delay to hourglass-delay, as in xfns.c. (x_set_tool_bar_lines): Modify as in xfns.c (x_change_window_heights): New function. * inc/macterm.h (struct x_output): Rename busy_cursor to hourglass_cursor, busy_window to hourglass_window, busy_p to hourglass_p, as in xterm.h. * src/macmenu.c (set_frame_menubar): Run activate-menu-bar-hook with safe_run_hooks, as in xmenu.c. * src/macterm.c (do_check_ram_size): New function. * src/Emacs.r: Add ALRT resource #129 for alert when there is over 256 MB RAM.
Diffstat (limited to 'mac/src')
-rw-r--r--mac/src/Emacs.r39
-rw-r--r--mac/src/macfns.c462
-rw-r--r--mac/src/macmenu.c2
-rw-r--r--mac/src/macterm.c21
4 files changed, 367 insertions, 157 deletions
diff --git a/mac/src/Emacs.r b/mac/src/Emacs.r
index 4a66d7cf49c..12ed6562744 100644
--- a/mac/src/Emacs.r
+++ b/mac/src/Emacs.r
@@ -139,9 +139,42 @@ resource 'DITL' (128, purgeable) {
139 {10, 60, 72, 278}, 139 {10, 60, 72, 278},
140 StaticText { 140 StaticText {
141 disabled, 141 disabled,
142 "GNU Emacs 21.0.90 for Mac OS\n" 142 "GNU Emacs 21.0.99 for Mac OS\n"
143 "(11 October 2000 release)\n" 143 "(27 February 2001 release)\n"
144 "Report bugs to akochoi@users.sourceforge.net" 144 "Report bugs to emacs-pretest-bug@gnu.org"
145 }
146 }
147};
148
149resource 'ALRT' (129, "Ram Too Large", purgeable) {
150 {40, 20, 160, 297},
151 129,
152 { /* array: 4 elements */
153 /* [1] */
154 OK, visible, silent,
155 /* [2] */
156 OK, visible, silent,
157 /* [3] */
158 OK, visible, silent,
159 /* [4] */
160 OK, visible, silent
161 },
162 centerMainScreen
163};
164
165resource 'DITL' (129, purgeable) {
166 { /* array DITLarray: 2 elements */
167 /* [1] */
168 {88, 185, 108, 265},
169 Button {
170 enabled,
171 "OK"
172 },
173 /* [2] */
174 {10, 60, 72, 278},
175 StaticText {
176 disabled,
177 "Emacs does not run on a Macintosh with more than 256 MB of physical or virtual memory"
145 } 178 }
146 } 179 }
147}; 180};
diff --git a/mac/src/macfns.c b/mac/src/macfns.c
index 7bf97d88cc2..851b4d98036 100644
--- a/mac/src/macfns.c
+++ b/mac/src/macfns.c
@@ -102,24 +102,25 @@ unsigned char *gray_bitmap_bits = gray_bits;
102 102
103Lisp_Object Vx_resource_name; 103Lisp_Object Vx_resource_name;
104 104
105/* Non nil if no window manager is in use. */ 105/* Non-zero means we're allowed to display an hourglass cursor. */
106
107Lisp_Object Vx_no_window_manager;
108 106
109/* Non-zero means we're allowed to display a busy cursor. */ 107int display_hourglass_p;
110
111int display_busy_cursor_p;
112 108
113/* The background and shape of the mouse pointer, and shape when not 109/* The background and shape of the mouse pointer, and shape when not
114 over text or in the modeline. */ 110 over text or in the modeline. */
115 111
116Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; 112Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
117Lisp_Object Vx_busy_pointer_shape; 113Lisp_Object Vx_hourglass_pointer_shape;
118 114
119/* The shape when over mouse-sensitive text. */ 115/* The shape when over mouse-sensitive text. */
120 116
121Lisp_Object Vx_sensitive_text_pointer_shape; 117Lisp_Object Vx_sensitive_text_pointer_shape;
122 118
119/* If non-nil, the pointer shape to indicate that windows can be
120 dragged horizontally. */
121
122Lisp_Object Vx_window_horizontal_drag_shape;
123
123/* Color of chars displayed in cursor box. */ 124/* Color of chars displayed in cursor box. */
124 125
125Lisp_Object Vx_cursor_fore_pixel; 126Lisp_Object Vx_cursor_fore_pixel;
@@ -128,6 +129,10 @@ Lisp_Object Vx_cursor_fore_pixel;
128 129
129static int mac_in_use; 130static int mac_in_use;
130 131
132/* Non nil if no window manager is in use. */
133
134Lisp_Object Vx_no_window_manager;
135
131/* Search path for bitmap files. */ 136/* Search path for bitmap files. */
132 137
133Lisp_Object Vx_bitmap_file_path; 138Lisp_Object Vx_bitmap_file_path;
@@ -203,6 +208,7 @@ Lisp_Object Quser_size;
203Lisp_Object Qscreen_gamma; 208Lisp_Object Qscreen_gamma;
204Lisp_Object Qline_spacing; 209Lisp_Object Qline_spacing;
205Lisp_Object Qcenter; 210Lisp_Object Qcenter;
211Lisp_Object Qcancel_timer;
206Lisp_Object Qhyper; 212Lisp_Object Qhyper;
207Lisp_Object Qsuper; 213Lisp_Object Qsuper;
208Lisp_Object Qmeta; 214Lisp_Object Qmeta;
@@ -280,7 +286,7 @@ have_menus_p ()
280} 286}
281 287
282/* Extract a frame as a FRAME_PTR, defaulting to the selected frame 288/* Extract a frame as a FRAME_PTR, defaulting to the selected frame
283 and checking validity for W32. */ 289 and checking validity for Mac. */
284 290
285FRAME_PTR 291FRAME_PTR
286check_x_frame (frame) 292check_x_frame (frame)
@@ -2128,7 +2134,6 @@ x_set_mouse_color (f, arg, oldval)
2128 struct frame *f; 2134 struct frame *f;
2129 Lisp_Object arg, oldval; 2135 Lisp_Object arg, oldval;
2130{ 2136{
2131
2132 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; 2137 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor;
2133 int count; 2138 int count;
2134 int mask_color; 2139 int mask_color;
@@ -2168,14 +2173,14 @@ x_set_mouse_color (f, arg, oldval)
2168 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr); 2173 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
2169 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); 2174 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
2170 2175
2171 if (!EQ (Qnil, Vx_busy_pointer_shape)) 2176 if (!EQ (Qnil, Vx_hourglass_pointer_shape))
2172 { 2177 {
2173 CHECK_NUMBER (Vx_busy_pointer_shape, 0); 2178 CHECK_NUMBER (Vx_hourglass_pointer_shape, 0);
2174 busy_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), 2179 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
2175 XINT (Vx_busy_pointer_shape)); 2180 XINT (Vx_hourglass_pointer_shape));
2176 } 2181 }
2177 else 2182 else
2178 busy_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch); 2183 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch);
2179 x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s"); 2184 x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
2180 2185
2181 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); 2186 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
@@ -2199,6 +2204,17 @@ x_set_mouse_color (f, arg, oldval)
2199 else 2204 else
2200 cross_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair); 2205 cross_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair);
2201 2206
2207 if (!NILP (Vx_window_horizontal_drag_shape))
2208 {
2209 CHECK_NUMBER (Vx_window_horizontal_drag_shape, 0);
2210 horizontal_drag_cursor
2211 = XCreateFontCursor (FRAME_X_DISPLAY (f),
2212 XINT (Vx_window_horizontal_drag_shape));
2213 }
2214 else
2215 horizontal_drag_cursor
2216 = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow);
2217
2202 /* Check and report errors with the above calls. */ 2218 /* Check and report errors with the above calls. */
2203 x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s"); 2219 x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
2204 x_uncatch_errors (FRAME_W32_DISPLAY (f), count); 2220 x_uncatch_errors (FRAME_W32_DISPLAY (f), count);
@@ -2224,7 +2240,7 @@ x_set_mouse_color (f, arg, oldval)
2224 &fore_color, &back_color); 2240 &fore_color, &back_color);
2225 XRecolorCursor (FRAME_W32_DISPLAY (f), cross_cursor, 2241 XRecolorCursor (FRAME_W32_DISPLAY (f), cross_cursor,
2226 &fore_color, &back_color); 2242 &fore_color, &back_color);
2227 XRecolorCursor (FRAME_W32_DISPLAY (f), busy_cursor, 2243 XRecolorCursor (FRAME_W32_DISPLAY (f), hourglass_cursor,
2228 &fore_color, &back_color); 2244 &fore_color, &back_color);
2229 } 2245 }
2230 2246
@@ -2240,10 +2256,10 @@ x_set_mouse_color (f, arg, oldval)
2240 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor); 2256 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor);
2241 f->output_data.w32->nontext_cursor = nontext_cursor; 2257 f->output_data.w32->nontext_cursor = nontext_cursor;
2242 2258
2243 if (busy_cursor != f->output_data.w32->busy_cursor 2259 if (hourglass_cursor != f->output_data.w32->hourglass_cursor
2244 && f->output_data.w32->busy_cursor != 0) 2260 && f->output_data.w32->hourglass_cursor != 0)
2245 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->busy_cursor); 2261 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hourglass_cursor);
2246 f->output_data.w32->busy_cursor = busy_cursor; 2262 f->output_data.w32->hourglass_cursor = hourglass_cursor;
2247 2263
2248 if (mode_cursor != f->output_data.w32->modeline_cursor 2264 if (mode_cursor != f->output_data.w32->modeline_cursor
2249 && f->output_data.w32->modeline_cursor != 0) 2265 && f->output_data.w32->modeline_cursor != 0)
@@ -2510,6 +2526,8 @@ x_set_font (f, arg, oldval)
2510 error ("The characters of the given font have varying widths"); 2526 error ("The characters of the given font have varying widths");
2511 else if (STRINGP (result)) 2527 else if (STRINGP (result))
2512 { 2528 {
2529 if (!NILP (Fequal (result, oldval)))
2530 return;
2513 store_frame_param (f, Qfont, result); 2531 store_frame_param (f, Qfont, result);
2514 recompute_basic_faces (f); 2532 recompute_basic_faces (f);
2515 } 2533 }
@@ -2587,6 +2605,36 @@ x_set_visibility (f, value, oldval)
2587 Fmake_frame_visible (frame); 2605 Fmake_frame_visible (frame);
2588} 2606}
2589 2607
2608
2609/* Change window heights in windows rooted in WINDOW by N lines. */
2610
2611static void
2612x_change_window_heights (window, n)
2613 Lisp_Object window;
2614 int n;
2615{
2616 struct window *w = XWINDOW (window);
2617
2618 XSETFASTINT (w->top, XFASTINT (w->top) + n);
2619 XSETFASTINT (w->height, XFASTINT (w->height) - n);
2620
2621 if (INTEGERP (w->orig_top))
2622 XSETFASTINT (w->orig_top, XFASTINT (w->orig_top) + n);
2623 if (INTEGERP (w->orig_height))
2624 XSETFASTINT (w->orig_height, XFASTINT (w->orig_height) - n);
2625
2626 /* Handle just the top child in a vertical split. */
2627 if (!NILP (w->vchild))
2628 x_change_window_heights (w->vchild, n);
2629
2630 /* Adjust all children in a horizontal split. */
2631 for (window = w->hchild; !NILP (window); window = w->next)
2632 {
2633 w = XWINDOW (window);
2634 x_change_window_heights (window, n);
2635 }
2636}
2637
2590void 2638void
2591x_set_menu_bar_lines (f, value, oldval) 2639x_set_menu_bar_lines (f, value, oldval)
2592 struct frame *f; 2640 struct frame *f;
@@ -2636,7 +2684,12 @@ x_set_tool_bar_lines (f, value, oldval)
2636 struct frame *f; 2684 struct frame *f;
2637 Lisp_Object value, oldval; 2685 Lisp_Object value, oldval;
2638{ 2686{
2639 int delta, nlines; 2687 int delta, nlines, root_height;
2688 Lisp_Object root_window;
2689
2690 /* Treat tool bars like menu bars. */
2691 if (FRAME_MINIBUF_ONLY_P (f))
2692 return;
2640 2693
2641 /* Use VALUE only if an integer >= 0. */ 2694 /* Use VALUE only if an integer >= 0. */
2642 if (INTEGERP (value) && XINT (value) >= 0) 2695 if (INTEGERP (value) && XINT (value) >= 0)
@@ -2648,10 +2701,48 @@ x_set_tool_bar_lines (f, value, oldval)
2648 ++windows_or_buffers_changed; 2701 ++windows_or_buffers_changed;
2649 2702
2650 delta = nlines - FRAME_TOOL_BAR_LINES (f); 2703 delta = nlines - FRAME_TOOL_BAR_LINES (f);
2704
2705 /* Don't resize the tool-bar to more than we have room for. */
2706 root_window = FRAME_ROOT_WINDOW (f);
2707 root_height = XINT (XWINDOW (root_window)->height);
2708 if (root_height - delta < 1)
2709 {
2710 delta = root_height - 1;
2711 nlines = FRAME_TOOL_BAR_LINES (f) + delta;
2712 }
2713
2651 FRAME_TOOL_BAR_LINES (f) = nlines; 2714 FRAME_TOOL_BAR_LINES (f) = nlines;
2652 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2715 x_change_window_heights (root_window, delta);
2653 do_pending_window_change (0);
2654 adjust_glyphs (f); 2716 adjust_glyphs (f);
2717
2718 /* We also have to make sure that the internal border at the top of
2719 the frame, below the menu bar or tool bar, is redrawn when the
2720 tool bar disappears. This is so because the internal border is
2721 below the tool bar if one is displayed, but is below the menu bar
2722 if there isn't a tool bar. The tool bar draws into the area
2723 below the menu bar. */
2724 if (FRAME_MAC_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
2725 {
2726 updating_frame = f;
2727 clear_frame ();
2728 clear_current_matrices (f);
2729 updating_frame = NULL;
2730 }
2731
2732 /* If the tool bar gets smaller, the internal border below it
2733 has to be cleared. It was formerly part of the display
2734 of the larger tool bar, and updating windows won't clear it. */
2735 if (delta < 0)
2736 {
2737 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
2738 int width = PIXEL_WIDTH (f);
2739 int y = nlines * CANON_Y_UNIT (f);
2740
2741 BLOCK_INPUT;
2742 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
2743 0, y, width, height, 0);
2744 UNBLOCK_INPUT;
2745 }
2655} 2746}
2656 2747
2657 2748
@@ -3538,7 +3629,7 @@ This function is an internal primitive--use `make-frame' instead.")
3538 int minibuffer_only = 0; 3629 int minibuffer_only = 0;
3539 long window_prompting = 0; 3630 long window_prompting = 0;
3540 int width, height; 3631 int width, height;
3541 int count = specpdl_ptr - specpdl; 3632 int count = BINDING_STACK_SIZE ();
3542 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 3633 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
3543 Lisp_Object display; 3634 Lisp_Object display;
3544 struct mac_display_info *dpyinfo = NULL; 3635 struct mac_display_info *dpyinfo = NULL;
@@ -4473,6 +4564,7 @@ enum image_value_type
4473 IMAGE_STRING_VALUE, 4564 IMAGE_STRING_VALUE,
4474 IMAGE_SYMBOL_VALUE, 4565 IMAGE_SYMBOL_VALUE,
4475 IMAGE_POSITIVE_INTEGER_VALUE, 4566 IMAGE_POSITIVE_INTEGER_VALUE,
4567 IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
4476 IMAGE_NON_NEGATIVE_INTEGER_VALUE, 4568 IMAGE_NON_NEGATIVE_INTEGER_VALUE,
4477 IMAGE_ASCENT_VALUE, 4569 IMAGE_ASCENT_VALUE,
4478 IMAGE_INTEGER_VALUE, 4570 IMAGE_INTEGER_VALUE,
@@ -4577,6 +4669,15 @@ parse_image_spec (spec, keywords, nkeywords, type)
4577 return 0; 4669 return 0;
4578 break; 4670 break;
4579 4671
4672 case IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR:
4673 if (INTEGERP (value) && XINT (value) >= 0)
4674 break;
4675 if (CONSP (value)
4676 && INTEGERP (XCAR (value)) && INTEGERP (XCDR (value))
4677 && XINT (XCAR (value)) >= 0 && XINT (XCDR (value)) >= 0)
4678 break;
4679 return 0;
4680
4580 case IMAGE_ASCENT_VALUE: 4681 case IMAGE_ASCENT_VALUE:
4581 if (SYMBOLP (value) && EQ (value, Qcenter)) 4682 if (SYMBOLP (value) && EQ (value, Qcenter))
4582 break; 4683 break;
@@ -5021,10 +5122,10 @@ lookup_image (f, spec)
5021 /* If not found, create a new image and cache it. */ 5122 /* If not found, create a new image and cache it. */
5022 if (img == NULL) 5123 if (img == NULL)
5023 { 5124 {
5125 BLOCK_INPUT;
5024 img = make_image (spec, hash); 5126 img = make_image (spec, hash);
5025 cache_image (f, img); 5127 cache_image (f, img);
5026 img->load_failed_p = img->type->load (f, img) == 0; 5128 img->load_failed_p = img->type->load (f, img) == 0;
5027 xassert (!interrupt_input_blocked);
5028 5129
5029 /* If we can't load the image, and we don't have a width and 5130 /* If we can't load the image, and we don't have a width and
5030 height, use some arbitrary width and height so that we can 5131 height, use some arbitrary width and height so that we can
@@ -5322,9 +5423,9 @@ static struct image_keyword xbm_format[XBM_LAST] =
5322 {":foreground", IMAGE_STRING_VALUE, 0}, 5423 {":foreground", IMAGE_STRING_VALUE, 0},
5323 {":background", IMAGE_STRING_VALUE, 0}, 5424 {":background", IMAGE_STRING_VALUE, 0},
5324 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 5425 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
5325 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 5426 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
5326 {":relief", IMAGE_INTEGER_VALUE, 0}, 5427 {":relief", IMAGE_INTEGER_VALUE, 0},
5327 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 5428 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
5328 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 5429 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
5329}; 5430};
5330 5431
@@ -5912,9 +6013,9 @@ static struct image_keyword xpm_format[XPM_LAST] =
5912 {":file", IMAGE_STRING_VALUE, 0}, 6013 {":file", IMAGE_STRING_VALUE, 0},
5913 {":data", IMAGE_STRING_VALUE, 0}, 6014 {":data", IMAGE_STRING_VALUE, 0},
5914 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 6015 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
5915 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 6016 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
5916 {":relief", IMAGE_INTEGER_VALUE, 0}, 6017 {":relief", IMAGE_INTEGER_VALUE, 0},
5917 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 6018 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
5918 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 6019 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
5919 {":color-symbols", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 6020 {":color-symbols", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
5920}; 6021};
@@ -6602,9 +6703,9 @@ static struct image_keyword pbm_format[PBM_LAST] =
6602 {":file", IMAGE_STRING_VALUE, 0}, 6703 {":file", IMAGE_STRING_VALUE, 0},
6603 {":data", IMAGE_STRING_VALUE, 0}, 6704 {":data", IMAGE_STRING_VALUE, 0},
6604 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 6705 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
6605 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 6706 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
6606 {":relief", IMAGE_INTEGER_VALUE, 0}, 6707 {":relief", IMAGE_INTEGER_VALUE, 0},
6607 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 6708 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
6608 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 6709 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
6609}; 6710};
6610 6711
@@ -6958,9 +7059,9 @@ static struct image_keyword png_format[PNG_LAST] =
6958 {":data", IMAGE_STRING_VALUE, 0}, 7059 {":data", IMAGE_STRING_VALUE, 0},
6959 {":file", IMAGE_STRING_VALUE, 0}, 7060 {":file", IMAGE_STRING_VALUE, 0},
6960 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 7061 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
6961 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 7062 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
6962 {":relief", IMAGE_INTEGER_VALUE, 0}, 7063 {":relief", IMAGE_INTEGER_VALUE, 0},
6963 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 7064 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
6964 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 7065 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
6965}; 7066};
6966 7067
@@ -7444,9 +7545,9 @@ static struct image_keyword jpeg_format[JPEG_LAST] =
7444 {":data", IMAGE_STRING_VALUE, 0}, 7545 {":data", IMAGE_STRING_VALUE, 0},
7445 {":file", IMAGE_STRING_VALUE, 0}, 7546 {":file", IMAGE_STRING_VALUE, 0},
7446 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 7547 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
7447 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 7548 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
7448 {":relief", IMAGE_INTEGER_VALUE, 0}, 7549 {":relief", IMAGE_INTEGER_VALUE, 0},
7449 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 7550 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
7450 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 7551 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
7451}; 7552};
7452 7553
@@ -7807,9 +7908,9 @@ static struct image_keyword tiff_format[TIFF_LAST] =
7807 {":data", IMAGE_STRING_VALUE, 0}, 7908 {":data", IMAGE_STRING_VALUE, 0},
7808 {":file", IMAGE_STRING_VALUE, 0}, 7909 {":file", IMAGE_STRING_VALUE, 0},
7809 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 7910 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
7810 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 7911 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
7811 {":relief", IMAGE_INTEGER_VALUE, 0}, 7912 {":relief", IMAGE_INTEGER_VALUE, 0},
7812 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 7913 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
7813 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 7914 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
7814}; 7915};
7815 7916
@@ -8126,9 +8227,9 @@ static struct image_keyword gif_format[GIF_LAST] =
8126 {":data", IMAGE_STRING_VALUE, 0}, 8227 {":data", IMAGE_STRING_VALUE, 0},
8127 {":file", IMAGE_STRING_VALUE, 0}, 8228 {":file", IMAGE_STRING_VALUE, 0},
8128 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 8229 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
8129 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 8230 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
8130 {":relief", IMAGE_INTEGER_VALUE, 0}, 8231 {":relief", IMAGE_INTEGER_VALUE, 0},
8131 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 8232 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
8132 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 8233 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
8133 {":image", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0} 8234 {":image", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}
8134}; 8235};
@@ -8441,9 +8542,9 @@ static struct image_keyword gs_format[GS_LAST] =
8441 {":loader", IMAGE_FUNCTION_VALUE, 0}, 8542 {":loader", IMAGE_FUNCTION_VALUE, 0},
8442 {":bounding-box", IMAGE_DONT_CHECK_VALUE_TYPE, 1}, 8543 {":bounding-box", IMAGE_DONT_CHECK_VALUE_TYPE, 1},
8443 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 8544 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
8444 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 8545 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
8445 {":relief", IMAGE_INTEGER_VALUE, 0}, 8546 {":relief", IMAGE_INTEGER_VALUE, 0},
8446 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 8547 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
8447 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 8548 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
8448}; 8549};
8449 8550
@@ -8794,117 +8895,117 @@ value.")
8794 ***********************************************************************/ 8895 ***********************************************************************/
8795 8896
8796/* If non-null, an asynchronous timer that, when it expires, displays 8897/* If non-null, an asynchronous timer that, when it expires, displays
8797 a busy cursor on all frames. */ 8898 an hourglass cursor on all frames. */
8798 8899
8799static struct atimer *busy_cursor_atimer; 8900static struct atimer *hourglass_atimer;
8800 8901
8801/* Non-zero means a busy cursor is currently shown. */ 8902/* Non-zero means an hourglass cursor is currently shown. */
8802 8903
8803static int busy_cursor_shown_p; 8904static int hourglass_shown_p;
8804 8905
8805/* Number of seconds to wait before displaying a busy cursor. */ 8906/* Number of seconds to wait before displaying an hourglass cursor. */
8806 8907
8807static Lisp_Object Vbusy_cursor_delay; 8908static Lisp_Object Vhourglass_delay;
8808 8909
8809/* Default number of seconds to wait before displaying a busy 8910/* Default number of seconds to wait before displaying an hourglass
8810 cursor. */ 8911 cursor. */
8811 8912
8812#define DEFAULT_BUSY_CURSOR_DELAY 1 8913#define DEFAULT_HOURGLASS_DELAY 1
8813 8914
8814/* Function prototypes. */ 8915/* Function prototypes. */
8815 8916
8816static void show_busy_cursor P_ ((struct atimer *)); 8917static void show_hourglass P_ ((struct atimer *));
8817static void hide_busy_cursor P_ ((void)); 8918static void hide_hourglass P_ ((void));
8818 8919
8819 8920
8820/* Cancel a currently active busy-cursor timer, and start a new one. */ 8921/* Cancel a currently active hourglass timer, and start a new one. */
8821 8922
8822void 8923void
8823start_busy_cursor () 8924start_hourglass ()
8824{ 8925{
8825#if 0 /* MAC_TODO: cursor shape changes. */ 8926#if 0 /* TODO: cursor shape changes. */
8826 EMACS_TIME delay; 8927 EMACS_TIME delay;
8827 int secs, usecs = 0; 8928 int secs, usecs = 0;
8828 8929
8829 cancel_busy_cursor (); 8930 cancel_hourglass ();
8830 8931
8831 if (INTEGERP (Vbusy_cursor_delay) 8932 if (INTEGERP (Vhourglass_delay)
8832 && XINT (Vbusy_cursor_delay) > 0) 8933 && XINT (Vhourglass_delay) > 0)
8833 secs = XFASTINT (Vbusy_cursor_delay); 8934 secs = XFASTINT (Vhourglass_delay);
8834 else if (FLOATP (Vbusy_cursor_delay) 8935 else if (FLOATP (Vhourglass_delay)
8835 && XFLOAT_DATA (Vbusy_cursor_delay) > 0) 8936 && XFLOAT_DATA (Vhourglass_delay) > 0)
8836 { 8937 {
8837 Lisp_Object tem; 8938 Lisp_Object tem;
8838 tem = Ftruncate (Vbusy_cursor_delay, Qnil); 8939 tem = Ftruncate (Vhourglass_delay, Qnil);
8839 secs = XFASTINT (tem); 8940 secs = XFASTINT (tem);
8840 usecs = (XFLOAT_DATA (Vbusy_cursor_delay) - secs) * 1000000; 8941 usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000;
8841 } 8942 }
8842 else 8943 else
8843 secs = DEFAULT_BUSY_CURSOR_DELAY; 8944 secs = DEFAULT_HOURGLASS_DELAY;
8844 8945
8845 EMACS_SET_SECS_USECS (delay, secs, usecs); 8946 EMACS_SET_SECS_USECS (delay, secs, usecs);
8846 busy_cursor_atimer = start_atimer (ATIMER_RELATIVE, delay, 8947 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
8847 show_busy_cursor, NULL); 8948 show_hourglass, NULL);
8848#endif 8949#endif
8849} 8950}
8850 8951
8851 8952
8852/* Cancel the busy cursor timer if active, hide a busy cursor if 8953/* Cancel the hourglass cursor timer if active, hide an hourglass
8853 shown. */ 8954 cursor if shown. */
8854 8955
8855void 8956void
8856cancel_busy_cursor () 8957cancel_hourglass ()
8857{ 8958{
8858 if (busy_cursor_atimer) 8959 if (hourglass_atimer)
8859 { 8960 {
8860 cancel_atimer (busy_cursor_atimer); 8961 cancel_atimer (hourglass_atimer);
8861 busy_cursor_atimer = NULL; 8962 hourglass_atimer = NULL;
8862 } 8963 }
8863 8964
8864 if (busy_cursor_shown_p) 8965 if (hourglass_shown_p)
8865 hide_busy_cursor (); 8966 hide_hourglass ();
8866} 8967}
8867 8968
8868 8969
8869/* Timer function of busy_cursor_atimer. TIMER is equal to 8970/* Timer function of hourglass_atimer. TIMER is equal to
8870 busy_cursor_atimer. 8971 hourglass_atimer.
8871 8972
8872 Display a busy cursor on all frames by mapping the frames' 8973 Display an hourglass cursor on all frames by mapping the frames'
8873 busy_window. Set the busy_p flag in the frames' output_data.x 8974 hourglass_window. Set the hourglass_p flag in the frames'
8874 structure to indicate that a busy cursor is shown on the 8975 output_data.x structure to indicate that an hourglass cursor is
8875 frames. */ 8976 shown on the frames. */
8876 8977
8877static void 8978static void
8878show_busy_cursor (timer) 8979show_hourglass (timer)
8879 struct atimer *timer; 8980 struct atimer *timer;
8880{ 8981{
8881#if 0 /* MAC_TODO: cursor shape changes. */ 8982#if 0 /* MAC_TODO: cursor shape changes. */
8882 /* The timer implementation will cancel this timer automatically 8983 /* The timer implementation will cancel this timer automatically
8883 after this function has run. Set busy_cursor_atimer to null 8984 after this function has run. Set hourglass_atimer to null
8884 so that we know the timer doesn't have to be canceled. */ 8985 so that we know the timer doesn't have to be canceled. */
8885 busy_cursor_atimer = NULL; 8986 hourglass_atimer = NULL;
8886 8987
8887 if (!busy_cursor_shown_p) 8988 if (!hourglass_shown_p)
8888 { 8989 {
8889 Lisp_Object rest, frame; 8990 Lisp_Object rest, frame;
8890 8991
8891 BLOCK_INPUT; 8992 BLOCK_INPUT;
8892 8993
8893 FOR_EACH_FRAME (rest, frame) 8994 FOR_EACH_FRAME (rest, frame)
8894 if (FRAME_X_P (XFRAME (frame))) 8995 if (FRAME_W32_P (XFRAME (frame)))
8895 { 8996 {
8896 struct frame *f = XFRAME (frame); 8997 struct frame *f = XFRAME (frame);
8897 8998
8898 f->output_data.w32->busy_p = 1; 8999 f->output_data.w32->hourglass_p = 1;
8899 9000
8900 if (!f->output_data.w32->busy_window) 9001 if (!f->output_data.w32->hourglass_window)
8901 { 9002 {
8902 unsigned long mask = CWCursor; 9003 unsigned long mask = CWCursor;
8903 XSetWindowAttributes attrs; 9004 XSetWindowAttributes attrs;
8904 9005
8905 attrs.cursor = f->output_data.w32->busy_cursor; 9006 attrs.cursor = f->output_data.w32->hourglass_cursor;
8906 9007
8907 f->output_data.w32->busy_window 9008 f->output_data.w32->hourglass_window
8908 = XCreateWindow (FRAME_X_DISPLAY (f), 9009 = XCreateWindow (FRAME_X_DISPLAY (f),
8909 FRAME_OUTER_WINDOW (f), 9010 FRAME_OUTER_WINDOW (f),
8910 0, 0, 32000, 32000, 0, 0, 9011 0, 0, 32000, 32000, 0, 0,
@@ -8913,24 +9014,25 @@ show_busy_cursor (timer)
8913 mask, &attrs); 9014 mask, &attrs);
8914 } 9015 }
8915 9016
8916 XMapRaised (FRAME_X_DISPLAY (f), f->output_data.w32->busy_window); 9017 XMapRaised (FRAME_X_DISPLAY (f),
9018 f->output_data.w32->hourglass_window);
8917 XFlush (FRAME_X_DISPLAY (f)); 9019 XFlush (FRAME_X_DISPLAY (f));
8918 } 9020 }
8919 9021
8920 busy_cursor_shown_p = 1; 9022 hourglass_shown_p = 1;
8921 UNBLOCK_INPUT; 9023 UNBLOCK_INPUT;
8922 } 9024 }
8923#endif 9025#endif
8924} 9026}
8925 9027
8926 9028
8927/* Hide the busy cursor on all frames, if it is currently shown. */ 9029/* Hide the hourglass cursor on all frames, if it is currently shown. */
8928 9030
8929static void 9031static void
8930hide_busy_cursor () 9032hide_hourglass ()
8931{ 9033{
8932#if 0 /* MAC_TODO: cursor shape changes. */ 9034#if 0 /* TODO: cursor shape changes. */
8933 if (busy_cursor_shown_p) 9035 if (hourglass_shown_p)
8934 { 9036 {
8935 Lisp_Object rest, frame; 9037 Lisp_Object rest, frame;
8936 9038
@@ -8939,19 +9041,20 @@ hide_busy_cursor ()
8939 { 9041 {
8940 struct frame *f = XFRAME (frame); 9042 struct frame *f = XFRAME (frame);
8941 9043
8942 if (FRAME_X_P (f) 9044 if (FRAME_W32_P (f)
8943 /* Watch out for newly created frames. */ 9045 /* Watch out for newly created frames. */
8944 && f->output_data.x->busy_window) 9046 && f->output_data.x->hourglass_window)
8945 { 9047 {
8946 XUnmapWindow (FRAME_X_DISPLAY (f), f->output_data.x->busy_window); 9048 XUnmapWindow (FRAME_X_DISPLAY (f),
8947 /* Sync here because XTread_socket looks at the busy_p flag 9049 f->output_data.x->hourglass_window);
8948 that is reset to zero below. */ 9050 /* Sync here because XTread_socket looks at the
9051 hourglass_p flag that is reset to zero below. */
8949 XSync (FRAME_X_DISPLAY (f), False); 9052 XSync (FRAME_X_DISPLAY (f), False);
8950 f->output_data.x->busy_p = 0; 9053 f->output_data.x->hourglass_p = 0;
8951 } 9054 }
8952 } 9055 }
8953 9056
8954 busy_cursor_shown_p = 0; 9057 hourglass_shown_p = 0;
8955 UNBLOCK_INPUT; 9058 UNBLOCK_INPUT;
8956 } 9059 }
8957#endif 9060#endif
@@ -9214,23 +9317,33 @@ x_create_tip_frame (dpyinfo, parms)
9214 return Qnil; 9317 return Qnil;
9215} 9318}
9216 9319
9217 9320#ifdef TODO /* Tooltip support not complete. */
9218DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, 9321DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
9219 "Show STRING in a \"tooltip\" window on frame FRAME.\n\ 9322 "Show STRING in a \"tooltip\" window on frame FRAME.\n\
9220A tooltip window is a small X window displaying STRING at\n\ 9323A tooltip window is a small window displaying a string.\n\
9221the current mouse position.\n\ 9324\n\
9222FRAME nil or omitted means use the selected frame.\n\ 9325FRAME nil or omitted means use the selected frame.\n\
9326\n\
9223PARMS is an optional list of frame parameters which can be\n\ 9327PARMS is an optional list of frame parameters which can be\n\
9224used to change the tooltip's appearance.\n\ 9328used to change the tooltip's appearance.\n\
9329\n\
9225Automatically hide the tooltip after TIMEOUT seconds.\n\ 9330Automatically hide the tooltip after TIMEOUT seconds.\n\
9226TIMEOUT nil means use the default timeout of 5 seconds.") 9331TIMEOUT nil means use the default timeout of 5 seconds.\n\
9227 (string, frame, parms, timeout) 9332\n\
9228 Lisp_Object string, frame, parms, timeout; 9333If the list of frame parameters PARAMS contains a `left' parameters,\n\
9334the tooltip is displayed at that x-position. Otherwise it is\n\
9335displayed at the mouse position, with offset DX added (default is 5 if\n\
9336DX isn't specified). Likewise for the y-position; if a `top' frame\n\
9337parameter is specified, it determines the y-position of the tooltip\n\
9338window, otherwise it is displayed at the mouse position, with offset\n\
9339DY added (default is 10).")
9340 (string, frame, parms, timeout, dx, dy)
9341 Lisp_Object string, frame, parms, timeout, dx, dy;
9229{ 9342{
9230 struct frame *f; 9343 struct frame *f;
9231 struct window *w; 9344 struct window *w;
9232 Window root, child; 9345 Window root, child;
9233 Lisp_Object buffer; 9346 Lisp_Object buffer, top, left;
9234 struct buffer *old_buffer; 9347 struct buffer *old_buffer;
9235 struct text_pos pos; 9348 struct text_pos pos;
9236 int i, width, height; 9349 int i, width, height;
@@ -9251,9 +9364,55 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9251 else 9364 else
9252 CHECK_NATNUM (timeout, 2); 9365 CHECK_NATNUM (timeout, 2);
9253 9366
9367 if (NILP (dx))
9368 dx = make_number (5);
9369 else
9370 CHECK_NUMBER (dx, 5);
9371
9372 if (NILP (dy))
9373 dy = make_number (-10);
9374 else
9375 CHECK_NUMBER (dy, 6);
9376
9377 if (NILP (last_show_tip_args))
9378 last_show_tip_args = Fmake_vector (make_number (3), Qnil);
9379
9380 if (!NILP (tip_frame))
9381 {
9382 Lisp_Object last_string = AREF (last_show_tip_args, 0);
9383 Lisp_Object last_frame = AREF (last_show_tip_args, 1);
9384 Lisp_Object last_parms = AREF (last_show_tip_args, 2);
9385
9386 if (EQ (frame, last_frame)
9387 && !NILP (Fequal (last_string, string))
9388 && !NILP (Fequal (last_parms, parms)))
9389 {
9390 struct frame *f = XFRAME (tip_frame);
9391
9392 /* Only DX and DY have changed. */
9393 if (!NILP (tip_timer))
9394 {
9395 Lisp_Object timer = tip_timer;
9396 tip_timer = Qnil;
9397 call1 (Qcancel_timer, timer);
9398 }
9399
9400 BLOCK_INPUT;
9401 compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);
9402 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9403 root_x, root_y - PIXEL_HEIGHT (f));
9404 UNBLOCK_INPUT;
9405 goto start_timer;
9406 }
9407 }
9408
9254 /* Hide a previous tip, if any. */ 9409 /* Hide a previous tip, if any. */
9255 Fx_hide_tip (); 9410 Fx_hide_tip ();
9256 9411
9412 ASET (last_show_tip_args, 0, string);
9413 ASET (last_show_tip_args, 1, frame);
9414 ASET (last_show_tip_args, 2, parms);
9415
9257 /* Add default values to frame parameters. */ 9416 /* Add default values to frame parameters. */
9258 if (NILP (Fassq (Qname, parms))) 9417 if (NILP (Fassq (Qname, parms)))
9259 parms = Fcons (Fcons (Qname, build_string ("tooltip")), parms); 9418 parms = Fcons (Fcons (Qname, build_string ("tooltip")), parms);
@@ -9277,8 +9436,8 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9277 will loose. I don't think this is a realistic case. */ 9436 will loose. I don't think this is a realistic case. */
9278 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 9437 w = XWINDOW (FRAME_ROOT_WINDOW (f));
9279 w->left = w->top = make_number (0); 9438 w->left = w->top = make_number (0);
9280 w->width = 80; 9439 w->width = make_number (80);
9281 w->height = 40; 9440 w->height = make_number (40);
9282 adjust_glyphs (f); 9441 adjust_glyphs (f);
9283 w->pseudo_window_p = 1; 9442 w->pseudo_window_p = 1;
9284 9443
@@ -9288,7 +9447,7 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9288 old_buffer = current_buffer; 9447 old_buffer = current_buffer;
9289 set_buffer_internal_1 (XBUFFER (buffer)); 9448 set_buffer_internal_1 (XBUFFER (buffer));
9290 Ferase_buffer (); 9449 Ferase_buffer ();
9291 Finsert (make_number (1), &string); 9450 Finsert (1, &string);
9292 clear_glyph_matrix (w->desired_matrix); 9451 clear_glyph_matrix (w->desired_matrix);
9293 clear_glyph_matrix (w->current_matrix); 9452 clear_glyph_matrix (w->current_matrix);
9294 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 9453 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
@@ -9330,15 +9489,15 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9330 9489
9331 /* Move the tooltip window where the mouse pointer is. Resize and 9490 /* Move the tooltip window where the mouse pointer is. Resize and
9332 show it. */ 9491 show it. */
9333#if 0 /* MAC_TODO : Mac specifics */ 9492 compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);
9493
9494#if 0 /* TODO : Mac specifics */
9334 BLOCK_INPUT; 9495 BLOCK_INPUT;
9335 XQueryPointer (FRAME_W32_DISPLAY (f), FRAME_W32_DISPLAY_INFO (f)->root_window, 9496 XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9336 &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask); 9497 root_x, root_y - height, width, height);
9337 XMoveResizeWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), 9498 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
9338 root_x + 5, root_y - height - 5, width, height);
9339 XMapRaised (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f));
9340 UNBLOCK_INPUT; 9499 UNBLOCK_INPUT;
9341#endif /* MAC_TODO */ 9500#endif /* TODO */
9342 9501
9343 /* Draw into the window. */ 9502 /* Draw into the window. */
9344 w->must_be_updated_p = 1; 9503 w->must_be_updated_p = 1;
@@ -9348,6 +9507,7 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9348 set_buffer_internal_1 (old_buffer); 9507 set_buffer_internal_1 (old_buffer);
9349 windows_or_buffers_changed = old_windows_or_buffers_changed; 9508 windows_or_buffers_changed = old_windows_or_buffers_changed;
9350 9509
9510 start_timer:
9351 /* Let the tip disappear after timeout seconds. */ 9511 /* Let the tip disappear after timeout seconds. */
9352 tip_timer = call3 (intern ("run-at-time"), timeout, Qnil, 9512 tip_timer = call3 (intern ("run-at-time"), timeout, Qnil,
9353 intern ("x-hide-tip")); 9513 intern ("x-hide-tip"));
@@ -9356,49 +9516,42 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
9356 return unbind_to (count, Qnil); 9516 return unbind_to (count, Qnil);
9357} 9517}
9358 9518
9519
9359DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, 9520DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
9360 "Hide the current tooltip window, if there is any.\n\ 9521 "Hide the current tooltip window, if there is any.\n\
9361Value is t is tooltip was open, nil otherwise.") 9522Value is t is tooltip was open, nil otherwise.")
9362 () 9523 ()
9363{ 9524{
9364 int count; 9525 int count;
9365 Lisp_Object deleted; 9526 Lisp_Object deleted, frame, timer;
9527 struct gcpro gcpro1, gcpro2;
9366 9528
9367 /* Return quickly if nothing to do. */ 9529 /* Return quickly if nothing to do. */
9368 if (NILP (tip_timer) && !FRAMEP (tip_frame)) 9530 if (NILP (tip_timer) && NILP (tip_frame))
9369 return Qnil; 9531 return Qnil;
9370 9532
9533 frame = tip_frame;
9534 timer = tip_timer;
9535 GCPRO2 (frame, timer);
9536 tip_frame = tip_timer = deleted = Qnil;
9537
9371 count = BINDING_STACK_SIZE (); 9538 count = BINDING_STACK_SIZE ();
9372 deleted = Qnil;
9373 specbind (Qinhibit_redisplay, Qt); 9539 specbind (Qinhibit_redisplay, Qt);
9374 specbind (Qinhibit_quit, Qt); 9540 specbind (Qinhibit_quit, Qt);
9375 9541
9376 if (!NILP (tip_timer)) 9542 if (!NILP (timer))
9377 { 9543 call1 (Qcancel_timer, timer);
9378 Lisp_Object tem;
9379 struct gcpro gcpro1;
9380 tem = tip_timer;
9381 GCPRO1 (tem);
9382 tip_timer = Qnil;
9383 call1 (intern ("cancel-timer"), tem);
9384 UNGCPRO;
9385 }
9386 9544
9387 if (FRAMEP (tip_frame)) 9545 if (FRAMEP (frame))
9388 { 9546 {
9389 Lisp_Object frame;
9390 struct gcpro gcpro1;
9391
9392 frame = tip_frame;
9393 GCPRO1 (frame);
9394 tip_frame = Qnil;
9395 Fdelete_frame (frame, Qnil); 9547 Fdelete_frame (frame, Qnil);
9396 deleted = Qt; 9548 deleted = Qt;
9397 UNGCPRO;
9398 } 9549 }
9399 9550
9551 UNGCPRO;
9400 return unbind_to (count, deleted); 9552 return unbind_to (count, deleted);
9401} 9553}
9554#endif
9402 9555
9403 9556
9404 9557
@@ -9620,6 +9773,8 @@ syms_of_macfns ()
9620 staticpro (&Qline_spacing); 9773 staticpro (&Qline_spacing);
9621 Qcenter = intern ("center"); 9774 Qcenter = intern ("center");
9622 staticpro (&Qcenter); 9775 staticpro (&Qcenter);
9776 Qcancel_timer = intern ("cancel-timer");
9777 staticpro (&Qcancel_timer);
9623 /* This is the end of symbol initialization. */ 9778 /* This is the end of symbol initialization. */
9624 9779
9625 Qhyper = intern ("hyper"); 9780 Qhyper = intern ("hyper");
@@ -9678,20 +9833,20 @@ switches, if present.");
9678 9833
9679 Vx_mode_pointer_shape = Qnil; 9834 Vx_mode_pointer_shape = Qnil;
9680 9835
9681 DEFVAR_LISP ("x-busy-pointer-shape", &Vx_busy_pointer_shape, 9836 DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
9682 "The shape of the pointer when Emacs is busy.\n\ 9837 "The shape of the pointer when Emacs is busy.\n\
9683This variable takes effect when you create a new frame\n\ 9838This variable takes effect when you create a new frame\n\
9684or when you set the mouse color."); 9839or when you set the mouse color.");
9685 Vx_busy_pointer_shape = Qnil; 9840 Vx_hourglass_pointer_shape = Qnil;
9686 9841
9687 DEFVAR_BOOL ("display-busy-cursor", &display_busy_cursor_p, 9842 DEFVAR_BOOL ("display-hourglass", &display_hourglass_p,
9688 "Non-zero means Emacs displays a busy cursor on window systems."); 9843 "Non-zero means Emacs displays an hourglass pointer on window systems.");
9689 display_busy_cursor_p = 1; 9844 display_hourglass_p = 1;
9690 9845
9691 DEFVAR_LISP ("busy-cursor-delay", &Vbusy_cursor_delay, 9846 DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay,
9692 "*Seconds to wait before displaying a busy-cursor.\n\ 9847 "*Seconds to wait before displaying an hourglass pointer.\n\
9693Value must be an integer or float."); 9848Value must be an integer or float.");
9694 Vbusy_cursor_delay = make_number (DEFAULT_BUSY_CURSOR_DELAY); 9849 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
9695 9850
9696 DEFVAR_LISP ("x-sensitive-text-pointer-shape", 9851 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
9697 &Vx_sensitive_text_pointer_shape, 9852 &Vx_sensitive_text_pointer_shape,
@@ -9841,15 +9996,18 @@ meaning don't clear the cache.");
9841 defsubr (&Simagep); 9996 defsubr (&Simagep);
9842 defsubr (&Slookup_image); 9997 defsubr (&Slookup_image);
9843#endif 9998#endif
9844#endif /* MAC_TODO */ 9999#endif /* TODO */
9845
9846 busy_cursor_atimer = NULL;
9847 busy_cursor_shown_p = 0;
9848 10000
10001 hourglass_atimer = NULL;
10002 hourglass_shown_p = 0;
10003#ifdef TODO /* Tooltip support not complete. */
9849 defsubr (&Sx_show_tip); 10004 defsubr (&Sx_show_tip);
9850 defsubr (&Sx_hide_tip); 10005 defsubr (&Sx_hide_tip);
9851 staticpro (&tip_timer); 10006#endif
9852 tip_timer = Qnil; 10007 tip_timer = Qnil;
10008 staticpro (&tip_timer);
10009 tip_frame = Qnil;
10010 staticpro (&tip_frame);
9853 10011
9854#if 0 /* MAC_TODO */ 10012#if 0 /* MAC_TODO */
9855 defsubr (&Sx_file_dialog); 10013 defsubr (&Sx_file_dialog);
@@ -9863,8 +10021,8 @@ init_xfns ()
9863 image_types = NULL; 10021 image_types = NULL;
9864 Vimage_types = Qnil; 10022 Vimage_types = Qnil;
9865 10023
10024#if 0 /* TODO : Image support for W32 */
9866 define_image_type (&xbm_type); 10025 define_image_type (&xbm_type);
9867#if 0 /* NTEMACS_TODO : Image support for W32 */
9868 define_image_type (&gs_type); 10026 define_image_type (&gs_type);
9869 define_image_type (&pbm_type); 10027 define_image_type (&pbm_type);
9870 10028
diff --git a/mac/src/macmenu.c b/mac/src/macmenu.c
index ac697cf7490..41536e466aa 100644
--- a/mac/src/macmenu.c
+++ b/mac/src/macmenu.c
@@ -1345,7 +1345,7 @@ set_frame_menubar (f, first_time, deep_p)
1345 set_buffer_internal_1 (XBUFFER (buffer)); 1345 set_buffer_internal_1 (XBUFFER (buffer));
1346 1346
1347 /* Run the Lucid hook. */ 1347 /* Run the Lucid hook. */
1348 call1 (Vrun_hooks, Qactivate_menubar_hook); 1348 safe_run_hooks (Qactivate_menubar_hook);
1349 /* If it has changed current-menubar from previous value, 1349 /* If it has changed current-menubar from previous value,
1350 really recompute the menubar from the value. */ 1350 really recompute the menubar from the value. */
1351 if (! NILP (Vlucid_menu_bar_dirty_flag)) 1351 if (! NILP (Vlucid_menu_bar_dirty_flag))
diff --git a/mac/src/macterm.c b/mac/src/macterm.c
index 2b7ea0f0a61..a6f979ed7b4 100644
--- a/mac/src/macterm.c
+++ b/mac/src/macterm.c
@@ -540,7 +540,7 @@ XDrawLine (display, w, gc, x1, y1, x2, y2)
540 540
541/* Mac version of XClearArea. */ 541/* Mac version of XClearArea. */
542 542
543static void 543void
544XClearArea (display, w, x, y, width, height, exposures) 544XClearArea (display, w, x, y, width, height, exposures)
545 Display *display; 545 Display *display;
546 WindowPtr w; 546 WindowPtr w;
@@ -11101,6 +11101,7 @@ static long app_sleep_time = WNE_SLEEP_AT_RESUME;
11101 11101
11102#define ARGV_STRING_LIST_ID 129 11102#define ARGV_STRING_LIST_ID 129
11103#define ABOUT_ALERT_ID 128 11103#define ABOUT_ALERT_ID 128
11104#define RAM_TOO_LARGE_ALERT_ID 129
11104 11105
11105Boolean terminate_flag = false; 11106Boolean terminate_flag = false;
11106 11107
@@ -11178,6 +11179,22 @@ do_init_managers (void)
11178 11179
11179 11180
11180static void 11181static void
11182do_check_ram_size (void)
11183{
11184 SInt32 physical_ram_size, logical_ram_size;
11185
11186 if (Gestalt (gestaltPhysicalRAMSize, &physical_ram_size) != noErr
11187 || Gestalt (gestaltLogicalRAMSize, &logical_ram_size) != noErr
11188 || physical_ram_size > 256 * 1024 * 1024
11189 || logical_ram_size > 256 * 1024 * 1024)
11190 {
11191 StopAlert (RAM_TOO_LARGE_ALERT_ID, NULL);
11192 exit (1);
11193 }
11194}
11195
11196
11197static void
11181do_window_update (WindowPtr win) 11198do_window_update (WindowPtr win)
11182{ 11199{
11183 struct mac_output *mwp = (mac_output *) GetWRefCon (win); 11200 struct mac_output *mwp = (mac_output *) GetWRefCon (win);
@@ -11644,6 +11661,8 @@ main (void)
11644 11661
11645 do_get_menus (); 11662 do_get_menus ();
11646 11663
11664 do_check_ram_size ();
11665
11647 init_emacs_passwd_dir (); 11666 init_emacs_passwd_dir ();
11648 11667
11649 init_environ (); 11668 init_environ ();