[BACK]Return to excl.trm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot / term

Annotation of OpenXM_contrib/gnuplot/term/excl.trm, Revision 1.1.1.1

1.1       maekawa     1: /*
                      2:  * $Id: excl.trm,v 1.9 1998/04/14 00:17:41 drd Exp $
                      3:  *
                      4:  */
                      5:
                      6: /* GNUPLOT - excl.trm */
                      7:
                      8: /* Copyright (c) 1992, 1998 by P. Klosowski at NIST.  All Rights Reserved
                      9:  *
                     10:  * Permission to use, copy, and distribute this software and its
                     11:  * documentation for any purpose with or without fee is hereby granted,
                     12:  * provided that the above copyright notice appear in all copies and
                     13:  * that both that copyright notice and this permission notice appear
                     14:  * in supporting documentation.
                     15:  *
                     16:  * Permission to modify the software is granted, but not the right to
                     17:  * distribute the complete modified source code.  Modifications are to
                     18:  * be distributed as patches to the released version.  Permission to
                     19:  * distribute binaries produced by compiling modified sources is granted,
                     20:  * provided you
                     21:  *   1. distribute the corresponding source modifications from the
                     22:  *    released version in the form of a patch file along with the binaries,
                     23:  *   2. add special version identification to distinguish your version
                     24:  *    in addition to the base release version number,
                     25:  *   3. provide your name and address as the primary contact for the
                     26:  *    support of your modified version, and
                     27:  *   4. retain our contact information in regard to use of the base
                     28:  *    software.
                     29:  * Permission to distribute the released version of the source code along
                     30:  * with corresponding source modifications in the form of a patch file is
                     31:  * granted with same provisions 2 through 4 for binary distributions.
                     32:  *
                     33:  * This software is provided "as is" without express or implied warranty
                     34:  * to the extent permitted by applicable law.
                     35:  *
                     36:  * This file is included by ../term.c.
                     37:  *
                     38:  *
                     39:  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
                     40:  *
                     41:  */
                     42:
                     43: /***
                     44:   NAME
                     45:      quic
                     46:    PURPOSE
                     47:      QUIC driver for GNUPLOT
                     48:    NOTES
                     49:
                     50:    HISTORY
                     51:      przemek - Aug 16, 1992: Created.
                     52:      lars - Nov 30, 1998: Updated to new gnuplot copyright by
                     53:                           permission from Przemek
                     54: ***/
                     55: /*
                     56: c               *****************************************
                     57: c               *****************************************
                     58: c               ******                              *****
                     59: c               ******   EXCL command definitions   *****
                     60: c               ******                              *****
                     61: c               *****************************************
                     62: c               *****************************************
                     63: */
                     64:
                     65: /*
                     66:  * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
                     67:  */
                     68:
                     69: #include "driver.h"
                     70:
                     71: #ifdef TERM_REGISTER
                     72: register_term(excl)
                     73: #endif
                     74:
                     75: #ifdef TERM_PROTO
                     76: TERM_PUBLIC void EXCL_init __PROTO((void));
                     77: TERM_PUBLIC void EXCL_graphics __PROTO((void));
                     78: TERM_PUBLIC void EXCL_text __PROTO((void));
                     79: TERM_PUBLIC void EXCL_linetype __PROTO((int linetype));
                     80: TERM_PUBLIC void EXCL_move __PROTO((unsigned int x, unsigned int y));
                     81: TERM_PUBLIC void EXCL_vector __PROTO((unsigned int x2, unsigned int y2));
                     82: TERM_PUBLIC void EXCL_put_text __PROTO((unsigned int x, unsigned int y, char str[]));
                     83: TERM_PUBLIC void EXCL_reset __PROTO((void));
                     84:
                     85: #define EXCL_XMAX 9000
                     86: #define EXCL_YMAX 6500
                     87:
                     88: #define EXCL_XLAST (EXCL_XMAX - 1)
                     89: #define EXCL_YLAST (EXCL_YMAX - 1)
                     90:
                     91: #define EXCL_VCHAR             120
                     92: #define EXCL_HCHAR             70
                     93: #define EXCL_VTIC              70
                     94: #define EXCL_HTIC              70
                     95: #endif /* TERM_PROTO */
                     96:
                     97:
                     98: #ifndef TERM_PROTO_ONLY
                     99: #ifdef TERM_BODY
                    100:
                    101: /*  Define ansi command headers, NUL character */
                    102: #define ESC "\033"
                    103: #define GS  "\035"
                    104: #define CSI "\033["
                    105: #define DCS "\033P"
                    106: #define ST  "\033\\"
                    107:
                    108: /*
                    109: page numbers are given per "Talaris EXCL programmer's reference manual" M292 rev.2
                    110: NOTE: EXCL coordinate system places (0,0) at upper left corner of the page
                    111:
                    112: c EXCL commands for initialization
                    113:
                    114: c     TALAMS: set ANSI                                        (p. 162)
                    115: c     TALMOD: set emulation *** EXCL                          (p. 164)
                    116: c     TALPGO: set page orient *** landscape                   (p.  81)
                    117: c     TALFCTL: set paper format *** 8.5x11                    (p.  85)
                    118: c     TALTBM: set top/bot margins  ** in land mode to full pg (p.  73)
                    119: c     TALLRM: set left/right margins                          (p.  75)
                    120: c     PUM:    set units ** units of measure set by TALPRM     (p.  67)
                    121: c     TALASF: Absorb cr/ff/lf/vt   ** ON                      (p. 182)
                    122: c     TALPOP: pop controller params                           (p. 168)
                    123: c     TALPSH: push controller params                          (p. 167)
                    124: c     TALPRM: set units of measure ** to 1/1000 inch          (p.  64)
                    125: c     TALGLT: set line type ** solid                          (p. 211)
                    126: c     TALORG: set page absolute origin ** (0,0) UL corner     (p.  78)
                    127: c     TALPCW: set page clip window *** for landsc/full page   (p.  84)
                    128: c     TALGLP: line: **pen7x7mil*draw*smear*glyph112*font5279* (p. 208)
                    129: c     TALGLPE: ending for TALGLP command, forcing DRAW mode
                    130: c     TALGBB: bounding box; used only by qdrive               (p. 207)
                    131: c     TALFPO: Force page out  ** clear bitmap                 (p.  95)
                    132: c     TALGDW: graphical draw to hor,vert ** abs  coords       (p. 212)
                    133: c     TALGMV: graphical move to hor,vert ** abs  coords       (p. 213)
                    134: */
                    135: #define TALAMS  "\033[0*s"
                    136: #define TALMOD  "\033[1;0r"
                    137: #define TALPGO  "\033[1;0p"
                    138: #define TALFCTL "\033[0;3x"
                    139: #define TALTBM  "\033[0;8500 v"
                    140: #define TALLRM  "\033[0;11000v"
                    141: #define PUM     "\033[11h"
                    142: #define TALASF  "\033[1 z"
                    143: #define TALPOP  "\033[*]"
                    144: #define TALPSH  "\033[*["
                    145: #define TALPRM  "\033[3y"
                    146: #define TALGLT  "\033[%s*t"
                    147: #define TALORG  "\033[0;0o"
                    148: #define TALCCNT "\033[1;0u"
                    149: #define TALPCW  "\033[0;8500;11000;0*c"
                    150: #define TALGLP_init  "\033[7;7;8;1;112;5279*w"
                    151: #define TALGLP  "\033[%d;%d;8*w"
                    152: #define TALFPO  "\033[0*F"
                    153: #define TALGDW "\033[0;%d;%d*d"
                    154: #define TALGMV "\033[0;%d;%d*m"
                    155:
                    156: /*  TALPYL: polyline                                        (p. 222)
                    157: **        5;0} list of 16-bit signed integers, encoded, mostly relative
                    158: **        5,1} list of ASCII  absolute coords (if w/o +- signs)(e.g. 315:1222;)
                    159: */
                    160:
                    161: #define TALPYL  "\033P5;1}"
                    162:
                    163: TERM_PUBLIC void EXCL_init()
                    164: {
                    165:     fprintf(gpoutfile, "%s%s%s%s%s%s",
                    166:            TALPSH, TALAMS, TALMOD, TALCCNT, TALFCTL, TALASF);
                    167: /*                ^save state   ^setEXCL       ^PaperSize8.5x11       */
                    168: /*                       ^setANSI      ^copyCount1     ^absorbCtlChar */
                    169:     fprintf(gpoutfile, "%s%s%s%s%s%s",
                    170:            PUM, TALPRM, TALPGO, TALPCW, TALORG, TALGLP_init);
                    171:     fprintf(gpoutfile, TALGLT, "");
                    172: /*                ^setUnits  ^landscape    ^OriginZero        ^SolidLine   */
                    173: /*                    ^Units1/1000" ^pageClip     ^SetLine            */
                    174: }
                    175:
                    176: TERM_PUBLIC void EXCL_graphics()
                    177: {
                    178: }
                    179:
                    180: TERM_PUBLIC void EXCL_text()
                    181: {
                    182:     fputs(TALFPO, gpoutfile);
                    183:     /*    ^pageout  */
                    184: }
                    185:
                    186:
                    187: TERM_PUBLIC void EXCL_linetype(linetype)
                    188: int linetype;
                    189: {
                    190: /* excl line widths in mils: 4 is mimimum, but too thin; then
                    191:    7,10,14,17,20,24,27...
                    192:    exclpen=MOD(NPEN,8)*7
                    193:    CSI  exclpen; exclpen; TALGLPE
                    194: */
                    195:     static char *type[2 + 9] =
                    196:     {
                    197:        "", "40;40", "", "42;42", "14;21",
                    198:     /*   ....   ----  -- -- --   . . .   */
                    199:        "", "49;30", "14;21", "", "49;30", "14;21"
                    200:     /*  same pattern, but thicker..  and thicker       */
                    201:     };
                    202:     static int width[2+9] = { 14, 7, 7, 7, 7, 10, 10, 10, 17, 17, 17 };
                    203:
                    204:     if (linetype >= 9)
                    205:        linetype %= 9;
                    206:
                    207:     fprintf(gpoutfile, TALGLP, width[linetype + 2], width[linetype + 2]);
                    208:     /*                 ^width in dots */
                    209:     fprintf(gpoutfile, TALGLT, type[linetype + 2]);
                    210:     /*                 ^line type     */
                    211: }
                    212:
                    213:
                    214: TERM_PUBLIC void EXCL_move(x, y)
                    215: unsigned int x, y;
                    216: {
                    217:     fprintf(gpoutfile, TALGMV, 1000 + x, EXCL_YLAST + 1000 - y);
                    218:     /*                 ^pen up vector */
                    219: }
                    220:
                    221:
                    222: TERM_PUBLIC void EXCL_vector(x2, y2)
                    223: unsigned int x2, y2;
                    224: {
                    225:     fprintf(gpoutfile, TALGDW, 1000 + x2, EXCL_YLAST + 1000 - y2);
                    226:     /*                 ^pen down vector */
                    227: }
                    228:
                    229:
                    230: TERM_PUBLIC void EXCL_put_text(x, y, str)
                    231: unsigned int x, y;
                    232: char str[];
                    233: {
                    234:     char ch;
                    235:     EXCL_move(x, y - EXCL_VCHAR / 3);
                    236:     ch = *str++;
                    237:     while (ch != NUL) {
                    238:        putc(ch, gpoutfile);
                    239:        ch = *str++;
                    240:     }
                    241: }
                    242:
                    243: TERM_PUBLIC void EXCL_reset()
                    244: {
                    245:     fprintf(gpoutfile, "%s%s", TALFPO, TALPOP);
                    246:     /*                         ^pageout ^pop  */
                    247: }
                    248:
                    249:
                    250: #endif /* TERM_BODY */
                    251:
                    252: #ifdef TERM_TABLE
                    253:
                    254: TERM_TABLE_START(excl_driver)
                    255:     "excl", "Talaris EXCL Laser printer (also Talaris 1590 and others)",
                    256:     EXCL_XMAX, EXCL_YMAX, EXCL_VCHAR, EXCL_HCHAR,
                    257:     EXCL_VTIC, EXCL_HTIC, options_null, EXCL_init, EXCL_reset,
                    258:     EXCL_text, null_scale, EXCL_graphics, EXCL_move, EXCL_vector,
                    259:     EXCL_linetype, EXCL_put_text, null_text_angle,
                    260:     null_justify_text, line_and_point, do_arrow, set_font_null
                    261: TERM_TABLE_END(excl_driver)
                    262: #undef LAST_TERM
                    263: #define LAST_TERM excl_driver
                    264:
                    265: #endif /* TERM_TABLE */
                    266: #endif /* TERM_PROTO_ONLY */
                    267:
                    268: #ifdef TERM_HELP
                    269: START_HELP(excl)
                    270: "1 excl",
                    271: "?commands set terminal excl",
                    272: "?set terminal excl",
                    273: "?set term excl",
                    274: "?terminal excl",
                    275: "?term excl",
                    276: "?excl",
                    277: " The `excl` terminal driver supports Talaris printers such as the EXCL Laser",
                    278: " printer and the 1590.  It has no options."
                    279: END_HELP(excl)
                    280: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>