175584Sru// -*- C++ -*- 2151497Sru/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc. 375584Sru Written by James Clark (jjc@jclark.com) 475584Sru 575584SruThis file is part of groff. 675584Sru 775584Srugroff is free software; you can redistribute it and/or modify it under 875584Sruthe terms of the GNU General Public License as published by the Free 975584SruSoftware Foundation; either version 2, or (at your option) any later 1075584Sruversion. 1175584Sru 1275584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY 1375584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or 1475584SruFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1575584Srufor more details. 1675584Sru 1775584SruYou should have received a copy of the GNU General Public License along 1875584Sruwith groff; see the file COPYING. If not, write to the Free Software 19151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ 2075584Sru 2175584Srustruct line_type { 2275584Sru enum { invisible, solid, dotted, dashed } type; 2375584Sru double dash_width; 2475584Sru double thickness; // the thickness is in points 2575584Sru 2675584Sru line_type(); 2775584Sru}; 2875584Sru 2975584Sru 3075584Sruclass output { 3175584Sruprotected: 3275584Sru char *args; 3375584Sru double desired_height; // zero if no height specified 3475584Sru double desired_width; // zero if no depth specified 3575584Sru double compute_scale(double, const position &, const position &); 3675584Srupublic: 3775584Sru output(); 3875584Sru virtual ~output(); 3975584Sru void set_desired_width_height(double wid, double ht); 4075584Sru void set_args(const char *); 4175584Sru virtual void start_picture(double sc, const position &ll, const position &ur) = 0; 4275584Sru virtual void finish_picture() = 0; 4375584Sru virtual void circle(const position &, double rad, 4475584Sru const line_type &, double) = 0; 4575584Sru virtual void text(const position &, text_piece *, int, double) = 0; 4675584Sru virtual void line(const position &, const position *, int n, 4775584Sru const line_type &) = 0; 4875584Sru virtual void polygon(const position *, int n, 4975584Sru const line_type &, double) = 0; 5075584Sru virtual void spline(const position &, const position *, int n, 5175584Sru const line_type &) = 0; 5275584Sru virtual void arc(const position &, const position &, const position &, 5375584Sru const line_type &) = 0; 5475584Sru virtual void ellipse(const position &, const distance &, 5575584Sru const line_type &, double) = 0; 5675584Sru virtual void rounded_box(const position &, const distance &, double, 5775584Sru const line_type &, double) = 0; 58104862Sru virtual void command(const char *, const char *, int) = 0; 59104862Sru virtual void set_location(const char *, int) {} 60104862Sru virtual void set_color(char *, char *) = 0; 61104862Sru virtual void reset_color() = 0; 62104862Sru virtual char *get_last_filled() = 0; 63104862Sru virtual char *get_outline_color() = 0; 6475584Sru virtual int supports_filled_polygons(); 6575584Sru virtual void begin_block(const position &ll, const position &ur); 6675584Sru virtual void end_block(); 6775584Sru}; 6875584Sru 6975584Sruextern output *out; 7075584Sru 7175584Sru/* #define FIG_SUPPORT 1 */ 7275584Sru#define TEX_SUPPORT 1 7375584Sru 7475584Sruoutput *make_troff_output(); 7575584Sru 7675584Sru#ifdef TEX_SUPPORT 7775584Sruoutput *make_tex_output(); 7875584Sruoutput *make_tpic_output(); 7975584Sru#endif /* TEX_SUPPORT */ 8075584Sru 8175584Sru#ifdef FIG_SUPPORT 8275584Sruoutput *make_fig_output(); 8375584Sru#endif /* FIG_SUPPORT */ 84