summaryrefslogtreecommitdiff
path: root/src/scroll.c
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2003-12-24 18:55:24 +0000
committerKaroly Lorentey <lorentey@elte.hu>2003-12-24 18:55:24 +0000
commit8a56675df17bbd27cf45bd60a2d6e94c8f2c2281 (patch)
tree1958036a29188aee654682dab877e738dd23d2eb /src/scroll.c
parentda1492a4cf822e50f489992115f1e0c0e23b895c (diff)
downloademacs-8a56675df17bbd27cf45bd60a2d6e94c8f2c2281.tar.gz
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.c10
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,
register struct matrix_elt *p, *p1;
register int cost, cost1;
- int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below);
+ int lines_moved = window_size
+ + (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()) ? 0 : lines_below);
/* first_insert_cost[I] is the cost of doing the first insert-line
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
@@ -466,7 +467,8 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
/* Overhead of setting the scroll window, plus the extra cost
cost of scrolling by a distance of one. The extra cost is
added once for consistency with the cost vectors */
- scroll_overhead = scroll_region_cost + extra_cost;
+ scroll_overhead
+ = TERMINAL_SCROLL_REGION_COST (CURRENT_TERMINAL ()) + extra_cost;
/* initialize the top left corner of the matrix */
matrix->writecost = 0;
@@ -818,7 +820,7 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
matrix = ((struct matrix_elt *)
alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
- if (scroll_region_ok)
+ if (TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
{
calculate_direct_scrolling (frame, matrix, window_size,
unchanged_at_bottom,
@@ -914,7 +916,7 @@ scroll_cost (frame, from, to, amount)
if (amount == 0)
return 0;
- if (! scroll_region_ok)
+ if (! TERMINAL_SCROLL_REGION_OK (CURRENT_TERMINAL ()))
limit = height;
else if (amount > 0)
limit += amount;