/* Scroll (change_scroll_region+parm_rindex+parm_index / csr+rin+indn) */ static void _scroll_region(TERM_REC *term, int y1, int y2, int count) { /* setup the scrolling region to wanted area */ scroll_region_setup(term, y1, y2); term->move(term, 0, y1); if (count > 0) { term->move(term, 0, y2); tput(tparm(term->TI_indn, count, count)); } else if (count < 0) { term->move(term, 0, y1); tput(tparm(term->TI_rin, -count, -count)); } /* reset the scrolling region to full screen */ scroll_region_setup(term, 0, term->height-1); }
/* Scroll (change_scroll_region+scroll_reverse+scroll_forward / csr+ri+ind) */ static void _scroll_region_1(TERM_REC *term, int y1, int y2, int count) { int i; /* setup the scrolling region to wanted area */ scroll_region_setup(term, y1, y2); if (count > 0) { term->move(term, 0, y2); for (i = 0; i < count; i++) tput(tparm(term->TI_ind)); } else if (count < 0) { term->move(term, 0, y1); for (i = count; i < 0; i++) tput(tparm(term->TI_ri)); } /* reset the scrolling region to full screen */ scroll_region_setup(term, 0, term->height-1); }
/* Scroll (parm_insert_line+parm_delete_line / il+dl) */ static void _scroll_line(TERM_REC *term, int y1, int y2, int count) { /* setup the scrolling region to wanted area - this might not necessarily work with il/dl, but at least it looks better if it does */ scroll_region_setup(term, y1, y2); if (count > 0) { term->move(term, 0, y1); tput(tparm(term->TI_dl, count, count)); term->move(term, 0, y2-count+1); tput(tparm(term->TI_il, count, count)); } else if (count < 0) { term->move(term, 0, y2+count+1); tput(tparm(term->TI_dl, -count, -count)); term->move(term, 0, y1); tput(tparm(term->TI_il, -count, -count)); } /* reset the scrolling region to full screen */ scroll_region_setup(term, 0, term->height-1); }