2 /* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004, 2007, 2009
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 3 of the License, or
11 (at your option) any later version.
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
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
45 virtual position origin();
46 virtual double width();
47 virtual double radius();
48 virtual double height();
49 virtual position north();
50 virtual position south();
51 virtual position east();
52 virtual position west();
53 virtual position north_east();
54 virtual position north_west();
55 virtual position south_east();
56 virtual position south_west();
57 virtual position start();
58 virtual position end();
59 virtual position center();
60 virtual place *find_label(const char *);
61 virtual void move_by(const position &);
63 virtual void update_bounding_box(bounding_box *);
64 virtual object_type type() = 0;
66 virtual void print_text();
69 typedef position (object::*corner)();
81 string_list *label_list;
87 path(char *, corner = 0);
91 void set_ypath(path *);
92 int follow(const place &, place *) const;
99 void append(object *);
100 void wrap_up_block(object_list *);
103 declare_ptable(place)
105 // these go counterclockwise
113 struct graphics_state {
118 struct saved_state : public graphics_state {
128 const char *filename;
131 text_item(char *, const char *, int);
135 const unsigned long IS_DOTTED = 01;
136 const unsigned long IS_DASHED = 02;
137 const unsigned long IS_CLOCKWISE = 04;
138 const unsigned long IS_INVISIBLE = 020;
139 const unsigned long HAS_LEFT_ARROW_HEAD = 040;
140 const unsigned long HAS_RIGHT_ARROW_HEAD = 0100;
141 const unsigned long HAS_SEGMENT = 0200;
142 const unsigned long IS_SAME = 0400;
143 const unsigned long HAS_FROM = 01000;
144 const unsigned long HAS_AT = 02000;
145 const unsigned long HAS_WITH = 04000;
146 const unsigned long HAS_HEIGHT = 010000;
147 const unsigned long HAS_WIDTH = 020000;
148 const unsigned long HAS_RADIUS = 040000;
149 const unsigned long HAS_TO = 0100000;
150 const unsigned long IS_CHOPPED = 0200000;
151 const unsigned long IS_DEFAULT_CHOPPED = 0400000;
152 const unsigned long HAS_THICKNESS = 01000000;
153 const unsigned long IS_FILLED = 02000000;
154 const unsigned long IS_DEFAULT_FILLED = 04000000;
155 const unsigned long IS_ALIGNED = 010000000;
156 const unsigned long IS_SHADED = 020000000;
157 const unsigned long IS_OUTLINED = 040000000;
158 const unsigned long IS_XSLANTED = 0100000000;
159 const unsigned long IS_YSLANTED = 0200000000;
165 segment(const position &, int, segment *);
168 class rectangle_object;
169 class graphic_object;
187 double segment_width;
188 double segment_height;
198 segment *segment_list;
199 position segment_pos;
200 int segment_is_absolute;
202 object_spec(object_type);
204 object *make_object(position *, direction *);
205 graphic_object *make_box(position *, direction *);
206 graphic_object *make_block(position *, direction *);
207 graphic_object *make_text(position *, direction *);
208 graphic_object *make_ellipse(position *, direction *);
209 graphic_object *make_circle(position *, direction *);
210 linear_object *make_line(position *, direction *);
211 linear_object *make_arc(position *, direction *);
212 graphic_object *make_linear(position *, direction *);
213 graphic_object *make_move(position *, direction *);
214 int position_rectangle(rectangle_object *p, position *curpos,
219 object *make_object(object_spec *, position *, direction *);
221 object *make_mark_object();
222 object *make_command_object(char *, const char *, int);
224 int lookup_variable(const char *name, double *val);
225 void define_variable(const char *name, double val);
227 void print_picture(object *);