DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

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

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦8c0480876⟧ TextFile

    Length: 6099 (0x17d3)
    Types: TextFile
    Notes: UNIX file
    Names: »output.c«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/src/gks/gks/output.c« 

TextFile


#include "../h/gks.h"
#include "../h/gksi.h"

Nc	q[33];		/* Points transformed to NDC.*/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* polyline    - POLYLINE.
*
* Input       - n = number of points.  Range: (2..n).
*               p = coordinates of points.  Range: WC.
*
* Process     - A sequence of connected straight lines is generated,
*               starting from the first point and ending at the last
*               point.  The polyline attribute entries in the GKS state
*               list are bound to the primitive when it is created.
*               These attribute entries are linetype and polyline
*               colour index.
*
* Output      - ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
polyline(n, p)
Size	n;
Wc	*p;
{	Nc	*qptr;
	Wc	*pptr;
	int	j;
	static	char pol[] = "polyline";

	ch_er_st(5, pol);

	if (n < 2)
	{	rep_er(100, pol);
		return;
	}

	/* Break p down into blocks of 32 points, so don't need too much
	   storage.  Have to repeat point at beginning of each polyline.*/
	pptr = p;
	while (n > 33)
	{	qptr = q;
		for (j = 1; j <= 33; j++)
			ntransf(pptr++, qptr++);
		FORALLWS
			if ((ws = gks.gk_actv[i]) != NULL)
				(*ws->ws_wsd->wd_func.pln)(33, q);
		ENDALLWS
		n = n - 32;
		pptr--;
	}
	qptr = q;
	for (j = 1; j <= n; j++)
		ntransf(pptr++, qptr++);
	FORALLWS
		if ((ws = gks.gk_actv[i]) != NULL)
			(*ws->ws_wsd->wd_func.pln)(n, q);
	ENDALLWS
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* polymark    - POLYMARKER.
*
* Input       - n = number of points.  Range: (1..n).
*               p = coordinates of points.  Range: WC.
*
* Process     - A sequence of markers is generated to identify all the
*               given positions.  The polymarker attribute entries in
*               the GKS state list are bound to the primitive when it
*               is created.  These attribute entries are marker type
*               and polymarker colour index.
*
* Output      - ws = current workstation state list.
*
* Comments    - A marker is visible if and only if the marker position
*               is within the clipping window.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
polymark(n, p)
Size	n;
Wc	*p;
{	Nc	*qptr;
	Wc	*pptr;
	int	j;
	static	char pom[] = "polymark";

	ch_er_st(5, pom);

	if (n < 1)
	{	rep_er(100, pom);
		return;
	}

	/* Break p down into blocks of 32 points, so don't need too much
	   storage.*/
	pptr = p;
	while (n > 32)
	{	qptr = q;
		for (j = 1; j <= 32; j++)
			ntransf(pptr++, qptr++);
		FORALLWS
			if ((ws = gks.gk_actv[i]) != NULL)
				(*ws->ws_wsd->wd_func.pmk)(32, q);
		ENDALLWS
		n = n - 32;
	}
	qptr = q;
	for (j = 1; j <= n; j++)
		ntransf(pptr++, qptr++);
	FORALLWS
		if ((ws = gks.gk_actv[i]) != NULL)
			(*ws->ws_wsd->wd_func.pmk)(n, q);
	ENDALLWS
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* text        - TEXT.
*
* Input       - p = text position.  Range: WC.
*               s = character string.
*               gks.chng_attr = indicates if character height needs to
*                  be changed.
*               gks.gk_chht = character height.
*
* Process     - A character string is generated.  The current text
*               attribute entries in the GKS state list are bound to
*               the primitive when it is created.  These attribute
*               entries are text colour index, character height,
*               character up vector, and character alignment.  The
*               text position is given in WC and transformed by the
*               current normalization transformation.
*
* Output      - ws = current workstation state list.
*               gks.chng_attr = indicates if character height needs to
*                  be changed.
*
* Comments    - Text is clipped on a full character basis.  That is,
*               if any part of the character lies outside the clipping
*               boundary, the entire character is clipped.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
text(p, s)
Wc	*p;
String	s;
{	Charhtn	ht;

	ch_er_st(5, "text");

	/* Update character height if necessary.*/
	if (gks.chng_attr == TRUE)
	{	ntrany(&gks.gk_chht, (Real *)&ht);
		/* Have to change this if add charup.*/
		FORALLWS
			if ((ws = gks.gk_actv[i]) != NULL)
				(*ws->ws_wsd->wd_func.cht)(ht);
		ENDALLWS
		gks.chng_attr = FALSE;
	}

	ntransf(p, q);
	FORALLWS
		if ((ws = gks.gk_actv[i]) != NULL)
			(*ws->ws_wsd->wd_func.txt)(q, s);
	ENDALLWS
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* fillarea    - FILL AREA.
*
* Input       - n = number of points.  Range: (3..32).
*               p = coordinates of points.  Range: WC.
*
* Process     - A FILL AREA primitive is generated.  The current fill
*               area attribute entries in the GKS state list are bound
*               to the primitive when it is created.  These attribute
*               entries are fill area interior style, and fill area
*               colour index.
*
*               The polygon defined by the points is filled according
*               to the interior style attribute.  The boundary is drawn
*               for style HOLLOW, and is not drawn for other interior
*               styles.
*
*               If parts of the area are clipped, the resulting new
*               boundaries become part of the area boundaries.  Multiple
*               subareas may be generated.
*
* Output      - ws = current workstation state list.
*
* Comments    - Only a maximum of 32 points are supported by this
*               implementation.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
fillarea(n,p)
Size	n;
Wc	*p;
{	Nc	*qptr;
	Wc	*pptr;
	int	j;
	static	char far[] = "fillarea";

	ch_er_st(5, far);

	if ((n < 3) || (n > 32))
	{	rep_er(100, far);
		return;
	}

	pptr = p;
	qptr = q;
	for (j = 1; j <= n; j++)
		ntransf(pptr++, qptr++);
	FORALLWS
		if ((ws = gks.gk_actv[i]) != NULL)
			(*ws->ws_wsd->wd_func.far)(n, q);
	ENDALLWS

	return;
}