4 /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License along
20 with groff; see the file COPYING. If not, write to the Free Software
21 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
26 class mark_box
: public pointer_box
{
29 int compute_metrics(int);
34 // we push down marks so that they don't interfere with spacing
36 box
*make_mark_box(box
*p
)
38 list_box
*b
= p
->to_list_box();
40 b
->list
.p
[0] = make_mark_box(b
->list
.p
[0]);
44 return new mark_box(p
);
47 mark_box::mark_box(box
*pp
) : pointer_box(pp
)
51 void mark_box::output()
56 int mark_box::compute_metrics(int style
)
58 int res
= p
->compute_metrics(style
);
60 error("multiple marks and lineups");
61 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
62 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
63 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
64 printf(".nr " MARK_REG
" 0\n");
68 void mark_box::debug_print()
70 fprintf(stderr
, "mark { ");
72 fprintf(stderr
, " }");
76 class lineup_box
: public pointer_box
{
80 int compute_metrics(int style
);
84 // we push down lineups so that they don't interfere with spacing
86 box
*make_lineup_box(box
*p
)
88 list_box
*b
= p
->to_list_box();
90 b
->list
.p
[0] = make_lineup_box(b
->list
.p
[0]);
94 return new lineup_box(p
);
97 lineup_box::lineup_box(box
*pp
) : pointer_box(pp
)
101 void lineup_box::output()
106 int lineup_box::compute_metrics(int style
)
108 int res
= p
->compute_metrics(style
);
110 error("multiple marks and lineups");
111 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
112 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
113 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
114 printf(".nr " MARK_REG
" 0\n");
118 void lineup_box::debug_print()
120 fprintf(stderr
, "lineup { ");
122 fprintf(stderr
, " }");