xref: /netbsd-src/external/gpl2/groff/dist/src/preproc/pic/common.h (revision 89a07cf815a29524268025a1139fac4c5190f765)
1 /*	$NetBSD: common.h,v 1.1.1.1 2016/01/13 18:41:48 christos Exp $	*/
2 
3 // -*- C++ -*-
4 /* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2003
5    Free Software Foundation, Inc.
6      Written by James Clark (jjc@jclark.com)
7 
8 This file is part of groff.
9 
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
13 version.
14 
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 for more details.
19 
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING.  If not, write to the Free Software
22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
23 
24 class common_output : public output {
25 private:
26   void dash_line(const position &start, const position &end,
27 		 const line_type &lt, double dash_width, double gap_width,
28 		 double *offsetp);
29   void dash_arc(const position &cent, double rad,
30 		double start_angle, double end_angle, const line_type &lt,
31 		double dash_width, double gap_width, double *offsetp);
32   void dot_line(const position &start, const position &end,
33 		const line_type &lt, double gap_width, double *offsetp);
34   void dot_arc(const position &cent, double rad,
35 	       double start_angle, double end_angle, const line_type &lt,
36 	       double gap_width, double *offsetp);
37 protected:
38   virtual void dot(const position &, const line_type &) = 0;
39   void ellipse_arc(const position &, const position &,
40 		   const position &, const distance &,
41 		   const line_type &);
42   void dashed_circle(const position &, double rad, const line_type &);
43   void dotted_circle(const position &, double rad, const line_type &);
44   void dashed_ellipse(const position &, const distance &, const line_type &);
45   void dotted_ellipse(const position &, const distance &, const line_type &);
46   void dashed_arc(const position &, const position &, const position &,
47 		  const line_type &);
48   void dotted_arc(const position &, const position &, const position &,
49 		  const line_type &);
50   virtual void solid_arc(const position &cent, double rad, double start_angle,
51 			 double end_angle, const line_type &lt);
52   void dashed_rounded_box(const position &, const distance &, double,
53 			  const line_type &);
54   void dotted_rounded_box(const position &, const distance &, double,
55 			  const line_type &);
56   void solid_rounded_box(const position &, const distance &, double,
57 			 const line_type &);
58   void filled_rounded_box(const position &, const distance &, double, double);
59 public:
60   void start_picture(double sc, const position &ll, const position &ur) = 0;
61   void finish_picture() = 0;
62   void circle(const position &, double rad, const line_type &, double) = 0;
63   void text(const position &, text_piece *, int, double) = 0;
64   void line(const position &, const position *, int n, const line_type &) = 0;
65   void polygon(const position *, int n, const line_type &, double) = 0;
66   void spline(const position &, const position *, int n,
67 	      const line_type &) = 0;
68   void arc(const position &, const position &, const position &,
69 	   const line_type &) = 0;
70   void ellipse(const position &, const distance &,
71 	       const line_type &, double) = 0;
72   void rounded_box(const position &, const distance &, double,
73 		   const line_type &, double);
74   void set_color(char *, char *) = 0;
75   void reset_color() = 0;
76   char *get_last_filled() = 0;
77   char *get_outline_color() = 0;
78 };
79 
80 int compute_arc_center(const position &start, const position &cent,
81 		       const position &end, position *result);
82 
83