DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T x

⟦8e529254e⟧ TextFile

    Length: 1639 (0x667)
    Types: TextFile
    Names: »x10.c«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z« 
        └─⟦036c765ac⟧ 
            └─⟦this⟧ »TeX3.0/mf/MFwindow/x10.c« 

TextFile

/*
 * X Version 10 Window interface for Metafont
 *
 * Tim Morgan  2/13/88
 */

#define	EXTERN	extern
#include "../mfd.h"

#ifdef	SYSV
#ifndef	ANSI
extern int sprintf();
#endif
#else
extern char *sprintf();
#endif

#ifdef	X10WIN
#include <X/Xlib.h>

static Display *my_display;
static Window my_window;

/* Return 1 if display opened successfully, else 0 */
mf_x10_initscreen()
{
    char default_geometry[50];
    OpaqueFrame outer_frame;

    my_display = XOpenDisplay("");
    if (!my_display) return(0);
    (void) sprintf(default_geometry, "=%dx%d", screenwidth, screendepth);
    outer_frame.bdrwidth = 2;
    outer_frame.border = BlackPixmap;
    outer_frame.background = BlackPixmap;
    my_window = XCreate("Metafont", "mf", (char *) 0,
	default_geometry, &outer_frame, screenwidth, screendepth);
    XMapWindow(my_window);
    return(1);
}

/* Make sure the screen is up to date */
mf_x10_updatescreen()
{
    XFlush();
}

mf_x10_blankrectangle(left, right, top, bottom)
screencol left, right;
screenrow top, bottom;
{
    XPixSet(my_window, (int) left, (int) top, (int) (right-left+1),
	(int) (bottom-top+1), WhitePixel);
}

mf_x10_paintrow(row, init_color, tvect, vector_size)
screenrow row;
pixelcolor init_color;
transspec tvect;
register screencol vector_size;
{
    register int color, col;

    color = (init_color == 0) ? WhitePixel : BlackPixel;

    do {
	col = *tvect++;
	XLine(my_window, col, (int) row, (int) (*tvect-1), (int) row,
		1, 1, color, GXcopy, AllPlanes);
	if (color == WhitePixel) color = BlackPixel;
	else color = WhitePixel;
    } while (--vector_size > 0);
}

#else
int x10_dummy;
#endif /* X10WIN */