2 /* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
4 * Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cc
8 * provides a state machine interface which generates html text.
12 This file is part of groff.
14 groff is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free
16 Software Foundation; either version 2, or (at your option) any later
19 groff is distributed in the hope that it will be useful, but WITHOUT ANY
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 You should have received a copy of the GNU General Public License along
25 with groff; see the file COPYING. If not, write to the Free Software
26 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
34 typedef enum {I_TAG
, B_TAG
, P_TAG
, SUB_TAG
, SUP_TAG
, TT_TAG
,
35 PRE_TAG
, SMALL_TAG
, BIG_TAG
, BREAK_TAG
, TABLE_TAG
,
38 typedef struct tag_definition
{
47 * the state of the current paragraph.
48 * It allows post-html.cc to request font changes, paragraph start/end
49 * and emits balanced tags with a small amount of peephole optimization.
54 html_text (simple_output
*op
);
56 void flush_text (void);
57 void do_emittext (const char *s
, int length
);
58 void do_italic (void);
65 void do_para (const char *arg1
);
70 void do_newline (void);
71 void do_table (const char *arg
);
72 void done_bold (void);
73 void done_italic (void);
74 char *done_para (void);
79 void done_small (void);
81 void do_indent (const char *arg
, int indent
, int pageoff
, int linelen
);
82 void do_color (color
*c
);
83 void done_color (void);
84 int emitted_text (void);
85 void emit_space (void);
87 void remove_tag (HTML_TAG tag
);
88 void remove_sub_sup (void);
89 void done_table (void);
90 int is_in_table (void);
93 tag_definition
*stackptr
; /* the current paragraph state */
94 tag_definition
*lastptr
; /* the end of the stack */
97 int current_indentation
; /* current .in value */
98 int pageoffset
; /* .po value */
99 int linelength
; /* current line length */
101 int is_present (HTML_TAG t
);
102 void end_tag (tag_definition
*t
);
103 void start_tag (tag_definition
*t
);
104 void push_para (HTML_TAG t
, void *arg
);
105 void push_para (HTML_TAG t
);
106 void push_para (color
*c
);
107 void do_push (tag_definition
*p
);
108 char *shutdown (HTML_TAG t
);
109 void check_emit_text (tag_definition
*t
);
110 int remove_break (void);
111 void issue_tag (char *tagname
, char *arg
);
112 void issue_color_begin (color
*c
);
113 void issue_table_begin (char *arg
);
114 void issue_table_end (void);
115 int table_is_void (tag_definition
*t
);
116 void remove_def (tag_definition
*t
);
117 void dump_stack_element (tag_definition
*p
);
118 void dump_stack (void);