22 |
#include "troff.h" |
#include "troff.h" |
23 |
#include "dictionary.h" |
#include "dictionary.h" |
24 |
#include "hvunits.h" |
#include "hvunits.h" |
25 |
|
#include "stringclass.h" |
26 |
|
#include "mtsm.h" |
27 |
#include "env.h" |
#include "env.h" |
28 |
#include "request.h" |
#include "request.h" |
29 |
#include "node.h" |
#include "node.h" |
624 |
prev_requested_size(sizescale*10), |
prev_requested_size(sizescale*10), |
625 |
char_height(0), |
char_height(0), |
626 |
char_slant(0), |
char_slant(0), |
|
seen_space(0), |
|
|
seen_eol(0), |
|
|
suppress_next_eol(0), |
|
|
seen_break(0), |
|
627 |
space_size(12), |
space_size(12), |
628 |
sentence_space_size(12), |
sentence_space_size(12), |
629 |
adjust_mode(ADJUST_BOTH), |
adjust_mode(ADJUST_BOTH), |
651 |
width_total(0), |
width_total(0), |
652 |
space_total(0), |
space_total(0), |
653 |
input_line_start(0), |
input_line_start(0), |
|
tabs(units_per_inch/2, TAB_LEFT), |
|
654 |
line_tabs(0), |
line_tabs(0), |
655 |
current_tab(TAB_NONE), |
current_tab(TAB_NONE), |
656 |
leader_node(0), |
leader_node(0), |
681 |
prev_glyph_color(&default_color), |
prev_glyph_color(&default_color), |
682 |
fill_color(&default_color), |
fill_color(&default_color), |
683 |
prev_fill_color(&default_color), |
prev_fill_color(&default_color), |
684 |
|
seen_space(0), |
685 |
|
seen_eol(0), |
686 |
|
suppress_next_eol(0), |
687 |
|
seen_break(0), |
688 |
|
tabs(units_per_inch/2, TAB_LEFT), |
689 |
name(nm), |
name(nm), |
690 |
control_char('.'), |
control_char('.'), |
691 |
no_break_control_char('\''), |
no_break_control_char('\''), |
716 |
fontno(e->fontno), |
fontno(e->fontno), |
717 |
prev_family(e->prev_family), |
prev_family(e->prev_family), |
718 |
family(e->family), |
family(e->family), |
|
seen_space(e->seen_space), |
|
|
seen_eol(e->seen_eol), |
|
|
suppress_next_eol(e->suppress_next_eol), |
|
|
seen_break(e->seen_break), |
|
719 |
space_size(e->space_size), |
space_size(e->space_size), |
720 |
sentence_space_size(e->sentence_space_size), |
sentence_space_size(e->sentence_space_size), |
721 |
adjust_mode(e->adjust_mode), |
adjust_mode(e->adjust_mode), |
743 |
width_total(0), |
width_total(0), |
744 |
space_total(0), |
space_total(0), |
745 |
input_line_start(0), |
input_line_start(0), |
|
tabs(e->tabs), |
|
746 |
line_tabs(e->line_tabs), |
line_tabs(e->line_tabs), |
747 |
current_tab(TAB_NONE), |
current_tab(TAB_NONE), |
748 |
leader_node(0), |
leader_node(0), |
773 |
prev_glyph_color(e->prev_glyph_color), |
prev_glyph_color(e->prev_glyph_color), |
774 |
fill_color(e->fill_color), |
fill_color(e->fill_color), |
775 |
prev_fill_color(e->prev_fill_color), |
prev_fill_color(e->prev_fill_color), |
776 |
|
seen_space(e->seen_space), |
777 |
|
seen_eol(e->seen_eol), |
778 |
|
suppress_next_eol(e->suppress_next_eol), |
779 |
|
seen_break(e->seen_break), |
780 |
|
tabs(e->tabs), |
781 |
name(e->name), // so that eg `.if "\n[.ev]"0"' works |
name(e->name), // so that eg `.if "\n[.ev]"0"' works |
782 |
control_char(e->control_char), |
control_char(e->control_char), |
783 |
no_break_control_char(e->no_break_control_char), |
no_break_control_char(e->no_break_control_char), |
2196 |
do_break(); |
do_break(); |
2197 |
} |
} |
2198 |
|
|
2199 |
node *environment::make_tag(const char *name, int i) |
node *environment::make_tag(const char *nm, int i) |
2200 |
{ |
{ |
2201 |
if (is_html) { |
if (is_html) { |
2202 |
/* |
/* |
2207 |
topdiv->begin_page(); |
topdiv->begin_page(); |
2208 |
macro *m = new macro; |
macro *m = new macro; |
2209 |
m->append_str("html-tag:"); |
m->append_str("html-tag:"); |
2210 |
for (const char *p = name; *p; p++) |
for (const char *p = nm; *p; p++) |
2211 |
if (!invalid_input_char((unsigned char)*p)) |
if (!invalid_input_char((unsigned char)*p)) |
2212 |
m->append(*p); |
m->append(*p); |
2213 |
m->append(' '); |
m->append(' '); |
2266 |
return NULL; |
return NULL; |
2267 |
} |
} |
2268 |
|
|
2269 |
void environment::construct_format_state(node *n, int was_centered, int fill) |
void environment::construct_format_state(node *n, int was_centered, |
2270 |
|
int filling) |
2271 |
{ |
{ |
2272 |
if (is_html) { |
if (is_html) { |
2273 |
// find first glyph node which has a state. |
// find first glyph node which has a state. |
2285 |
n->state->add_tag(MTSM_CE, center_lines+1); |
n->state->add_tag(MTSM_CE, center_lines+1); |
2286 |
else |
else |
2287 |
n->state->add_tag_if_unknown(MTSM_CE, 0); |
n->state->add_tag_if_unknown(MTSM_CE, 0); |
2288 |
n->state->add_tag_if_unknown(MTSM_FI, fill); |
n->state->add_tag_if_unknown(MTSM_FI, filling); |
2289 |
n = n->next; |
n = n->next; |
2290 |
while (n != 0) { |
while (n != 0) { |
2291 |
if (n->state != 0) { |
if (n->state != 0) { |
2292 |
n->state->sub_tag_ce(); |
n->state->sub_tag_ce(); |
2293 |
n->state->add_tag_if_unknown(MTSM_FI, fill); |
n->state->add_tag_if_unknown(MTSM_FI, filling); |
2294 |
} |
} |
2295 |
n = n->next; |
n = n->next; |
2296 |
} |
} |