2 * Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992, 2002, 2004, 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
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
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.
26 #include "pic-config.h"
54 virtual position
origin();
55 virtual double width();
56 virtual double radius();
57 virtual double height();
58 virtual position
north();
59 virtual position
south();
60 virtual position
east();
61 virtual position
west();
62 virtual position
north_east();
63 virtual position
north_west();
64 virtual position
south_east();
65 virtual position
south_west();
66 virtual position
start();
67 virtual position
end();
68 virtual position
center();
69 virtual place
*find_label(const char *);
70 virtual void move_by(const position
&);
72 virtual void update_bounding_box(bounding_box
*);
73 virtual object_type
type() = 0;
75 virtual void print_text();
78 typedef position (object::*corner
)();
91 string_list
*label_list
;
98 path(char *, corner
= 0);
102 void set_ypath(path
*);
103 int follow(const place
&, place
*) const;
112 void append(object
*);
113 void wrap_up_block(object_list
*);
116 declare_ptable(place
)
118 // these go counterclockwise
126 struct graphics_state
{
131 struct saved_state
: public graphics_state
{
142 const char *filename
;
145 text_item(char *, const char *, int);
149 const unsigned long IS_DOTTED
= 01;
150 const unsigned long IS_DASHED
= 02;
151 const unsigned long IS_CLOCKWISE
= 04;
152 const unsigned long IS_INVISIBLE
= 020;
153 const unsigned long HAS_LEFT_ARROW_HEAD
= 040;
154 const unsigned long HAS_RIGHT_ARROW_HEAD
= 0100;
155 const unsigned long HAS_SEGMENT
= 0200;
156 const unsigned long IS_SAME
= 0400;
157 const unsigned long HAS_FROM
= 01000;
158 const unsigned long HAS_AT
= 02000;
159 const unsigned long HAS_WITH
= 04000;
160 const unsigned long HAS_HEIGHT
= 010000;
161 const unsigned long HAS_WIDTH
= 020000;
162 const unsigned long HAS_RADIUS
= 040000;
163 const unsigned long HAS_TO
= 0100000;
164 const unsigned long IS_CHOPPED
= 0200000;
165 const unsigned long IS_DEFAULT_CHOPPED
= 0400000;
166 const unsigned long HAS_THICKNESS
= 01000000;
167 const unsigned long IS_FILLED
= 02000000;
168 const unsigned long IS_DEFAULT_FILLED
= 04000000;
169 const unsigned long IS_ALIGNED
= 010000000;
170 const unsigned long IS_SHADED
= 020000000;
171 const unsigned long IS_OUTLINED
= 040000000;
172 const unsigned long IS_XSLANTED
= 0100000000;
173 const unsigned long IS_YSLANTED
= 0200000000;
181 segment(const position
&, int, segment
*);
184 class rectangle_object
;
185 class graphic_object
;
205 double segment_width
;
206 double segment_height
;
216 segment
*segment_list
;
217 position segment_pos
;
218 int segment_is_absolute
;
220 object_spec(object_type
);
222 object
*make_object(position
*, direction
*);
223 graphic_object
*make_box(position
*, direction
*);
224 graphic_object
*make_block(position
*, direction
*);
225 graphic_object
*make_text(position
*, direction
*);
226 graphic_object
*make_ellipse(position
*, direction
*);
227 graphic_object
*make_circle(position
*, direction
*);
228 linear_object
*make_line(position
*, direction
*);
229 linear_object
*make_arc(position
*, direction
*);
230 graphic_object
*make_linear(position
*, direction
*);
231 graphic_object
*make_move(position
*, direction
*);
232 int position_rectangle(rectangle_object
*p
, position
*curpos
,
236 object
*make_object(object_spec
*, position
*, direction
*);
238 object
*make_mark_object();
239 object
*make_command_object(char *, const char *, int);
241 int lookup_variable(const char *name
, double *val
);
242 void define_variable(const char *name
, double val
);
244 void print_picture(object
*);