1 /* Hello, Emacs, this is -*-C-*-
2 * $Id: unixplot.trm,v 1.16 2006/07/21 02:35:48 sfeam Exp $
6 /* GNUPLOT -- unixplot.trm */
9 * Copyright 1990 - 1993, 1998, 2004
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.
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,
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
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.
34 * This software is provided "as is" without express or implied warranty
35 * to the extent permitted by applicable law.
39 * This file is included by ../term.c.
41 * This terminal driver supports:
42 * Unix plot(5) graphics language
45 * Colin Kelley, Thomas Williams, Russell Lang
47 * send your comments or suggestions to (gnuplot-info@lists.sourceforge.net).
52 * Unixplot library writes to stdout. A fix was put in place by
53 * ..!arizona!naucse!jdc to let set term and set output redirect
54 * stdout. All other terminals write to gpoutfile.
58 * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
64 register_term(unixplot)
68 TERM_PUBLIC void UP_init __PROTO((void));
69 TERM_PUBLIC void UP_graphics __PROTO((void));
70 TERM_PUBLIC void UP_text __PROTO((void));
71 TERM_PUBLIC void UP_linetype __PROTO((int linetype));
72 TERM_PUBLIC void UP_move __PROTO((unsigned int x, unsigned int y));
73 TERM_PUBLIC void UP_vector __PROTO((unsigned int x, unsigned int y));
74 TERM_PUBLIC void UP_put_text __PROTO((unsigned int x, unsigned int y, const char str[]));
75 TERM_PUBLIC void UP_reset __PROTO((void));
80 #define UP_XLAST (UP_XMAX - 1)
81 #define UP_YLAST (UP_YMAX - 1)
83 #define UP_VCHAR (UP_YMAX/30) /* just a guess--no way to know this! */
84 #define UP_HCHAR (UP_XMAX/60) /* just a guess--no way to know this! */
85 #define UP_VTIC (UP_YMAX/80)
86 #define UP_HTIC (UP_XMAX/80)
87 #endif /* TERM_PROTO */
89 #ifndef TERM_PROTO_ONLY
96 space(0, 0, UP_XMAX, UP_YMAX);
115 UP_linetype(int linetype)
117 static char *lt[2 + 5] = {"solid", "longdashed", "solid", "dotted",
118 "shortdashed", "dotdashed", "longdashed"};
126 linemod(lt[linetype + 2]);
131 UP_move(unsigned int x, unsigned int y)
138 UP_vector(unsigned int x, unsigned int y)
145 UP_put_text(unsigned int x, unsigned int y, const char str[])
147 UP_move(x + UP_HCHAR / 2, y + UP_VCHAR / 5);
157 #endif /* TERM_BODY */
160 TERM_TABLE_START(unixplot_driver)
161 "unixplot", "Unix plotting standard (see plot(1))",
162 UP_XMAX, UP_YMAX, UP_VCHAR, UP_HCHAR,
163 UP_VTIC, UP_HTIC, options_null, UP_init, UP_reset,
164 UP_text, null_scale, UP_graphics, UP_move, UP_vector,
165 UP_linetype, UP_put_text, null_text_angle,
166 null_justify_text, line_and_point, do_arrow, set_font_null
167 TERM_TABLE_END(unixplot_driver)
170 #define LAST_TERM unixplot_driver
172 #endif /* TERM_TABLE */
173 #endif /* TERM_PROTO_ONLY */
177 #ifndef TERM_HELP_GNUGRAPH
180 "?commands set terminal unixplot",
181 "?set terminal unixplot",
182 "?set term unixplot",
183 "?terminal unixplot",
186 " The `unixplot` terminal driver generates output in the Unix \"plot\" graphics",
187 " language. It has no options.",
189 " This terminal cannot be compiled if the GNU version of plot is to be used;",
190 " in that case, use the `gnugraph` terminal instead."