~ubuntu-branches/ubuntu/dapper/groff/dapper

« back to all changes in this revision

Viewing changes to src/preproc/pic/output.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2002-03-17 04:11:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020317041150-wkgfawjc3gxlk0o5
Tags: upstream-1.17.2
ImportĀ upstreamĀ versionĀ 1.17.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
 
3
     Written by James Clark (jjc@jclark.com)
 
4
 
 
5
This file is part of groff.
 
6
 
 
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.
 
11
 
 
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.
 
16
 
 
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. */
 
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,
 
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
 
 
65
extern output *out;
 
66
 
 
67
/* #define FIG_SUPPORT 1 */
 
68
#define TEX_SUPPORT 1
 
69
 
 
70
output *make_troff_output();
 
71
 
 
72
#ifdef TEX_SUPPORT
 
73
output *make_tex_output();
 
74
output *make_tpic_output();
 
75
#endif /* TEX_SUPPORT */
 
76
 
 
77
#ifdef FIG_SUPPORT
 
78
output *make_fig_output();
 
79
#endif /* FIG_SUPPORT */