diff options
| author | Gerd Moellmann | 2001-03-28 12:06:39 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-28 12:06:39 +0000 |
| commit | a02f1be0c01bd0c45f1d2cfe00e014a17159ab10 (patch) | |
| tree | 5cb9e4194c83eb4a3577433cbe0bf75900cead1b /src | |
| parent | f827b862ade26841b3a0c1226fc283e9dfc1b082 (diff) | |
| download | emacs-a02f1be0c01bd0c45f1d2cfe00e014a17159ab10.tar.gz emacs-a02f1be0c01bd0c45f1d2cfe00e014a17159ab10.zip | |
(expose_window_tree, expose_frame): Don't compute
intersections here.
(expose_window): Do it here instead.
(x_draw_glyph_string): Fix a computation of the underline
position.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xterm.c | 108 |
2 files changed, 39 insertions, 75 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b5c4f3aff49..5cd9330962b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2001-03-28 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-03-28 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xterm.c (expose_window_tree, expose_frame): Don't compute | ||
| 4 | intersections here. | ||
| 5 | (expose_window): Do it here instead. | ||
| 6 | (x_draw_glyph_string): Fix a computation of the underline | ||
| 7 | position. | ||
| 8 | |||
| 3 | * bytecode.c (BYTE_CODE_QUIT): New macro. | 9 | * bytecode.c (BYTE_CODE_QUIT): New macro. |
| 4 | (Fbyte_code): Use BYTE_CODE_QUIT instead of QUIT. | 10 | (Fbyte_code): Use BYTE_CODE_QUIT instead of QUIT. |
| 5 | 11 | ||
diff --git a/src/xterm.c b/src/xterm.c index 4996f6e4dfe..53ee5c490f9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4336,7 +4336,7 @@ x_draw_glyph_string (s) | |||
| 4336 | else if (s->face->font) | 4336 | else if (s->face->font) |
| 4337 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | 4337 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; |
| 4338 | else | 4338 | else |
| 4339 | y = s->height - h; | 4339 | y = s->y + s->height - h; |
| 4340 | 4340 | ||
| 4341 | if (s->face->underline_defaulted_p) | 4341 | if (s->face->underline_defaulted_p) |
| 4342 | XFillRectangle (s->display, s->window, s->gc, | 4342 | XFillRectangle (s->display, s->window, s->gc, |
| @@ -5669,41 +5669,11 @@ expose_frame (f, x, y, w, h) | |||
| 5669 | expose_window_tree (XWINDOW (f->root_window), &r); | 5669 | expose_window_tree (XWINDOW (f->root_window), &r); |
| 5670 | 5670 | ||
| 5671 | if (WINDOWP (f->tool_bar_window)) | 5671 | if (WINDOWP (f->tool_bar_window)) |
| 5672 | { | 5672 | expose_window (XWINDOW (f->tool_bar_window), &r); |
| 5673 | struct window *w = XWINDOW (f->tool_bar_window); | ||
| 5674 | XRectangle window_rect; | ||
| 5675 | XRectangle intersection_rect; | ||
| 5676 | int window_x, window_y, window_width, window_height; | ||
| 5677 | |||
| 5678 | |||
| 5679 | window_box (w, -1, &window_x, &window_y, &window_width, &window_height); | ||
| 5680 | window_rect.x = window_x; | ||
| 5681 | window_rect.y = window_y; | ||
| 5682 | window_rect.width = window_width; | ||
| 5683 | window_rect.height = window_height; | ||
| 5684 | |||
| 5685 | if (x_intersect_rectangles (&r, &window_rect, &intersection_rect)) | ||
| 5686 | expose_window (w, &intersection_rect); | ||
| 5687 | } | ||
| 5688 | 5673 | ||
| 5689 | #ifndef USE_X_TOOLKIT | 5674 | #ifndef USE_X_TOOLKIT |
| 5690 | if (WINDOWP (f->menu_bar_window)) | 5675 | if (WINDOWP (f->menu_bar_window)) |
| 5691 | { | 5676 | expose_window (XWINDOW (f->menu_bar_window), &r); |
| 5692 | struct window *w = XWINDOW (f->menu_bar_window); | ||
| 5693 | XRectangle window_rect; | ||
| 5694 | XRectangle intersection_rect; | ||
| 5695 | int window_x, window_y, window_width, window_height; | ||
| 5696 | |||
| 5697 | |||
| 5698 | window_box (w, -1, &window_x, &window_y, &window_width, &window_height); | ||
| 5699 | window_rect.x = window_x; | ||
| 5700 | window_rect.y = window_y; | ||
| 5701 | window_rect.width = window_width; | ||
| 5702 | window_rect.height = window_height; | ||
| 5703 | |||
| 5704 | if (x_intersect_rectangles (&r, &window_rect, &intersection_rect)) | ||
| 5705 | expose_window (w, &intersection_rect); | ||
| 5706 | } | ||
| 5707 | #endif /* not USE_X_TOOLKIT */ | 5677 | #endif /* not USE_X_TOOLKIT */ |
| 5708 | } | 5678 | } |
| 5709 | 5679 | ||
| @@ -5723,32 +5693,8 @@ expose_window_tree (w, r) | |||
| 5723 | else if (!NILP (w->vchild)) | 5693 | else if (!NILP (w->vchild)) |
| 5724 | expose_window_tree (XWINDOW (w->vchild), r); | 5694 | expose_window_tree (XWINDOW (w->vchild), r); |
| 5725 | else | 5695 | else |
| 5726 | { | 5696 | expose_window (w, r); |
| 5727 | XRectangle window_rect; | 5697 | w = NILP (w->next) ? NULL : XWINDOW (w->next); |
| 5728 | XRectangle intersection_rect; | ||
| 5729 | struct frame *f = XFRAME (w->frame); | ||
| 5730 | int window_x, window_y, window_width, window_height; | ||
| 5731 | |||
| 5732 | /* Frame-relative pixel rectangle of W. */ | ||
| 5733 | window_box (w, -1, &window_x, &window_y, &window_width, | ||
| 5734 | &window_height); | ||
| 5735 | window_rect.x | ||
| 5736 | = (window_x | ||
| 5737 | - FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) | ||
| 5738 | - FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)); | ||
| 5739 | window_rect.y = window_y; | ||
| 5740 | window_rect.width | ||
| 5741 | = (window_width | ||
| 5742 | + FRAME_X_FLAGS_AREA_WIDTH (f) | ||
| 5743 | + FRAME_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)); | ||
| 5744 | window_rect.height | ||
| 5745 | = window_height + CURRENT_MODE_LINE_HEIGHT (w); | ||
| 5746 | |||
| 5747 | if (x_intersect_rectangles (r, &window_rect, &intersection_rect)) | ||
| 5748 | expose_window (w, &intersection_rect); | ||
| 5749 | } | ||
| 5750 | |||
| 5751 | w = NILP (w->next) ? 0 : XWINDOW (w->next); | ||
| 5752 | } | 5698 | } |
| 5753 | } | 5699 | } |
| 5754 | 5700 | ||
| @@ -5869,18 +5815,19 @@ x_phys_cursor_in_rect_p (w, r) | |||
| 5869 | } | 5815 | } |
| 5870 | 5816 | ||
| 5871 | 5817 | ||
| 5872 | /* Redraw a rectangle of window W. R is a rectangle in window | 5818 | /* Redraw the part of window W intersection rectangle FR. Pixel |
| 5873 | relative coordinates. Call this function with input blocked. */ | 5819 | coordinates in FR are frame-relative. Call this function with |
| 5820 | input blocked. */ | ||
| 5874 | 5821 | ||
| 5875 | static void | 5822 | static void |
| 5876 | expose_window (w, r) | 5823 | expose_window (w, fr) |
| 5877 | struct window *w; | 5824 | struct window *w; |
| 5878 | XRectangle *r; | 5825 | XRectangle *fr; |
| 5879 | { | 5826 | { |
| 5827 | struct frame *f = XFRAME (w->frame); | ||
| 5880 | struct glyph_row *row; | 5828 | struct glyph_row *row; |
| 5881 | int y; | 5829 | int y, yb, cursor_cleared_p; |
| 5882 | int yb = window_text_bottom_y (w); | 5830 | XRectangle wr, r; |
| 5883 | int cursor_cleared_p; | ||
| 5884 | 5831 | ||
| 5885 | /* If window is not yet fully initialized, do nothing. This can | 5832 | /* If window is not yet fully initialized, do nothing. This can |
| 5886 | happen when toolkit scroll bars are used and a window is split. | 5833 | happen when toolkit scroll bars are used and a window is split. |
| @@ -5889,16 +5836,27 @@ expose_window (w, r) | |||
| 5889 | if (w->current_matrix == NULL || w == updated_window) | 5836 | if (w->current_matrix == NULL || w == updated_window) |
| 5890 | return; | 5837 | return; |
| 5891 | 5838 | ||
| 5839 | /* Frame-relative pixel rectangle of W. */ | ||
| 5840 | wr.x = XFASTINT (w->left) * CANON_X_UNIT (f); | ||
| 5841 | wr.y = XFASTINT (w->top) * CANON_Y_UNIT (f); | ||
| 5842 | wr.width = XFASTINT (w->width) * CANON_X_UNIT (f); | ||
| 5843 | wr.height = XFASTINT (w->height) * CANON_Y_UNIT (f); | ||
| 5844 | |||
| 5845 | if (!x_intersect_rectangles (fr, &wr, &r)) | ||
| 5846 | return; | ||
| 5847 | |||
| 5848 | yb = window_text_bottom_y (w); | ||
| 5849 | |||
| 5892 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", | 5850 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", |
| 5893 | r->x, r->y, r->width, r->height)); | 5851 | r.x, r.y, r.width, r.height)); |
| 5894 | 5852 | ||
| 5895 | /* Convert to window coordinates. */ | 5853 | /* Convert to window coordinates. */ |
| 5896 | r->x = FRAME_TO_WINDOW_PIXEL_X (w, r->x); | 5854 | r.x = FRAME_TO_WINDOW_PIXEL_X (w, r.x); |
| 5897 | r->y = FRAME_TO_WINDOW_PIXEL_Y (w, r->y); | 5855 | r.y = FRAME_TO_WINDOW_PIXEL_Y (w, r.y); |
| 5898 | 5856 | ||
| 5899 | /* Turn off the cursor. */ | 5857 | /* Turn off the cursor. */ |
| 5900 | if (!w->pseudo_window_p | 5858 | if (!w->pseudo_window_p |
| 5901 | && x_phys_cursor_in_rect_p (w, r)) | 5859 | && x_phys_cursor_in_rect_p (w, &r)) |
| 5902 | { | 5860 | { |
| 5903 | x_clear_cursor (w); | 5861 | x_clear_cursor (w); |
| 5904 | cursor_cleared_p = 1; | 5862 | cursor_cleared_p = 1; |
| @@ -5911,7 +5869,7 @@ expose_window (w, r) | |||
| 5911 | y = 0; | 5869 | y = 0; |
| 5912 | while (row->enabled_p | 5870 | while (row->enabled_p |
| 5913 | && y < yb | 5871 | && y < yb |
| 5914 | && y + row->height < r->y) | 5872 | && y + row->height < r.y) |
| 5915 | { | 5873 | { |
| 5916 | y += row->height; | 5874 | y += row->height; |
| 5917 | ++row; | 5875 | ++row; |
| @@ -5920,9 +5878,9 @@ expose_window (w, r) | |||
| 5920 | /* Display the text in the rectangle, one text line at a time. */ | 5878 | /* Display the text in the rectangle, one text line at a time. */ |
| 5921 | while (row->enabled_p | 5879 | while (row->enabled_p |
| 5922 | && y < yb | 5880 | && y < yb |
| 5923 | && y < r->y + r->height) | 5881 | && y < r.y + r.height) |
| 5924 | { | 5882 | { |
| 5925 | expose_line (w, row, r); | 5883 | expose_line (w, row, &r); |
| 5926 | y += row->height; | 5884 | y += row->height; |
| 5927 | ++row; | 5885 | ++row; |
| 5928 | } | 5886 | } |
| @@ -5931,8 +5889,8 @@ expose_window (w, r) | |||
| 5931 | if (WINDOW_WANTS_MODELINE_P (w) | 5889 | if (WINDOW_WANTS_MODELINE_P (w) |
| 5932 | && (row = MATRIX_MODE_LINE_ROW (w->current_matrix), | 5890 | && (row = MATRIX_MODE_LINE_ROW (w->current_matrix), |
| 5933 | row->enabled_p) | 5891 | row->enabled_p) |
| 5934 | && row->y < r->y + r->height) | 5892 | && row->y < r.y + r.height) |
| 5935 | expose_line (w, row, r); | 5893 | expose_line (w, row, &r); |
| 5936 | 5894 | ||
| 5937 | if (!w->pseudo_window_p) | 5895 | if (!w->pseudo_window_p) |
| 5938 | { | 5896 | { |