/* Copyright (c) 1988 Bellcore ** All Rights Reserved ** Permission is granted to copy or use this program, EXCEPT that it ** may not be sold for profit, the copyright notice must be reproduced ** on copies, and credit should be given to Bellcore where it is due. ** BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. */ #ifndef lint static char rcsid[]= "$Header: visual.c,v 1.1 88/09/15 11:34:02 daniel Rel $"; #endif #ifdef MGR #include "misc.h" #include "line.h" #include "token.h" #include "/usr/public/pkg/mgr/include/term.h" #include "/usr/public/pkg/mgr/include/restart.h" #define OTHER 0 #define ON_DEBUG 1 #define OFF_DEBUG 2 #define DO_QUIT 3 #define DO_PAGE 4 #define NEW_PREC 5 #define NROW 60 #define NCOL 80 int isdiff[MAXTOKENS]; /* flag showing if a token pair was shown different*/ int comwin,wina, winb; /* location to store window numbers */ int fontx,fonty; /* size of the font in pixels */ int debug =0; int firsttoken = 0; /* index of first token pair being displayed */ int tokencnt; /* count of the number of token pairs being displayed */ V_visual(flags) int flags; { int moretodo = 1; /* flag to clear when we're finished */ messup(); m_selectwin(comwin); m_setmode(W_ACTIVATE); showpages(comroutine,flags); do { switch(getinput()) { case ON_DEBUG: debug = 0; break; case OFF_DEBUG: debug = 1; break; case DO_QUIT: moretodo = 0; break; case DO_PAGE: if((firsttoken+tokencnt>= K_gettmax(0))|| (firsttoken+tokencnt>= K_gettmax(1))) { m_selectwin(comwin); m_printstr("\007this is the last page\n"); break; } firsttoken += tokencnt; showpages(comroutine,flags); break; case NEW_PREC: updatepages(comroutine,flags); break; case OTHER: break; default : Z_fatal("bad value in main switch"); } } while (moretodo); V_cleanup(); return(0); } getinput() { char ibuf[Z_LINELEN]; /* input buffer */ char *ptr; m_selectwin(comwin); m_setmode(W_ACTIVATE); switch (m_getchar()) { case 't': m_gets(ibuf); /* ** skip the 'tol' */ ptr = ibuf; S_nextword(&ptr); T_setdef(ptr); return(NEW_PREC); case 'q': return(DO_QUIT); case 'd': return(OFF_DEBUG); case 'D': return(ON_DEBUG); case 'm': return(DO_PAGE); default: return(OTHER); } } showpages(comroutine,flags) int (*comroutine)(); int flags; { int i; m_selectwin(wina); m_clear(); m_selectwin(winb); m_clear(); showlines(); for(i=firsttoken;ipos*fontx,fonty/2,(Bt[firsttoken]->pos*fontx)-2,fonty/2); */ } if (Anexttoken > Bnexttoken) { m_selectwin(wina); for(i=Bnexttoken;i