|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 3943 (0xf67)
Types: TextFile
Names: »mf_windows.BSD4_n.c«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
└─⟦this⟧ »./tex82/Unsupported/MFpxl/mflib/mf_windows.BSD4_n.c«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
└─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z«
└─⟦25c524ae4⟧
└─⟦this⟧ »Unsupported/MFpxl/mflib/mf_windows.BSD4_n.c«
#ifndef lint
static char RCSid[] = "$Header: mf_windows.c,v 1.0 86/01/31 14:59:56 richards Released $";
#endif
/* Tektronix and X10 support added since release (PAM) */
#include <stdio.h>
#include "mftypes.h"
/*
* Generic Window interface to Unix version of MetaFont
*
* This module contains a dispatch table indexed by the
* TERM environment variable to select the graphics routines
* appropriate to the user's terminal. Note that all graphics
* output comes out on "stdio", which must be a legitimate
* terminal device (ala isatty()).
*/
#ifdef SUNWIN
extern mf_sun_initscreen(), mf_sun_updatescreen();
extern mf_sun_blankrectangle(), mf_sun_paintrow();
#endif
#ifdef HP2627WIN
extern mf_hp2627_initscreen(), mf_hp2627_updatescreen();
extern mf_hp2627_blankrectangle(), mf_hp2627_paintrow();
#endif
#ifdef TEKTRONIXWIN
extern mf_tektronix_initscreen(), mf_tektronix_updatescreen();
extern mf_tektronix_blankrectangle(), mf_tektronix_paintrow();
#endif
#ifdef X10WIN
extern mf_X10_initscreen(), mf_X10_updatescreen();
extern mf_X10_blankrectangle(), mf_X10_paintrow();
#endif
/*
* Array "mfwsw" contains the dispatch tables for each terminal.
* we map the pascal calls to the routines:
* init_screen;
* update_screen;
* blank_rectangle;
* and paint_row;
* into the appropriate entry point for the specific terminal
* that MF is being run from.
* I was too lazy to make multiple aliases for the same terminal,
* but didn't feel it was needed...
*/
struct mfwin_sw {
char *mfwsw_type; /* name of terminal ala TERMCAP */
int (*mfwsw_initscreen)(); /* initscreen() entry */
int (*mfwsw_updatescrn)(); /* updatescreen() entry */
int (*mfwsw_blankrect)(); /* blankrectangle() entry */
int (*mfwsw_paintrow)(); /* paintrow() entry */
} mfwsw[] = {
#ifdef SUNWIN
{ "sun",
mf_sun_initscreen, mf_sun_updatescreen,
mf_sun_blankrectangle, mf_sun_paintrow },
#endif
#ifdef HP2627WIN
{ "hp2627",
mf_hp2627_initscreen, mf_hp2627_updatescreen,
mf_hp2627_blankrectangle, mf_hp2627_paintrow },
#endif
#ifdef TEKTRONIXWIN
{ "tek",
mf_tektronix_initscreen, mf_tektronix_updatescreen,
mf_tektronix_blankrectangle, mf_tektronix_paintrow },
#endif
#ifdef X10WIN
{
"xterm",
mf_X10_initscreen, mf_X10_updatescreen,
mf_X10_blankrectangle, mf_X10_paintrow },
#endif
/*=========== End of mfsw[] must have mfwsw_type==NULL =================*/
{ NULL,
NULL, NULL,
NULL, NULL }
};
/*======================================================================*/
static struct mfwin_sw *mfwp; /* pointer to current mfwsw[] entry */
/*
* The following are dummy routines that just jump to the correct
* terminal-specific graphics code:
*
* init_screen: boolean; return true if window operations legal
*/
extern char *getenv();
initscreen()
{
register char *ttytype;
if ((ttytype = getenv("TERM")) == NULL || !(isatty(fileno(stdout))))
return(0);
for (mfwp = mfwsw; mfwp->mfwsw_type != NULL; mfwp++)
if (!strcmp(mfwp->mfwsw_type, ttytype))
return((*mfwp->mfwsw_initscreen)());
return(0);
}
/*
* updatescreen; -- just make sure screen is ready to view
*/
updatescreen()
{
return((*mfwp->mfwsw_updatescrn)());
}
/*
* blankrectangle: reset rectangle bounded by ([left,right],[top,bottom])
* to background color
*/
blankrectangle(left, right, top, bottom)
screencol left, right;
screenrow top, bottom;
{
return((*mfwp->mfwsw_blankrect)(left, right, top, bottom));
}
/*
* paintrow -- paint "row" starting with color "init_color", up to next
* transition specified by "transition_vector", switch colors,
* and continue for "vector_size" transitions.
*/
paintrow(row, init_color, transition_vector, vector_size)
screenrow row;
pixelcolor init_color;
transspec transition_vector;
screencol vector_size;
{
return((*mfwp->mfwsw_paintrow)(row, init_color,
transition_vector, vector_size));
}