70352b85010379c832f20d148d73f2377b1ddd18
[platform/upstream/groff.git] / src / preproc / pic / common.h
1 // -*- C++ -*-
2 /* Copyright (C) 1989-2014  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 3 of the License, or
10 (at your option) any later 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
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 class common_output : public output {
21 private:
22   void dash_line(const position &start, const position &end,
23                  const line_type &lt, double dash_width, double gap_width,
24                  double *offsetp);
25   void dash_arc(const position &cent, double rad,
26                 double start_angle, double end_angle, const line_type &lt,
27                 double dash_width, double gap_width, double *offsetp);
28   void dot_line(const position &start, const position &end,
29                 const line_type &lt, double gap_width, double *offsetp);
30   void dot_arc(const position &cent, double rad,
31                double start_angle, double end_angle, const line_type &lt,
32                double gap_width, double *offsetp);
33 protected:
34   virtual void dot(const position &, const line_type &) = 0;
35   void ellipse_arc(const position &, const position &,
36                    const position &, const distance &,
37                    const line_type &);
38   void dashed_circle(const position &, double rad, const line_type &);
39   void dotted_circle(const position &, double rad, const line_type &);
40   void dashed_ellipse(const position &, const distance &, const line_type &);
41   void dotted_ellipse(const position &, const distance &, const line_type &);
42   void dashed_arc(const position &, const position &, const position &,
43                   const line_type &);
44   void dotted_arc(const position &, const position &, const position &,
45                   const line_type &);
46   virtual void solid_arc(const position &cent, double rad, double start_angle,
47                          double end_angle, const line_type &lt);
48   void dashed_rounded_box(const position &, const distance &, double,
49                           const line_type &);
50   void dotted_rounded_box(const position &, const distance &, double,
51                           const line_type &);
52   void solid_rounded_box(const position &, const distance &, double,
53                          const line_type &);
54   void filled_rounded_box(const position &, const distance &, double,
55                           double);
56 public:
57   void start_picture(double sc, const position &ll, const position &ur) = 0;
58   void finish_picture() = 0;
59   void circle(const position &, double rad, const line_type &, double) = 0;
60   void text(const position &, text_piece *, int, double) = 0;
61   void line(const position &, const position *, int n, const line_type &) = 0;
62   void polygon(const position *, int n, const line_type &, double) = 0;
63   void spline(const position &, const position *, int n,
64               const line_type &) = 0;
65   void arc(const position &, const position &, const position &,
66            const line_type &) = 0;
67   void ellipse(const position &, const distance &,
68                const line_type &, double) = 0;
69   void rounded_box(const position &, const distance &, double,
70                    const line_type &, double, char *);
71   void set_color(char *, char *) = 0;
72   void reset_color() = 0;
73   char *get_last_filled() = 0;
74   char *get_outline_color() = 0;
75 };
76
77 int compute_arc_center(const position &start, const position &cent,
78                        const position &end, position *result);
79