|
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: 3939 (0xf63) Types: TextFile Names: »mf_windows.c«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89 └─⟦this⟧ »./tex82/Unsupported/FromJapan/mf84.support/mf84/MFlib/mf_windows.c« └─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z« └─⟦25c524ae4⟧ └─⟦this⟧ »Unsupported/FromJapan/mf84.support/mf84/MFlib/mf_windows.c«
#ifndef lint static char RCSid[] = "$Header: mf_windows.c,v 1.1 87/05/18 11:39:34 ikadai Exp $"; #endif #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 XWIN extern mf_xwin_initscreen(), mf_xwin_updatescreen(); extern mf_xwin_blankrectangle(), mf_xwin_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 XWIN { "xterm", mf_xwin_initscreen, mf_xwin_updatescreen, mf_xwin_blankrectangle, mf_xwin_paintrow }, { "xterms", mf_xwin_initscreen, mf_xwin_updatescreen, mf_xwin_blankrectangle, mf_xwin_paintrow }, { "egterm", mf_xwin_initscreen, mf_xwin_updatescreen, mf_xwin_blankrectangle, mf_xwin_paintrow }, { "jgterm", mf_xwin_initscreen, mf_xwin_updatescreen, mf_xwin_blankrectangle, mf_xwin_paintrow }, { "jgterms", mf_xwin_initscreen, mf_xwin_updatescreen, mf_xwin_blankrectangle, mf_xwin_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)); }