2 /* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009
3 * Free Software Foundation, Inc.
5 * Gaius Mulley (gaius@glam.ac.uk) wrote html-table.h
9 * provides the methods necessary to handle indentation and tab
10 * positions using html tables.
14 This file is part of groff.
16 groff is free software; you can redistribute it and/or modify it under
17 the terms of the GNU General Public License as published by the Free
18 Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
21 groff is distributed in the hope that it will be useful, but WITHOUT ANY
22 WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 You should have received a copy of the GNU General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>. */
31 #if !defined(HTML_TABLE_H)
34 typedef struct tab_position {
37 struct tab_position *next;
46 int compatible (const char *s);
47 void init (const char *s);
48 void check_init (const char *s);
49 int find_tab (int pos);
50 int get_tab_pos (int n);
51 char get_tab_align (int n);
52 void dump_tabs (void);
55 void delete_list (void);
72 html_table (simple_output *op, int linelen);
74 int add_column (int coln, int hstart, int hend, char align);
75 cols *get_column (int coln);
76 int insert_column (int coln, int hstart, int hend, char align);
77 int modify_column (cols *c, int hstart, int hend, char align);
78 int find_tab_column (int pos);
79 int find_column (int pos);
80 int get_tab_pos (int n);
81 char get_tab_align (int n);
82 void set_linelength (int linelen);
83 int no_columns (void);
86 void dump_table (void);
87 void emit_table_header (int space);
88 void emit_col (int n);
89 void emit_new_row (void);
90 void emit_finish_table (void);
91 int get_right (cols *c);
92 void add_indent (int indent);
93 void finish_row (void);
94 int get_effective_linelength (void);
95 void set_space (int space);
96 void emit_colspan (void);
97 void emit_td (int percentage, const char *s = ">");
99 tabs *tab_stops; /* tab stop positions */
102 cols *columns; /* column entries */
104 cols *last_col; /* last column started */
105 int start_space; /* have we seen a `.sp' tag? */
107 void remove_cols (cols *c);
111 * the indentation wrapper.
112 * Builds an indentation from a html-table.
113 * This table is only emitted if the paragraph is emitted.
118 html_indent (simple_output *op, int ind, int pageoffset, int linelength);
120 void begin (int space); // called if we need to use the indent
121 void get_reg (int *ind, int *pageoffset, int *linelength);
123 // the indent is shutdown when it is deleted
128 int pg; // values of the registers as passed via initialization