|
|
1.1 ! root 1: # include "curses.ext" ! 2: /* @(#) _tscroll.c: 1.1 10/15/83 (1.3 7/17/82) */ ! 3: ! 4: _tscroll( win ) ! 5: register WINDOW *win; ! 6: { ! 7: ! 8: register chtype *sp; ! 9: register int i; ! 10: register chtype *temp; ! 11: register int top, bot; ! 12: ! 13: #ifdef DEBUG ! 14: if( win == stdscr ) ! 15: { ! 16: if(outf) fprintf( outf, "scroll( stdscr )\n" ); ! 17: } ! 18: else ! 19: { ! 20: if( win == curscr) ! 21: { ! 22: if(outf) fprintf( outf, "scroll( curscr )\n" ); ! 23: } ! 24: else ! 25: { ! 26: if(outf) fprintf( outf, "scroll( %x )\n", win ); ! 27: } ! 28: } ! 29: #endif ! 30: if( !win->_scroll ) ! 31: { ! 32: return ERR; ! 33: } ! 34: /* scroll the window lines themselves up */ ! 35: top = win->_tmarg; ! 36: bot = win->_bmarg; ! 37: temp = win->_y[top]; ! 38: #ifdef DEBUG ! 39: if(outf) ! 40: { ! 41: fprintf( outf, "top = %d, bot = %d\n", top, bot ); ! 42: } ! 43: #endif DEBUG ! 44: for (i = top; i < bot; i++) ! 45: { ! 46: win->_y[i] = win->_y[i+1]; ! 47: } ! 48: /* Put a blank line in the opened up space */ ! 49: for (sp = temp; sp - temp < win->_maxx; ) ! 50: *sp++ = ' '; ! 51: win->_y[bot] = temp; ! 52: #ifdef DEBUG ! 53: if(outf) ! 54: { ! 55: fprintf(outf,"SCROLL win [0%o], curscr [0%o], top %d, bot %d\n", ! 56: win, curscr, top, bot); ! 57: fprintf( outf, "Doing --> touchwin( 0%o )\n", win ); ! 58: } ! 59: #endif DEBUG ! 60: win->_cury--; ! 61: /* ! 62: ** This section taken out because it wasn't allowing the scrolling of a ! 63: ** region smaller than the full screen. Taken out on 10/12/83. The ! 64: ** function call touchwin(win) is done all the time now, & seems to do ! 65: ** the correct thing when it comes to scrolling with a smaller than screen ! 66: ** sized region, & a screen sized region. ! 67: ** ! 68: ** if( win->_flags&_FULLWIN ) ! 69: ** { ! 70: ** _scrdown(); ! 71: ** } ! 72: ** else ! 73: ** { ! 74: ** musttouch = 1; ! 75: ** } ! 76: ** if( musttouch ) ! 77: ** touchwin(win); ! 78: */ ! 79: touchwin(win); ! 80: return OK; ! 81: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.