コード例 #1
0
ファイル: pltroff.c プロジェクト: bapt/heirloom-doctools
void openpl(char *s)	/* initialize device; s is residue of .PS invocation line */
{
	double maxw, maxh, ratio = 1;
	double odeltx = deltx, odelty = delty;

	hpos = vpos = 0;
	maxw = getfval("maxpswid");
	maxh = getfval("maxpsht");
	if (deltx > maxw) {	/* shrink horizontal */
		ratio = maxw / deltx;
		deltx *= ratio;
		delty *= ratio;
	}
	if (delty > maxh) {	/* shrink vertical */
		ratio = maxh / delty;
		deltx *= ratio;
		delty *= ratio;
	}
	if (ratio != 1) {
		fprintf(stderr, "pic: %g X %g picture shrunk to", odeltx, odelty);
		fprintf(stderr, " %g X %g\n", deltx, delty);
	}
	space(xmin, ymin, xmax, ymax);
	printf(".\\\" %g %g %g %g\n", xmin, ymin, xmax, ymax);
	printf(".\\\" %.3fi %.3fi %.3fi %.3fi\n",
		xconv(xmin), yconv(ymin), xconv(xmax), yconv(ymax));
	printf(".nr 00 \\n(.u\n");
	printf(".nf\n");
	printf(".PS %.3fi %.3fi %s", yconv(ymin), xconv(xmax), s);
		/* assumes \n comes as part of s */
}
コード例 #2
0
ファイル: pltroff.c プロジェクト: 99years/plan9
void closepl(char *PEline)	/* clean up after finished */
{
	movehv(0.0, 0.0);	/* get back to where we started */
	if (strchr(PEline, 'F') == NULL) {
		printf(".sp 1+%.3fi\n", yconv(ymin));
	}
	printf("%s\n", PEline);
	printf(".if \\n(00 .fi\n");
}
コード例 #3
0
ファイル: pltroff.c プロジェクト: n-t-roff/DWB3.3
void
openpl(char *s)	/* initialize device */
	/* char *s;	/ * residue of .PS invocation line */
{
	double maxw, maxh, ratio = 1;
	double odeltx = deltx, odelty = delty;

	hpos = vpos = 0;
	maxw = getfval("maxpswid");
	maxh = getfval("maxpsht");
/*	if (deltx > getfval("maxpswid") || delty > getfval("maxpsht")) {	/ * 8.5x11 inches max * /
 *		fprintf(stderr, "pic: %g X %g picture shrunk to", deltx, delty);
 *		maxdelt = max(deltx, delty);
 *		deltx *= 7/maxdelt;	/ * screwed up anyway; * /
 *		delty *= 7/maxdelt;	/ * make it 7x7 so someone can see it * /
 *		fprintf(stderr, " %g X %g\n", deltx, delty);
 *	}
 */
	if (deltx > maxw) {	/* shrink horizontal */
		ratio = maxw / deltx;
		deltx *= ratio;
		delty *= ratio;
	}
	if (delty > maxh) {	/* shrink vertical */
		ratio = maxh / delty;
		deltx *= ratio;
		delty *= ratio;
	}
	if (ratio != 1) {
		fprintf(stderr, "pic: %g X %g picture shrunk to", odeltx, odelty);
		fprintf(stderr, " %g X %g\n", deltx, delty);
	}
	space(xmin, ymin, xmax, ymax);
	printf("... %g %g %g %g\n", xmin, ymin, xmax, ymax);
	printf("... %.3fi %.3fi %.3fi %.3fi\n",
		xconv(xmin), yconv(ymin), xconv(xmax), yconv(ymax));
	printf(".nr 00 \\n(.u\n");
	printf(".nf\n");
	printf(".PS %.3fi %.3fi %s", yconv(ymin), xconv(xmax), s);
		/* assumes \n comes as part of s */
}
コード例 #4
0
ファイル: pltroff.c プロジェクト: n-t-roff/DWB3.3
void
closepl(int type)	/* clean up after finished */
{
	movehv(0.0, 0.0);	/* get back to where we started */
	if (type == 'F')
		printf(".PF\n");
	else {
		printf(".sp 1+%.3fi\n", yconv(ymin));
		printf(".PE\n");
	}
	printf(".if \\n(00 .fi\n");
}
コード例 #5
0
ファイル: pltroff.c プロジェクト: 99years/plan9
void cont(double x, double y)	/* continue line from here to x,y */
{
	double h1, v1;
	double dh, dv;

	h1 = xconv(x);
	v1 = yconv(y);
	dh = h1 - hpos;
	dv = v1 - vpos;
	hvflush();
	printf("\\D'l%.3fi %.3fi'\n", dh, dv);
	flyback();	/* expensive */
	hpos = h1;
	vpos = v1;
}
コード例 #6
0
ファイル: graphutils.cpp プロジェクト: nixz/covise
int iscontained(int gno, double wx, double wy)
{
    int i;
    double xconv(double x), yconv(double y);
    double x = xconv(wx), y = yconv(wy);

    for (i = 0; i < maxgraph; i++)
    {
        if (g[i].active == ON)
        {
            if ((g[i].v.xv1 <= x && g[i].v.xv2 >= x) && (g[i].v.yv1 <= y && g[i].v.yv2 >= y))
            {
                return i;
            }
        }
    }
    return gno;
}
コード例 #7
0
ファイル: pltroff.c プロジェクト: bapt/heirloom-doctools
void cont(double x, double y)	/* continue line from here to x,y */
{
	double h1, v1;
	double dh, dv;
	int rh = 0;

	h1 = xconv(x);
	v1 = yconv(y);
	dh = h1 - hpos;
	dv = v1 - vpos;
	if (dh > 0 && !dv) {
		rh = 1;
		move(x, y);
		dh = -dh;
	}
	hvflush();
	printf("\\D'l%.3fi %.3fi'\n", dh, dv);
	if (rh) move(x, y);
	flyback();	/* expensive */
	hpos = h1;
	vpos = v1;
}
コード例 #8
0
ファイル: pltroff.c プロジェクト: bapt/heirloom-doctools
void move(double x, double y)	/* go to position x, y in external coords */
{
	hgoto(xconv(x));
	vgoto(yconv(y));
}
コード例 #9
0
ファイル: move.c プロジェクト: dank101/4.4BSD-Alpha
move(xi,yi){
		movep(xconv(xsc(xi)),yconv(ysc(yi)));
		return;
}
コード例 #10
0
ファイル: line.c プロジェクト: andreiw/polaris
void
cont(int x0, int y0)
{
	iline(xnow,ynow,xconv(xsc(x0)),yconv(ysc(y0)));
	return;
}
コード例 #11
0
ファイル: line.c プロジェクト: andreiw/polaris
void
line(int x0, int y0, int x1, int y1)
{
	iline(xconv(xsc(x0)),yconv(ysc(y0)),xconv(xsc(x1)),yconv(ysc(y1)));
		return;
}
コード例 #12
0
ファイル: line.c プロジェクト: dank101/4.4BSD-Alpha
cont(x0,y0){
	iline(xnow,ynow,xconv(xsc(x0)),yconv(ysc(y0)));
	return;
}
コード例 #13
0
ファイル: line.c プロジェクト: dank101/4.4BSD-Alpha
line(x0,y0,x1,y1){
	iline(xconv(xsc(x0)),yconv(ysc(y0)),xconv(xsc(x1)),yconv(ysc(y1)));
		return;
}