LCOV - code coverage report
Current view: top level - roff/troff - node.h (source / functions) Hit Total Coverage
Test: GNU roff Lines: 41 41 100.0 %
Date: 2026-01-16 17:51:41 Functions: 14 15 93.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright 1989-2025 Free Software Foundation, Inc.
       2             :      Written by James Clark (jjc@jclark.com)
       3             : 
       4             : This file is part of groff, the GNU roff typesetting system.
       5             : 
       6             : groff is free software; you can redistribute it and/or modify it under
       7             : the terms of the GNU General Public License as published by the Free
       8             : Software Foundation, either version 3 of the License, or
       9             : (at your option) any later version.
      10             : 
      11             : groff is distributed in the hope that it will be useful, but WITHOUT ANY
      12             : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      13             : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      14             : for more details.
      15             : 
      16             : You should have received a copy of the GNU General Public License
      17             : along with this program.  If not, see <http://www.gnu.org/licenses/>. */
      18             : 
      19             : struct hyphen_list {
      20             :   bool is_hyphen;
      21             :   bool is_breakable;
      22             :   unsigned char hyphenation_code;
      23             :   hyphen_list *next;
      24             :   hyphen_list(unsigned char code,
      25             :               hyphen_list * /* p */ = 0 /* nullptr */);
      26             : };
      27             : 
      28             : enum hyphenation_type {
      29             :   HYPHENATION_PERMITTED,
      30             :   HYPHENATION_UNNECESSARY,
      31             :   HYPHENATION_INHIBITED
      32             : };
      33             : 
      34             : class ascii_output_file;
      35             : 
      36             : struct breakpoint;
      37             : struct vertical_size;
      38             : class charinfo;
      39             : 
      40             : class macro;
      41             : 
      42             : class troff_output_file;
      43             : class tfont;
      44             : class environment;
      45             : 
      46             : class glyph_node;
      47             : class diverted_space_node;
      48             : class token_node;
      49             : 
      50             : struct node {
      51             :   node *next;
      52             :   node *last;
      53             :   statem *state;
      54             :   statem *push_state;
      55             :   int div_nest_level;
      56             :   bool is_special;
      57             :   node();
      58             :   node(node *);
      59             :   node(node *, statem *, int);
      60             :   node(node *, statem *, int, bool);
      61             :   virtual node *add_char(charinfo *, environment *, hunits *, int *,
      62             :                  node ** /* glyph_comp_np */ = 0 /* nullptr */);
      63             : 
      64             :   virtual ~node();
      65             :   virtual node *copy() = 0;
      66             :   virtual bool set_unformat_flag();
      67             :   virtual bool causes_tprint() = 0;
      68             :   virtual bool is_tag() = 0;
      69             :   // TODO: Figure out what a hyphenation code means in the UTF-8 future,
      70             :   // where a "grochar" is a vector of NFD decomposed code points.  Can
      71             :   // it be a scalar--a 32-bit int?
      72             :   virtual unsigned char get_break_code();
      73             :   virtual hunits width();
      74             :   virtual hunits subscript_correction();
      75             :   virtual hunits italic_correction();
      76             :   virtual hunits left_italic_correction();
      77             :   virtual hunits skew();
      78             :   virtual int nspaces();
      79             :   virtual bool did_space_merge(hunits, hunits, hunits);
      80             :   virtual vunits vertical_width();
      81             :   virtual node *last_char_node();
      82             :   virtual void vertical_extent(vunits *, vunits *);
      83             :   virtual int character_type();
      84             :   virtual void set_vertical_size(vertical_size *);
      85             :   virtual int ends_sentence();
      86             :   virtual node *merge_self(node *);
      87             :   virtual node *add_discretionary_hyphen();
      88             :   virtual node *add_self(node *, hyphen_list **);
      89             :   virtual hyphen_list *get_hyphen_list(hyphen_list *, int *);
      90             :   virtual void ascii_print(ascii_output_file *);
      91             :   virtual void asciify(macro *) = 0;
      92             :   virtual bool discardable();
      93             :   virtual void spread_space(int *, hunits *);
      94             :   virtual void freeze_space();
      95             :   virtual void is_escape_colon();
      96             :   virtual breakpoint *get_breakpoints(hunits, int,
      97             :                               breakpoint * /* rest */ = 0 /* nullptr */,
      98             :                               bool /* is_inner */ = false);
      99             :   virtual int nbreaks();
     100             :   virtual void split(int, node **, node **);
     101             :   virtual hyphenation_type get_hyphenation_type();
     102             :   virtual bool need_reread(bool *);
     103             :   virtual token_node *get_token_node();
     104             :   virtual bool overlaps_vertically();
     105             :   virtual bool overlaps_horizontally();
     106             :   virtual units size();
     107             :   virtual bool interpret(macro *);
     108             : 
     109             :   virtual node *merge_glyph_node(glyph_node *);
     110             :   virtual tfont *get_tfont();
     111             :   virtual color *get_stroke_color();
     112             :   virtual color *get_fill_color();
     113             :   virtual void tprint(troff_output_file *);
     114             :   virtual void zero_width_tprint(troff_output_file *);
     115             : 
     116             :   virtual node *add_italic_correction(hunits *);
     117             : 
     118             :   virtual bool is_same_as(node *) = 0;
     119             :   virtual const char *type() = 0;
     120             :   virtual void dump_properties();
     121             :   virtual void dump_node();
     122             : };
     123             : 
     124     6816958 : inline node::node()
     125             : : next(0 /* nullptr */), last(0 /* nullptr */),
     126             :   state(0 /* nullptr */), push_state(0 /* nullptr */),
     127     6816958 :   div_nest_level(0), is_special(false)
     128             : {
     129     6816958 : }
     130             : 
     131     1659669 : inline node::node(node *n)
     132             : : next(n), last(0 /* nullptr */),
     133             :   state(0 /* nullptr */), push_state(0 /* nullptr */),
     134     1659669 :   div_nest_level(0), is_special(false)
     135             : {
     136     1659669 : }
     137             : 
     138    21434786 : inline node::node(node *n, statem *s, int divlevel)
     139             : : next(n), last(0 /* nullptr */),
     140             :   push_state(0 /* nullptr */),
     141    21434786 :   div_nest_level(divlevel), is_special(false)
     142             : {
     143    21434786 :   if (s != 0 /* nullptr */)
     144       21206 :     state = new statem(s);
     145             :   else
     146    21413580 :     state = 0 /* nullptr */;
     147    21434786 : }
     148             : 
     149      204892 : inline node::node(node *n, statem *s, int divlevel, bool special)
     150             : : next(n), last(0 /* nullptr */),
     151             :   push_state(0 /* nullptr */),
     152      204892 :   div_nest_level(divlevel), is_special(special)
     153             : {
     154      204892 :   if (s != 0 /* nullptr */)
     155          18 :     state = new statem(s);
     156             :   else
     157      204874 :     state = 0 /* nullptr */;
     158      204892 : }
     159             : 
     160    60130498 : inline node::~node()
     161             : {
     162    30065249 :   if (state != 0 /* nullptr */)
     163      127069 :     delete state;
     164    30065249 :   if (push_state != 0 /* nullptr */)
     165       48034 :     delete push_state;
     166    30065249 : }
     167             : 
     168             : // three-valued Boolean :-|
     169             : // 0 means it doesn't, 1 means it does, 2 means it's transparent
     170             : int node_list_ends_sentence(node *);
     171             : 
     172             : struct breakpoint {
     173             :   breakpoint *next;
     174             :   hunits width;
     175             :   int nspaces;
     176             :   node *nd;
     177             :   int index;
     178             :   char hyphenated;
     179             : };
     180             : 
     181             : class line_start_node : public node {
     182             : public:
     183     4231865 :   line_start_node() {}
     184             :   void asciify(macro *);
     185     1654665 :   node *copy() { return new line_start_node; }
     186             :   bool is_same_as(node *);
     187             :   bool causes_tprint();
     188             :   bool is_tag();
     189             :   const char *type();
     190             : };
     191             : 
     192             : // Represent a space of any width, including zero.
     193             : class space_node : public node {
     194             : private:
     195             : protected:
     196             :   hunits n;
     197             :   bool set;
     198             :   bool was_escape_colon;
     199             :   color *col;                   /* for grotty */
     200             :   space_node(hunits, int, int, color *, statem *, int,
     201             :              node * = 0 /* nullptr */);
     202             : public:
     203             :   space_node(hunits, color *, node * = 0 /* nullptr */);
     204             :   void asciify(macro *);
     205             :   node *copy();
     206             :   int nspaces();
     207             :   hunits width();
     208             :   bool discardable();
     209             :   bool did_space_merge(hunits, hunits, hunits);
     210             :   void freeze_space();
     211             :   void is_escape_colon();
     212             :   void spread_space(int *, hunits *);
     213             :   void tprint(troff_output_file *);
     214             :   breakpoint *get_breakpoints(hunits, int,
     215             :                               breakpoint * /* rest */ = 0 /* nullptr */,
     216             :                               bool /* is_inner */ = false);
     217             :   int nbreaks();
     218             :   void split(int, node **, node **);
     219             :   void ascii_print(ascii_output_file *);
     220             :   bool is_same_as(node *);
     221             :   const char *type();
     222             :   bool causes_tprint();
     223             :   bool is_tag();
     224             :   hyphenation_type get_hyphenation_type();
     225             :   void dump_properties();
     226             : };
     227             : 
     228             : struct width_list {
     229             :   hunits width;
     230             :   hunits sentence_width;
     231             :   width_list *next;
     232             :   width_list(hunits, hunits);
     233             :   width_list(width_list *);
     234             :   void dump();
     235             : };
     236             : 
     237             : class word_space_node : public space_node {
     238             : protected:
     239             :   width_list *orig_width;
     240             :   bool unformat;
     241             :   word_space_node(hunits /* d */, int /* s */, color * /* c */,
     242             :                   width_list * /* w */, bool /* flag */,
     243             :                   statem * /* st */, int /* divlevel */,
     244             :                   node * /* x */ = 0 /* nullptr */);
     245             : public:
     246             :   word_space_node(hunits, color *, width_list *,
     247             :                   node * /* x */ = 0 /* nullptr */);
     248             :   ~word_space_node();
     249             :   void asciify(macro *);
     250             :   node *copy();
     251             :   bool need_reread(bool *);
     252             :   bool set_unformat_flag();
     253             :   void tprint(troff_output_file *);
     254             :   bool is_same_as(node *);
     255             :   const char *type();
     256             :   bool did_space_merge(hunits, hunits, hunits);
     257             :   bool causes_tprint();
     258             :   bool is_tag();
     259             :   void dump_properties();
     260             : };
     261             : 
     262             : class unbreakable_space_node : public word_space_node {
     263             :   unbreakable_space_node(hunits, int, color *, statem *, int,
     264             :                          node * /* x */ = 0 /* nullptr */);
     265             : public:
     266             :   unbreakable_space_node(hunits, color *,
     267             :                          node * /* x */ = 0 /* nullptr */);
     268             :   void asciify(macro *);
     269             :   node *copy();
     270             :   bool need_reread(bool *);
     271             :   void tprint(troff_output_file *);
     272             :   bool is_same_as(node *);
     273             :   const char *type();
     274             :   bool causes_tprint();
     275             :   bool is_tag();
     276             :   breakpoint *get_breakpoints(hunits, int,
     277             :                               breakpoint * /* rest */ = 0 /* nullptr */,
     278             :                               bool /* is_inner */ = false);
     279             :   int nbreaks();
     280             :   void split(int, node **, node **);
     281             :   bool did_space_merge(hunits, hunits, hunits);
     282             :   node *add_self(node *, hyphen_list **);
     283             :   hyphen_list *get_hyphen_list(hyphen_list *, int *);
     284             :   hyphenation_type get_hyphenation_type();
     285             : };
     286             : 
     287             : class diverted_space_node : public node {
     288             : public:
     289             :   vunits n;
     290             :   diverted_space_node(vunits, node * /* p */ = 0 /* nullptr */);
     291             :   diverted_space_node(vunits, statem *, int,
     292             :                       node * /* p */ = 0 /* nullptr */);
     293             :   void asciify(macro *);
     294             :   node *copy();
     295             :   bool need_reread(bool *);
     296             :   bool is_same_as(node *);
     297             :   const char *type();
     298             :   bool causes_tprint();
     299             :   bool is_tag();
     300             :   void dump_properties();
     301             : };
     302             : 
     303             : class diverted_copy_file_node : public node {
     304             :   symbol filename;
     305             : public:
     306             :   vunits n;
     307             :   diverted_copy_file_node(symbol, node * /* p */ = 0 /* nullptr */);
     308             :   diverted_copy_file_node(symbol, statem *, int,
     309             :                           node * /* p */ = 0 /* nullptr */);
     310             :   void asciify(macro *);
     311             :   node *copy();
     312             :   bool need_reread(bool *);
     313             :   bool is_same_as(node *);
     314             :   const char *type();
     315             :   bool causes_tprint();
     316             :   bool is_tag();
     317             :   void dump_properties();
     318             : };
     319             : 
     320             : class extra_size_node : public node {
     321             :   vunits n;
     322             : public:
     323             :   extra_size_node(vunits);
     324             :   extra_size_node(vunits, statem *, int);
     325             :   void set_vertical_size(vertical_size *);
     326             :   void asciify(macro *);
     327             :   node *copy();
     328             :   bool is_same_as(node *);
     329             :   const char *type();
     330             :   bool causes_tprint();
     331             :   bool is_tag();
     332             :   void dump_properties();
     333             : };
     334             : 
     335             : class vertical_size_node : public node {
     336             :   vunits n;
     337             : public:
     338             :   vertical_size_node(vunits, statem *, int);
     339             :   vertical_size_node(vunits);
     340             :   void asciify(macro *);
     341             :   void set_vertical_size(vertical_size *);
     342             :   node *copy();
     343             :   bool set_unformat_flag();
     344             :   bool is_same_as(node *);
     345             :   const char *type();
     346             :   bool causes_tprint();
     347             :   bool is_tag();
     348             :   void dump_properties();
     349             : };
     350             : 
     351             : class hmotion_node : public node {
     352             : protected:
     353             :   hunits n;
     354             :   bool was_tab;                 // needed by `unformat`
     355             :   bool unformat;
     356             :   color *col;                   /* for grotty */
     357             : public:
     358      495665 :   hmotion_node(hunits i, color *c, node *nxt = 0 /* nullptr */)
     359      495665 :     : node(nxt), n(i), was_tab(false), unformat(false), col(c) {}
     360        6192 :   hmotion_node(hunits i, color *c, statem *s, int divlevel,
     361             :                node *nxt = 0 /* nullptr */)
     362        6192 :     : node(nxt, s, divlevel), n(i), was_tab(false), unformat(false),
     363        6192 :       col(c) {}
     364     1835120 :   hmotion_node(hunits i, bool flag1, bool flag2, color *c, statem *s,
     365             :                int divlevel, node *nxt = 0 /* nullptr */)
     366     1835120 :     : node(nxt, s, divlevel), n(i), was_tab(flag1), unformat(flag2),
     367     1835120 :       col(c) {}
     368         784 :   hmotion_node(hunits i, bool flag1, bool flag2, color *c,
     369             :                node *nxt = 0 /* nullptr */)
     370         784 :     : node(nxt), n(i), was_tab(flag1), unformat(flag2), col(c) {}
     371             :   void asciify(macro *);
     372             :   node *copy();
     373             :   bool need_reread(bool *);
     374             :   bool set_unformat_flag();
     375             :   void tprint(troff_output_file *);
     376             :   hunits width();
     377             :   void ascii_print(ascii_output_file *);
     378             :   bool is_same_as(node *);
     379             :   const char *type();
     380             :   bool causes_tprint();
     381             :   bool is_tag();
     382             :   node *add_self(node *, hyphen_list **);
     383             :   hyphen_list *get_hyphen_list(hyphen_list *, int *);
     384             :   hyphenation_type get_hyphenation_type();
     385             :   void dump_properties();
     386             : };
     387             : 
     388             : class space_char_hmotion_node : public hmotion_node {
     389             : public:
     390             :   space_char_hmotion_node(hunits, color *,
     391             :                           node * /* nxt */ = 0 /* nullptr */);
     392             :   space_char_hmotion_node(hunits, color *, statem *, int,
     393             :                           node * /* nxt */ = 0 /* nullptr */);
     394             :   node *copy();
     395             :   void asciify(macro *);
     396             :   void ascii_print(ascii_output_file *);
     397             :   void tprint(troff_output_file *);
     398             :   bool is_same_as(node *);
     399             :   const char *type();
     400             :   bool causes_tprint();
     401             :   bool is_tag();
     402             :   node *add_self(node *, hyphen_list **);
     403             :   hyphen_list *get_hyphen_list(hyphen_list *, int *);
     404             :   hyphenation_type get_hyphenation_type();
     405             : };
     406             : 
     407             : class vmotion_node : public node {
     408             :   vunits n;
     409             :   color *col;                   /* for grotty */
     410             : public:
     411             :   vmotion_node(vunits, color *);
     412             :   vmotion_node(vunits, color *, statem *, int);
     413             :   void asciify(macro *);
     414             :   void tprint(troff_output_file *);
     415             :   node *copy();
     416             :   vunits vertical_width();
     417             :   bool is_same_as(node *);
     418             :   const char *type();
     419             :   bool causes_tprint();
     420             :   bool is_tag();
     421             :   void dump_properties();
     422             : };
     423             : 
     424             : struct container_node : public node {
     425             :   node *nodes;
     426             :   container_node(node * /* contents */);
     427             :   container_node(node * /* next */, node * /* contents */);
     428             :   container_node(node * /* next */, statem *, int);
     429             :   //container_node(node * /* next */, statem *, node * /* contents */);
     430             :   container_node(node * /* next */, statem *, int,
     431             :                  node * /* contents */);
     432             :   container_node(node * /* next */, statem *, int, bool,
     433             :                  node * /* contents */);
     434             :   ~container_node();
     435             :   virtual void dump_node();
     436             : };
     437             : 
     438             : class hline_node : public container_node {
     439             :   hunits x;
     440             : public:
     441             :   hline_node(hunits, node *, node * /* nxt */ = 0 /* nullptr */);
     442             :   hline_node(hunits, node *, statem *, int,
     443             :              node * /* nxt */ = 0 /* nullptr */);
     444             :   void asciify(macro *);
     445             :   node *copy();
     446             :   hunits width();
     447             :   void tprint(troff_output_file *);
     448             :   bool is_same_as(node *);
     449             :   const char *type();
     450             :   bool causes_tprint();
     451             :   bool is_tag();
     452             :   void dump_properties();
     453             : };
     454             : 
     455             : class vline_node : public container_node {
     456             :   vunits x;
     457             : public:
     458             :   vline_node(vunits, node *, node * /* nxt */ = 0 /* nullptr */);
     459             :   vline_node(vunits, node *, statem *, int,
     460             :              node * /* nxt */ = 0 /* nullptr */);
     461             :   void asciify(macro *);
     462             :   node *copy();
     463             :   void tprint(troff_output_file *);
     464             :   hunits width();
     465             :   vunits vertical_width();
     466             :   void vertical_extent(vunits *, vunits *);
     467             :   bool is_same_as(node *);
     468             :   const char *type();
     469             :   bool causes_tprint();
     470             :   bool is_tag();
     471             :   void dump_properties();
     472             : };
     473             : 
     474             : class dummy_node : public node {
     475             : public:
     476      112266 :   dummy_node(node * nd = 0 /* nullptr */) : node(nd) {}
     477             :   void asciify(macro *);
     478             :   node *copy();
     479             :   bool is_same_as(node *);
     480             :   const char *type();
     481             :   bool causes_tprint();
     482             :   bool is_tag();
     483             :   hyphenation_type get_hyphenation_type();
     484             : };
     485             : 
     486             : class transparent_dummy_node : public node {
     487             : public:
     488      295352 :   transparent_dummy_node(node * nd = 0 /* nullptr */) : node(nd) {}
     489             :   void asciify(macro *);
     490             :   node *copy();
     491             :   bool is_same_as(node *);
     492             :   const char *type();
     493             :   bool causes_tprint();
     494             :   bool is_tag();
     495             :   int ends_sentence();
     496             :   hyphenation_type get_hyphenation_type();
     497             : };
     498             : 
     499             : class zero_width_node : public container_node {
     500             : public:
     501             :   zero_width_node(node *);
     502             :   zero_width_node(node *, statem *, int);
     503             :   void asciify(macro *);
     504             :   node *copy();
     505             :   void tprint(troff_output_file *);
     506             :   void ascii_print(ascii_output_file *);
     507             :   bool is_same_as(node *);
     508             :   const char *type();
     509             :   bool causes_tprint();
     510             :   bool is_tag();
     511             :   void append(node *);
     512             :   int character_type();
     513             :   void vertical_extent(vunits *, vunits *);
     514             : };
     515             : 
     516             : class left_italic_corrected_node : public container_node {
     517             :   hunits x;
     518             : public:
     519             :   left_italic_corrected_node(node * /* xx */ = 0 /* nullptr */);
     520             :   left_italic_corrected_node(statem *, int,
     521             :                              node * /* xx */ = 0 /* nullptr */);
     522             :   void asciify(macro *);
     523             :   void tprint(troff_output_file *);
     524             :   void ascii_print(ascii_output_file *);
     525             :   node *copy();
     526             :   bool is_same_as(node *);
     527             :   const char *type();
     528             :   bool causes_tprint();
     529             :   bool is_tag();
     530             :   hunits width();
     531             :   node *last_char_node();
     532             :   void vertical_extent(vunits *, vunits *);
     533             :   int ends_sentence();
     534             :   bool overlaps_horizontally();
     535             :   bool overlaps_vertically();
     536             :   hyphenation_type get_hyphenation_type();
     537             :   tfont *get_tfont();
     538             :   int character_type();
     539             :   hunits skew();
     540             :   hunits italic_correction();
     541             :   hunits subscript_correction();
     542             :   hyphen_list *get_hyphen_list(hyphen_list *, int *);
     543             :   node *add_self(node *, hyphen_list **);
     544             :   node *merge_glyph_node(glyph_node *);
     545             :   void dump_properties();
     546             : };
     547             : 
     548             : class overstrike_node : public container_node {
     549             :   hunits max_width;
     550             : public:
     551             :   overstrike_node();
     552             :   overstrike_node(statem *, int);
     553             :   void asciify(macro *);
     554             :   node *copy();
     555             :   void tprint(troff_output_file *);
     556             :   void overstrike(node *);      // add another node to be overstruck
     557             :   hunits width();
     558             :   void ascii_print(ascii_output_file *);
     559             :   bool is_same_as(node *);
     560             :   const char *type();
     561             :   bool causes_tprint();
     562             :   bool is_tag();
     563             :   node *add_self(node *, hyphen_list **);
     564             :   hyphen_list *get_hyphen_list(hyphen_list *, int *);
     565             :   hyphenation_type get_hyphenation_type();
     566             :   void dump_properties();
     567             : };
     568             : 
     569             : class bracket_node : public container_node {
     570             :   hunits max_width;
     571             : public:
     572             :   bracket_node();
     573             :   bracket_node(statem *, int);
     574             :   void asciify(macro *);
     575             :   node *copy();
     576             :   void tprint(troff_output_file *);
     577             :   void bracket(node *);         // add another node to be stacked
     578             :   hunits width();
     579             :   void ascii_print(ascii_output_file *);
     580             :   bool is_same_as(node *);
     581             :   const char *type();
     582             :   bool causes_tprint();
     583             :   bool is_tag();
     584             :   void dump_properties();
     585             : };
     586             : 
     587             : class device_extension_node : public node {
     588             :   macro mac;
     589             :   tfont *tf;
     590             :   color *gcol;
     591             :   color *fcol;
     592             :   bool lacks_command_prefix;
     593             :   void tprint_start(troff_output_file *);
     594             :   void tprint_char(troff_output_file *, unsigned char);
     595             :   void tprint_end(troff_output_file *);
     596             : public:
     597             :   device_extension_node(const macro & /* m */,
     598             :                         bool /* lacks_command_prefix */ = false);
     599             :   device_extension_node(const macro & /* m */, tfont * /* tf */,
     600             :                         color * /* gcol */, color * /* fcol */,
     601             :                         statem * /* s */, int divlevel,
     602             :                         bool /* lacks_command_prefix */ = false);
     603             :   void asciify(macro *);
     604             :   node *copy();
     605             :   void tprint(troff_output_file *);
     606             :   bool is_same_as(node *);
     607             :   const char *type();
     608             :   bool causes_tprint();
     609             :   bool is_tag();
     610             :   hyphenation_type get_hyphenation_type();
     611             :   int ends_sentence();
     612             :   tfont *get_tfont();
     613             :   void dump_properties();
     614             : };
     615             : 
     616             : class suppress_node : public node {
     617             :   int is_on; // three-valued Boolean :-|
     618             :   bool emit_limits;     // must we issue extent of the area written out?
     619             :   symbol filename;
     620             :   char position;
     621             :   int  image_id;
     622             : public:
     623             :   suppress_node(int, int);
     624             :   suppress_node(symbol, char, int);
     625             :   suppress_node(int, int, symbol, char, int, statem *, int);
     626             :   suppress_node(int, int, symbol, char, int);
     627             :   void asciify(macro *);
     628             :   node *copy();
     629             :   void tprint(troff_output_file *);
     630             :   hunits width();
     631             :   bool is_same_as(node *);
     632             :   const char *type();
     633             :   bool causes_tprint();
     634             :   bool is_tag();
     635             :   void dump_properties();
     636             : private:
     637             :   void put(troff_output_file *, const char *);
     638             : };
     639             : 
     640             : class tag_node : public node {
     641             : public:
     642             :   string tag_string;
     643             :   bool delayed;
     644             :   tag_node();
     645             :   tag_node(string, int);
     646             :   tag_node(string, statem *, int, int);
     647             :   void asciify(macro *);
     648             :   node *copy();
     649             :   void tprint(troff_output_file *);
     650             :   bool is_same_as(node *);
     651             :   const char *type();
     652             :   bool causes_tprint();
     653             :   bool is_tag();
     654             :   int ends_sentence(); // three-valued Boolean :-|
     655             :   void dump_properties();
     656             : };
     657             : 
     658             : struct hvpair {
     659             :   hunits h;
     660             :   vunits v;
     661             :   hvpair();
     662             : };
     663             : 
     664             : class draw_node : public node {
     665             :   int npoints;
     666             :   font_size sz;
     667             :   color *gcol;
     668             :   color *fcol;
     669             :   char code;
     670             :   hvpair *point;
     671             : public:
     672             :   draw_node(char, hvpair *, int, font_size, color *, color *);
     673             :   draw_node(char, hvpair *, int, font_size, color *, color *, statem *,
     674             :             int);
     675             :   ~draw_node();
     676             :   hunits width();
     677             :   vunits vertical_width();
     678             :   void asciify(macro *);
     679             :   node *copy();
     680             :   void tprint(troff_output_file *);
     681             :   bool is_same_as(node *);
     682             :   const char *type();
     683             :   bool causes_tprint();
     684             :   bool is_tag();
     685             :   void dump_properties();
     686             : };
     687             : 
     688             : node *make_node(charinfo *, environment *);
     689             : bool character_exists(charinfo *, environment *);
     690             : 
     691             : int same_node_list(node *, node *);
     692             : node *reverse_node_list(node *);
     693             : void delete_node_list(node *);
     694             : node *copy_node_list(node *);
     695             : 
     696             : hunits env_font_emboldening_offset(environment *, int);
     697             : 
     698      205787 : inline hyphen_list::hyphen_list(unsigned char code, hyphen_list *p)
     699      205787 : : is_hyphen(false), is_breakable(false), hyphenation_code(code), next(p)
     700             : {
     701      205787 : }
     702             : 
     703             : extern void read_desc();
     704             : extern bool mount_font(int, symbol,
     705             :                        symbol /* external_name */ = NULL_SYMBOL);
     706             : extern bool is_font_name(symbol, symbol);
     707             : extern bool is_abstract_style(symbol);
     708             : extern bool mount_style(int, symbol);
     709             : extern bool is_valid_font_mounting_position(int);
     710             : extern int symbol_fontno(symbol);
     711             : extern int next_available_font_position();
     712             : extern void init_size_list(int *);
     713             : extern int get_underline_fontno();
     714             : 
     715             : class output_file {
     716             :   char make_g_plus_plus_shut_up;
     717             : public:
     718             :   output_file();
     719             :   bool is_dying;
     720             :   virtual ~output_file();
     721             :   virtual void trailer(vunits);
     722             :   virtual void flush() = 0;
     723             :   virtual void transparent_char(unsigned char) = 0;
     724             :   virtual void print_line(hunits x, vunits y, node *n,
     725             :                           vunits before, vunits after,
     726             :                           hunits width) = 0;
     727             :   virtual void begin_page(int pageno, vunits page_length) = 0;
     728             :   virtual void copy_file(hunits x, vunits y, const char *filename) = 0;
     729             :   virtual bool is_selected_for_printing() = 0;
     730             :   virtual void put_filename(const char *, int);
     731             :   virtual void on();
     732             :   virtual void off();
     733             : #ifdef COLUMN
     734             :   virtual void vjustify(vunits, symbol);
     735             : #endif /* COLUMN */
     736             :   mtsm state;
     737             : };
     738             : 
     739             : extern char *pipe_command;
     740             : 
     741             : extern output_file *the_output;
     742             : extern void init_output();
     743             : bool in_output_page_list(int);
     744             : 
     745             : class font_family {
     746             :   int *map;
     747             :   int map_size;
     748             : public:
     749             :   const symbol nm;
     750             :   font_family(symbol);
     751             :   ~font_family();
     752             :   int resolve(int);
     753             :   static void invalidate_fontno(int);
     754             : };
     755             : 
     756             : font_family *lookup_family(symbol);
     757             : symbol get_font_name(int, environment *);
     758             : symbol get_style_name(int);
     759             : extern search_path include_search_path;
     760             : extern const int FONT_NOT_MOUNTED;
     761             : 
     762             : // Local Variables:
     763             : // fill-column: 72
     764             : // mode: C++
     765             : // End:
     766             : // vim: set cindent noexpandtab shiftwidth=2 textwidth=72:

Generated by: LCOV version 1.14