386BSD 0.1 development
[unix-history] / usr / src / usr.bin / groff / pic / output.h
CommitLineData
e79d4cdd
WJ
1// -*- C++ -*-
2/* Copyright (C) 1989, 1990 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.uucp)
4
5This file is part of groff.
6
7groff is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 1, or (at your option) any later
10version.
11
12groff is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License along
18with groff; see the file LICENSE. If not, write to the Free Software
19Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21struct 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
30class output {
31protected:
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 &);
36public:
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);
59 virtual void set_location(const char *, int);
60 virtual int supports_filled_polygons();
61 virtual void begin_block(const position &ll, const position &ur);
62 virtual void end_block();
63};
64
65extern output *out;
66
67output *make_troff_output();
68output *make_grops_output();
69output *make_tex_output();
70output *make_tpic_output();
71output *make_fig_output();