2 /* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.uucp)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 1, or (at your option) any later
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file LICENSE. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 class mark_box
: public pointer_box
{
27 int compute_metrics(int);
32 // we push down marks so that they don't interfere with spacing
34 box
*make_mark_box(box
*p
)
36 list_box
*b
= p
->to_list_box();
38 b
->list
.p
[0] = make_mark_box(b
->list
.p
[0]);
42 return new mark_box(p
);
45 mark_box::mark_box(box
*pp
) : pointer_box(pp
)
49 void mark_box::output()
54 int mark_box::compute_metrics(int style
)
56 int res
= p
->compute_metrics(style
);
58 error("multiple marks and lineups");
59 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
60 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
61 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
62 printf(".nr " MARK_REG
" 0\n");
66 void mark_box::debug_print()
68 fprintf(stderr
, "mark { ");
70 fprintf(stderr
, " }");
74 class lineup_box
: public pointer_box
{
78 int compute_metrics(int style
);
82 // we push down lineups so that they don't interfere with spacing
84 box
*make_lineup_box(box
*p
)
86 list_box
*b
= p
->to_list_box();
88 b
->list
.p
[0] = make_lineup_box(b
->list
.p
[0]);
92 return new lineup_box(p
);
95 lineup_box::lineup_box(box
*pp
) : pointer_box(pp
)
99 void lineup_box::output()
104 int lineup_box::compute_metrics(int style
)
106 int res
= p
->compute_metrics(style
);
108 error("multiple marks and lineups");
109 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
110 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
111 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
112 printf(".nr " MARK_REG
" 0\n");
116 void lineup_box::debug_print()
118 fprintf(stderr
, "lineup { ");
120 fprintf(stderr
, " }");