Sync-to-go: update copyright for 2015
[s-roff.git] / src / pre-pic / output.h
blob385f4f1d975f212b2c77ce50f919c3d335eed7fd
1 /*@
2 * Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992, 2001, 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 _OUTPUT_H
23 #define _OUTPUT_H
25 #include "config.h"
26 #include "pic-config.h"
28 class line_type
30 public:
31 enum { invisible, solid, dotted, dashed } type;
32 double dash_width;
33 double thickness; // the thickness is in points
35 line_type();
38 class output
40 protected:
41 char *args;
42 double desired_height; // zero if no height specified
43 double desired_width; // zero if no depth specified
44 double compute_scale(double, const position &, const position &);
46 public:
47 output();
48 virtual ~output();
49 void set_desired_width_height(double wid, double ht);
50 void set_args(const char *);
51 virtual void start_picture(double sc, const position &ll, const position &ur) = 0;
52 virtual void finish_picture() = 0;
53 virtual void circle(const position &, double rad,
54 const line_type &, double) = 0;
55 virtual void text(const position &, text_piece *, int, double) = 0;
56 virtual void line(const position &, const position *, int n,
57 const line_type &) = 0;
58 virtual void polygon(const position *, int n,
59 const line_type &, double) = 0;
60 virtual void spline(const position &, const position *, int n,
61 const line_type &) = 0;
62 virtual void arc(const position &, const position &, const position &,
63 const line_type &) = 0;
64 virtual void ellipse(const position &, const distance &,
65 const line_type &, double) = 0;
66 virtual void rounded_box(const position &, const distance &, double,
67 const line_type &, double, char *) = 0;
68 virtual void command(const char *, const char *, int) = 0;
69 virtual void set_location(const char *, int) {}
70 virtual void set_color(char *, char *) = 0;
71 virtual void reset_color() = 0;
72 virtual char *get_last_filled() = 0;
73 virtual char *get_outline_color() = 0;
74 virtual int supports_filled_polygons();
75 virtual void begin_block(const position &ll, const position &ur);
76 virtual void end_block();
79 extern output *out;
81 output *make_troff_output();
83 #ifdef TEX_SUPPORT
84 output *make_tex_output();
85 output *make_tpic_output();
86 #endif
88 #ifdef FIG_SUPPORT
89 output *make_fig_output();
90 #endif
92 #endif // _OUTPUT_H
93 // s-it2-mode