diff options
| author | Richard M. Stallman | 1993-07-25 21:50:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-07-25 21:50:16 +0000 |
| commit | c83febd71f9d9f1abd8a0cafe6924112bea60d14 (patch) | |
| tree | d14f9899791082d666d5477027329ab401bffa9b /src/xterm.c | |
| parent | 76426794809951a8528eee648d716dab7ebc4369 (diff) | |
| download | emacs-c83febd71f9d9f1abd8a0cafe6924112bea60d14.tar.gz emacs-c83febd71f9d9f1abd8a0cafe6924112bea60d14.zip | |
(redraw_previous_char): New function.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index dbfd6d1ab99..4005f5a603c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -271,6 +271,7 @@ extern Cursor XCreateCursor (); | |||
| 271 | extern FONT_TYPE *XOpenFont (); | 271 | extern FONT_TYPE *XOpenFont (); |
| 272 | 272 | ||
| 273 | static void flashback (); | 273 | static void flashback (); |
| 274 | static void redraw_previous_char (); | ||
| 274 | 275 | ||
| 275 | #ifndef HAVE_X11 | 276 | #ifndef HAVE_X11 |
| 276 | static void dumpqueue (); | 277 | static void dumpqueue (); |
| @@ -288,7 +289,7 @@ static int XTclear_end_of_line (); | |||
| 288 | of the frame being updated, so that the XT... functions do not | 289 | of the frame being updated, so that the XT... functions do not |
| 289 | need to take a frame as argument. Most of the XT... functions | 290 | need to take a frame as argument. Most of the XT... functions |
| 290 | should never be called except during an update, the only exceptions | 291 | should never be called except during an update, the only exceptions |
| 291 | being XTcursor_to, XTwrite_char and XTreassert_line_highlight. */ | 292 | being XTcursor_to, XTwrite_glyphs and XTreassert_line_highlight. */ |
| 292 | 293 | ||
| 293 | extern int mouse_track_top, mouse_track_left, mouse_track_width; | 294 | extern int mouse_track_top, mouse_track_left, mouse_track_width; |
| 294 | 295 | ||
| @@ -680,7 +681,9 @@ XTclear_end_of_line (first_unused) | |||
| 680 | CHAR_TO_PIXEL_ROW (f, curs_y), | 681 | CHAR_TO_PIXEL_ROW (f, curs_y), |
| 681 | FONT_WIDTH (f->display.x->font) * (first_unused - curs_x), | 682 | FONT_WIDTH (f->display.x->font) * (first_unused - curs_x), |
| 682 | FONT_HEIGHT (f->display.x->font), False); | 683 | FONT_HEIGHT (f->display.x->font), False); |
| 683 | 684 | #if 0 | |
| 685 | redraw_previous_char (f, curs_x, curs_y); | ||
| 686 | #endif | ||
| 684 | #else /* ! defined (HAVE_X11) */ | 687 | #else /* ! defined (HAVE_X11) */ |
| 685 | XPixSet (FRAME_X_WINDOW (f), | 688 | XPixSet (FRAME_X_WINDOW (f), |
| 686 | CHAR_TO_PIXEL_COL (f, curs_x), | 689 | CHAR_TO_PIXEL_COL (f, curs_x), |
| @@ -693,6 +696,38 @@ XTclear_end_of_line (first_unused) | |||
| 693 | UNBLOCK_INPUT; | 696 | UNBLOCK_INPUT; |
| 694 | } | 697 | } |
| 695 | 698 | ||
| 699 | /* Erase the character (if any) at the position just before X, Y in frame F, | ||
| 700 | then redraw it and the character before it. | ||
| 701 | This is necessary when we erase starting at X, | ||
| 702 | in case the character after X overlaps into the one before X. */ | ||
| 703 | |||
| 704 | static void | ||
| 705 | redraw_previous_char (f, x, y) | ||
| 706 | FRAME_PTR f; | ||
| 707 | int x, y; | ||
| 708 | { | ||
| 709 | /* Erase the character before the new ones, in case | ||
| 710 | what was here before overlaps it. | ||
| 711 | Reoutput that character, and the previous character | ||
| 712 | (in case the previous character overlaps it). */ | ||
| 713 | if (x > 0) | ||
| 714 | { | ||
| 715 | int start_x = x - 2; | ||
| 716 | if (start_x < 0) | ||
| 717 | start_x = 0; | ||
| 718 | XClearArea (x_current_display, FRAME_X_WINDOW (f), | ||
| 719 | CHAR_TO_PIXEL_COL (f, x - 1), | ||
| 720 | CHAR_TO_PIXEL_ROW (f, y), | ||
| 721 | FONT_WIDTH (f->display.x->font), | ||
| 722 | FONT_HEIGHT (f->display.x->font), False); | ||
| 723 | |||
| 724 | dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x), | ||
| 725 | CHAR_TO_PIXEL_ROW (f, y), | ||
| 726 | &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x], | ||
| 727 | x - start_x, highlight); | ||
| 728 | } | ||
| 729 | } | ||
| 730 | |||
| 696 | static | 731 | static |
| 697 | XTclear_frame () | 732 | XTclear_frame () |
| 698 | { | 733 | { |