v14i012: Device-independant graphics system, with drivers

Rich Salz rsalz at uunet.uu.net
Wed Mar 30 04:55:13 AEST 1988


Submitted-by: Joe Dellinger <joe at hanauma.STANFORD.EDU>
Posting-number: Volume 14, Issue 12
Archive-name: vplot/part07

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 7 (of 24)."
# Wrapped by rsalz at fig.bbn.com on Fri Mar 25 11:46:56 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Envision_device/envilib/envigetpoint.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Envision_device/envilib/envigetpoint.c'\"
else
echo shar: Extracting \"'Envision_device/envilib/envigetpoint.c'\" \(1627 characters\)
sed "s/^X//" >'Envision_device/envilib/envigetpoint.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/envilib/envigetpoint.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X#include <stdio.h>
X#include "envi.h"
X
extern FILE    *pltout;
X
envigetpoint (termout, x, y)
X    FILE           *termout;
X    int            *x, *y;
X{
char            string[80];
char            c;
X
X    envisetmode (REG);
X    envipanoff ();		/* Turn off panning */
X    envicursoron ();		/* Turn on the cursor */
X    fflush (pltout);
X
X    fflush (termout);
X    fgets (string, 79, termout);/* Wait for a return */
X    fflush (termout);
X
X    fprintf (pltout, "%cYC", ESC);	/* Ask for position of cursor */
X    fflush (pltout);
X    c = '\0';
X    fflush (termout);
X    fscanf (termout, "%4x%4x\n%c\n", x, y, &c);	/* Get answer */
X
X    /* Undo the window weirdness */
X    *x = (*x + 1) / 4;
X    *y = (*y + 0) / 4;
X/*
X * The plus 1 and 0 are to try to make it land on the right point.
X * Sometimes we get one off. I'm not sure where the problem lies.
X */
X
X    envipanon ();		/* Turn on panning */
X    envicursoroff ();		/* Turn the cursor off again */
X    fflush (pltout);
X    if (c == 'q')
X	return (1);
X    else
X	return (0);
X}
END_OF_FILE
if test 1627 -ne `wc -c <'Envision_device/envilib/envigetpoint.c'`; then
    echo shar: \"'Envision_device/envilib/envigetpoint.c'\" unpacked with wrong size!
fi
# end of 'Envision_device/envilib/envigetpoint.c'
fi
if test -f 'Envision_device/envilib/enviplot.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Envision_device/envilib/enviplot.c'\"
else
echo shar: Extracting \"'Envision_device/envilib/enviplot.c'\" \(1741 characters\)
sed "s/^X//" >'Envision_device/envilib/enviplot.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/envilib/enviplot.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X#include <stdio.h>
X#include "envi.h"
extern FILE    *pltout;
X
int             lost = 1;	/* 1 means we are lost, zero means we aren't */
X
enviplot (x, y, draw)	/* efficiently get to the point x,y. */
X    int             x, y, draw;	/* draw 0 means we want to move, not to draw */
X{
int             hiy, loy, hix, lox;
int             ok;	/* ok not 1 means that our old position is
X			 * meaningless */
static int      ohiy, oloy, ohix, olox;
X
X    if (draw == 0)
X    {
X	envisetmode (REG);
X    }
X    envisetmode (TEK);
X
X    ok = (lost == 0);
X    hiy = (y >> 5) | 040;	/* y/32+32 hi y byte */
X    loy = (y & 037) | 0140;	/* y%32+96 low y byte */
X    hix = (x >> 5) | 040;	/* x/32+32 hi x byte */
X    lox = (x & 037) | 0100;	/* x%32+64 low x byte */
X
X    if ((hiy != ohiy) || (ok != 1))
X	fprintf (pltout, "%c", hiy);
X    if ((hix != ohix) || (ok != 1))
X    {
X	fprintf (pltout, "%c%c", loy, hix);
X    }
X    else
X    {
X	if ((loy != oloy) || (ok != 1))
X	    fprintf (pltout, "%c", loy);
X    }
X    fprintf (pltout, "%c", lox);
X
X    /* remember this for next time */
X    oloy = loy;
X    ohiy = hiy;
X    ohix = hix;
X    olox = lox;
X
X    lost = 0;
X}
END_OF_FILE
if test 1741 -ne `wc -c <'Envision_device/envilib/enviplot.c'`; then
    echo shar: \"'Envision_device/envilib/enviplot.c'\" unpacked with wrong size!
fi
# end of 'Envision_device/envilib/enviplot.c'
fi
if test -f 'Envision_device/envilib/envipoint.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Envision_device/envilib/envipoint.c'\"
else
echo shar: Extracting \"'Envision_device/envilib/envipoint.c'\" \(1567 characters\)
sed "s/^X//" >'Envision_device/envilib/envipoint.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/envilib/envipoint.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X#include <stdio.h>
X#include "envi.h"
extern FILE    *pltout;
X
extern int      lost;
X
envipoint (x, y)	/* draw a point at x,y. */
X    int             x, y;
X{
int             hiy, loy, hix, lox;
int             ok;	/* ok not 1 means that our old position is
X			 * meaningless */
static int      ohiy, oloy, ohix, olox;
X
X    envisetmode (MOV);
X
X    ok = (lost == 0);
X    hiy = (y >> 5) | 040;	/* y/32+32 hi y byte */
X    loy = (y & 037) | 0140;	/* y%32+96 low y byte */
X    hix = (x >> 5) | 040;	/* x/32+32 hi x byte */
X    lox = (x & 037) | 0100;	/* x%32+64 low x byte */
X
X    if ((hiy != ohiy) || (ok != 1))
X	fprintf (pltout, "%c", hiy);
X    if ((hix != ohix) || (ok != 1))
X    {
X	fprintf (pltout, "%c%c", loy, hix);
X    }
X    else
X    {
X	if ((loy != oloy) || (ok != 1))
X	    fprintf (pltout, "%c", loy);
X    }
X    fprintf (pltout, "%c", lox);
X
X    /* remember this for next time */
X    oloy = loy;
X    ohiy = hiy;
X    ohix = hix;
X    olox = lox;
X
X    lost = 0;
X}
END_OF_FILE
if test 1567 -ne `wc -c <'Envision_device/envilib/envipoint.c'`; then
    echo shar: \"'Envision_device/envilib/envipoint.c'\" unpacked with wrong size!
