|
|
1.1 ! root 1: /********************************************************************* ! 2: * COPYRIGHT NOTICE * ! 3: ********************************************************************** ! 4: * This software is copyright (C) 1982 by Pavel Curtis * ! 5: * * ! 6: * Permission is granted to reproduce and distribute * ! 7: * this file by any means so long as no fee is charged * ! 8: * above a nominal handling fee and so long as this * ! 9: * notice is always included in the copies. * ! 10: * * ! 11: * Other rights are reserved except as explicitly granted * ! 12: * by written permission of the author. * ! 13: * Pavel Curtis * ! 14: * Computer Science Dept. * ! 15: * 405 Upson Hall * ! 16: * Cornell University * ! 17: * Ithaca, NY 14853 * ! 18: * * ! 19: * Ph- (607) 256-4934 * ! 20: * * ! 21: * Pavel.Cornell@Udel-Relay (ARPAnet) * ! 22: * decvax!cornell!pavel (UUCPnet) * ! 23: *********************************************************************/ ! 24: ! 25: /* ! 26: ** lib_scroll.c ! 27: ** ! 28: ** The routine scroll(). ! 29: ** ! 30: ** $Log: lib_scroll.c,v $ ! 31: * Revision 1.11 93/04/12 14:14:03 bin ! 32: * Udo: third color update ! 33: * ! 34: * Revision 1.5 92/06/02 12:05:32 bin ! 35: * *** empty log message *** ! 36: * ! 37: * Revision 1.2 92/04/13 14:38:26 bin ! 38: * update by vlad ! 39: * ! 40: * Revision 2.2 91/04/20 21:40:21 munk ! 41: * Usage of register variables ! 42: * ! 43: * Revision 2.1 82/10/25 14:48:54 pavel ! 44: * Added Copyright Notice ! 45: * ! 46: * Revision 2.0 82/10/25 13:49:22 pavel ! 47: * Beta-one Test Release ! 48: * ! 49: ** ! 50: */ ! 51: ! 52: #ifdef RCSHDR ! 53: static char RCSid[] = ! 54: "$Header: /src386/usr/lib/ncurses/RCS/lib_scroll.c,v 1.11 93/04/12 14:14:03 bin Exp Locker: bin $"; ! 55: #endif ! 56: ! 57: #include "curses.h" ! 58: #include "curses.priv.h" ! 59: ! 60: ! 61: scroll(win) ! 62: register WINDOW *win; ! 63: { ! 64: register int i; ! 65: chtype *ptr, *temp; ! 66: chtype blank = ' ' | win->_attrs; ! 67: ! 68: #ifdef TRACE ! 69: if (_tracing) ! 70: _tracef("scroll(%o) called", win); ! 71: #endif ! 72: ! 73: if (!win->_scroll) ! 74: return; ! 75: ! 76: /* scroll up within scrolling region */ ! 77: temp = win->_line[win->_regtop]; ! 78: for (i = win->_regtop; i < win->_regbottom; i++) { ! 79: win->_line[i] = win->_line[i+1]; ! 80: ! 81: win->_firstchar[i] = 0; ! 82: win->_numchngd[i] = win->_lastchar[i] = win->_maxx; ! 83: } ! 84: ! 85: /* clear last line */ ! 86: for (ptr = temp; ptr - temp <= win->_maxx; ptr++) ! 87: *ptr = blank; ! 88: ! 89: win->_line[win->_regbottom] = temp; ! 90: win->_firstchar[win->_regbottom] = 0; ! 91: win->_numchngd[win->_regbottom] = win->_lastchar[win->_regbottom] = ! 92: win->_maxx; ! 93: ! 94: /* if cursor is in scrolling region move it up */ ! 95: if ((win->_cury > win->_regtop) && (win->_cury <= win->_regbottom)) ! 96: win->_cury--; ! 97: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.