diff options
| author | Kim F. Storm | 2004-11-21 15:49:12 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-11-21 15:49:12 +0000 |
| commit | 08f6668226c6c70e63c63e8962785dfe86cba70d (patch) | |
| tree | 18f0138120d0cbae388af2bbe684ce50b047bff5 /src | |
| parent | b5a2e277b0f03f0d834e2eb0da7c050016969427 (diff) | |
| download | emacs-08f6668226c6c70e63c63e8962785dfe86cba70d.tar.gz emacs-08f6668226c6c70e63c63e8962785dfe86cba70d.zip | |
(x_clip_to_row): Add area arg. Callers changed.
(x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 19 | ||||
| -rw-r--r-- | src/xterm.c | 19 |
2 files changed, 20 insertions, 18 deletions
diff --git a/src/macterm.c b/src/macterm.c index eae892fb7fc..f4f9235c846 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -279,7 +279,7 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | |||
| 279 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, | 279 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, |
| 280 | enum text_cursor_kinds)); | 280 | enum text_cursor_kinds)); |
| 281 | 281 | ||
| 282 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC)); | 282 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); |
| 283 | static void x_flush P_ ((struct frame *f)); | 283 | static void x_flush P_ ((struct frame *f)); |
| 284 | static void x_update_begin P_ ((struct frame *)); | 284 | static void x_update_begin P_ ((struct frame *)); |
| 285 | static void x_update_window_begin P_ ((struct window *)); | 285 | static void x_update_window_begin P_ ((struct window *)); |
| @@ -1454,12 +1454,12 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 1454 | int oldVH = row->visible_height; | 1454 | int oldVH = row->visible_height; |
| 1455 | row->visible_height = p->h; | 1455 | row->visible_height = p->h; |
| 1456 | row->y -= rowY - p->y; | 1456 | row->y -= rowY - p->y; |
| 1457 | x_clip_to_row (w, row, gc); | 1457 | x_clip_to_row (w, row, -1, gc); |
| 1458 | row->y = oldY; | 1458 | row->y = oldY; |
| 1459 | row->visible_height = oldVH; | 1459 | row->visible_height = oldVH; |
| 1460 | } | 1460 | } |
| 1461 | else | 1461 | else |
| 1462 | x_clip_to_row (w, row, gc); | 1462 | x_clip_to_row (w, row, -1, gc); |
| 1463 | 1463 | ||
| 1464 | if (p->bx >= 0 && !p->overlay_p) | 1464 | if (p->bx >= 0 && !p->overlay_p) |
| 1465 | { | 1465 | { |
| @@ -4615,18 +4615,19 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) | |||
| 4615 | mode lines must be clipped to the whole window. */ | 4615 | mode lines must be clipped to the whole window. */ |
| 4616 | 4616 | ||
| 4617 | static void | 4617 | static void |
| 4618 | x_clip_to_row (w, row, gc) | 4618 | x_clip_to_row (w, row, area, gc) |
| 4619 | struct window *w; | 4619 | struct window *w; |
| 4620 | struct glyph_row *row; | 4620 | struct glyph_row *row; |
| 4621 | int area; | ||
| 4621 | GC gc; | 4622 | GC gc; |
| 4622 | { | 4623 | { |
| 4623 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 4624 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 4624 | Rect clip_rect; | 4625 | Rect clip_rect; |
| 4625 | int window_y, window_width; | 4626 | int window_x, window_y, window_width; |
| 4626 | 4627 | ||
| 4627 | window_box (w, -1, 0, &window_y, &window_width, 0); | 4628 | window_box (w, area, &window_x, &window_y, &window_width, 0); |
| 4628 | 4629 | ||
| 4629 | clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0); | 4630 | clip_rect.left = window_x; |
| 4630 | clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 4631 | clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
| 4631 | clip_rect.top = max (clip_rect.top, window_y); | 4632 | clip_rect.top = max (clip_rect.top, window_y); |
| 4632 | clip_rect.right = clip_rect.left + window_width; | 4633 | clip_rect.right = clip_rect.left + window_width; |
| @@ -4692,7 +4693,7 @@ x_draw_hollow_cursor (w, row) | |||
| 4692 | gc = dpyinfo->scratch_cursor_gc; | 4693 | gc = dpyinfo->scratch_cursor_gc; |
| 4693 | 4694 | ||
| 4694 | /* Set clipping, draw the rectangle, and reset clipping again. */ | 4695 | /* Set clipping, draw the rectangle, and reset clipping again. */ |
| 4695 | x_clip_to_row (w, row, gc); | 4696 | x_clip_to_row (w, row, TEXT_AREA, gc); |
| 4696 | mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h); | 4697 | mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h); |
| 4697 | mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f)); | 4698 | mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f)); |
| 4698 | } | 4699 | } |
| @@ -4763,7 +4764,7 @@ x_draw_bar_cursor (w, row, width, kind) | |||
| 4763 | width = min (cursor_glyph->pixel_width, width); | 4764 | width = min (cursor_glyph->pixel_width, width); |
| 4764 | 4765 | ||
| 4765 | w->phys_cursor_width = width; | 4766 | w->phys_cursor_width = width; |
| 4766 | x_clip_to_row (w, row, gc); | 4767 | x_clip_to_row (w, row, TEXT_AREA, gc); |
| 4767 | 4768 | ||
| 4768 | if (kind == BAR_CURSOR) | 4769 | if (kind == BAR_CURSOR) |
| 4769 | XFillRectangle (dpy, window, gc, | 4770 | XFillRectangle (dpy, window, gc, |
diff --git a/src/xterm.c b/src/xterm.c index 586d0002e8a..e106027ff8b 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -357,7 +357,7 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | |||
| 357 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, | 357 | static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, |
| 358 | enum text_cursor_kinds)); | 358 | enum text_cursor_kinds)); |
| 359 | 359 | ||
| 360 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC)); | 360 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); |
| 361 | static void x_flush P_ ((struct frame *f)); | 361 | static void x_flush P_ ((struct frame *f)); |
| 362 | static void x_update_begin P_ ((struct frame *)); | 362 | static void x_update_begin P_ ((struct frame *)); |
| 363 | static void x_update_window_begin P_ ((struct window *)); | 363 | static void x_update_window_begin P_ ((struct window *)); |
| @@ -709,12 +709,12 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 709 | int oldVH = row->visible_height; | 709 | int oldVH = row->visible_height; |
| 710 | row->visible_height = p->h; | 710 | row->visible_height = p->h; |
| 711 | row->y -= rowY - p->y; | 711 | row->y -= rowY - p->y; |
| 712 | x_clip_to_row (w, row, gc); | 712 | x_clip_to_row (w, row, -1, gc); |
| 713 | row->y = oldY; | 713 | row->y = oldY; |
| 714 | row->visible_height = oldVH; | 714 | row->visible_height = oldVH; |
| 715 | } | 715 | } |
| 716 | else | 716 | else |
| 717 | x_clip_to_row (w, row, gc); | 717 | x_clip_to_row (w, row, -1, gc); |
| 718 | 718 | ||
| 719 | if (p->bx >= 0 && !p->overlay_p) | 719 | if (p->bx >= 0 && !p->overlay_p) |
| 720 | { | 720 | { |
| @@ -7135,18 +7135,19 @@ XTread_socket (sd, expected, hold_quit) | |||
| 7135 | mode lines must be clipped to the whole window. */ | 7135 | mode lines must be clipped to the whole window. */ |
| 7136 | 7136 | ||
| 7137 | static void | 7137 | static void |
| 7138 | x_clip_to_row (w, row, gc) | 7138 | x_clip_to_row (w, row, area, gc) |
| 7139 | struct window *w; | 7139 | struct window *w; |
| 7140 | struct glyph_row *row; | 7140 | struct glyph_row *row; |
| 7141 | int area; | ||
| 7141 | GC gc; | 7142 | GC gc; |
| 7142 | { | 7143 | { |
| 7143 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 7144 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7144 | XRectangle clip_rect; | 7145 | XRectangle clip_rect; |
| 7145 | int window_y, window_width; | 7146 | int window_x, window_y, window_width; |
| 7146 | 7147 | ||
| 7147 | window_box (w, -1, 0, &window_y, &window_width, 0); | 7148 | window_box (w, area, &window_x, &window_y, &window_width, 0); |
| 7148 | 7149 | ||
| 7149 | clip_rect.x = WINDOW_TO_FRAME_PIXEL_X (w, 0); | 7150 | clip_rect.x = window_x; |
| 7150 | clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 7151 | clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
| 7151 | clip_rect.y = max (clip_rect.y, window_y); | 7152 | clip_rect.y = max (clip_rect.y, window_y); |
| 7152 | clip_rect.width = window_width; | 7153 | clip_rect.width = window_width; |
| @@ -7212,7 +7213,7 @@ x_draw_hollow_cursor (w, row) | |||
| 7212 | gc = dpyinfo->scratch_cursor_gc; | 7213 | gc = dpyinfo->scratch_cursor_gc; |
| 7213 | 7214 | ||
| 7214 | /* Set clipping, draw the rectangle, and reset clipping again. */ | 7215 | /* Set clipping, draw the rectangle, and reset clipping again. */ |
| 7215 | x_clip_to_row (w, row, gc); | 7216 | x_clip_to_row (w, row, TEXT_AREA, gc); |
| 7216 | XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h); | 7217 | XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h); |
| 7217 | XSetClipMask (dpy, gc, None); | 7218 | XSetClipMask (dpy, gc, None); |
| 7218 | } | 7219 | } |
| @@ -7284,7 +7285,7 @@ x_draw_bar_cursor (w, row, width, kind) | |||
| 7284 | width = min (cursor_glyph->pixel_width, width); | 7285 | width = min (cursor_glyph->pixel_width, width); |
| 7285 | 7286 | ||
| 7286 | w->phys_cursor_width = width; | 7287 | w->phys_cursor_width = width; |
| 7287 | x_clip_to_row (w, row, gc); | 7288 | x_clip_to_row (w, row, TEXT_AREA, gc); |
| 7288 | 7289 | ||
| 7289 | if (kind == BAR_CURSOR) | 7290 | if (kind == BAR_CURSOR) |
| 7290 | XFillRectangle (dpy, window, gc, | 7291 | XFillRectangle (dpy, window, gc, |