Annotation of OpenXM_contrib/gnuplot/term/hp2648.trm, Revision 1.1
1.1 ! maekawa 1: /*
! 2: * $Id: hp2648.trm,v 1.14 1998/04/14 00:17:48 drd Exp $
! 3: *
! 4: */
! 5:
! 6: /* GNUPLOT - hp2648.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: * HP2648 and HP2647
! 43: *
! 44: * AUTHORS
! 45: * Russell Lang
! 46: *
! 47: * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
! 48: *
! 49: */
! 50:
! 51: /*
! 52: * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
! 53: */
! 54:
! 55: #include "driver.h"
! 56:
! 57: #ifdef TERM_REGISTER
! 58: register_term(hp2648)
! 59: #endif
! 60:
! 61: #ifdef TERM_PROTO
! 62: TERM_PUBLIC void HP2648init __PROTO((void));
! 63: TERM_PUBLIC void HP2648graphics __PROTO((void));
! 64: TERM_PUBLIC void HP2648text __PROTO((void));
! 65: TERM_PUBLIC void HP2648linetype __PROTO((int linetype));
! 66: TERM_PUBLIC void HP2648move __PROTO((unsigned int x, unsigned int y));
! 67: TERM_PUBLIC void HP2648vector __PROTO((unsigned int x, unsigned int y));
! 68: TERM_PUBLIC void HP2648put_text __PROTO((unsigned int x, unsigned int y, char *str));
! 69: TERM_PUBLIC int HP2648_text_angle __PROTO((int ang));
! 70: TERM_PUBLIC void HP2648reset __PROTO((void));
! 71:
! 72: #define HP2648XMAX 720
! 73: #define HP2648YMAX 360
! 74:
! 75: #define HP2648VCHAR 12
! 76: #define HP2648HCHAR 7
! 77: #define HP2648VTIC 8
! 78: #define HP2648HTIC 8
! 79: #endif /* TERM_PROTO */
! 80:
! 81: #ifndef TERM_PROTO_ONLY
! 82: #ifdef TERM_BODY
! 83: #define HP2648XLAST (HP2648XMAX - 1)
! 84: #define HP2648YLAST (HP2648YMAX - 1)
! 85:
! 86:
! 87: TERM_PUBLIC void HP2648init()
! 88: {
! 89: fprintf(gpoutfile, "\033*m1m1n136,1cZ");
! 90: /* 1 2 3 4
! 91: 1. mode
! 92: 2. textsize=1
! 93: 3. textangle=1
! 94: 4. define line type 2 to be * * * * etc.
! 95: */
! 96: }
! 97:
! 98:
! 99: TERM_PUBLIC void HP2648graphics()
! 100: {
! 101: fprintf(gpoutfile, "\033*dacZ");
! 102: /* 1 23
! 103: 1. mode
! 104: 2. clear grahics screen
! 105: 3. graphics video on
! 106: */
! 107: }
! 108:
! 109:
! 110: TERM_PUBLIC void HP2648text()
! 111: {
! 112: }
! 113:
! 114:
! 115: TERM_PUBLIC void HP2648linetype(linetype)
! 116: int linetype;
! 117: {
! 118: static int hpline[] = { 1, 7, 1, 4, 5, 6, 8, 9, 10, 7, 2 };
! 119: fprintf(gpoutfile, "\033*m%dbZ", hpline[(linetype + 2) % 11]);
! 120: }
! 121:
! 122:
! 123: TERM_PUBLIC void HP2648move(x, y)
! 124: unsigned int x, y;
! 125: {
! 126: fprintf(gpoutfile, "\033*paf%d,%dZ", x, y);
! 127: /* 1 23 4
! 128: 1 plot mode
! 129: 2 "pen up"
! 130: 3 goto absolute x,y
! 131: 4 end command
! 132: */
! 133: }
! 134:
! 135:
! 136: TERM_PUBLIC void HP2648vector(x, y)
! 137: unsigned int x, y;
! 138: {
! 139: fprintf(gpoutfile, "\033*pbf%d,%dZ", x, y);
! 140: /* 1
! 141: 1 "pen down"
! 142: */
! 143: }
! 144:
! 145:
! 146: TERM_PUBLIC void HP2648put_text(x, y, str)
! 147: unsigned int x, y;
! 148: char *str;
! 149: {
! 150: HP2648move(x, y - HP2648VCHAR / 2 + 1);
! 151: fprintf(gpoutfile, "\033*l%s\n", str);
! 152: }
! 153:
! 154:
! 155: TERM_PUBLIC int HP2648_text_angle(ang)
! 156: int ang;
! 157: {
! 158: fprintf(gpoutfile, "\033*m%dnZ\n", ang + 1);
! 159: return TRUE;
! 160: }
! 161:
! 162: TERM_PUBLIC void HP2648reset()
! 163: {
! 164: }
! 165:
! 166: #endif /* TERM_BODY */
! 167:
! 168: #ifdef TERM_TABLE
! 169: TERM_TABLE_START(hp2648_driver)
! 170: "hp2648", "HP2648 and HP2647",
! 171: HP2648XMAX, HP2648YMAX, HP2648VCHAR, HP2648HCHAR,
! 172: HP2648VTIC, HP2648HTIC, options_null, HP2648init, HP2648reset,
! 173: HP2648text, null_scale, HP2648graphics, HP2648move, HP2648vector,
! 174: HP2648linetype, HP2648put_text, HP2648_text_angle,
! 175: null_justify_text, line_and_point, do_arrow, set_font_null
! 176: TERM_TABLE_END(hp2648_driver)
! 177:
! 178: #undef LAST_TERM
! 179: #define LAST_TERM hp2648_driver
! 180:
! 181: #endif /* TERM_TABLE */
! 182: #endif /* TERM_PROTO_ONLY */
! 183:
! 184: #ifdef TERM_HELP
! 185: START_HELP(hp2648)
! 186: "1 hp2648",
! 187: "?commands set terminal hp2648",
! 188: "?set terminal hp2648",
! 189: "?set term hp2648",
! 190: "?terminal hp2648",
! 191: "?term hp2648",
! 192: "?hp2648",
! 193: " The `hp2648` terminal driver supports the Hewlett Packard HP2647 and HP2648.",
! 194: " It has no options."
! 195: END_HELP(hp2648)
! 196: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>