2 * Copyright (c) 2014 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992 Free Software Foundation, Inc.
5 * Written by James Clark (jjc@jclark.com)
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 2, 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 COPYING. If not, write to the Free Software
19 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "eqn-config.h"
33 int compute_metrics(int);
38 // we push down marks so that they don't interfere with spacing
40 box
*make_mark_box(box
*p
)
42 list_box
*b
= p
->to_list_box();
44 b
->list
.p
[0] = make_mark_box(b
->list
.p
[0]);
48 return new mark_box(p
);
51 mark_box::mark_box(box
*pp
) : pointer_box(pp
)
55 void mark_box::output()
60 int mark_box::compute_metrics(int style
)
62 int res
= p
->compute_metrics(style
);
64 error("multiple marks and lineups");
65 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
66 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
67 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
68 printf(".nr " MARK_REG
" 0\n");
72 void mark_box::debug_print()
74 fprintf(stderr
, "mark { ");
76 fprintf(stderr
, " }");
85 int compute_metrics(int style
);
89 // we push down lineups so that they don't interfere with spacing
91 box
*make_lineup_box(box
*p
)
93 list_box
*b
= p
->to_list_box();
95 b
->list
.p
[0] = make_lineup_box(b
->list
.p
[0]);
99 return new lineup_box(p
);
102 lineup_box::lineup_box(box
*pp
) : pointer_box(pp
)
106 void lineup_box::output()
111 int lineup_box::compute_metrics(int style
)
113 int res
= p
->compute_metrics(style
);
115 error("multiple marks and lineups");
116 printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]\n", uid
, p
->uid
);
117 printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
118 printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
119 printf(".nr " MARK_REG
" 0\n");
123 void lineup_box::debug_print()
125 fprintf(stderr
, "lineup { ");
127 fprintf(stderr
, " }");