fi
# end of 'Envision_device/envilib/envipoint.c'
fi
if test -f 'Masscomp_device/gpslib/gpsconf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Masscomp_device/gpslib/gpsconf.c'\"
else
echo shar: Extracting \"'Masscomp_device/gpslib/gpsconf.c'\" \(1675 characters\)
sed "s/^X//" >'Masscomp_device/gpslib/gpsconf.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/gpslib/gpsconf.c
X *
X * Stewart A. Levin (SEP), July, 3 1987
X *	Cribbed rasconf.c for gps filter
X */
X
X/*
X * Keyword: vplot versatec color pen masscomp
X */
X#include <stdio.h>
X#include "../include/enum.h"
X#include "../include/extern.h"
X#include "gpspen.h"
X
X/*
X * mandatory declarations and initializations
X */
X#ifdef SEP
char            name[] = "Gpspen";
X#else
char            name[] = "gpspen";
X#endif
X#include "gpsdoc.h"
X
X/*
X * device routine table
X */
extern int
genmessage (), gpsopen (), genmarker ();
extern int
genvector (), gentext ();
extern int
genpoint (), gpsplot ();
extern int
vecarea (), genraster ();
extern int
nulldev (), gpsattr (), gpsreset (), gpsclose ();
X
struct device   dev =
X{
X
X /* control routines */
X gpsopen,		/* open */
X gpsreset,		/* reset */
X genmessage,		/* message */
X nulldev,		/* erase */
X gpsclose,		/* close */
X
X /* high level output */
X genvector,		/* vector */
X genmarker,		/* marker */
X gentext,		/* text */
X vecarea,		/* area */
X genraster,		/* raster */
X genpoint,		/* point */
X gpsattr,		/* attributes */
X
X /* input */
X nulldev,		/* getpoint */
X nulldev,		/* interact */
X
X /* low level output */
X gpsplot,		/* plot */
X nulldev,		/* startpoly */
X nulldev,		/* midpoly */
X nulldev		/* endpoly */
X};
END_OF_FILE
if test 1675 -ne `wc -c <'Masscomp_device/gpslib/gpsconf.c'`; then
    echo shar: \"'Masscomp_device/gpslib/gpsconf.c'\" unpacked with wrong size!
fi
# end of 'Masscomp_device/gpslib/gpsconf.c'
fi
if test -f 'Printronix_device/lprlib/lprconf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Printronix_device/lprlib/lprconf.c'\"
else
echo shar: Extracting \"'Printronix_device/lprlib/lprconf.c'\" \(1809 characters\)
sed "s/^X//" >'Printronix_device/lprlib/lprconf.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/lprlib/lprconf.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * printronix P300/P600 configuration
X */
X#include <stdio.h>
X#include "../include/enum.h"
X#include "../include/extern.h"
X
X/*
X * mandatory declarations and initializations
X */
X#ifdef SEP
char            name[] = "Lprpen";
X#else
char            name[] = "lprpen";
X#endif
X#include "lprdoc.h"
X
X/*
X * device routine table
X */
extern int
lpropen (), lprerase (), lprclose (), lprvector ();
extern int
gentext (), genraster (), genmessage (), genpatarea ();
extern int
genpoint (), genmarker (), lprattr (), nulldev ();
X
struct device   dev = {
X
X /* control routines */
X		       lpropen,	/* open */
X		       nulldev,	/* reset */
X		       genmessage,	/* message */
X		       lprerase,	/* erase */
X		       lprclose,	/* close */
X
X /* high level output */
X		       lprvector,	/* vector */
X		       genmarker,	/* marker */
X		       gentext,	/* text */
X		       genpatarea,	/* area */
X		       genraster,	/* raster */
X		       genpoint,	/* point */
X		       lprattr,	/* attributes */
X
X /* input */
X		       nulldev,	/* getpoint */
X		       nulldev,	/* interact */
X
X /* low level output */
X		       nulldev,	/* plot */
X		       nulldev,	/* startpoly */
X		       nulldev,	/* midpoly */
X		       nulldev	/* endpoly */
X};
END_OF_FILE
if test 1809 -ne `wc -c <'Printronix_device/lprlib/lprconf.c'`; then
    echo shar: \"'Printronix_device/lprlib/lprconf.c'\" unpacked with wrong size!
fi
# end of 'Printronix_device/lprlib/lprconf.c'
fi
if test -f 'Regis_device/gigilib/gigiattr.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigiattr.c'\"
else
echo shar: Extracting \"'Regis_device/gigilib/gigiattr.c'\" \(1556 characters\)
sed "s/^X//" >'Regis_device/gigilib/gigiattr.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/gigilib/gigiattr.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * control graphics attributes
X */
X#include <stdio.h>
X#include "gigi.h"
X#include "../include/attrcom.h"
extern FILE    *pltout;
extern char     wstype[], callname[];
X
gigiattributes (command, value, dummy1, dummy2, dummy3)
X    int             command, value, dummy1, dummy2, dummy3;
X{
static int      cur_color;
int             color;
X
X    switch (command)
X    {
X    case SET_COLOR:
X	if ((!strcmp (wstype, "vt125")) && (value > 3))
X	    color = 1 + (value - 2) % 3;	/* this maps 7 (white) to 3
X						 * (white) */
X	else
X	if (value > 7)
X	    color = 1 + (value - 8) % 7;
X	else
X	    color = value;
X
X	if ((color != cur_color) && (color >= 0))
X	{
X	    if (color == 0)
X		fprintf (pltout, ";@:W (W(EI%dA0N0M2P1(M2)))@;", color);
X	    else
X		fprintf (pltout, ";@:W (W(VI%dA0N0M2P1(M2)))@;", color);
X	    lastop = ' ';
X	    cur_color = color;
X	}
X	break;
X    case SET_COLOR_TABLE:	/* None to set on GIGI */
X	break;
X    default:
X	break;
X    }
X
X    return 0;
X}
END_OF_FILE
if test 1556 -ne `wc -c <'Regis_device/gigilib/gigiattr.c'`; then
    echo shar: \"'Regis_device/gigilib/gigiattr.c'\" unpacked with wrong size!
fi
# end of 'Regis_device/gigilib/gigiattr.c'
fi
if test -f 'Regis_device/gigilib/gigiclose.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigiclose.c'\"
else
echo shar: Extracting \"'Regis_device/gigilib/gigiclose.c'\" \(1576 characters\)
sed "s/^X//" >'Regis_device/gigilib/gigiclose.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/gigilib/gigiclose.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Routine to finish up with the terminal.
X */
X#include <stdio.h>
X#include "gigi.h"
X#include "../include/closestat.h"
X#include "../include/mesgcom.h"
extern FILE    *pltout;
X
gigiclose (status)
X    int             status;
X{
X    switch (status)
X    {
X    case CLOSE_DONE:
X	if (lastop != '\0')
X	    goff ();
X	break;
X    case CLOSE_FLUSH:
X	fflush (pltout);
X	break;
X    case CLOSE_PAUSE:
X	gigimessage (MESG_HOME);
X	break;
X    case CLOSE_INTERRUPT:
X	if (lastop != '\0')
X	{
X	    fprintf (pltout, ";;;");
X	}
X	break;
X    case CLOSE_NORMAL:
X    case CLOSE_ERROR:
X    case CLOSE_NOTHING:
X    default:			/* not meant for us, ignore */
X	break;
X    }
X}
X
extern char    *getenv ();
goff ()
X{
X    /* GIGI owners manual page 66 */
static char     off1[10] = "X\\";
char           *screencolor;
X    off1[0] = ESC;
X    if (NULL != (screencolor = getenv ("SCREEN")))
X	fprintf (pltout, ";S(I(%c))", *screencolor);
X    fprintf (pltout, "%s", off1);
X    fflush (pltout);
X    lastop = ' ';
X}
END_OF_FILE
if test 1576 -ne `wc -c <'Regis_device/gigilib/gigiclose.c'`; then
    echo shar: \"'Regis_device/gigilib/gigiclose.c'\" unpacked with wrong size!
