register struct matrix_elt *p, *p1;
register int cost, cost1;
register struct matrix_elt *p, *p1;
register int cost, cost1;
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
int *first_insert_cost
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
int *first_insert_cost
/* Perform insert-lines and delete-lines operations on CURRENT_MATRIX
according to the costs in MATRIX, using the general scrolling
method that is used if the terminal does not support the setting of
/* Perform insert-lines and delete-lines operations on CURRENT_MATRIX
according to the costs in MATRIX, using the general scrolling
method that is used if the terminal does not support the setting of
WINDOW_SIZE is the number of lines being considered for scrolling
and UNCHANGED_AT_TOP is the vpos of the first line being
considered. These two arguments can specify any contiguous range
of lines. */
WINDOW_SIZE is the number of lines being considered for scrolling
and UNCHANGED_AT_TOP is the vpos of the first line being
considered. These two arguments can specify any contiguous range
of lines. */
static void
do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
struct glyph_matrix *current_matrix;
static void
do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
struct glyph_matrix *current_matrix;
struct queue *queue_start
= (struct queue *) alloca (current_matrix->nrows * sizeof (struct queue));
struct queue *queue = queue_start;
struct queue *queue_start
= (struct queue *) alloca (current_matrix->nrows * sizeof (struct queue));
struct queue *queue = queue_start;
char *retained_p = (char *) alloca (window_size * sizeof (char));
int *copy_from = (int *) alloca (window_size * sizeof (int));
char *retained_p = (char *) alloca (window_size * sizeof (char));
int *copy_from = (int *) alloca (window_size * sizeof (int));
if (p->insertcost < p->writecost && p->insertcost < p->deletecost)
{
/* Insert should be done at vpos i-1, plus maybe some before.
if (p->insertcost < p->writecost && p->insertcost < p->deletecost)
{
/* Insert should be done at vpos i-1, plus maybe some before.
register struct matrix_elt *p, *p1;
register int cost, cost1, delta;
/* first_insert_cost[-I] is the cost of doing the first insert-line
at a position I lines above the bottom line in the scroll window. */
int *first_insert_cost
register struct matrix_elt *p, *p1;
register int cost, cost1, delta;
/* first_insert_cost[-I] is the cost of doing the first insert-line
at a position I lines above the bottom line in the scroll window. */
int *first_insert_cost
To reduce the cumulative effects of rounding error, we
vary the position at which the difference is computed. */
cost1 += first_insert_cost[-j] - first_insert_cost[1-j] +
To reduce the cumulative effects of rounding error, we
vary the position at which the difference is computed. */
cost1 += first_insert_cost[-j] - first_insert_cost[1-j] +
cost += scroll_overhead + first_delete_cost[-delta] +
(delta-1) * (next_delete_cost[-delta] + extra_cost);
cost1 += first_delete_cost[-i] - first_delete_cost[1-i] +
cost += scroll_overhead + first_delete_cost[-delta] +
(delta-1) * (next_delete_cost[-delta] + extra_cost);
cost1 += first_delete_cost[-i] - first_delete_cost[1-i] +
and UNCHANGED_AT_TOP is the vpos of the first line being
considered. These two arguments can specify any contiguous range
of lines.
and UNCHANGED_AT_TOP is the vpos of the first line being
considered. These two arguments can specify any contiguous range
of lines.
In the direct scrolling method, a new scroll window is selected
before each insertion or deletion, so that groups of lines can be
scrolled directly to their final vertical positions. This method
In the direct scrolling method, a new scroll window is selected
before each insertion or deletion, so that groups of lines can be
scrolled directly to their final vertical positions. This method
without also decrementing i, this corresponds to omitting these
lines in the new rows, i.e. rows are deleted. */
i = j = window_size;
without also decrementing i, this corresponds to omitting these
lines in the new rows, i.e. rows are deleted. */
i = j = window_size;
if (p->insertcost < p->writecost
&& p->insertcost < p->deletecost
&& (write_follows_p || i < j))
if (p->insertcost < p->writecost
&& p->insertcost < p->deletecost
&& (write_follows_p || i < j))
{
calculate_direct_scrolling (frame, matrix, window_size,
unchanged_at_bottom,
{
calculate_direct_scrolling (frame, matrix, window_size,
unchanged_at_bottom,
old_hash, new_hash, free_at_end);
do_direct_scrolling (frame->current_matrix,
matrix, window_size, unchanged_at_top);
old_hash, new_hash, free_at_end);
do_direct_scrolling (frame->current_matrix,
matrix, window_size, unchanged_at_top);
- [tt.t_ILov + (frame_height + 1 - L) * tt.t_ILpf] +
- N * [tt.t_ILnov + (frame_height + 1 - L) * tt.t_ILnpf]
+ [tt.t_ILov + (frame_lines + 1 - L) * tt.t_ILpf] +
+ N * [tt.t_ILnov + (frame_lines + 1 - L) * tt.t_ILnpf]
ILov represents the basic insert line overhead. ILpf is the padding
required to allow the terminal time to move a line: insertion at line
ILov represents the basic insert line overhead. ILpf is the padding
required to allow the terminal time to move a line: insertion at line
The first bracketed expression above is the overhead; the second is
the multiply factor. Both are dependent only on the position at
The first bracketed expression above is the overhead; the second is
the multiply factor. Both are dependent only on the position at
{
FRAME_INSERT_COST (frame) =
(int *) xrealloc (FRAME_INSERT_COST (frame),
{
FRAME_INSERT_COST (frame) =
(int *) xrealloc (FRAME_INSERT_COST (frame),
FRAME_DELETEN_COST (frame) =
(int *) xrealloc (FRAME_DELETEN_COST (frame),
FRAME_DELETEN_COST (frame) =
(int *) xrealloc (FRAME_DELETEN_COST (frame),
FRAME_INSERTN_COST (frame) =
(int *) xrealloc (FRAME_INSERTN_COST (frame),
FRAME_INSERTN_COST (frame) =
(int *) xrealloc (FRAME_INSERTN_COST (frame),
FRAME_DELETE_COST (frame) =
(int *) xrealloc (FRAME_DELETE_COST (frame),
FRAME_DELETE_COST (frame) =
(int *) xrealloc (FRAME_DELETE_COST (frame),
- (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
- FRAME_DELETE_COST (frame) =
- (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
+ (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));
+ FRAME_DELETE_COST (frame) =
+ (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));