| 1 |
lars |
1 |
% $Header: /cvsroot/html2ps/postscript/box.break.ps,v 1.1 2005/12/18 07:21:36 Konstantin Exp $
|
|
|
2 |
|
|
|
3 |
/box-br-create {
|
|
|
4 |
box-generic-create
|
|
|
5 |
dup box-br-setup-methods
|
|
|
6 |
dup /box-br add-type
|
|
|
7 |
|
|
|
8 |
dup /display /block put-css-value
|
|
|
9 |
} def
|
|
|
10 |
|
|
|
11 |
/box-br-get-max-width { % => Context This
|
|
|
12 |
pop pop 0
|
|
|
13 |
} def
|
|
|
14 |
|
|
|
15 |
/box-br-get-min-width { % => Context This
|
|
|
16 |
pop pop 0
|
|
|
17 |
} def
|
|
|
18 |
|
|
|
19 |
/box-br-reflow { % => Context Parent This
|
|
|
20 |
1 index get-current-y % => Context Parent This PCY
|
|
|
21 |
|
|
|
22 |
% CSS 'clear' property may be applied to BR tags!
|
|
|
23 |
|
|
|
24 |
3 index exch % => Context Pareht This Context PCY
|
|
|
25 |
2 index box-generic-apply-clear % => Context Pareht This Y
|
|
|
26 |
|
|
|
27 |
% Move current "box" to parent current coordinates. It is REQUIRED,
|
|
|
28 |
% as some other routines uses box coordinates.
|
|
|
29 |
|
|
|
30 |
2 index get-current-x
|
|
|
31 |
2 index put-left % => Context Parent This Y
|
|
|
32 |
|
|
|
33 |
1 index put-top % => Context Parent This
|
|
|
34 |
|
|
|
35 |
% If we have a sequence of BR tags (like <BR><BR>), we'll have an only one item in the parent's
|
|
|
36 |
% line box - whitespace; in this case we'll need to additionally offset current y coordinate by the font size
|
|
|
37 |
|
|
|
38 |
1 index get-line length 0 eq { % => Context Parent This
|
|
|
39 |
2 index
|
|
|
40 |
2 index
|
|
|
41 |
box-container-close-line % => Context Parent This
|
|
|
42 |
|
|
|
43 |
1 index get-current-y
|
|
|
44 |
1 index /font-size get-css-value
|
|
|
45 |
sub
|
|
|
46 |
1 index get-bottom
|
|
|
47 |
min
|
|
|
48 |
|
|
|
49 |
2 index put-current-y
|
|
|
50 |
} {
|
|
|
51 |
1 index get-line length 1 gt
|
|
|
52 |
2 index get-line 0 get
|
|
|
53 |
is-whitespace not or { % => Context Parent This
|
|
|
54 |
2 index
|
|
|
55 |
2 index box-container-close-line
|
|
|
56 |
} {
|
|
|
57 |
1 index get-line length 0 gt {
|
|
|
58 |
% Restore height of whitespace (it had been reset in /flow-whitespace as a first whitespace in a line box)
|
|
|
59 |
1 index get-line 0 get
|
|
|
60 |
/font-size get-css-value % => Context Parent This DH
|
|
|
61 |
3 index
|
|
|
62 |
3 index
|
|
|
63 |
box-container-close-line % => Context Parent This DH
|
|
|
64 |
2 index get-current-y
|
|
|
65 |
exch sub % => Context Parent This CY'
|
|
|
66 |
1 index get-bottom
|
|
|
67 |
min
|
|
|
68 |
2 index put-current-y % => Context Pareht This
|
|
|
69 |
} if
|
|
|
70 |
} ifelse
|
|
|
71 |
} ifelse % => Context Parent This
|
|
|
72 |
|
|
|
73 |
% We need to explicitly extend the parent's height, as we don't know if
|
|
|
74 |
% it have any children _after_ this BR box.
|
|
|
75 |
1 index get-current-y
|
|
|
76 |
2 index box-generic-extend-height
|
|
|
77 |
|
|
|
78 |
pop pop pop
|
|
|
79 |
|
|
|
80 |
} def
|
|
|
81 |
|
|
|
82 |
/box-br-setup-methods {
|
|
|
83 |
dup /Methods get
|
|
|
84 |
dup /get-max-width {box-br-get-max-width} put
|
|
|
85 |
dup /get-min-width {box-br-get-min-width} put
|
|
|
86 |
dup /reflow {box-br-reflow} put
|
|
|
87 |
dup /show {box-br-show} put
|
|
|
88 |
pop pop
|
|
|
89 |
} def
|
|
|
90 |
|
|
|
91 |
/box-br-show { % => Viewport Box
|
|
|
92 |
pop pop
|
|
|
93 |
} def
|