/[groff]/groff/src/roff/troff/env.cpp
ViewVC logotype

Diff of /groff/src/roff/troff/env.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by wl, Sun Oct 10 19:08:03 2004 UTC revision 1.10 by wl, Fri Oct 15 05:08:35 2004 UTC
# Line 22  Foundation, 59 Temple Place - Suite 330, Line 22  Foundation, 59 Temple Place - Suite 330,
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"
# Line 622  environment::environment(symbol nm) Line 624  environment::environment(symbol nm)
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),
# Line 653  environment::environment(symbol nm) Line 651  environment::environment(symbol nm)
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),
# Line 684  environment::environment(symbol nm) Line 681  environment::environment(symbol nm)
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('\''),
# Line 714  environment::environment(const environme Line 716  environment::environment(const environme
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),
# Line 745  environment::environment(const environme Line 743  environment::environment(const environme
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),
# Line 776  environment::environment(const environme Line 773  environment::environment(const environme
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),
# Line 2194  void environment::final_break() Line 2196  void environment::final_break()
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      /*      /*
# Line 2205  node *environment::make_tag(const char * Line 2207  node *environment::make_tag(const char *
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(' ');
# Line 2264  statem *environment::construct_state(int Line 2266  statem *environment::construct_state(int
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.
# Line 2282  void environment::construct_format_state Line 2285  void environment::construct_format_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      }      }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26