2 /* Copyright (C) 2002 Free Software Foundation, Inc.
4 * Gaius Mulley (gaius@glam.ac.uk) wrote html-table.cc
8 * provides the methods necessary to handle indentation and tab
9 * positions using html tables.
13 This file is part of groff.
15 groff is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License as published by the Free
17 Software Foundation; either version 2, or (at your option) any later
20 groff is distributed in the hope that it will be useful, but WITHOUT ANY
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 You should have received a copy of the GNU General Public License along
26 with groff; see the file COPYING. If not, write to the Free Software
27 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
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 int find_tab (int pos);
49 int get_tab_pos (int n);
50 char get_tab_align (int n);
51 void dump_tabs (void);
54 void delete_list (void);
71 html_table (simple_output *op, int linelen);
73 int add_column (int coln, int hstart, int hend, char align);
74 cols *get_column (int coln);
75 int insert_column (int coln, int hstart, int hend, char align);
76 int modify_column (cols *c, int hstart, int hend, char align);
77 int find_tab_column (int pos);
78 int find_column (int pos);
79 int get_tab_pos (int n);
80 char get_tab_align (int n);
81 void set_linelength (int linelen);
82 int no_columns (void);
85 void dump_table (void);
86 void emit_table_header (int space);
87 void emit_col (int n);
88 void emit_new_row (void);
89 void emit_finish_table (void);
90 int get_right (cols *c);
91 void add_indent (int indent);
92 void finish_row (void);
93 int get_effective_linelength (void);
95 tabs *tab_stops; /* tab stop positions */
97 cols *columns; /* column entries */
100 cols *last_col; /* last column started */
101 int start_space; /* encapsulate with <p> </p> */
103 void remove_cols (cols *c);
107 * the indentation wrapper.
108 * Builds an indentation from a html-table.
109 * This table is only emitted if the paragraph is emitted.
114 html_indent (simple_output *op, int ind, int pageoffset, int linelength);
116 void begin (int space); // called if we need to use the indent
117 void get_reg (int *ind, int *pageoffset, int *linelength);
119 // the indent is shutdown when it is deleted
124 int pg; // values of the registers as passed via initialization