source: trunk/Jgraph/jgraph.h@ 662

Last change on this file since 662 was 420, checked in by Nicholas Riley, 16 years ago

Jgraph: my changes - ANSIfication, few minor bug fixes; works on OS X 10.5 now

File size: 5.6 KB
Line 
1/*
2 * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/jgraph.h,v $
3 * $Revision: 8.3 $
4 * $Date: 92/11/30 11:42:24 $
5 * $Author: jsp $
6 */
7
8#include "list.h"
9#include "prio_list.h"
10#ifdef LCC
11#include <stdlib.h>
12#endif
13
14#define PPI 120
15#define FPPI 120.0
16#define CPI 72.0
17#define FCPI 72.0
18#define CNULL ((char *)0)
19#define GMNULL ((Point)0)
20#define FSIG -10010.0
21#define ISIG -11111111
22#define HASH_SIZE 5.0
23#define MHASH_SIZE 2.0
24
25typedef struct point {
26 struct point *flink;
27 struct point *blink;
28 float x;
29 float y;
30 char e; /* 'x' for x_ebars, 'y' for y_ebars, 'p' for neither */
31} *Point;
32
33typedef struct flist {
34 struct flist *flink;
35 struct flist *blink;
36 float f;
37} *Flist;
38
39typedef struct label {
40 char *label;
41 float x;
42 float y;
43 float rotate;
44 char *font;
45 float fontsize;
46 char hj;
47 char vj;
48 float gray[3];
49 char graytype;
50 float linesep;
51 float xmin;
52 float xmax;
53 float ymin;
54 float ymax;
55 int nlines;
56} *Label;
57
58typedef struct curve {
59 struct curve *flink;
60 struct curve *blink;
61 int num;
62 Label l;
63 Label lmark;
64 Point pts;
65 Point yepts;
66 Point xepts;
67 int npts;
68 Point general_marks;
69 float marksize[2];
70 float fill[3];
71 float gray[3];
72 float afill[3];
73 float pfill[3];
74 float linethick;
75 float mrotate;
76 Flist gen_linetype;
77 char graytype ;
78 char filltype ;
79 char afilltype;
80 char pfilltype;
81 char pattern;
82 float parg;
83 char apattern;
84 float aparg;
85 char ppattern;
86 float pparg;
87 char marktype;
88 char linetype;
89 char *postscript;
90 char *eps;
91 int postfile;
92 int rarrow;
93 int larrow;
94 int rarrows;
95 int larrows;
96 int bezier;
97 int poly;
98 float asize[2];
99 int clip;
100} *Curve;
101
102typedef struct string {
103 struct string *flink;
104 struct string *blink;
105 int num;
106 Label s;
107} *String;
108
109typedef struct hash {
110 struct hash *flink;
111 struct hash *blink;
112 float loc;
113 float size;
114 int major;
115} *Hash;
116
117typedef struct deflt {
118 float rotate;
119 float fontsize;
120 Point general_marks;
121 float fill;
122 float linethick;
123 float marksize[2];
124 char *font;
125 char hj;
126 char vj;
127 char marktype;
128} *Default;
129
130typedef struct axis {
131 Label label;
132 Label hl;
133 float max;
134 float min;
135 float pmax;
136 float pmin;
137 float logmin;
138 float logfactor;
139 float size;
140 float psize;
141 float factor;
142 float hash_interval;
143 float hash_start;
144 float hash_scale;
145 float log_base;
146 float draw_hash_marks_at;
147 float draw_hash_labels_at;
148 float draw_at;
149 float gray[3];
150 char graytype;
151 float gr_gray[3];
152 char gr_graytype;
153 float mgr_gray[3];
154 char mgr_graytype;
155 char hash_format;
156 int grid_lines;
157 int mgrid_lines;
158 int draw_hash_labels;
159 int draw_axis_line;
160 int draw_hash_marks;
161 int draw_axis_label;
162 int auto_hash_labels;
163 int auto_hash_marks;
164 int minor_hashes;
165 int precision;
166 int start_given;
167 String hash_labels;
168 Hash hash_lines;
169 int is_x;
170 int is_lg;
171} *Axis;
172
173typedef struct legend {
174 float linelength;
175 float linebreak;
176 int anylines;
177 float midspace;
178 char type; /* 'n' = off, 'u' = userdefined (use Label), 'c' = custom */
179 Label l;
180} *Legend;
181
182typedef struct graph {
183 struct graph *flink;
184 struct graph *blink;
185 int num;
186 float xminval;
187 float yminval;
188 float xmaxval;
189 float ymaxval;
190 float x_translate;
191 float y_translate;
192 Axis x_axis;
193 Axis y_axis;
194 Curve curves;
195 Legend legend;
196 String strings;
197 Label title;
198 int clip;
199 int border;
200 Default def;
201} *Graph;
202
203typedef struct graphs {
204 struct graphs *flink;
205 struct graphs *blink;
206 Graph g;
207 float height;
208 float width;
209 int bb[4]; /* Bounding box */
210 char *preamble;
211 char *epilogue;
212 int prefile;
213 int epifile;
214 int page;
215} *Graphs;
216
217extern float ctop();
218extern float disttop();
219extern float intop();
220extern float ptoc();
221extern float ptodist();
222
223extern char *getlabel();
224extern char *getmultiline();
225
226/* Stuff defined in jgraph.c */
227
228extern Curve new_line();
229extern Curve new_curve();
230extern Curve get_curve();
231extern Graph new_graph();
232extern Graph get_graph();
233extern String new_string();
234extern String get_string();
235extern Label new_label();
236extern char *MARKTYPESTRS[];
237extern char MARKTYPES[];
238extern int NMARKTYPES;
239extern int NORMALMARKTYPES;
240extern char *PATTERNS[];
241extern char PTYPES[];
242extern int NPATTERNS;
243
244void new_graphs(Graphs gs);
245
246/* Stuff defined in printline.c */
247
248void print_label(Label l);
249void set_comment(int c);
250void comment(char *s);
251void gsave(void);
252void grestore(void);
253void setlinewidth(float size);
254void setlinestyle(char style, Flist glist);
255void print_ebar(float x1, float y1, float x2, float ms, char orientation);
256void start_line(float x1, float y1, Curve c);
257void bezier_control(float x1, float y1);
258void bezier_end(float x1, float y1);
259void end_line(void);
260void setfill(float x, float y, char t, float f[], char p, float a);
261void cont_line(float x1, float y1);
262void setgray(char t, float f[]);
263void printline(float x1, float y1, float x2, float y2, char orientation);
264void start_poly(float x1, float y1);
265void cont_poly(float x1, float y1);
266void end_poly(float x, float y, char ftype, float fill[],
267 char pattern, float parg);
268void printellipse(float x, float y, float radius1, float radius2,
269 char ftype, float fill[], char pattern, float parg);
270void setfont(char *f, float s);
271
272/* Stuff defined in edit.c */
273
274void copy_label(Label l1, Label l2);
275void edit_graphs(Graphs gs);
276
277/* Stuff defined in token.c */
278
279void set_input_file(char *s);
280int getint(int *i);
281int getstring(char *s);
282int getfloat(float *f);
283void rejecttoken(void);
284
285/* Stuff defined in process.c */
286
287void process_graphs(Graphs gs);
288
289/* Stuff defined in show.c */
290
291void show_graphs(Graphs gs);
292
293/* Stuff defined in draw.c */
294
295void draw_graphs(Graphs gs, int pp, int landscape);
Note: See TracBrowser for help on using the repository browser.