| Commit | Line | Data |
|---|---|---|
| 92d0a6a6 | 1 | // -*- C++ -*- |
| 4d3e9548 JL |
2 | /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2007, 2009 |
| 3 | Free Software Foundation, Inc. | |
| 92d0a6a6 JR |
4 | Written by James Clark (jjc@jclark.com) |
| 5 | ||
| 6 | This file is part of groff. | |
| 7 | ||
| 8 | groff is free software; you can redistribute it and/or modify it under | |
| 9 | the terms of the GNU General Public License as published by the Free | |
| 4d3e9548 JL |
10 | Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. | |
| 92d0a6a6 JR |
12 | |
| 13 | groff is distributed in the hope that it will be useful, but WITHOUT ANY | |
| 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 16 | for more details. | |
| 17 | ||
| 4d3e9548 JL |
18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
| 92d0a6a6 JR |
20 | |
| 21 | struct line_type { | |
| 22 | enum { invisible, solid, dotted, dashed } type; | |
| 23 | double dash_width; | |
| 24 | double thickness; // the thickness is in points | |
| 25 | ||
| 26 | line_type(); | |
| 27 | }; | |
| 28 | ||
| 29 | ||
| 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, | |
| 4d3e9548 | 57 | const line_type &, double, char *) = 0; |
| 92d0a6a6 JR |
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(); | |
| 67 | }; | |
| 68 | ||
| 69 | extern output *out; | |
| 70 | ||
| 71 | /* #define FIG_SUPPORT 1 */ | |
| 72 | #define TEX_SUPPORT 1 | |
| 73 | ||
| 74 | output *make_troff_output(); | |
| 75 | ||
| 76 | #ifdef TEX_SUPPORT | |
| 77 | output *make_tex_output(); | |
| 78 | output *make_tpic_output(); | |
| 79 | #endif /* TEX_SUPPORT */ | |
| 80 | ||
| 81 | #ifdef FIG_SUPPORT | |
| 82 | output *make_fig_output(); | |
| 83 | #endif /* FIG_SUPPORT */ |