summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/roff/troff/env.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/src/roff/troff/env.h')
-rw-r--r--contrib/groff/src/roff/troff/env.h111
1 files changed, 79 insertions, 32 deletions
diff --git a/contrib/groff/src/roff/troff/env.h b/contrib/groff/src/roff/troff/env.h
index 43a4c97..2ee7bdc 100644
--- a/contrib/groff/src/roff/troff/env.h
+++ b/contrib/groff/src/roff/troff/env.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+class statem;
struct size_range {
int min;
@@ -63,7 +65,7 @@ inline int font_size::to_points()
return p/sizescale;
}
-struct environment;
+class environment;
hunits env_digit_width(environment *);
hunits env_space_width(environment *);
@@ -94,11 +96,52 @@ public:
const unsigned MARGIN_CHARACTER_ON = 1;
const unsigned MARGIN_CHARACTER_NEXT = 2;
-struct charinfo;
+class charinfo;
struct node;
struct breakpoint;
-struct font_family;
-struct pending_output_line;
+class font_family;
+class pending_output_line;
+
+// declarations to avoid friend name injection problems
+void title_length();
+void space_size();
+void fill();
+void no_fill();
+void adjust();
+void no_adjust();
+void center();
+void right_justify();
+void vertical_spacing();
+void post_vertical_spacing();
+void line_spacing();
+void line_length();
+void indent();
+void temporary_indent();
+void do_underline(int);
+void do_input_trap(int);
+void set_tabs();
+void margin_character();
+void no_number();
+void number_lines();
+void leader_character();
+void tab_character();
+void hyphenate_request();
+void no_hyphenate();
+void hyphen_line_max_request();
+void hyphenation_space_request();
+void hyphenation_margin_request();
+void line_width();
+#if 0
+void tabs_save();
+void tabs_restore();
+#endif
+void line_tabs_request();
+void title();
+#ifdef WIDOW_CONTROL
+void widow_control_request();
+#endif /* WIDOW_CONTROL */
+
+void do_divert(int append, int boxing);
class environment {
int dummy; // dummy environment used for \w
@@ -147,7 +190,6 @@ class environment {
hunits width_total;
int space_total;
hunits input_line_start;
- tab_stops tabs;
node *tab_contents;
hunits tab_width;
hunits tab_distance;
@@ -183,8 +225,6 @@ class environment {
#ifdef WIDOW_CONTROL
int widow_control;
#endif /* WIDOW_CONTROL */
- int ignore_next_eol;
- int emitted_node; // have we emitted a node since the last html eol tag?
color *glyph_color;
color *prev_glyph_color;
color *fill_color;
@@ -193,9 +233,9 @@ class environment {
tab_type distance_to_next_tab(hunits *);
tab_type distance_to_next_tab(hunits *distance, hunits *leftpos);
void start_line();
- void output_line(node *, hunits);
+ void output_line(node *, hunits, int);
void output(node *nd, int retain_size, vunits vs, vunits post_vs,
- hunits width);
+ hunits width, int was_centered);
void output_title(node *nd, int retain_size, vunits vs, vunits post_vs,
hunits width);
#ifdef WIDOW_CONTROL
@@ -209,6 +249,11 @@ class environment {
node *make_tab_node(hunits d, node *next = 0);
node *get_prev_char();
public:
+ int seen_space;
+ int seen_eol;
+ int suppress_next_eol;
+ int seen_break;
+ tab_stops tabs;
const symbol name;
unsigned char control_char;
unsigned char no_break_control_char;
@@ -217,14 +262,15 @@ public:
environment(symbol);
environment(const environment *); // for temporary environment
~environment();
+ statem *construct_state(int only_eol);
void copy(const environment *);
int is_dummy() { return dummy; }
int is_empty();
int is_composite() { return composite; }
void set_composite() { composite = 1; }
- vunits get_vertical_spacing(); // .v
- vunits get_post_vertical_spacing(); // .pvs
- int get_line_spacing(); // .L
+ vunits get_vertical_spacing(); // .v
+ vunits get_post_vertical_spacing(); // .pvs
+ int get_line_spacing(); // .L
vunits total_post_vertical_spacing();
int get_point_size() { return size.to_scaled_points(); }
font_size get_font_size() { return size; }
@@ -233,23 +279,23 @@ public:
int get_char_height() { return char_height; }
int get_char_slant() { return char_slant; }
hunits get_digit_width();
- int get_font() { return fontno; }; // .f
+ int get_font() { return fontno; }; // .f
font_family *get_family() { return family; }
- int get_bold(); // .b
- int get_adjust_mode(); // .j
- int get_fill(); // .u
- hunits get_indent(); // .i
+ int get_bold(); // .b
+ int get_adjust_mode(); // .j
+ int get_fill(); // .u
+ hunits get_indent(); // .i
hunits get_temporary_indent();
- hunits get_line_length(); // .l
- hunits get_saved_line_length(); // .ll
- hunits get_saved_indent(); // .in
+ hunits get_line_length(); // .l
+ hunits get_saved_line_length(); // .ll
+ hunits get_saved_indent(); // .in
hunits get_title_length();
- hunits get_prev_char_width(); // .w
+ hunits get_prev_char_width(); // .w
hunits get_prev_char_skew();
vunits get_prev_char_height();
vunits get_prev_char_depth();
- hunits get_text_length(); // .k
- hunits get_prev_text_length(); // .n
+ hunits get_text_length(); // .k
+ hunits get_prev_text_length(); // .n
hunits get_space_width() { return env_space_width(this); }
int get_space_size() { return space_size; } // in ems/36
int get_sentence_space_size() { return sentence_space_size; }
@@ -289,13 +335,9 @@ public:
void possibly_break_line(int start_here = 0, int forced = 0);
void do_break(int spread = 0); // .br
void final_break();
- void add_html_tag(int, const char *);
- void add_html_tag(int, const char *, int);
- void add_html_tag_tabs(int);
- node *make_html_tag(const char *name, int i);
- node *make_html_tag(const char *);
+ node *make_tag(const char *name, int i);
void newline();
- void handle_tab(int is_leader = 0); // do a tab or leader
+ void handle_tab(int is_leader = 0); // do a tab or leader
void add_node(node *);
void add_char(charinfo *);
void add_hyphen_indicator();
@@ -303,12 +345,18 @@ public:
void space();
void space(hunits, hunits);
void space_newline();
+ const char *get_glyph_color_string();
+ const char *get_fill_color_string();
const char *get_font_family_string();
const char *get_font_name_string();
+ const char *get_style_name_string();
const char *get_name_string();
const char *get_point_size_string();
const char *get_requested_point_size_string();
void output_pending_lines();
+ void construct_format_state(node *n, int was_centered, int fill);
+ void construct_new_line_state(node *n);
+ void dump_troff_state();
friend void title_length();
friend void space_size();
@@ -357,7 +405,6 @@ extern void push_env(int);
void init_environments();
void read_hyphen_file(const char *name);
-void title();
extern double spread_limit;
OpenPOWER on IntegriCloud