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

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

1.1       maekawa     1: /*
                      2:  * $Id: dxy.trm,v 1.13 1998/04/14 00:17:38 drd Exp $
                      3:  *
                      4:  */
                      5:
                      6: /* GNUPLOT - dxy.trm */
                      7:
                      8: /*[
                      9:  * Copyright 1990 - 1993, 1998
                     10:  *
                     11:  * Permission to use, copy, and distribute this software and its
                     12:  * documentation for any purpose with or without fee is hereby granted,
                     13:  * provided that the above copyright notice appear in all copies and
                     14:  * that both that copyright notice and this permission notice appear
                     15:  * in supporting documentation.
                     16:  *
                     17:  * Permission to modify the software is granted, but not the right to
                     18:  * distribute the complete modified source code.  Modifications are to
                     19:  * be distributed as patches to the released version.  Permission to
                     20:  * distribute binaries produced by compiling modified sources is granted,
                     21:  * provided you
                     22:  *   1. distribute the corresponding source modifications from the
                     23:  *    released version in the form of a patch file along with the binaries,
                     24:  *   2. add special version identification to distinguish your version
                     25:  *    in addition to the base release version number,
                     26:  *   3. provide your name and address as the primary contact for the
                     27:  *    support of your modified version, and
                     28:  *   4. retain our contact information in regard to use of the base
                     29:  *    software.
                     30:  * Permission to distribute the released version of the source code along
                     31:  * with corresponding source modifications in the form of a patch file is
                     32:  * granted with same provisions 2 through 4 for binary distributions.
                     33:  *
                     34:  * This software is provided "as is" without express or implied warranty
                     35:  * to the extent permitted by applicable law.
                     36: ]*/
                     37:
                     38: /*
                     39:  * This file is included by ../term.c.
                     40:  *
                     41:  * This terminal driver supports:
                     42:  *  Roland DXY800A plotter
                     43:  *
                     44:  * AUTHORS
                     45:  *  Martin Yii, eln557h@monu3.OZ
                     46:  *  Further modified Jan 1990 by Russell Lang, rjl@monu1.cc.monash.oz
                     47:  *
                     48:  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
                     49:  *
                     50:  */
                     51:
                     52: /*
                     53:  * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
                     54:  */
                     55:
                     56: #include "driver.h"
                     57:
                     58: #ifdef TERM_REGISTER
                     59: register_term(dxy800a)
                     60: #endif
                     61:
                     62: #ifdef TERM_PROTO
                     63: TERM_PUBLIC void DXY_init __PROTO((void));
                     64: TERM_PUBLIC void DXY_graphics __PROTO((void));
                     65: TERM_PUBLIC void DXY_text __PROTO((void));
                     66: TERM_PUBLIC void DXY_linetype __PROTO((int linetype));
                     67: TERM_PUBLIC void DXY_move __PROTO((unsigned int x, unsigned int y));
                     68: TERM_PUBLIC void DXY_vector __PROTO((unsigned int x, unsigned int y));
                     69: TERM_PUBLIC void DXY_put_text __PROTO((unsigned int x, unsigned int y, char *str));
                     70: TERM_PUBLIC int DXY_text_angle __PROTO((int ang));
                     71: TERM_PUBLIC void DXY_reset __PROTO((void));
                     72:
                     73: #define DXY_XMAX 2470
                     74: #define DXY_YMAX 1700
                     75:
                     76: #define DXY_XLAST (DXY_XMAX - 1)
                     77: #define DXY_YLAST (DXY_XMAX - 1)
                     78:
                     79: #define DXY_VCHAR      (56)    /* double actual height of characters */
                     80: #define DXY_HCHAR      (28)    /* actual width including spacing */
                     81: #define DXY_VTIC       (28)
                     82: #define DXY_HTIC       (28)
                     83: #endif /* TERM_PROTO */
                     84:
                     85: #ifndef TERM_PROTO_ONLY
                     86: #ifdef TERM_BODY
                     87:
                     88: int dxy_angle = 0;
                     89:
                     90: TERM_PUBLIC void DXY_init()
                     91: {
                     92:     /* No initialisation sequences for DXY 800A */
                     93: }
                     94:
                     95:
                     96: TERM_PUBLIC void DXY_graphics()
                     97: {
                     98:     /* HOME, Character size 3 */
                     99:     fputs("H\nS3\n", gpoutfile);
                    100: }
                    101:
                    102:
                    103: TERM_PUBLIC void DXY_text()
                    104: {
                    105:     /* No sequences needed */
                    106: }
                    107:
                    108:
                    109: TERM_PUBLIC void DXY_linetype(linetype)
                    110: int linetype;
                    111: {
                    112:     /* select pen */
                    113:     fprintf(gpoutfile, "J%d\n", (linetype + 2) % 8 + 1);
                    114:     switch (linetype) {
                    115:     case -1:
                    116:        /* use dotted line for axis */
                    117:        fputs("L1\nB50\n", gpoutfile);
                    118:        break;
                    119:     default:
                    120:        /* use solid line for all others */
                    121:        fputs("L0\n", gpoutfile);
                    122:        break;
                    123:     }
                    124: }
                    125:
                    126:
                    127: TERM_PUBLIC void DXY_move(x, y)
                    128: unsigned int x, y;
                    129: {
                    130:     fprintf(gpoutfile, "M%d,%d\n", x, y);
                    131: }
                    132:
                    133:
                    134: TERM_PUBLIC void DXY_vector(x, y)
                    135: unsigned int x, y;
                    136: {
                    137:     fprintf(gpoutfile, "D%d,%d\n", x, y);
                    138: }
                    139:
                    140:
                    141: TERM_PUBLIC void DXY_put_text(x, y, str)
                    142: unsigned int x, y;
                    143: char *str;
                    144: {
                    145:     if (dxy_angle == 1) {
                    146:        /* vertical */
                    147:        DXY_move(x + DXY_VCHAR / 4, y);
                    148:     } else {
                    149:        /* horiz */
                    150:        DXY_move(x, y - DXY_VCHAR / 4);
                    151:     }
                    152:     fprintf(gpoutfile, "P%s\n", str);
                    153: }
                    154:
                    155:
                    156: TERM_PUBLIC int DXY_text_angle(ang)
                    157: int ang;
                    158: {
                    159:     dxy_angle = ang;
                    160:     fprintf(gpoutfile, "Q%d\n", ang);
                    161:     return TRUE;
                    162: }
                    163:
                    164:
                    165: TERM_PUBLIC void DXY_reset()
                    166: {
                    167:     /* Home pen */
                    168:     fputs("H\n", gpoutfile);
                    169: }
                    170:
                    171: #endif /* TERM_BODY */
                    172:
                    173: #ifdef TERM_TABLE
                    174: TERM_TABLE_START(dxy_driver)
                    175:     "dxy800a", "Roland DXY800A plotter",
                    176:     DXY_XMAX, DXY_YMAX, DXY_VCHAR, DXY_HCHAR,
                    177:     DXY_VTIC, DXY_HTIC, options_null, DXY_init, DXY_reset,
                    178:     DXY_text, null_scale, DXY_graphics, DXY_move, DXY_vector,
                    179:     DXY_linetype, DXY_put_text, DXY_text_angle,
                    180:     null_justify_text, do_point, do_arrow, set_font_null
                    181: TERM_TABLE_END(dxy_driver)
                    182:
                    183: #undef LAST_TERM
                    184: #define LAST_TERM dxy_driver
                    185:
                    186: #endif /* TERM_TABLE */
                    187: #endif /* TERM_PROTO_ONLY */
                    188:
                    189: #ifdef TERM_HELP
                    190: START_HELP(dxy800a)
                    191: "1 dxy800a",
                    192: "?commands set terminal dxy800a",
                    193: "?set terminal dxy800a",
                    194: "?set term dxy800a",
                    195: "?terminal dxy800a",
                    196: "?term dxy800a",
                    197: "?dxy800a",
                    198: " This terminal driver supports the Roland DXY800A plotter.  It has no options."
                    199: END_HELP(dxy800a)
                    200: #endif

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