/* prototypes for this file are in tek.trm-proto */ /* GNUPLOT - tek.trm */ /* * Copyright (C) 1990 * * Permission to use, copy, and distribute this software and its * documentation for any purpose with or without fee is hereby granted, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. * * Permission to modify the software is granted, but not the right to * distribute the modified code. Modifications are to be distributed * as patches to released version. * * This software is provided "as is" without express or implied warranty. * * This file is included by ../term.c. * * This terminal driver supports: * tek40xx, bitgraph, kermit_color_tek40xx, kermit_mono_tek40xx, selanar * * AUTHORS * Colin Kelley, Thomas Williams, Russell Lang * * send your comments or suggestions to (pixar!info-gnuplot@sun.com). * */ #ifdef TEK #define TEK40XMAX 1024 #define TEK40YMAX 780 #define TEK40XLAST (TEK40XMAX - 1) #define TEK40YLAST (TEK40YMAX - 1) #define TEK40VCHAR 25 #define TEK40HCHAR 14 #define TEK40VTIC 11 #define TEK40HTIC 11 #define HX 0x20 /* bit pattern to OR over 5-bit data */ #define HY 0x20 #define LX 0x40 #define LY 0x60 #define LOWER5 31 #define UPPER5 (31<<5) #if defined(_WIN32) #include #define sleep(sec) Sleep(sec * 1000) #else #include #endif int TEK40init(void) { return 0; } int TEK40graphics(void) { #ifdef vms term_pasthru(); #endif /* vms */ fprintf(outfile, "\033\014"); /* 1 1. clear screen */ (void) fflush(outfile); sleep(1); /* sleep 1 second to allow screen time to clear on real tektronix terminals */ return 0; } int TEK40text(void) { TEK40move(0, 12); fprintf(outfile, "\037"); /* 1 1. into alphanumerics */ #ifdef vms term_nopasthru(); #endif /* vms */ return 0; } int TEK40linetype(int linetype) { return 0; } int TEK40move(int x, int y) { (void) putc('\035', outfile); /* into graphics */ TEK40vector(x, y); return 0; } int TEK40vector(int x, int y) { y += 4; /* offset vertically to avoid problems with Hershey char. parentheses--MDB */ (void) putc((HY | (y & UPPER5)>>5), outfile); (void) putc((LY | (y & LOWER5)), outfile); (void) putc((HX | (x & UPPER5)>>5), outfile); (void) putc((LX | (x & LOWER5)), outfile); return 0; } int TEK40put_text(int x, int y, char *str) { TEK40move(x, y-11); fprintf(outfile, "\037%s\n", str); return 0; } int TEK40reset(void) { return 0; } #endif /* TEK */ /* thanks to dukecdu!evs (Ed Simpson) for the BBN BitGraph driver */ #ifdef BITGRAPH #define BG_XMAX 768 /* width of plot area */ #define BG_YMAX 768 /* height of plot area */ #define BG_SCREEN_HEIGHT 1024 /* full screen height */ #define BG_XLAST (BG_XMAX - 1) #define BG_YLAST (BG_YMAX - 1) #define BG_VCHAR 16 #define BG_HCHAR 9 #define BG_VTIC 8 #define BG_HTIC 8 #define BG_init TEK40init #define BG_graphics TEK40graphics #define BG_linetype TEK40linetype #define BG_move TEK40move #define BG_vector TEK40vector int BG_text(void) { BG_move(0, BG_SCREEN_HEIGHT - 2 * BG_VCHAR); fprintf(outfile, "\037"); /* 1 1. into alphanumerics */ return 0; } int BG_put_text(int x, int y, char *str) { BG_move(x, y-11); fprintf(outfile, "\037%s\n", str); return 0; } #define BG_reset TEK40reset #endif /* BITGRAPH */ /* Color and Monochrome specials for the MS-Kermit Tektronix Emulator by Russell Lang, eln272v@monu1.cc.monash.oz */ #ifdef KERMIT #define KTEK40HCHAR 13 int KTEK40graphics(void) { #ifdef vms term_mode_tek(); term_pasthru(); #endif /* vms */ fprintf(outfile, "\033\014"); /* 1 1. clear screen */ /* kermit tektronix emulation doesn't need to wait */ return 0; } int KTEK40Ctext(void) { TEK40text(); KTEK40Clinetype(0); /* change to green */ #ifdef vms term_nopasthru(); #endif /* vms */ return 0; } /* special color linetypes for MS-DOS Kermit v2.31 tektronix emulator */ /* 0 = normal, 1 = bright foreground color (30-37) = 30 + colors where colors are 1=red, 2=green, 4=blue */ static char *kermit_color[15]= {"\033[0;37m", "\033[1;30m", "\033[0;32m", "\033[0;36m", "\033[0;31m", "\033[0;35m", "\033[1;34m", "\033[1;33m", "\033[1;31m", "\033[1;37m", "\033[1;35m", "\033[1;32m", "\033[1;36m", "\033[0;34m", "\033[0;33m"}; int KTEK40Clinetype(int linetype) { if (linetype >= 13) linetype %= 13; fprintf(outfile, "%s", kermit_color[linetype+2]); return 0; } /* linetypes for MS-DOS Kermit v2.30 tektronix emulator */ /* `=solid, a=fine dots, b=short dashes, c=dash dot, d=long dash dot, e=dash dot dot */ static char *kerm_linetype = "`a`abcde" ; int KTEK40Mlinetype(int linetype) { if (linetype >= 6) linetype %= 6; fprintf(outfile, "\033%c", kerm_linetype[linetype+2]); return 0; } int KTEK40reset(void) { fprintf(outfile, "\030\n"); /* turn off Tek emulation */ #ifdef vms term_mode_native(); #endif /* vms */ return 0; } #endif /* KERMIT */ /* thanks to sask!macphed (Geoff Coleman and Ian Macphedran) for the Selanar driver */ #ifdef SELANAR int SEL_init(void) { fprintf(outfile, "\033\062"); /* 1 1. set to ansi mode */ return 0; } int SEL_graphics(void) { fprintf(outfile, "\033[H\033[J\033\061\033\014"); /* 1 2 3 1. clear ANSI screen 2. set to TEK mode 3. clear screen */ return 0; } int SEL_text(void) { TEK40move(0, 12); fprintf(outfile, "\033\062"); /* 1 1. into ANSI mode */ return 0; } int SEL_reset(void) { fprintf(outfile, "\033\061\033\012\033\062\033[H\033[J"); /* 1 2 3 4 1 set tek mode 2 clear screen 3 set ansi mode 4 clear screen */ return 0; } #endif /* SELANAR */ #ifdef VTTEK int VTTEK40init(void) { fprintf(outfile, "\033[?38h"); fflush(outfile); sleep(1); /* sleep 1 second to allow screen time to clear on some terminals */ #ifdef vms term_mode_tek(); #endif /* vms */ return 0; } int VTTEK40reset(void) { fprintf(outfile, "\033[?38l"); fflush(outfile); sleep(1); /* sleep 1 second to allow screen time to clear on some terminals */ #ifdef vms term_mode_native(); #endif /* vms */ return 0; } /* linetypes for VT-type terminals in tektronix emulator mode */ /* `=solid, a=fine dots, b=short dashes, c=dash dot, d=long dash dot, h=bold solid, i=bold fine dots, j=bold short dashes, k=bold dash dot, l=bold long dash dot */ static char *vt_linetype = "`a`abcdhijkl" ; static int last_vt_linetype = 0; int VTTEK40linetype(int linetype) { if (linetype >= 10) linetype %= 10; fprintf(outfile, "\033%c", vt_linetype[linetype+2]); last_vt_linetype = linetype; return 0; } int VTTEK40put_text(int x, int y, char *str) { int linetype; linetype = last_vt_linetype; VTTEK40linetype(0); TEK40put_text(x, y, str); VTTEK40linetype(linetype); return 0; } #endif /* VTTEK */