2 /* Copyright (C) 1989, 1990, 1991, 1992, 2009
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
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, " }");