aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorKim F. Storm2004-04-20 22:17:34 +0000
committerKim F. Storm2004-04-20 22:17:34 +0000
commitffe8b3f4e8cf60dd97c3e5ec5f12183ad9006c02 (patch)
treefef04eb8231cb0e02208aa38d9e3e2fb7d75b24e /src/macterm.c
parentb1bd81349503cb8b478d3903dd219559108d3cd7 (diff)
downloademacs-ffe8b3f4e8cf60dd97c3e5ec5f12183ad9006c02.tar.gz
emacs-ffe8b3f4e8cf60dd97c3e5ec5f12183ad9006c02.zip
(x_draw_relief_rect): Add top_p and bot_p args.
(x_draw_glyph_string_box): Fix call to x_draw_relief_rect. (x_draw_image_foreground, x_draw_image_relief) (x_draw_image_foreground_1, x_draw_image_glyph_string): Draw sliced images.
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c174
1 files changed, 97 insertions, 77 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 6a0f1aa1b0f..dd5f2504032 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -294,7 +294,6 @@ void deactivate_scroll_bars (FRAME_PTR);
294 294
295static int is_emacs_window (WindowPtr); 295static int is_emacs_window (WindowPtr);
296 296
297extern int image_ascent (struct image *, struct face *);
298int x_bitmap_icon (struct frame *, Lisp_Object); 297int x_bitmap_icon (struct frame *, Lisp_Object);
299void x_make_frame_visible (struct frame *); 298void x_make_frame_visible (struct frame *);
300 299
@@ -311,7 +310,7 @@ XFreePixmap (display, pixmap)
311 Display *display; /* not used */ 310 Display *display; /* not used */
312 Pixmap pixmap; 311 Pixmap pixmap;
313{ 312{
314 DisposeGWorld (pixmap); 313 DisposeGWorld (pixmap);
315} 314}
316 315
317 316
@@ -1283,7 +1282,7 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1283 int x, y0, y1; 1282 int x, y0, y1;
1284{ 1283{
1285 struct frame *f = XFRAME (WINDOW_FRAME (w)); 1284 struct frame *f = XFRAME (WINDOW_FRAME (w));
1286 1285
1287 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1286 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1288 f->output_data.mac->normal_gc, x, y0, x, y1); 1287 f->output_data.mac->normal_gc, x, y0, x, y1);
1289} 1288}
@@ -1525,7 +1524,7 @@ x_draw_fringe_bitmap (w, row, p)
1525 : face->foreground); 1524 : face->foreground);
1526 gcv.background = face->background; 1525 gcv.background = face->background;
1527 1526
1528 mac_draw_bitmap (display, window, &gcv, p->x, p->y, 1527 mac_draw_bitmap (display, window, &gcv, p->x, p->y,
1529 p->wd, p->h, bits, p->overlay_p); 1528 p->wd, p->h, bits, p->overlay_p);
1530 } 1529 }
1531 1530
@@ -1759,7 +1758,8 @@ static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
1759static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, 1758static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
1760 int, int, int)); 1759 int, int, int));
1761static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, 1760static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
1762 int, int, int, int, Rect *)); 1761 int, int, int, int, int, int,
1762 Rect *));
1763static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, 1763static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
1764 int, int, int, Rect *)); 1764 int, int, int, Rect *));
1765 1765
@@ -2483,9 +2483,10 @@ x_setup_relief_colors (s)
2483 2483
2484static void 2484static void
2485x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 2485x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2486 raised_p, left_p, right_p, clip_rect) 2486 raised_p, top_p, bot_p, left_p, right_p, clip_rect)
2487 struct frame *f; 2487 struct frame *f;
2488 int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; 2488 int left_x, top_y, right_x, bottom_y, width;
2489 int top_p, bot_p, left_p, right_p, raised_p;
2489 Rect *clip_rect; 2490 Rect *clip_rect;
2490{ 2491{
2491 Display *dpy = FRAME_MAC_DISPLAY (f); 2492 Display *dpy = FRAME_MAC_DISPLAY (f);
@@ -2500,10 +2501,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2500 mac_set_clip_rectangle (dpy, window, clip_rect); 2501 mac_set_clip_rectangle (dpy, window, clip_rect);
2501 2502
2502 /* Top. */ 2503 /* Top. */
2503 for (i = 0; i < width; ++i) 2504 if (top_p)
2504 XDrawLine (dpy, window, gc, 2505 for (i = 0; i < width; ++i)
2505 left_x + i * left_p, top_y + i, 2506 XDrawLine (dpy, window, gc,
2506 right_x - i * right_p, top_y + i); 2507 left_x + i * left_p, top_y + i,
2508 right_x - i * right_p, top_y + i);
2507 2509
2508 /* Left. */ 2510 /* Left. */
2509 if (left_p) 2511 if (left_p)
@@ -2520,10 +2522,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2520 clip_rect); 2522 clip_rect);
2521 2523
2522 /* Bottom. */ 2524 /* Bottom. */
2523 for (i = 0; i < width; ++i) 2525 if (bot_p)
2524 XDrawLine (dpy, window, gc, 2526 for (i = 0; i < width; ++i)
2525 left_x + i * left_p, bottom_y - i, 2527 XDrawLine (dpy, window, gc,
2526 right_x - i * right_p, bottom_y - i); 2528 left_x + i * left_p, bottom_y - i,
2529 right_x - i * right_p, bottom_y - i);
2527 2530
2528 /* Right. */ 2531 /* Right. */
2529 if (right_p) 2532 if (right_p)
@@ -2629,7 +2632,7 @@ x_draw_glyph_string_box (s)
2629 { 2632 {
2630 x_setup_relief_colors (s); 2633 x_setup_relief_colors (s);
2631 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 2634 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
2632 width, raised_p, left_p, right_p, &clip_rect); 2635 width, raised_p, 1, 1, left_p, right_p, &clip_rect);
2633 } 2636 }
2634} 2637}
2635 2638
@@ -2640,21 +2643,22 @@ static void
2640x_draw_image_foreground (s) 2643x_draw_image_foreground (s)
2641 struct glyph_string *s; 2644 struct glyph_string *s;
2642{ 2645{
2643 int x; 2646 int x = s->x;
2644 int y = s->ybase - image_ascent (s->img, s->face); 2647 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2645 2648
2646 /* If first glyph of S has a left box line, start drawing it to the 2649 /* If first glyph of S has a left box line, start drawing it to the
2647 right of that line. */ 2650 right of that line. */
2648 if (s->face->box != FACE_NO_BOX 2651 if (s->face->box != FACE_NO_BOX
2649 && s->first_glyph->left_box_line_p) 2652 && s->first_glyph->left_box_line_p
2650 x = s->x + abs (s->face->box_line_width); 2653 && s->slice.x == 0)
2651 else 2654 x += abs (s->face->box_line_width);
2652 x = s->x;
2653 2655
2654 /* If there is a margin around the image, adjust x- and y-position 2656 /* If there is a margin around the image, adjust x- and y-position
2655 by that margin. */ 2657 by that margin. */
2656 x += s->img->hmargin; 2658 if (s->slice.x == 0)
2657 y += s->img->vmargin; 2659 x += s->img->hmargin;
2660 if (s->slice.y == 0)
2661 y += s->img->vmargin;
2658 2662
2659 if (s->img->pixmap) 2663 if (s->img->pixmap)
2660 { 2664 {
@@ -2667,11 +2671,12 @@ x_draw_image_foreground (s)
2667 CONVERT_TO_XRECT (clip_rect, nr); 2671 CONVERT_TO_XRECT (clip_rect, nr);
2668 image_rect.x = x; 2672 image_rect.x = x;
2669 image_rect.y = y; 2673 image_rect.y = y;
2670 image_rect.width = s->img->width; 2674 image_rect.width = s->slice.width;
2671 image_rect.height = s->img->height; 2675 image_rect.height = s->slice.height;
2672 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2676 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2673 mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, 2677 mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask,
2674 s->window, s->gc, r.x - x, r.y - y, 2678 s->window, s->gc,
2679 s->slice.x + r.x - x, s->slice.y + r.y - y,
2675 r.width, r.height, r.x, r.y); 2680 r.width, r.height, r.x, r.y);
2676 } 2681 }
2677 else 2682 else
@@ -2683,11 +2688,12 @@ x_draw_image_foreground (s)
2683 CONVERT_TO_XRECT (clip_rect, nr); 2688 CONVERT_TO_XRECT (clip_rect, nr);
2684 image_rect.x = x; 2689 image_rect.x = x;
2685 image_rect.y = y; 2690 image_rect.y = y;
2686 image_rect.width = s->img->width; 2691 image_rect.width = s->slice.width;
2687 image_rect.height = s->img->height; 2692 image_rect.height = s->slice.height;
2688 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2693 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2689 mac_copy_area (s->display, s->img->pixmap, s->window, s->gc, 2694 mac_copy_area (s->display, s->img->pixmap, s->window, s->gc,
2690 r.x - x, r.y - y, r.width, r.height, r.x, r.y); 2695 s->slice.x + r.x - x, s->slice.y + r.y - y,
2696 r.width, r.height, r.x, r.y);
2691 2697
2692 /* When the image has a mask, we can expect that at 2698 /* When the image has a mask, we can expect that at
2693 least part of a mouse highlight or a block cursor will 2699 least part of a mouse highlight or a block cursor will
@@ -2699,15 +2705,17 @@ x_draw_image_foreground (s)
2699 { 2705 {
2700 int r = s->img->relief; 2706 int r = s->img->relief;
2701 if (r < 0) r = -r; 2707 if (r < 0) r = -r;
2702 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, 2708 mac_draw_rectangle (s->display, s->window, s->gc,
2703 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2709 x - r, y - r,
2710 s->slice.width + r*2 - 1,
2711 s->slice.height + r*2 - 1);
2704 } 2712 }
2705 } 2713 }
2706 } 2714 }
2707 else 2715 else
2708 /* Draw a rectangle if image could not be loaded. */ 2716 /* Draw a rectangle if image could not be loaded. */
2709 mac_draw_rectangle (s->display, s->window, s->gc, x, y, 2717 mac_draw_rectangle (s->display, s->window, s->gc, x, y,
2710 s->img->width - 1, s->img->height - 1); 2718 s->slice.width - 1, s->slice.height - 1);
2711} 2719}
2712 2720
2713 2721
@@ -2719,21 +2727,22 @@ x_draw_image_relief (s)
2719{ 2727{
2720 int x0, y0, x1, y1, thick, raised_p; 2728 int x0, y0, x1, y1, thick, raised_p;
2721 Rect r; 2729 Rect r;
2722 int x; 2730 int x = s->x;
2723 int y = s->ybase - image_ascent (s->img, s->face); 2731 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2724 2732
2725 /* If first glyph of S has a left box line, start drawing it to the 2733 /* If first glyph of S has a left box line, start drawing it to the
2726 right of that line. */ 2734 right of that line. */
2727 if (s->face->box != FACE_NO_BOX 2735 if (s->face->box != FACE_NO_BOX
2728 && s->first_glyph->left_box_line_p) 2736 && s->first_glyph->left_box_line_p
2729 x = s->x + abs (s->face->box_line_width); 2737 && s->slice.x == 0)
2730 else 2738 x += abs (s->face->box_line_width);
2731 x = s->x;
2732 2739
2733 /* If there is a margin around the image, adjust x- and y-position 2740 /* If there is a margin around the image, adjust x- and y-position
2734 by that margin. */ 2741 by that margin. */
2735 x += s->img->hmargin; 2742 if (s->slice.x == 0)
2736 y += s->img->vmargin; 2743 x += s->img->hmargin;
2744 if (s->slice.y == 0)
2745 y += s->img->vmargin;
2737 2746
2738 if (s->hl == DRAW_IMAGE_SUNKEN 2747 if (s->hl == DRAW_IMAGE_SUNKEN
2739 || s->hl == DRAW_IMAGE_RAISED) 2748 || s->hl == DRAW_IMAGE_RAISED)
@@ -2749,12 +2758,17 @@ x_draw_image_relief (s)
2749 2758
2750 x0 = x - thick; 2759 x0 = x - thick;
2751 y0 = y - thick; 2760 y0 = y - thick;
2752 x1 = x + s->img->width + thick - 1; 2761 x1 = x + s->slice.width + thick - 1;
2753 y1 = y + s->img->height + thick - 1; 2762 y1 = y + s->slice.height + thick - 1;
2754 2763
2755 x_setup_relief_colors (s); 2764 x_setup_relief_colors (s);
2756 get_glyph_string_clip_rect (s, &r); 2765 get_glyph_string_clip_rect (s, &r);
2757 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); 2766 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
2767 s->slice.y == 0,
2768 s->slice.y + s->slice.height == s->img->height,
2769 s->slice.x == 0,
2770 s->slice.x + s->slice.width == s->img->width,
2771 &r);
2758} 2772}
2759 2773
2760 2774
@@ -2765,33 +2779,37 @@ x_draw_image_foreground_1 (s, pixmap)
2765 struct glyph_string *s; 2779 struct glyph_string *s;
2766 Pixmap pixmap; 2780 Pixmap pixmap;
2767{ 2781{
2768 int x; 2782 int x = 0;
2769 int y = s->ybase - s->y - image_ascent (s->img, s->face); 2783 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
2770 2784
2771 /* If first glyph of S has a left box line, start drawing it to the 2785 /* If first glyph of S has a left box line, start drawing it to the
2772 right of that line. */ 2786 right of that line. */
2773 if (s->face->box != FACE_NO_BOX 2787 if (s->face->box != FACE_NO_BOX
2774 && s->first_glyph->left_box_line_p) 2788 && s->first_glyph->left_box_line_p
2775 x = abs (s->face->box_line_width); 2789 && s->slice.x == 0)
2776 else 2790 x += abs (s->face->box_line_width);
2777 x = 0;
2778 2791
2779 /* If there is a margin around the image, adjust x- and y-position 2792 /* If there is a margin around the image, adjust x- and y-position
2780 by that margin. */ 2793 by that margin. */
2781 x += s->img->hmargin; 2794 if (s->slice.x == 0)
2782 y += s->img->vmargin; 2795 x += s->img->hmargin;
2796 if (s->slice.y == 0)
2797 y += s->img->vmargin;
2783 2798
2784 if (s->img->pixmap) 2799 if (s->img->pixmap)
2785 { 2800 {
2786 if (s->img->mask) 2801 if (s->img->mask)
2787 mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap, 2802 mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap,
2788 s->img->mask, pixmap, s->gc, 2803 s->img->mask, pixmap, s->gc,
2789 0, 0, s->img->width, s->img->height, 2804 s->slice.x, s->slice.y,
2805 s->slice.width, s->slice.height,
2790 x, y); 2806 x, y);
2791 else 2807 else
2792 { 2808 {
2793 mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc, 2809 mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc,
2794 0, 0, s->img->width, s->img->height, x, y); 2810 s->slice.x, s->slice.y,
2811 s->slice.width, s->slice.height,
2812 x, y);
2795 2813
2796 /* When the image has a mask, we can expect that at 2814 /* When the image has a mask, we can expect that at
2797 least part of a mouse highlight or a block cursor will 2815 least part of a mouse highlight or a block cursor will
@@ -2804,15 +2822,15 @@ x_draw_image_foreground_1 (s, pixmap)
2804 int r = s->img->relief; 2822 int r = s->img->relief;
2805 if (r < 0) r = -r; 2823 if (r < 0) r = -r;
2806 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, 2824 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r,
2807 s->img->width + r*2 - 1, 2825 s->slice.width + r*2 - 1,
2808 s->img->height + r*2 - 1); 2826 s->slice.height + r*2 - 1);
2809 } 2827 }
2810 } 2828 }
2811 } 2829 }
2812 else 2830 else
2813 /* Draw a rectangle if image could not be loaded. */ 2831 /* Draw a rectangle if image could not be loaded. */
2814 mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, 2832 mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y,
2815 s->img->width - 1, s->img->height - 1); 2833 s->slice.width - 1, s->slice.height - 1);
2816} 2834}
2817 2835
2818 2836
@@ -2869,19 +2887,21 @@ x_draw_image_glyph_string (s)
2869 taller than image or if image has a clip mask to reduce 2887 taller than image or if image has a clip mask to reduce
2870 flickering. */ 2888 flickering. */
2871 s->stippled_p = s->face->stipple != 0; 2889 s->stippled_p = s->face->stipple != 0;
2872 if (height > s->img->height 2890 if (height > s->slice.height
2873 || s->img->hmargin 2891 || s->img->hmargin
2874 || s->img->vmargin 2892 || s->img->vmargin
2875 || s->img->mask 2893 || s->img->mask
2876 || s->img->pixmap == 0 2894 || s->img->pixmap == 0
2877 || s->width != s->background_width) 2895 || s->width != s->background_width)
2878 { 2896 {
2879 if (box_line_hwidth && s->first_glyph->left_box_line_p) 2897 x = s->x;
2880 x = s->x + box_line_hwidth; 2898 if (s->first_glyph->left_box_line_p
2881 else 2899 && s->slice.x == 0)
2882 x = s->x; 2900 x += box_line_hwidth;
2883 2901
2884 y = s->y + box_line_vwidth; 2902 y = s->y;
2903 if (s->slice.y == 0)
2904 y += box_line_vwidth;
2885 2905
2886 if (s->img->mask) 2906 if (s->img->mask)
2887 { 2907 {
@@ -3842,7 +3862,7 @@ glyph_rect (f, x, y, rect)
3842 3862
3843 /* x is to the right of the last glyph in the row. */ 3863 /* x is to the right of the last glyph in the row. */
3844 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx); 3864 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
3845 /* Shouldn't this be a pixel value? 3865 /* Shouldn't this be a pixel value?
3846 WINDOW_RIGHT_EDGE_X (w) seems to be the right value. 3866 WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
3847 ++KFS */ 3867 ++KFS */
3848 rect->right = WINDOW_RIGHT_EDGE_COL (w); 3868 rect->right = WINDOW_RIGHT_EDGE_COL (w);
@@ -3984,7 +4004,7 @@ mac_handle_tool_bar_click (f, button_event)
3984 if (button_event->what == mouseDown) 4004 if (button_event->what == mouseDown)
3985 handle_tool_bar_click (f, x, y, 1, 0); 4005 handle_tool_bar_click (f, x, y, 1, 0);
3986 else 4006 else
3987 handle_tool_bar_click (f, x, y, 0, 4007 handle_tool_bar_click (f, x, y, 0,
3988 x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f), 4008 x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f),
3989 button_event->modifiers)); 4009 button_event->modifiers));
3990} 4010}
@@ -4933,7 +4953,7 @@ x_new_font (f, fontname)
4933 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) 4953 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
4934 { 4954 {
4935 int wid = FRAME_COLUMN_WIDTH (f); 4955 int wid = FRAME_COLUMN_WIDTH (f);
4936 FRAME_CONFIG_SCROLL_BAR_COLS (f) 4956 FRAME_CONFIG_SCROLL_BAR_COLS (f)
4937 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; 4957 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
4938 } 4958 }
4939 else 4959 else
@@ -5826,7 +5846,7 @@ decode_mac_font_name (char *name, int size, short scriptcode)
5826 break; 5846 break;
5827 case smKorean: 5847 case smKorean:
5828 coding_system = Qeuc_kr; 5848 coding_system = Qeuc_kr;
5829 break; 5849 break;
5830 default: 5850 default:
5831 return; 5851 return;
5832 } 5852 }
@@ -6277,7 +6297,7 @@ mac_do_list_fonts (pattern, maxnames)
6277 if (fast_string_match (pattern_regex, fontname) >= 0) 6297 if (fast_string_match (pattern_regex, fontname) >= 0)
6278 { 6298 {
6279 font_list = Fcons (fontname, font_list); 6299 font_list = Fcons (fontname, font_list);
6280 6300
6281 n_fonts++; 6301 n_fonts++;
6282 if (maxnames > 0 && n_fonts >= maxnames) 6302 if (maxnames > 0 && n_fonts >= maxnames)
6283 break; 6303 break;
@@ -6987,7 +7007,7 @@ mac_get_emulated_btn ( UInt32 modifiers )
6987 if (modifiers & controlKey) 7007 if (modifiers & controlKey)
6988 result = cmdIs3 ? 2 : 1; 7008 result = cmdIs3 ? 2 : 1;
6989 else if (modifiers & optionKey) 7009 else if (modifiers & optionKey)
6990 result = cmdIs3 ? 1 : 2; 7010 result = cmdIs3 ? 1 : 2;
6991 } 7011 }
6992 return result; 7012 return result;
6993} 7013}
@@ -7020,7 +7040,7 @@ mac_get_mouse_btn (EventRef ref)
7020 switch (result) 7040 switch (result)
7021 { 7041 {
7022 case kEventMouseButtonPrimary: 7042 case kEventMouseButtonPrimary:
7023 if (Vmac_emulate_three_button_mouse == Qnil) 7043 if (Vmac_emulate_three_button_mouse == Qnil)
7024 return 0; 7044 return 0;
7025 else { 7045 else {
7026 UInt32 mods = 0; 7046 UInt32 mods = 0;
@@ -8189,7 +8209,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8189 switch (part_code) 8209 switch (part_code)
8190 { 8210 {
8191 case inMenuBar: 8211 case inMenuBar:
8192 if (er.what == mouseDown) 8212 if (er.what == mouseDown)
8193 { 8213 {
8194 struct frame *f = ((mac_output *) 8214 struct frame *f = ((mac_output *)
8195 GetWRefCon (FrontWindow ()))->mFP; 8215 GetWRefCon (FrontWindow ()))->mFP;
@@ -8269,7 +8289,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8269 else 8289 else
8270 mouse_tracking_in_progress = mouse_tracking_none; 8290 mouse_tracking_in_progress = mouse_tracking_none;
8271 window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1); 8291 window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1);
8272 8292
8273 if (EQ (window, mwp->mFP->tool_bar_window)) 8293 if (EQ (window, mwp->mFP->tool_bar_window))
8274 { 8294 {
8275 if (er.what == mouseDown) 8295 if (er.what == mouseDown)
@@ -8308,10 +8328,10 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8308 8328
8309 case inDrag: 8329 case inDrag:
8310#if TARGET_API_MAC_CARBON 8330#if TARGET_API_MAC_CARBON
8311 if (er.what == mouseDown) 8331 if (er.what == mouseDown)
8312 { 8332 {
8313 BitMap bm; 8333 BitMap bm;
8314 8334
8315 GetQDGlobalsScreenBits (&bm); 8335 GetQDGlobalsScreenBits (&bm);
8316 DragWindow (window_ptr, er.where, &bm.bounds); 8336 DragWindow (window_ptr, er.where, &bm.bounds);
8317 } 8337 }
@@ -8331,7 +8351,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8331 8351
8332 /* window resize handling added --ben */ 8352 /* window resize handling added --ben */
8333 case inGrow: 8353 case inGrow:
8334 if (er.what == mouseDown) 8354 if (er.what == mouseDown)
8335 { 8355 {
8336 do_grow_window(window_ptr, &er); 8356 do_grow_window(window_ptr, &er);
8337 break; 8357 break;
@@ -9185,10 +9205,10 @@ Otherwise the option key is used. */);
9185 useful for non-standard keyboard layouts. */); 9205 useful for non-standard keyboard layouts. */);
9186 Vmac_reverse_ctrl_meta = Qnil; 9206 Vmac_reverse_ctrl_meta = Qnil;
9187 9207
9188 DEFVAR_LISP ("mac-emulate-three-button-mouse", 9208 DEFVAR_LISP ("mac-emulate-three-button-mouse",
9189 &Vmac_emulate_three_button_mouse, 9209 &Vmac_emulate_three_button_mouse,
9190 doc: /* t means that when the option-key is held down while pressing the 9210 doc: /* t means that when the option-key is held down while pressing the
9191 mouse button, the click will register as mouse-2 and while the 9211 mouse button, the click will register as mouse-2 and while the
9192 command-key is held down, the click will register as mouse-3. 9212 command-key is held down, the click will register as mouse-3.
9193 'reverse means that the the option-key will register for mouse-3 9213 'reverse means that the the option-key will register for mouse-3
9194 and the command-key will register for mouse-2. nil means that 9214 and the command-key will register for mouse-2. nil means that