fi
# end of 'Regis_device/gigilib/gigiclose.c'
fi
if test -f 'Tek_device/cteklib/ctekattr.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekattr.c'\"
else
echo shar: Extracting \"'Tek_device/cteklib/ctekattr.c'\" \(1793 characters\)
sed "s/^X//" >'Tek_device/cteklib/ctekattr.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/cteklib/ctekattr.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * control graphics attributes
X */
X#include <stdio.h>
X#include <math.h>
X#include "ctek.h"
X#include "../include/attrcom.h"
extern FILE    *pltout;
X
ctekattributes (command, value, v1, v2, v3)
X    register int    command, value;
X    int             v1, v2, v3;
X{
static int      cur_color;
int             color;
int             hue, lightness, saturation, temp;
float           x, y;
X
X    switch (command)
X    {
X    case SET_COLOR:
X	color = value;
X
X	if ((color != cur_color) && (color >= 0))
X	{
X	    ctekcolor (color);
X	    cur_color = color;
X	}
X	break;
X    case SET_COLOR_TABLE:
X	if (value < 8)
X	{
X	    x = v3 - .5 * v2 - .5 * v1;
X	    y = (.866) * (v1 - v2);
X	    if (x == 0. && y == 0.)
X	    {
X		hue = 0;
X	    }
X	    else
X	    {
X		hue = (180.) * atan2 (y, x) / 3.1416;
X	    }
X	    if (v1 < v2)
X	    {
X		temp = v1;
X		v1 = v2;
X		v2 = temp;
X	    }
X	    if (v1 < v3)
X	    {
X		temp = v1;
X		v1 = v3;
X		v3 = temp;
X	    }
X	    if (v2 < v3)
X	    {
X		temp = v2;
X		v2 = v3;
X		v3 = temp;
X	    }
X	    lightness = 100 * (v1 + v3) / (255 * 2);
X	    saturation = 100 * abs (v1 - v3) / 255;
X	    cteksetcoltab (value, hue, lightness, saturation);
X	}
X	break;
X    default:
X	break;
X    }
X
X    return 0;
X}
END_OF_FILE
if test 1793 -ne `wc -c <'Tek_device/cteklib/ctekattr.c'`; then
    echo shar: \"'Tek_device/cteklib/ctekattr.c'\" unpacked with wrong size!
fi
# end of 'Tek_device/cteklib/ctekattr.c'
fi
if test -f 'Tek_device/cteklib/ctekclose.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekclose.c'\"
else
echo shar: Extracting \"'Tek_device/cteklib/ctekclose.c'\" \(1607 characters\)
sed "s/^X//" >'Tek_device/cteklib/ctekclose.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/cteklib/ctekclose.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Routine to close the device
X */
X#include <stdio.h>
X#include "ctek.h"
X#include "../include/mesgcom.h"
X#include "../include/closestat.h"
X#include "../include/extern.h"
X#include "../include/enum.h"
X
X#define BELL	007
int             want_bell = YES;
X
ctekclose (status)
X    int             status;
X{
X    switch (status)
X    {
X    case CLOSE_PAUSE:
X	cteksetmode (ANSI);
X	if (want_bell == YES)
X	{
X	    Putc (BELL);
X	    Putc (BELL);
X	    Putc (BELL);
X	    Putc (BELL);
X	    Putc (BELL);
X	}
X	break;
X
X    case CLOSE_ERROR:
X	break;
X
X    case CLOSE_FLUSH:
X	fflush (pltout);
X	break;
X
X    case CLOSE_INTERRUPT:
X	Putc (US);
X	fprintf (pltout, "%c%%!1", ESC);
X	Putc (US);
X	fprintf (pltout, "%c%%!1", ESC);
X	Putc (US);
X	fprintf (pltout, "%c%%!1", ESC);
X	Putc (US);
X	fprintf (pltout, "%c%%!1", ESC);
X	cteksetmode (ANSI);
X	break;
X
X    case CLOSE_NOTHING:	/* No input */
X    case CLOSE_NORMAL:
X	break;
X
X    case CLOSE_DONE:
X	cteksetmode (ANSI);
X	break;
X
X    default:			/* not meant for us, ignore */
X	break;
X    }
X}
END_OF_FILE
if test 1607 -ne `wc -c <'Tek_device/cteklib/ctekclose.c'`; then
    echo shar: \"'Tek_device/cteklib/ctekclose.c'\" unpacked with wrong size!
fi
# end of 'Tek_device/cteklib/ctekclose.c'
fi
if test -f 'Tek_device/cteklib/ctekmessage.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekmessage.c'\"
else
echo shar: Extracting \"'Tek_device/cteklib/ctekmessage.c'\" \(1678 characters\)
sed "s/^X//" >'Tek_device/cteklib/ctekmessage.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/cteklib/ctekmessage.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Device dependent subroutine to handle message operations
X */
X#include	<stdio.h>
X#include	"ctek.h"
X#include	"../include/mesgcom.h"
X#include	"../include/enum.h"
extern FILE    *pltout;
X
ctekmessage (command, string)
X    int             command;
X    char            string[];
X{
X
X    switch (command)
X    {
X    case MESG_HOME:		/* Home */
X	cteksetmode (ANSI);
X	fprintf (pltout, "%c[H", ESC);
X	break;
X    case MESG_READY:
X	cteksetmode (ANSI);
X	break;
X    case MESG_TEXT:
X	fprintf (pltout, "%s", string);
X	break;
X    case MESG_ON:		/* Turn on Text */
X	cteksetmode (TEK);
X	fprintf (pltout, "%cLV1", ESC);
X	fflush (pltout);
X	break;
X    case MESG_OFF:		/* Turn off text */
X	cteksetmode (TEK);
X	fprintf (pltout, "%cLV0", ESC);
X	fflush (pltout);
X	break;
X    case MESG_ERASE:		/* Erase Text */
X	cteksetmode (TEK);
X	fprintf (pltout, "%cLZ", ESC);
X	fflush (pltout);
X	break;
X    case MESG_HIGHLIGHT_ON:
X	fprintf (pltout, "%c[7m", ESC);
X	break;
X    case MESG_HIGHLIGHT_OFF:
X	fprintf (pltout, "%c[0m", ESC);
X	break;
X    case MESG_DONE:
X    default:
X	fflush (pltout);
X	break;
X    }
X}
END_OF_FILE
if test 1678 -ne `wc -c <'Tek_device/cteklib/ctekmessage.c'`; then
    echo shar: \"'Tek_device/cteklib/ctekmessage.c'\" unpacked with wrong size!
