home *** CD-ROM | disk | FTP | other *** search
- #define REGISXMAX 800
- #define REGISYMAX 440
-
- #define REGISXLAST (REGISXMAX - 1)
- #define REGISYLAST (REGISYMAX - 1)
-
- #define REGISVCHAR 20
- #define REGISHCHAR 8
- #define REGISVTIC 8
- #define REGISHTIC 6
-
- REGISinit()
- {
- fprintf(outfile,"\033[r\033[24;1H");
- /* 1 2
- 1. reset scrolling region
- 2. locate cursor on bottom line
- */
- }
-
-
- /* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
- REGISgraphics()
- {
- fprintf(outfile,"\033[2J\033P1pS(C0)S(E)");
- /* 1 2 3 4
- 1. clear screen
- 2. enter ReGIS graphics
- 3. turn off graphics diamond cursor
- 4. clear graphics screen
- */
- }
-
-
- REGIStext()
- {
- fprintf(outfile,"\033\\\033[24;1H");
- /* 1 2
- 1. Leave ReGIS graphics mode
- 2. locate cursor on last line of screen
- */
- }
-
-
- REGISlinetype(linetype)
- int linetype;
- {
- /* This will change color in order G,R,B,G-dot,R-dot,B-dot */
- static int in_map[9 + 2] = {2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1};
- static int lt_map[9 + 2] = {1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6};
-
- if (linetype >= 9)
- linetype %= 9;
- fprintf(outfile, "W(I%d)", in_map[linetype + 2]);
- fprintf(outfile, "W(P%d)", lt_map[linetype + 2]);
- }
-
-
- REGISmove(x,y)
- int x,y;
- {
- fprintf(outfile,"P[%d,%d]",x,REGISYLAST-y,x,REGISYLAST-y);
- }
-
-
- REGISvector(x,y)
- int x,y;
- {
- fprintf(outfile,"v[]v[%d,%d]",x,REGISYLAST - y);
- /* the initial v[] is needed to get the first pixel plotted */
- }
-
-
- REGISlrput_text(row,str)
- int row;
- char *str;
- {
- REGISmove(REGISXMAX-REGISHTIC-REGISHCHAR*(strlen(str)+3),
- REGISVTIC+REGISVCHAR*(row+1));
- (void) putc('T',outfile); (void) putc('\'',outfile);
- while (*str) {
- (void) putc(*str,outfile);
- if (*str == '\'')
- (void) putc('\'',outfile); /* send out another one */
- str++;
- }
- (void) putc('\'',outfile);
- }
-
-
- REGISulput_text(row,str)
- int row;
- char *str;
- {
- REGISmove(REGISVTIC,REGISYMAX-REGISVTIC*2-REGISVCHAR*row);
- (void) putc('T',outfile); (void) putc('\'',outfile);
- while (*str) {
- (void) putc(*str,outfile);
- if (*str == '\'')
- (void) putc('\'',outfile); /* send out another one */
- str++;
- }
- (void) putc('\'',outfile);
- }
-
-
- REGISreset()
- {
- fprintf(outfile,"\033[2J\033[24;1H");
- }
-
-
-