/* Clear from cursor to end of screen. */ static void w32con_clear_to_end (void) { struct frame * f = PICK_FRAME (); w32con_clear_end_of_line (FRAME_COLS (f) - 1); w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); }
/* If start is zero insert blanks instead of a string at start ?. */ static void w32con_insert_glyphs (register struct glyph *start, register int len) { scroll_line (len, RIGHT); /* Move len chars to the right starting at cursor_coords, fill with blanks */ if (start) { /* Print the first len characters of start, cursor_coords.X adjusted by write_glyphs. */ w32con_write_glyphs (start, len); } else { w32con_clear_end_of_line (cursor_coords.X + len); } }
/* Insert n lines at vpos. if n is negative delete -n lines. */ static void w32con_ins_del_lines (int vpos, int n) { int i, nb; SMALL_RECT scroll; COORD dest; CHAR_INFO fill; struct frame * f = PICK_FRAME (); if (n < 0) { scroll.Top = vpos - n; scroll.Bottom = FRAME_LINES (f); dest.Y = vpos; } else { scroll.Top = vpos; scroll.Bottom = FRAME_LINES (f) - n; dest.Y = vpos + n; } scroll.Left = 0; scroll.Right = FRAME_COLS (f); dest.X = 0; fill.Char.AsciiChar = 0x20; fill.Attributes = char_attr_normal; ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); /* Here we have to deal with a w32 console flake: If the scroll region looks like abc and we scroll c to a and fill with d we get cbd... if we scroll block c one line at a time to a, we get cdd... Emacs expects cdd consistently... So we have to deal with that here... (this also occurs scrolling the same way in the other direction. */ if (n > 0) { if (scroll.Bottom < dest.Y) { for (i = scroll.Bottom; i < dest.Y; i++) { w32con_move_cursor (i, 0); w32con_clear_end_of_line (FRAME_COLS (f)); } } } else { nb = dest.Y + (scroll.Bottom - scroll.Top) + 1; if (nb < scroll.Top) { for (i = nb; i < scroll.Top; i++) { w32con_move_cursor (i, 0); w32con_clear_end_of_line (FRAME_COLS (f)); } } } cursor_coords.X = 0; cursor_coords.Y = vpos; }
/* Clear from cursor to end of screen. */ static void w32con_clear_to_end (struct frame *f) { w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); }