fi
# end of 'Tek_device/cteklib/ctekmessage.c'
fi
if test -f 'Tek_device/cteklib/cteksetmode.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Tek_device/cteklib/cteksetmode.c'\"
else
echo shar: Extracting \"'Tek_device/cteklib/cteksetmode.c'\" \(1752 characters\)
sed "s/^X//" >'Tek_device/cteklib/cteksetmode.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/cteklib/cteksetmode.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Three possible modes for the Tek 4105: ANSI, Tek (or alpha), and
X * vector input mode. This is the exclusive routine that keeps
X * track of which mode we are in, and does what is necessary to
X * change modes.
X */
X/*
X * Updated to realize the fact that popping out to TEK mode loses
X * the train of vectors! (i.e. sets variable "lost" appropriately)
X */
X#include	<stdio.h>
X#include	"ctek.h"
extern FILE    *pltout;
X
int             lost;
X
cteksetmode (mode)
X    int             mode;
X{
static int      old_mode = ANSI;
X
X    switch (mode)
X    {
X    case ANSI:
X	if (old_mode == VECTOR)
X	{
X	    lost = 1;
X	    Putc (US);
X	    old_mode = TEK;
X	}
X	if (old_mode == TEK)
X	{
X	    fprintf (pltout, "%c%%!1", ESC);
X	    old_mode = ANSI;
X	}
X	break;
X    case TEK:
X	if (old_mode == VECTOR)
X	{
X	    lost = 1;
X	    Putc (US);
X	    old_mode = TEK;
X	}
X	else
X	if (old_mode == ANSI)
X	{
X	    fprintf (pltout, "%c%%!0", ESC);
X	    old_mode = TEK;
X	}
X	break;
X    case VECTOR:
X	if (old_mode == TEK)
X	{
X	    Putc (GS);
X	    old_mode = VECTOR;
X	}
X	else
X	if (old_mode == ANSI)
X	{
X	    fprintf (pltout, "%c%%!0%c", ESC, GS);
X	    old_mode = VECTOR;
X	}
X	break;
X    }
X}
END_OF_FILE
if test 1752 -ne `wc -c <'Tek_device/cteklib/cteksetmode.c'`; then
    echo shar: \"'Tek_device/cteklib/cteksetmode.c'\" unpacked with wrong size!
fi
# end of 'Tek_device/cteklib/cteksetmode.c'
fi
if test -f 'Virtual_device/raslib/rasconf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Virtual_device/raslib/rasconf.c'\"
else
echo shar: Extracting \"'Virtual_device/raslib/rasconf.c'\" \(1741 characters\)
sed "s/^X//" >'Virtual_device/raslib/rasconf.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/raslib/rasconf.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Keyword: vplot raster movie pen
X */
X#include <stdio.h>
X#include "../include/enum.h"
X#include "../include/extern.h"
X#include "raspen.h"
X
X/*
X * mandatory declarations and initializations
X */
X#ifdef SEP
char            name[] = "Raspen";
X#else
char            name[] = "raspen";
X#endif
X#include "rasdoc.h"
X
X/*
X * device routine table
X */
extern int
genmessage (), raserase (), rasopen (), genmarker ();
extern int
rasvector (), gentext ();
extern int      genpoint ();
extern int
genpatarea (), genraster ();
extern int
nulldev (), rasattr (), rasreset (), rasclose ();
X
struct device   dev =
X{
X
X /* control routines */
X rasopen,		/* open */
X rasreset,		/* reset */
X genmessage,		/* message */
X raserase,		/* erase */
X rasclose,		/* close */
X
X /* high level output */
X rasvector,		/* vector */
X genmarker,		/* marker */
X gentext,		/* text */
X genpatarea,		/* area */
X genraster,		/* raster */
X genpoint,		/* point */
X rasattr,		/* attributes */
X
X /* input */
X nulldev,		/* getpoint */
X nulldev,		/* interact */
X
X /* low level output */
X nulldev,		/* plot */
X nulldev,		/* startpoly */
X nulldev,		/* midpoly */
X nulldev		/* endpoly */
X};
END_OF_FILE
if test 1741 -ne `wc -c <'Virtual_device/raslib/rasconf.c'`; then
    echo shar: \"'Virtual_device/raslib/rasconf.c'\" unpacked with wrong size!
fi
# end of 'Virtual_device/raslib/rasconf.c'
fi
if test -f 'Virtual_device/vplib/vpconf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpconf.c'\"
else
echo shar: Extracting \"'Virtual_device/vplib/vpconf.c'\" \(1773 characters\)
sed "s/^X//" >'Virtual_device/vplib/vpconf.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/vplib/vpconf.c
X *
X * Joe Dellinger (SEP), Dec 19 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * A generic filter --- both inputs and outputs vplot.
X * Keyword: pchain pen vplot
X */
X#include <stdio.h>
X#include "../include/extern.h"
X
X/*
X * mandatory declarations
X */
X#ifdef SEP
char            name[] = "Vppen";
X#else
char            name[] = "vppen";
X#endif
X#include "vpdoc.h"
X
X/*
X * device routine table
X */
extern int
vpopen (), vpreset (), vpmessage (), vperase (), vpclose ();
extern int
vpattributes (), vpvector (), vpplot ();
extern int
vpstartpoly (), vpmidpoly (), vpendpoly ();
extern int
vpraster (), vpmarker (), vptext ();
extern int
genarea (), genpoint ();
extern int      nulldev ();
X
struct device   dev =
X{
X /* control routines */
X vpopen,		/* open */
X vpreset,		/* reset */
X vpmessage,		/* message */
X vperase,		/* erase */
X vpclose,		/* close */
X
X /* high level output */
X vpvector,		/* vector */
X vpmarker,		/* marker */
X vptext,		/* text */
X genarea,		/* area */
X vpraster,		/* raster */
X genpoint,		/* point */
X vpattributes,		/* attributes */
X
X /* input */
X nulldev,		/* getpoint */
X nulldev,		/* interact */
X
X /* low level output */
X vpplot,		/* plot */
X vpstartpoly,		/* startpoly */
X vpmidpoly,		/* midpoly */
X vpendpoly		/* endpoly */
X};
END_OF_FILE
if test 1773 -ne `wc -c <'Virtual_device/vplib/vpconf.c'`; then
    echo shar: \"'Virtual_device/vplib/vpconf.c'\" unpacked with wrong size!
