diff options
| author | Andrew Choi | 2002-08-31 00:53:12 +0000 |
|---|---|---|
| committer | Andrew Choi | 2002-08-31 00:53:12 +0000 |
| commit | ca45961da55a3dd2b1705ab449b6adb76baa0bea (patch) | |
| tree | 0ced062412acb99a536808ec0e71bad5dd4d499d /src/macterm.c | |
| parent | d5ec54b6eaa660f3c34d64378c31d5293888b2ce (diff) | |
| download | emacs-ca45961da55a3dd2b1705ab449b6adb76baa0bea.tar.gz emacs-ca45961da55a3dd2b1705ab449b6adb76baa0bea.zip | |
2002-08-30 Andrew Choi <akochoi@shaw.ca>
* macterm.c (expose_overlaps): New function (merge code from
xterm.c).
(expose_window): Use it to fix the display of overlapping
rows (merge code from xterm.c).
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/src/macterm.c b/src/macterm.c index 460960e7beb..b69cdfa6c10 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -443,6 +443,8 @@ static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int)); | |||
| 443 | static int x_intersect_rectangles P_ ((Rect *, Rect *, Rect *)); | 443 | static int x_intersect_rectangles P_ ((Rect *, Rect *, Rect *)); |
| 444 | static void expose_frame P_ ((struct frame *, int, int, int, int)); | 444 | static void expose_frame P_ ((struct frame *, int, int, int, int)); |
| 445 | static int expose_window_tree P_ ((struct window *, Rect *)); | 445 | static int expose_window_tree P_ ((struct window *, Rect *)); |
| 446 | static void expose_overlaps P_ ((struct window *, struct glyph_row *, | ||
| 447 | struct glyph_row *)); | ||
| 446 | static int expose_window P_ ((struct window *, Rect *)); | 448 | static int expose_window P_ ((struct window *, Rect *)); |
| 447 | static void expose_area P_ ((struct window *, struct glyph_row *, | 449 | static void expose_area P_ ((struct window *, struct glyph_row *, |
| 448 | Rect *, enum glyph_row_area)); | 450 | Rect *, enum glyph_row_area)); |
| @@ -6240,8 +6242,41 @@ x_phys_cursor_in_rect_p (w, r) | |||
| 6240 | } | 6242 | } |
| 6241 | 6243 | ||
| 6242 | 6244 | ||
| 6243 | /* Redraw the part of window W intersection rectagle FR. Pixel | 6245 | /* Redraw those parts of glyphs rows during expose event handling that |
| 6244 | coordinates in FR are frame relative. Call this function with | 6246 | overlap other rows. Redrawing of an exposed line writes over parts |
| 6247 | of lines overlapping that exposed line; this function fixes that. | ||
| 6248 | |||
| 6249 | W is the window being exposed. FIRST_OVERLAPPING_ROW is the first | ||
| 6250 | row in W's current matrix that is exposed and overlaps other rows. | ||
| 6251 | LAST_OVERLAPPING_ROW is the last such row. */ | ||
| 6252 | |||
| 6253 | static void | ||
| 6254 | expose_overlaps (w, first_overlapping_row, last_overlapping_row) | ||
| 6255 | struct window *w; | ||
| 6256 | struct glyph_row *first_overlapping_row; | ||
| 6257 | struct glyph_row *last_overlapping_row; | ||
| 6258 | { | ||
| 6259 | struct glyph_row *row; | ||
| 6260 | |||
| 6261 | for (row = first_overlapping_row; row <= last_overlapping_row; ++row) | ||
| 6262 | if (row->overlapping_p) | ||
| 6263 | { | ||
| 6264 | xassert (row->enabled_p && !row->mode_line_p); | ||
| 6265 | |||
| 6266 | if (row->used[LEFT_MARGIN_AREA]) | ||
| 6267 | x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA); | ||
| 6268 | |||
| 6269 | if (row->used[TEXT_AREA]) | ||
| 6270 | x_fix_overlapping_area (w, row, TEXT_AREA); | ||
| 6271 | |||
| 6272 | if (row->used[RIGHT_MARGIN_AREA]) | ||
| 6273 | x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA); | ||
| 6274 | } | ||
| 6275 | } | ||
| 6276 | |||
| 6277 | |||
| 6278 | /* Redraw the part of window W intersection rectangle FR. Pixel | ||
| 6279 | coordinates in FR are frame-relative. Call this function with | ||
| 6245 | input blocked. Value is non-zero if the exposure overwrites | 6280 | input blocked. Value is non-zero if the exposure overwrites |
| 6246 | mouse-face. */ | 6281 | mouse-face. */ |
| 6247 | 6282 | ||
| @@ -6281,7 +6316,8 @@ expose_window (w, fr) | |||
| 6281 | int yb = window_text_bottom_y (w); | 6316 | int yb = window_text_bottom_y (w); |
| 6282 | struct glyph_row *row; | 6317 | struct glyph_row *row; |
| 6283 | int cursor_cleared_p; | 6318 | int cursor_cleared_p; |
| 6284 | 6319 | struct glyph_row *first_overlapping_row, *last_overlapping_row; | |
| 6320 | |||
| 6285 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", | 6321 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", |
| 6286 | r.left, r.top, r.right, r.bottom)); | 6322 | r.left, r.top, r.right, r.bottom)); |
| 6287 | 6323 | ||
| @@ -6301,7 +6337,8 @@ expose_window (w, fr) | |||
| 6301 | else | 6337 | else |
| 6302 | cursor_cleared_p = 0; | 6338 | cursor_cleared_p = 0; |
| 6303 | 6339 | ||
| 6304 | /* Find the first row intersecting the rectangle R. */ | 6340 | /* Update lines intersecting rectangle R. */ |
| 6341 | first_overlapping_row = last_overlapping_row = NULL; | ||
| 6305 | for (row = w->current_matrix->rows; | 6342 | for (row = w->current_matrix->rows; |
| 6306 | row->enabled_p; | 6343 | row->enabled_p; |
| 6307 | ++row) | 6344 | ++row) |
| @@ -6314,10 +6351,17 @@ expose_window (w, fr) | |||
| 6314 | || (r.top >= y0 && r.top < y1) | 6351 | || (r.top >= y0 && r.top < y1) |
| 6315 | || (r.bottom > y0 && r.bottom < y1)) | 6352 | || (r.bottom > y0 && r.bottom < y1)) |
| 6316 | { | 6353 | { |
| 6354 | if (row->overlapping_p) | ||
| 6355 | { | ||
| 6356 | if (first_overlapping_row == NULL) | ||
| 6357 | first_overlapping_row = row; | ||
| 6358 | last_overlapping_row = row; | ||
| 6359 | } | ||
| 6360 | |||
| 6317 | if (expose_line (w, row, &r)) | 6361 | if (expose_line (w, row, &r)) |
| 6318 | mouse_face_overwritten_p = 1; | 6362 | mouse_face_overwritten_p = 1; |
| 6319 | } | 6363 | } |
| 6320 | 6364 | ||
| 6321 | if (y1 >= yb) | 6365 | if (y1 >= yb) |
| 6322 | break; | 6366 | break; |
| 6323 | } | 6367 | } |
| @@ -6334,9 +6378,13 @@ expose_window (w, fr) | |||
| 6334 | 6378 | ||
| 6335 | if (!w->pseudo_window_p) | 6379 | if (!w->pseudo_window_p) |
| 6336 | { | 6380 | { |
| 6381 | /* Fix the display of overlapping rows. */ | ||
| 6382 | if (first_overlapping_row) | ||
| 6383 | expose_overlaps (w, first_overlapping_row, last_overlapping_row); | ||
| 6384 | |||
| 6337 | /* Draw border between windows. */ | 6385 | /* Draw border between windows. */ |
| 6338 | x_draw_vertical_border (w); | 6386 | x_draw_vertical_border (w); |
| 6339 | 6387 | ||
| 6340 | /* Turn the cursor on again. */ | 6388 | /* Turn the cursor on again. */ |
| 6341 | if (cursor_cleared_p) | 6389 | if (cursor_cleared_p) |
| 6342 | x_update_window_cursor (w, 1); | 6390 | x_update_window_cursor (w, 1); |