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