fi
# end of 'Virtual_device/vplib/vpconf.c'
fi
if test -f 'Virtual_device/vplib/vpdoc.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpdoc.h'\"
else
echo shar: Extracting \"'Virtual_device/vplib/vpdoc.h'\" \(1808 characters\)
sed "s/^X//" >'Virtual_device/vplib/vpdoc.h' <<'END_OF_FILE'
char *documentation[] = {
X" ",
X"NAME",
X#ifdef SEP
X"    Vppen - SEPlib vplot filter for the virtual vplot device",
X#else
X"    vppen - vplot filter for the virtual vplot device",
X#endif
X" ",
X"Although it is perhaps not obvious, this program can be used to",
X"\"Capture the screen\". Ie, you play with Pen options until you",
X"get something you like, and then you can use those options with",
X"this program to make a new vplot file that without any options",
X"will draw the same thing.",
X" ",
X"OPTIONS",
X"    Defaults: dumb=n stat=n big=y align=uu vpstyle=y blast=y bit=0",
X"		gridnum=0,0 gridsize=xsize,ysize grid=-1",
X"dumb=y causes output to only be vectors, erases, and color changes.",
X"stat=y causes plot statistics to be printed to stdout instead of vplot.",
X"big=y expands the size of the device's screen (and hence outermost",
X"clipping window) to nearly infinity (bad for rotated style!).",
X"align=xy aligns plot:",
X"x is one of l, r, c, u for left, right, center, unaligned",
X"y is one of b, t, c, u for bottom, top, center, unaligned.",
X"In all cases the given point is aligned to have coordinate zero.",
X"vpstyle=n omits declaring absolute style in the output file.",
X"(The generic pen option \"size\" defaults to absolute for input.)",
X"blast is as in the libvplot raster documentation. ",
X"if bit > 0, then bit raster is used with bit the color.",
X"gridnum=numx,numy grids the screen, each part has gridsize=xsize,ysize",
X"numy defaults to numx. [xy]size default to [xy]screensize / num[xy].",
X"grid=N turns on drawing a grid, with fatness N.",
X"",
X"Some combinations of options are not allowed.",
X"You may not redirect or pipe the input if either the stat or align option",
X"is used. ALL GENERIC PEN OPTIONS ARE APPLICABLE.",
X};
int	doclength = { sizeof documentation/sizeof documentation[0] };
END_OF_FILE
if test 1808 -ne `wc -c <'Virtual_device/vplib/vpdoc.h'`; then
    echo shar: \"'Virtual_device/vplib/vpdoc.h'\" unpacked with wrong size!
fi
# end of 'Virtual_device/vplib/vpdoc.h'
fi
if test -f 'Virtual_device/vplib/vpreset.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpreset.c'\"
else
echo shar: Extracting \"'Virtual_device/vplib/vpreset.c'\" \(1673 characters\)
sed "s/^X//" >'Virtual_device/vplib/vpreset.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/vplib/vpreset.c
X *
X * Joe Dellinger (SEP), Dec 19 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X * Joe Dellinger Feb 25 1988
X *	Do erases FIRST! And only THEN the setstyle.
X */
X
X#include <stdio.h>
X#include <vplot.h>
X#include "../include/extern.h"
X#include "../include/attrcom.h"
X#include "../include/enum.h"
X#include "../include/round.h"
X#include "vp.h"
X
extern int      erase;
X
vpreset ()
X{
X/*
X * Reset everything we can think of.
X * Ignore initial erases, and instead look at the command line
X * value of "erase" to decide whether to have an initial erase
X * or not.
X */
X
X/*
X * vpsetflag is used to squeeze out redundant attribute-setting commands.
X */
X    vpsetflag = NO;
X
X    if (erase & FORCE_INITIAL)
X	vp_erase ();
X
X    if (!vpdumb && vpstyle)
X    {
X	vp_style (ABSOLUTE);
X    }
X
X    if (!vpdumb)
X    {
X	dev.attributes (SET_WINDOW, dev_xmin, dev_ymin, dev_xmax, dev_ymax);
X	dev.attributes (SET_COLOR, WHITE, 0, 0, 0);
X	dev.attributes (NEW_FAT, 0, 0, 0, 0);
X	dev.attributes (NEW_DASH, 0, 0, 0, 0);
X	dev.attributes (NEW_FONT, txfont, txprec, txovly, 0);
X	dev.attributes (NEW_ALIGN, txalign.hor, txalign.ver, 0, 0);
X	dev.attributes (NEW_OVERLAY, overlay, 0, 0, 0);
X    }
X}
END_OF_FILE
if test 1673 -ne `wc -c <'Virtual_device/vplib/vpreset.c'`; then
    echo shar: \"'Virtual_device/vplib/vpreset.c'\" unpacked with wrong size!
fi
# end of 'Virtual_device/vplib/vpreset.c'
fi
if test -f 'Vplot_Kernel/filters/Tests/Font.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/Font.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/Tests/Font.c'\" \(1739 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/Tests/Font.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/Tests/Font.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X#include <stdio.h>
X#include <vplot.h>
X#define NUMFONTS 17
char           *fontnames[] =
X{
X "pen",
X "romans",
X "romand",
X "romanc",
X "romant",
X "italicc",
X "italict",
X "scripts",
X "scriptc",
X "greeks",
X "greekc",
X "cyrilc",
X "gothgbt",
X "gothgrt",
X "gothitt",
X "math",
X "misc",
X ""
X};
X
main (argc, argv)
X    int             argc;
X    char          **argv;
X{
int             ii, xx, yy, font;
X
X    if (argc == 1)
X    {
X	fprintf (stderr, "usage: Font font_number | plas | ?pen\n");
X	exit (1);
X    }
X    font = atoi (argv[1]);
X
X    printf ("S a\n");
X
X    printf ("m 2400 30\n");
X    printf ("F 0 1 0\n");
X    if (font < NUMFONTS)
X	printf ("T 5 0\n\\f2 Font %d: %s\n", font, fontnames[font]);
X    else
X	printf ("T 5 0\n\\f2 Font %d: hardware\n", font);
X
X    for (ii = 30; ii < 200; ii++)
X    {
X	xx = (ii - 30) % 10;
X	yy = (ii - 30) / 10;
X
X	xx = xx * 550 + 300;
X	yy = yy * 255 + 300;
X
X	printf ("m %d %d\n", xx, yy);
X	printf ("F 0 1 0\nJ %d %d\n", TH_RIGHT, TV_NORMAL);
X	printf ("T 3 0\n%d:\\v%d :\n", ii, ii);
X	printf ("m %d %d\n", xx + 10, yy);
X	printf ("F %d 1 0\nJ %d %d\n", font, TH_NORMAL, TV_NORMAL);
X	printf ("T 8 0\n\\v%d \n", ii);
X    }
X}
END_OF_FILE
if test 1739 -ne `wc -c <'Vplot_Kernel/filters/Tests/Font.c'`; then
    echo shar: \"'Vplot_Kernel/filters/Tests/Font.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/Tests/Font.c'
