NetBSD/gnu/usr.bin/groff/pic/output.h

83 lines
2.7 KiB
C
Raw Normal View History

1993-03-21 12:45:37 +03:00
// -*- C++ -*-
1993-07-15 20:37:48 +04:00
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
1993-03-21 12:45:37 +03:00
This file is part of groff.
groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
1993-07-15 20:37:48 +04:00
Software Foundation; either version 2, or (at your option) any later
1993-03-21 12:45:37 +03:00
version.
groff is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
1993-07-15 20:37:48 +04:00
with groff; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: output.h,v 1.3 1993/08/02 17:44:47 mycroft Exp $
*/
1993-03-21 12:45:37 +03:00
struct line_type {
enum { invisible, solid, dotted, dashed } type;
double dash_width;
double thickness; // the thickness is in points
line_type();
};
class output {
protected:
char *args;
double desired_height; // zero if no height specified
double desired_width; // zero if no depth specified
double compute_scale(double, const position &, const position &);
public:
output();
virtual ~output();
void set_desired_width_height(double wid, double ht);
void set_args(const char *);
virtual void start_picture(double sc, const position &ll, const position &ur) = 0;
virtual void finish_picture() = 0;
virtual void circle(const position &, double rad,
const line_type &, double) = 0;
virtual void text(const position &, text_piece *, int, double) = 0;
virtual void line(const position &, const position *, int n,
const line_type &) = 0;
virtual void polygon(const position *, int n,
const line_type &, double) = 0;
virtual void spline(const position &, const position *, int n,
const line_type &) = 0;
virtual void arc(const position &, const position &, const position &,
const line_type &) = 0;
virtual void ellipse(const position &, const distance &,
const line_type &, double) = 0;
virtual void rounded_box(const position &, const distance &, double,
const line_type &, double) = 0;
virtual void command(const char *, const char *, int);
virtual void set_location(const char *, int);
virtual int supports_filled_polygons();
virtual void begin_block(const position &ll, const position &ur);
virtual void end_block();
};
extern output *out;
1993-07-15 20:37:48 +04:00
/* #define FIG_SUPPORT 1 */
#define TEX_SUPPORT 1
1993-03-21 12:45:37 +03:00
output *make_troff_output();
1993-07-15 20:37:48 +04:00
#ifdef TEX_SUPPORT
1993-03-21 12:45:37 +03:00
output *make_tex_output();
output *make_tpic_output();
1993-07-15 20:37:48 +04:00
#endif /* TEX_SUPPORT */
#ifdef FIG_SUPPORT
1993-03-21 12:45:37 +03:00
output *make_fig_output();
1993-07-15 20:37:48 +04:00
#endif /* FIG_SUPPORT */