1 /*@ Provides the methods necessary to handle indentation and tab
2 *@ positions using html tables.
4 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 * Copyright (C) 2002 - 2005, 2007 Free Software Foundation, Inc.
7 * Written by Gaius Mulley (gaius@glam.ac.uk)
10 * This is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2, or (at your option) any later
15 * This is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * You should have received a copy of the GNU General Public License along
21 * with groff; see the file COPYING. If not, write to the Free Software
22 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
29 typedef struct tab_position
{
32 struct tab_position
*next
;
37 void delete_list (void);
44 int compatible (const char *s
);
45 void init (const char *s
);
46 void check_init (const char *s
);
47 int find_tab (int pos
);
48 int get_tab_pos (int n
);
49 char get_tab_align (int n
);
50 void dump_tabs (void);
66 cols
*columns
; /* column entries */
68 cols
*last_col
; /* last column started */
69 int start_space
; /* have we seen a `.sp' tag? */
71 void remove_cols (cols
*c
);
74 html_table (simple_output
*op
, int linelen
);
76 int add_column (int coln
, int hstart
, int hend
, char align
);
77 cols
*get_column (int coln
);
78 int insert_column (int coln
, int hstart
, int hend
, char align
);
79 int modify_column (cols
*c
, int hstart
, int hend
, char align
);
80 int find_tab_column (int pos
);
81 int find_column (int pos
);
82 int get_tab_pos (int n
);
83 char get_tab_align (int n
);
84 void set_linelength (int linelen
);
85 int no_columns (void);
88 void dump_table (void);
89 void emit_table_header (int space
);
90 void emit_col (int n
);
91 void emit_new_row (void);
92 void emit_finish_table (void);
93 int get_right (cols
*c
);
94 void add_indent (int indent
);
95 void finish_row (void);
96 int get_effective_linelength (void);
97 void set_space (int space
);
98 void emit_colspan (void);
99 void emit_td (int percentage
, const char *s
= ">");
101 tabs
*tab_stops
; /* tab stop positions */
106 * the indentation wrapper.
107 * Builds an indentation from a html-table.
108 * This table is only emitted if the paragraph is emitted.
115 int pg
; // values of the registers as passed via initialization
121 html_indent (simple_output
*op
, int ind
, int pageoffset
, int linelength
);
123 void begin (int space
); // called if we need to use the indent
124 void get_reg (int *ind
, int *pageoffset
, int *linelength
);
126 // the indent is shutdown when it is deleted
129 #endif // _HTML_TABLE_H