fi
if test -f 'Vplot_Kernel/filters/Tests/TEST_align' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/TEST_align'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/Tests/TEST_align'\" \(1715 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/Tests/TEST_align' <<'END_OF_FILE'
e
S s
c 1
f 3
z
Test of text alignment.
z
X
z
Text should be aligned as it claims to be, despite the size changes.
z
All cyan colored text (top 4 on the left) should be boxed.
z
No boxes should be opaque, except for the slanted one
z
containing the word "Symbol". That box should stop at the
z
green degree symbol, which should be centered.
c 7
m 1000 2000
d 3000 2000
m 1000 2100
d 1000 1900
m 1000 2000
f 0
c 5
J 1 2
F 3 2 1
T 10 0
X\c2 L\c-1 eft, Base (fine!)\nNewline!\nAll in a box!
f 3
c 7
m 1000 3000
d 3000 3000
m 3000 3100
d 3000 2900
m 3000 3000
f 0
c 5
J 3 3
X# Here we break up a ts that would otherwise make a ligature, like
X# the KH, ch, and ya.
T 10 0
Right, \F11 \c2 (KHochet\-sya!)\c-1 \F-1  \^1\_\h\_2
f 3
c 7
m 1000 4000
d 3000 4000
m 2000 4100
d 2000 3900
m 2000 4000
f 0
c 5
J 2 4
T 10 0
Center, Cap (ffffi)
f 3
c 7
m 1000 5000
d 3000 5000
m 2000 5100
d 2000 4900
m 2000 5000
f 0
c 5
J 2 1
T 10 0
Center, Bottom (fffi)
F 3 2 0
f 3
c 7
m 1000 1000
d 3000 1000
m 2000 1100
d 2000 0900
m 2000 1000
f 0
c 6
J 2 5
T 10 0
Center, Top! (cauliflower)
f 3
c 7
m 4000 1000
d 6000 1000
m 5000 1100
d 5000 0900
m 5000 1000
f 0
c 6
J 2 5
T 10 0
Center \s200 (Size) \s50 Top!
f 3
c 7
m 4000 2000
d 6000 2000
m 5000 2100
d 5000 1900
m 5000 2000
f 0
c 6
J 2 5
T 10 0
X(Center) \s80 Size \s20 Top!
f 3
c 7
m 4000 3000
d 6000 3000
m 5000 3100
d 5000 2900
m 5000 3000
f 0
c 6
J 2 5
T 10 0
Center \s80 Size \s270 (Top)!
f 3
c 7
m 4000 5000
d 6000 5000
m 5000 5100
d 5000 4900
m 5000 5000
f 0
c 6
J 2 1
T 10 0
X\s20 Center, \s200 (ffi,) \s80 Bottom\m1 \_\F10 f\M1 \^g
f 3
c 7
m 4000 4000
d 6000 4000
m 5000 4100
d 5000 3900
m 5000 4000
f 0
c 6
J 4 6
F 3 2 3
T 11 30
Symbol, -> \F1 \c4 \v127 \c-1 \m0 \F-1  <- Symbol\M0 
END_OF_FILE
if test 1715 -ne `wc -c <'Vplot_Kernel/filters/Tests/TEST_align'`; then
    echo shar: \"'Vplot_Kernel/filters/Tests/TEST_align'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/Tests/TEST_align'
fi
if test -f 'Vplot_Kernel/filters/genlib/genarea.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genarea.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genarea.c'\" \(1772 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/genlib/genarea.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/genlib/genarea.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X#include <stdio.h>
X#include "../include/vertex.h"
X#include "../include/params.h"
X#include "../include/extern.h"
X
extern int      smart_clip;
X
extern int      Allgone;
X
X/*
X * Device Independent Polygon treatment.
X * Do a first-pass sort of clipping using
X * polysubs, and then finish the job by calling polyfix and
X * polystart.
X *
X * Not the prettiest of code, but hey, it works.
X * Someone out there should volunteer to clean this up a bit.
X */
X
genarea (npts, head)
X    int             npts;
X    struct vertex  *head;
X{
struct vertex  *v;
int             firstpoint, i;
X
X    Allgone = 1;		/* Assume none left unless polyfix tells us */
X    if (!smart_clip)
X    {
X	firstpoint = 2;
X	xminclip (0, 0, &firstpoint);	/* Tell them all to get ready */
X    }
X
X    firstpoint = 1;
X
X    v = head;
X    for (i = 0; i < npts; i++)
X    {
X	if (!smart_clip)
X	{
X	    xminclip (v->x, v->y, &firstpoint);
X	}
X	else
X	{
X	    polyfix (v->x, v->y, &firstpoint);
X	}
X	v++;
X    }
X    if (!smart_clip)
X    {
X	firstpoint = -1;	/* Means this was the last point! */
X	xminclip (0, 0, &firstpoint);
X    }
X    if (Allgone == 0)		/* If still 1, means there's nothing left! */
X    {
X	polystart ();
X    }
X}
END_OF_FILE
if test 1772 -ne `wc -c <'Vplot_Kernel/filters/genlib/genarea.c'`; then
    echo shar: \"'Vplot_Kernel/filters/genlib/genarea.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/genlib/genarea.c'
fi
if test -f 'Vplot_Kernel/filters/include/closestat.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/closestat.h'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/include/closestat.h'\" \(1573 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/include/closestat.h' <<'END_OF_FILE'
X/*
X * status passed to device's finish routine:
X *
X * status of CLOSE_NORMAL means normal finish,
X *
X * status of CLOSE_ERROR means fatal error condition is causing the exit,
X *
X * status of CLOSE_INTERRUPT means we just got "INTERRUPTed" (the user
X * 	hit control C, for example), and
X *
X * status of CLOSE_NOTHING means that they provided no input
X *	(dev.reset was never called, just dev.open).
X *
X * Following each of these will be a call with a status of CLOSE_DONE.
X * The device is guaranteed never to be called again after this call.
X * But that doesn't mean YOU should exit! You should return and let
X * dovplot and frontend do the exiting!!!
X *
X * Status of CLOSE_PAUSE gives us a chance to beep or do whatever should be
X * done during the pause generated by setting endpause=YES (remember that
X * the user can do this too). The sequence of calls to dev.close when closing
X * normally and with endpause=YES is PAUSE, NORMAL, DONE.
X * Many devices will simply ignore the case CLOSE_PAUSE. It is NOT the
X * responsibility of dev.close to wait for the user to do something before
X * returning! That responsibility is in dev.interact's domain.
X *
X * CLOSE_FLUSH means that the output stream to the plot device should be
X * flushed for one reason or another. Most devices should support this,
X * ESPECIALLY devices where it is possible for the user to look at the
X * output as it is produced!
X */
X
X#define CLOSE_DONE	-1
X#define CLOSE_NOTHING	 0
X#define CLOSE_ERROR 	 1
X#define CLOSE_INTERRUPT	 2
X#define CLOSE_NORMAL 	 3
X#define CLOSE_PAUSE 	 4
X#define CLOSE_FLUSH	 5
END_OF_FILE
if test 1573 -ne `wc -c <'Vplot_Kernel/filters/include/closestat.h'`; then
    echo shar: \"'Vplot_Kernel/filters/include/closestat.h'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/include/closestat.h'
