diff options
| author | Karoly Lorentey | 2003-12-24 18:55:24 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2003-12-24 18:55:24 +0000 |
| commit | 8a56675df17bbd27cf45bd60a2d6e94c8f2c2281 (patch) | |
| tree | 1958036a29188aee654682dab877e738dd23d2eb /src/scroll.c | |
| parent | da1492a4cf822e50f489992115f1e0c0e23b895c (diff) | |
| download | emacs-8a56675df17bbd27cf45bd60a2d6e94c8f2c2281.tar.gz emacs-8a56675df17bbd27cf45bd60a2d6e94c8f2c2281.zip | |
Add a level of indirection to terminal characteristics.
* src/termchar.h (struct terminal): New struct.
(must_write_spaces, min_padding_speed, line_ins_del_ok)
(char_ins_del_ok, scroll_region_ok, scroll_region_cost)
(memory_below_frame, fast_clear_end_of_line): Moved to struct
terminal.
(current_terminal): New variable.
(CURRENT_TERMINAL, TERMINAL_*): New accessor macros.
(min_padding_speed, dont_calculate_costs): Commented out (unused).
* src/term.c (_current_terminal): New variable. Will be removed when
true multi-tty support is implemented.
* src/termopts.h (no_redraw_on_reenter): Moved here.
* src/term.c (set_terminal_window, ins_del_lines, calculate_costs)
(term_init): Use the accessor macros for terminal characteristics.
* src/dispnew.c (line_hash_code, line_draw_cost)
(direct_output_for_insert, update_frame_1, scrolling)
(update_frame_line): Ditto.
* src/macterm.c (mac_initialize): Ditto.
* src/msdos.c (internal_terminal_init): Ditto.
* src/scroll.c (calculate_scrolling, calculate_direct_scrolling)
(scrolling_1, scroll_cost): Ditto.
* src/sysdep.c (hft_init): Ditto.
* src/w32term.c (w32_initialize): Ditto.
* src/xdisp.c (try_window_id): Ditto.
* src/xterm.c (x_initialize): Ditto.
* etc/TODO: Add pointer to my tla archive.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-1
Diffstat (limited to 'src/scroll.c')
| -rw-r--r-- | src/scroll.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/scroll.c b/src/scroll.c index 6c6aa4abf98..a786d3c2cf4 100644 --- a/src/scroll.c +++ b/src/scroll.c | |||
| @@ -100,7 +100,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below, | |||
| 100 | register struct matrix_elt *p, *p1; | 100 | register struct matrix_elt *p, *p1; |
| 101 | register int cost, cost1; | 101 | register int cost, cost1; |
| 102 | 102 | ||
| 103 | int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below); | 103 | int lines_moved = window_size |
| 104 | + (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) ? 0 : lines_below); | ||
| 104 | /* first_insert_cost[I] is the cost of doing the first insert-line | 105 | /* first_insert_cost[I] is the cost of doing the first insert-line |
| 105 | at the i'th line of the lines we are considering, | 106 | at the i'th line of the lines we are considering, |
| 106 | where I is origin 1 (as it is below). */ | 107 | where I is origin 1 (as it is below). */ |
| @@ -466,7 +467,8 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below, | |||
| 466 | /* Overhead of setting the scroll window, plus the extra cost | 467 | /* Overhead of setting the scroll window, plus the extra cost |
| 467 | cost of scrolling by a distance of one. The extra cost is | 468 | cost of scrolling by a distance of one. The extra cost is |
| 468 | added once for consistency with the cost vectors */ | 469 | added once for consistency with the cost vectors */ |
| 469 | scroll_overhead = scroll_region_cost + extra_cost; | 470 | scroll_overhead |
| 471 | = TERMINAL_SCROLL_REGION_COST (CURRENT_TERMINAL ()) + extra_cost; | ||
| 470 | 472 | ||
| 471 | /* initialize the top left corner of the matrix */ | 473 | /* initialize the top left corner of the matrix */ |
| 472 | matrix->writecost = 0; | 474 | matrix->writecost = 0; |
| @@ -818,7 +820,7 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom, | |||
| 818 | matrix = ((struct matrix_elt *) | 820 | matrix = ((struct matrix_elt *) |
| 819 | alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix)); | 821 | alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix)); |
| 820 | 822 | ||
| 821 | if (scroll_region_ok) | 823 | if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())) |
| 822 | { | 824 | { |
| 823 | calculate_direct_scrolling (frame, matrix, window_size, | 825 | calculate_direct_scrolling (frame, matrix, window_size, |
| 824 | unchanged_at_bottom, | 826 | unchanged_at_bottom, |
| @@ -914,7 +916,7 @@ scroll_cost (frame, from, to, amount) | |||
| 914 | if (amount == 0) | 916 | if (amount == 0) |
| 915 | return 0; | 917 | return 0; |
| 916 | 918 | ||
| 917 | if (! scroll_region_ok) | 919 | if (! TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ())) |
| 918 | limit = height; | 920 | limit = height; |
| 919 | else if (amount > 0) | 921 | else if (amount > 0) |
| 920 | limit += amount; | 922 | limit += amount; |