* REVISION: Increased to 2.
[s-roff.git] / src / preproc / pic / output.h
bloba0a8331f883d924d7d3163a6cec7058ea72d1be8
1 // -*- C++ -*-
2 /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file COPYING. If not, write to the Free Software
19 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 struct line_type {
22 enum { invisible, solid, dotted, dashed } type;
23 double dash_width;
24 double thickness; // the thickness is in points
26 line_type();
30 class output {
31 protected:
32 char *args;
33 double desired_height; // zero if no height specified
34 double desired_width; // zero if no depth specified
35 double compute_scale(double, const position &, const position &);
36 public:
37 output();
38 virtual ~output();
39 void set_desired_width_height(double wid, double ht);
40 void set_args(const char *);
41 virtual void start_picture(double sc, const position &ll, const position &ur) = 0;
42 virtual void finish_picture() = 0;
43 virtual void circle(const position &, double rad,
44 const line_type &, double) = 0;
45 virtual void text(const position &, text_piece *, int, double) = 0;
46 virtual void line(const position &, const position *, int n,
47 const line_type &) = 0;
48 virtual void polygon(const position *, int n,
49 const line_type &, double) = 0;
50 virtual void spline(const position &, const position *, int n,
51 const line_type &) = 0;
52 virtual void arc(const position &, const position &, const position &,
53 const line_type &) = 0;
54 virtual void ellipse(const position &, const distance &,
55 const line_type &, double) = 0;
56 virtual void rounded_box(const position &, const distance &, double,
57 const line_type &, double) = 0;
58 virtual void command(const char *, const char *, int) = 0;
59 virtual void set_location(const char *, int) {}
60 virtual void set_color(char *, char *) = 0;
61 virtual void reset_color() = 0;
62 virtual char *get_last_filled() = 0;
63 virtual char *get_outline_color() = 0;
64 virtual int supports_filled_polygons();
65 virtual void begin_block(const position &ll, const position &ur);
66 virtual void end_block();
69 extern output *out;
71 /* #define FIG_SUPPORT 1 */
72 #define TEX_SUPPORT 1
74 output *make_troff_output();
76 #ifdef TEX_SUPPORT
77 output *make_tex_output();
78 output *make_tpic_output();
79 #endif /* TEX_SUPPORT */
81 #ifdef FIG_SUPPORT
82 output *make_fig_output();
83 #endif /* FIG_SUPPORT */