fi
if test -f 'Vplot_Kernel/filters/include/intcom.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/intcom.h'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/include/intcom.h'\" \(1549 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/include/intcom.h' <<'END_OF_FILE'
X/*
X * commands to the device's "interact" routine
X */
X
X#define	INT_USER_PAUSE		0
X#define	INT_GET_STRING		1
X#define	INT_PAUSE		2
X#define	INT_F_PAUSE		3
X
X/*
X * Termout is conncted to read input from "/dev/tty".
X * You don't have to use it if that isn't appropriate.
X *
X * dev.interact(INT_GET_STRING, termout, instring)
X * FILE *termout;
X * char *instring;
X *
X * Wait for the user to enter a newline-terminated string.
X * Put the user's string into instring and return. (This option
X * is currently not used, but is provided to allow interactive
X * extensions in the future without changing the device-dependent code
X * interface.)
X *
X *
X * dev.interact(INT_PAUSE, termout, instring)
X * FILE *termout;
X * char *instring;
X *
X * Wait for the user to indicate his desire for plotting to continue,
X * in whatever fashion is appropriate for that device, then return.
X * For most devices, this will be by hitting "return" on the keyboard,
X * and so this case can simply be handled the same way as the previous one.
X * Any text stuffed into "instring" will be ignored, however.
X *
X * dev.interact(INT_F_PAUSE, termout, instring)
X * FILE *termout;
X * char *instring;
X *
X * Just like the INT_PAUSE case, except that this is a pause generated
X * by "endpause=y", occuring after all plotting is over with.
X *
X * dev.interact(INT_USER_PAUSE, termout, instring)
X * FILE *termout;
X * char *instring;
X *
X * Never used from dovplot. Provided so that in case the device wants to
X * make its own special case for internal use only, a number is already
X * reserved.
X */
END_OF_FILE
if test 1549 -ne `wc -c <'Vplot_Kernel/filters/include/intcom.h'`; then
    echo shar: \"'Vplot_Kernel/filters/include/intcom.h'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/include/intcom.h'
fi
if test -f 'Vplot_Kernel/filters/include/vplotfonts/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/vplotfonts/README'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/include/vplotfonts/README'\" \(1552 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/include/vplotfonts/README' <<'END_OF_FILE'
This directory contains all the Vplot fonts.
The fonts are in three forms:
X
X.vplot_fonts : This is the human-editable form generated by the program
X		hertovplot.c. Its format is documented in the beginning
X		of the program makefont.c
X
X.bin :		A binary form of the font, which can be loaded at
X		execute time on demand by gentext.c. (They aren't
X		loaded unless the user accesses the font.)
X
X.include:	An ``include'' file form of the font, which can be
X		#include'd into gentext.c at compile time. This way
X		gentext.c won't have to read the font off disk at
X		runtime if the user uses it.
X
Which fonts are included and which are loaded at compile time is set
in the include file font_definitions.h in the .../vplot/include
directory. It should be obvious from the file how to modify it.
If you have more or fewer fonts than we do here, you will also have to edit
the makefile in this directory so that it knows what fonts you have.
X
Generally, very commonly used fonts should be included, and all the
others should be loaded at runtime as needed. At SEP we have only
fonts 0, 1, and 3 (pen, roman simplex, and roman complex) compiled in.
Since the fonts are quite large, compiling in each font takes a
large amount of compile time. (To say nothing of making lint virtually
unuseable.)
X
Please read "vplottext.mn" and the Makefile in this directory to
find out how to obtain the necessary .vplot_font files. "pen.vplot_font"
is NOT a Hershey font and is an official part of Vplot. It is not beautiful,
but it is complete and efficient.
X
X- Joe Dellinger
END_OF_FILE
if test 1552 -ne `wc -c <'Vplot_Kernel/filters/include/vplotfonts/README'`; then
    echo shar: \"'Vplot_Kernel/filters/include/vplotfonts/README'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/include/vplotfonts/README'
fi
if test -f 'Vplot_Kernel/filters/loclib/err.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/loclib/err.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/loclib/err.c'\" \(1776 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/loclib/err.c' <<'END_OF_FILE'
X/*
X *
X *  source file:   ./filters/loclib/err.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X * Joe Dellinger Feb 16 1988
X *	Use VARARGS and vsprintf if they are available.
X */
X
X/*
X *	error abortion subroutine
X *
X *	a is a printf format string, while b-h are optional arguments
X *	When the subroutine is called, the program will stop after
X *	printing its message.
X *	Example:	err("Cannot divide %f by %f\n", x, y);
X *
X *      perror() is wiped out by including a dummy version of it here.
X *	this is because perror has the audacity to print directly to
X *	stderr, which we can't allow. this special version of err replaces
X *	the normal seplib version and forces seplib to go through ERR,
X *	the vplot filter subroutine for error messages that takes special
X *	care not to try to print messages in the middle of plotting.
X */
X#include <stdio.h>
X#include "../include/err.h"
X#include "../include/extern.h"
X
X#if defined (SUN) || defined (ultrix)
X#include <varargs.h>
X/*VARARGS1*/
err (va_alist)
va_dcl
X{
va_list         apdum;
extern char   **xargv;
char           *format;
char            string[120];
X
X    va_start (apdum);
X    format = va_arg (apdum, char *);
X    vsprintf (string, format, apdum);
X    va_end (apdum);
X
X    ERR (FATAL, name, "sep: %s", string);
X/*
X * Force the linker to link in my version of perror
X */
X    perror ();
X}
X#else
X/*VARARGS1*/
err (a, b, c, d, e, f, g, h)
X    char           *a, *b, *c, *d, *e, *f, *g, *h;
X{
extern char   **xargv;
char            string[120];
X
X    sprintf (string, a, b, c, d, e, f, g, h);
X    ERR (FATAL, name, "sep: %s", string);
X/*
X * Force the linker to link in my version of perror
X */
X    perror ();
X}
X#endif
X
perror ()
X{
X}
END_OF_FILE
if test 1776 -ne `wc -c <'Vplot_Kernel/filters/loclib/err.c'`; then
    echo shar: \"'Vplot_Kernel/filters/loclib/err.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/loclib/err.c'
fi
if test -f 'Vplot_Kernel/filters/utilities/greycorr.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/utilities/greycorr.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/filters/utilities/greycorr.c'\" \(1532 characters\)
sed "s/^X//" >'Vplot_Kernel/filters/utilities/greycorr.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./filters/utilities/greycorr.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X */
X
X/*
X * Utility to modify color tables for plotting grey rasters.
X */
X
X#include <stdio.h>
X#include "../include/extern.h"
X#include "../include/round.h"
X
int
greycorr (colornum)
X    int             colornum;
X{
float           newval;
extern float    greyc, pixc;
X
X    newval = colornum;
X/* 
X * correction to simulate nonlinearity of graphics displays
X */
X    if (greyc != 1.)
X    {
X	newval /= 255.;
X	newval = (-2. + 2. * greyc) * newval * newval * newval + 3. * (1. - greyc) * newval * newval + greyc * newval;
X	newval *= 255.;
X	if (newval < 0)
X	    newval = 0.;
X	if (newval > 255.)
X	    newval = 255.;
X    }
X
X/*
X * correction for pixel overlap on hardcopy devices
X */
X    if (pixc != 1.)
X    {
X	if (newval < pixc * 128.)
X	{
X	    newval /= pixc;
X	}
X	else
X	{
X	    newval = 128. + (newval - pixc * 128.) / (2. - pixc);
X	}
X	if (newval < 0)
X	    newval = 0.;
X	if (newval > 255.)
X	    newval = 255.;
X    }
X
X    return ROUND (newval);
X}
END_OF_FILE
if test 1532 -ne `wc -c <'Vplot_Kernel/filters/utilities/greycorr.c'`; then
    echo shar: \"'Vplot_Kernel/filters/utilities/greycorr.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/filters/utilities/greycorr.c'
