PageRenderTime 33ms CodeModel.GetById 26ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/groff/src/preproc/pic/output.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 83 lines | 54 code | 9 blank | 20 comment | 0 complexity | 3ea3e33638148608d6ed8ba3f4006981 MD5 | raw file
 1// -*- C++ -*-
 2/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
 3     Written by James Clark (jjc@jclark.com)
 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 2, 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 COPYING.  If not, write to the Free Software
19Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, 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) = 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
69extern output *out;
70
71/* #define FIG_SUPPORT 1 */
72#define TEX_SUPPORT 1
73
74output *make_troff_output();
75
76#ifdef TEX_SUPPORT
77output *make_tex_output();
78output *make_tpic_output();
79#endif /* TEX_SUPPORT */
80
81#ifdef FIG_SUPPORT
82output *make_fig_output();
83#endif /* FIG_SUPPORT */