Copyright 2017
[s-roff.git] / src / pre-pic / common.h
blob69283f5fea552150c70cc1fe588b23f01cd56d87
1 /*@
2 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * Copyright (C) 1989 - 1993, 2003, 2007
5 * Free Software Foundation, Inc.
6 * Written by James Clark (jjc@jclark.com)
8 * This is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2, or (at your option) any later
11 * version.
13 * This is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef _COMMON_H
23 #define _COMMON_H
25 #include "config.h"
26 #include "pic-config.h"
28 class common_output
29 : public output
31 void dash_line(const position &start, const position &end,
32 const line_type &lt, double dash_width, double gap_width,
33 double *offsetp);
34 void dash_arc(const position &cent, double rad,
35 double start_angle, double end_angle, const line_type &lt,
36 double dash_width, double gap_width, double *offsetp);
37 void dot_line(const position &start, const position &end,
38 const line_type &lt, double gap_width, double *offsetp);
39 void dot_arc(const position &cent, double rad,
40 double start_angle, double end_angle, const line_type &lt,
41 double gap_width, double *offsetp);
43 protected:
44 virtual void dot(const position &, const line_type &) = 0;
45 void ellipse_arc(const position &, const position &,
46 const position &, const distance &,
47 const line_type &);
48 void dashed_circle(const position &, double rad, const line_type &);
49 void dotted_circle(const position &, double rad, const line_type &);
50 void dashed_ellipse(const position &, const distance &, const line_type &);
51 void dotted_ellipse(const position &, const distance &, const line_type &);
52 void dashed_arc(const position &, const position &, const position &,
53 const line_type &);
54 void dotted_arc(const position &, const position &, const position &,
55 const line_type &);
56 virtual void solid_arc(const position &cent, double rad, double start_angle,
57 double end_angle, const line_type &lt);
58 void dashed_rounded_box(const position &, const distance &, double,
59 const line_type &);
60 void dotted_rounded_box(const position &, const distance &, double,
61 const line_type &);
62 void solid_rounded_box(const position &, const distance &, double,
63 const line_type &);
64 void filled_rounded_box(const position &, const distance &, double,
65 double);
67 public:
68 void start_picture(double sc, const position &ll, const position &ur) = 0;
69 void finish_picture() = 0;
70 void circle(const position &, double rad, const line_type &, double) = 0;
71 void text(const position &, text_piece *, int, double) = 0;
72 void line(const position &, const position *, int n, const line_type &) = 0;
73 void polygon(const position *, int n, const line_type &, double) = 0;
74 void spline(const position &, const position *, int n,
75 const line_type &) = 0;
76 void arc(const position &, const position &, const position &,
77 const line_type &) = 0;
78 void ellipse(const position &, const distance &,
79 const line_type &, double) = 0;
80 void rounded_box(const position &, const distance &, double,
81 const line_type &, double, char *);
82 void set_color(char *, char *) = 0;
83 void reset_color() = 0;
84 char *get_last_filled() = 0;
85 char *get_outline_color() = 0;
88 int compute_arc_center(const position &start, const position &cent,
89 const position &end, position *result);
91 #endif // _COMMON_H
92 // s-it2-mode