fi
if test -f 'Vplot_Kernel/lvplot/vp_file.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_file.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_file.c'\" \(1668 characters\)
sed "s/^X//" >'Vplot_Kernel/lvplot/vp_file.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *  source file:   ./lvplot/vp_file.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X *
X * Steve Cole (SEP), October 27 1987
X *	Null character is added to filename when called from fortran
X *      to prevent allocation errors.
X */
X
X#include <stdio.h>
X#include <vplot.h>
X#include "vp_pc.h"
X
X#ifdef FORTRAN
X
X#define VPFILE vpwfile_
X
X#else
X
X#define VPFILE vp_file
X
X#endif
X
X#ifdef FORTRAN
VPFILE (filename, nchars)
X    int            *nchars;
X#else
VPFILE (filename)
X#endif
X    char           *filename;
X{
FILE           *temp, *fopen ();
X
X#ifdef FORTRAN
char           *tempfilename;
char           *malloc ();
int             ncharsp1, i;
X    ncharsp1 = *(nchars) + 1;
X    tempfilename = (char *) malloc (ncharsp1);
X    tempfilename[ncharsp1 - 1] = '\0';
X    for (i = 0; i < *(nchars); i++)
X    {
X	tempfilename[i] = filename[i];
X    }
X    temp = fopen (tempfilename, "w");
X#else FORTRAN
X    temp = fopen (filename, "w");
X#endif
X    if (temp == NULL)
X    {
X#ifdef FORTRAN
X	fprintf (stderr, "libvplot.vpfile: cannot create %s\n", tempfilename);
X#else
X	fprintf (stderr, "libvplot.vpfile: cannot create %s\n", filename);
X#endif
X	exit (-1);
X    }
X    vp_pc._pltout = temp;
X}
END_OF_FILE
if test 1668 -ne `wc -c <'Vplot_Kernel/lvplot/vp_file.c'`; then
    echo shar: \"'Vplot_Kernel/lvplot/vp_file.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/lvplot/vp_file.c'
fi
if test -f 'Vplot_Kernel/lvplot/vp_fill.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_fill.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_fill.c'\" \(1662 characters\)
sed "s/^X//" >'Vplot_Kernel/lvplot/vp_fill.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./lvplot/vp_fill.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X * Joe Dellinger Jan 14 1988
X *	Do rounding.
X */
X
X#include <stdio.h>
X#include <vplot.h>
X#include "round.h"
X#include "vp_pc.h"
X
X#ifdef FORTRAN
X
X#ifndef UUU
X#define AREA	vpfill_
X#else UUU
X#define UAREA	vpufill_
X#endif UUU
X#define LP		*lp
X#define XP xp2
X#define YP yp2
X
X#else
X
X#ifndef UUU
X#define AREA	vp_fill
X#else UUU
X#define UAREA	vp_ufill
X#endif UUU
X#define LP		lp
X#define XP xp
X#define YP yp
X
X#endif
X
X#ifndef UUU
AREA (xp, yp, lp)
X#else UUU
UAREA (xp, yp, lp)
X#endif UUU
X    float          *xp, *yp;
X    int             LP;
X{
int             i;
int             ix, iy;
X
X#ifdef FORTRAN
register float *xp2, *yp2;
X    xp2 = xp;
X    yp2 = yp;
X#endif FORTRAN
X
X    putc (VP_AREA, vp_pc._pltout);
X    puth (LP, vp_pc._pltout);
X
X    for (i = 0; i < LP; i++)
X    {
X#ifndef UUU
X	ix = ROUND ((*XP) * RPERIN);
X	iy = ROUND ((*YP) * RPERIN);
X#else UUU
X	ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
X	iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
X#endif UUU
X	XP++;
X	YP++;
X	puth (ix, vp_pc._pltout);
X	puth (iy, vp_pc._pltout);
X    }
X}
END_OF_FILE
if test 1662 -ne `wc -c <'Vplot_Kernel/lvplot/vp_fill.c'`; then
    echo shar: \"'Vplot_Kernel/lvplot/vp_fill.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/lvplot/vp_fill.c'
fi
if test -f 'Vplot_Kernel/lvplot/vp_pline.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_pline.c'\"
else
echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_pline.c'\" \(1673 characters\)
sed "s/^X//" >'Vplot_Kernel/lvplot/vp_pline.c' <<'END_OF_FILE'
X/*
X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
X * University. Official permission to use this software is included in
X * the documentation. It authorizes you to use this file for any
X * non-commercial purpose, provided that this copyright notice is not
X * removed and that any modifications made to this file are commented
X * and dated in the style of my example below.
X */
X
X/*
X *
X *  source file:   ./lvplot/vp_pline.c
X *
X * Joe Dellinger (SEP), June 11 1987
X *	Inserted this sample edit history entry.
X *	Please log any further modifications made to this file:
X * Joe Dellinger Jan 14 1988
X *	Do rounding.
X */
X
X#include <stdio.h>
X#include <vplot.h>
X#include "round.h"
X#include "vp_pc.h"
X
X#ifdef FORTRAN
X
X#ifndef UUU
X#define PLINE	vppline_
X#else UUU
X#define UPLINE	vpupline_
X#endif UUU
X#define LP		*lp
X#define XP xp2
X#define YP yp2
X
X#else
X
X#ifndef UUU
X#define PLINE	vp_pline
X#else UUU
X#define UPLINE	vp_upline
X#endif UUU
X#define LP		lp
X#define XP xp
X#define YP yp
X
X#endif
X
X#ifndef UUU
PLINE (xp, yp, lp)
X#else UUU
UPLINE (xp, yp, lp)
X#endif UUU
X    float          *xp, *yp;
X    int             LP;
X{
int             i;
int             ix, iy;
X
X#ifdef FORTRAN
register float *xp2, *yp2;
X    xp2 = xp;
X    yp2 = yp;
X#endif FORTRAN
X
X    putc (VP_PLINE, vp_pc._pltout);
X    puth (LP, vp_pc._pltout);
X    for (i = 0; i < LP; i++)
X    {
X#ifndef UUU
X	ix = ROUND ((*XP) * RPERIN);
X	iy = ROUND ((*YP) * RPERIN);
X#else UUU
X	ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
X	iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
X#endif UUU
X	XP++;
X	YP++;
X	puth (ix, vp_pc._pltout);
X	puth (iy, vp_pc._pltout);
X    }
X}
END_OF_FILE
if test 1673 -ne `wc -c <'Vplot_Kernel/lvplot/vp_pline.c'`; then
    echo shar: \"'Vplot_Kernel/lvplot/vp_pline.c'\" unpacked with wrong size!
fi
# end of 'Vplot_Kernel/lvplot/vp_pline.c'
fi
echo shar: End of archive 7 \(of 24\).
cp /dev/null ark7isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 24 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.



More information about the Comp.sources.unix mailing list