aboutsummaryrefslogtreecommitdiff
path: root/sys/psio/pspos.x
blob: 55a918c14d7cbbbf34ebb7121091c76e721e2606 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include "psio.h"


# PS_XPOS -- Set current X position on page.

procedure ps_xpos (ps, xpos)

pointer	ps					#I PSIO descriptor
int	xpos					#I position

begin
	PS_XPOS(ps) = xpos
	call fprintf (PS_FD(ps), "%d H\n")
	    call pargi (PS_XPOS(ps))
end


# PS_YPOS -- Set current Y position on page.

procedure ps_ypos (ps, ypos)

pointer	ps					#I PSIO descriptor
int	ypos					#I position

begin
	PS_YPOS(ps) = ypos
	call fprintf (PS_FD(ps), "%d V\n")
	    call pargi (PS_YPOS(ps))
end


# PS_INDENT -- Set current left margin defined as a number of fixed width
# characters from the permanent left margin.

procedure ps_indent (ps, nchars)

pointer	ps					#I PSIO descriptor
int	nchars					#I position

begin
	PS_CLMARGIN(ps) = PS_PLMARGIN(ps) + max(0,nchars) * FIXED_WIDTH
	PS_LINE_WIDTH(ps) = (PS_PWIDTH(ps) * RESOLUTION) - 
                                PS_CLMARGIN(ps) - PS_PRMARGIN(ps) 
end


# PS_TESTPAGE -- Test whether we are within the given number of lines from
# the bottom of the page, if so break.

procedure ps_testpage (ps, nlines)

pointer	ps					#I PSIO descriptor
int	nlines					#I position

int	nleft

begin
	nleft = nlines * LINE_HEIGHT * RESOLUTION
	if ((PS_YPOS(ps) - PS_PBMARGIN(ps)) < nleft)
	    call ps_pagebreak (ps)
end