2 /* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff 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
13 groff 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
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. */
46 virtual position origin();
47 virtual double width();
48 virtual double radius();
49 virtual double height();
50 virtual position north();
51 virtual position south();
52 virtual position east();
53 virtual position west();
54 virtual position north_east();
55 virtual position north_west();
56 virtual position south_east();
57 virtual position south_west();
58 virtual position start();
59 virtual position end();
60 virtual position center();
61 virtual place *find_label(const char *);
62 virtual void move_by(const position &);
64 virtual void update_bounding_box(bounding_box *);
65 virtual object_type type() = 0;
67 virtual void print_text();
70 typedef position (object::*corner)();
82 string_list *label_list;
88 path(char *, corner = 0);
92 void set_ypath(path *);
93 int follow(const place &, place *) const;
100 void append(object *);
101 void wrap_up_block(object_list *);
104 declare_ptable(place)
106 // these go counterclockwise
114 struct graphics_state {
119 struct saved_state : public graphics_state {
129 const char *filename;
132 text_item(char *, const char *, int);
136 const unsigned long IS_DOTTED = 01;
137 const unsigned long IS_DASHED = 02;
138 const unsigned long IS_CLOCKWISE = 04;
139 const unsigned long IS_INVISIBLE = 020;
140 const unsigned long HAS_LEFT_ARROW_HEAD = 040;
141 const unsigned long HAS_RIGHT_ARROW_HEAD = 0100;
142 const unsigned long HAS_SEGMENT = 0200;
143 const unsigned long IS_SAME = 0400;
144 const unsigned long HAS_FROM = 01000;
145 const unsigned long HAS_AT = 02000;
146 const unsigned long HAS_WITH = 04000;
147 const unsigned long HAS_HEIGHT = 010000;
148 const unsigned long HAS_WIDTH = 020000;
149 const unsigned long HAS_RADIUS = 040000;
150 const unsigned long HAS_TO = 0100000;
151 const unsigned long IS_CHOPPED = 0200000;
152 const unsigned long IS_DEFAULT_CHOPPED = 0400000;
153 const unsigned long HAS_THICKNESS = 01000000;
154 const unsigned long IS_FILLED = 02000000;
155 const unsigned long IS_DEFAULT_FILLED = 04000000;
156 const unsigned long IS_ALIGNED = 010000000;
157 const unsigned long IS_SHADED = 020000000;
158 const unsigned long IS_OUTLINED = 040000000;
164 segment(const position &, int, segment *);
167 class rectangle_object;
168 class graphic_object;
186 double segment_width;
187 double segment_height;
195 segment *segment_list;
196 position segment_pos;
197 int segment_is_absolute;
199 object_spec(object_type);
201 object *make_object(position *, direction *);
202 graphic_object *make_box(position *, direction *);
203 graphic_object *make_block(position *, direction *);
204 graphic_object *make_text(position *, direction *);
205 graphic_object *make_ellipse(position *, direction *);
206 graphic_object *make_circle(position *, direction *);
207 linear_object *make_line(position *, direction *);
208 linear_object *make_arc(position *, direction *);
209 graphic_object *make_linear(position *, direction *);
210 graphic_object *make_move(position *, direction *);
211 int position_rectangle(rectangle_object *p, position *curpos,
216 object *make_object(object_spec *, position *, direction *);
218 object *make_mark_object();
219 object *make_command_object(char *, const char *, int);
221 int lookup_variable(const char *name, double *val);
222 void define_variable(const char *name, double val);
224 void print_picture(object *);