Rev 8878 | Rev 15297 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10 | reyssat | 1 | /* Copyright (C) 1998-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis |
2 | * |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
||
16 | */ |
||
17 | |||
18 | #include <stdio.h> |
||
19 | #include <stdlib.h> |
||
20 | #include <stdarg.h> |
||
21 | #include <string.h> |
||
22 | #include <unistd.h> |
||
23 | #include <ctype.h> |
||
24 | #include <math.h> |
||
7615 | bpr | 25 | #include <gd.h> |
26 | #include <gdfontt.h> |
||
27 | #include <gdfonts.h> |
||
28 | #include <gdfontmb.h> |
||
29 | #include <gdfontl.h> |
||
30 | #include <gdfontg.h> |
||
10 | reyssat | 31 | |
8102 | bpr | 32 | #include "../Lib/libwims.h" |
33 | |||
10 | reyssat | 34 | #define MAX_PARMS 8192 |
35 | #define MAX_SIZE 4096 |
||
36 | #define MAX_VARS 1024 |
||
37 | #define MAX_VARNAMEBUF 16384 |
||
38 | #define BOUND (MAX_SIZE*10) |
||
39 | #define exec_prefix_char '#' |
||
40 | |||
41 | |||
8102 | bpr | 42 | /* from flydraw.c */ |
43 | extern int linecnt, varcnt; |
||
44 | extern ev_variable vartab[]; |
||
45 | extern char varnamebuf[MAX_VARNAMEBUF], *varnameptr; |
||
8158 | bpr | 46 | extern gdImagePtr image, wimg, tileimg, brushimg; |
47 | extern int brushed, tiled, styled, savew, wcolor, transform; |
||
8102 | bpr | 48 | typedef double matrice[4]; |
49 | #define JC_NB_MATRICES 19 |
||
50 | extern matrice matrices_pavage[JC_NB_MATRICES+1]; |
||
51 | #define matrix matrices_pavage[0] |
||
52 | typedef double vecteur[2]; |
||
53 | extern vecteur vecteurs_pavage[JC_NB_MATRICES+1]; |
||
54 | #define vector vecteurs_pavage[0]; |
||
55 | extern double scale_buf[MAX_PARMS]; |
||
8158 | bpr | 56 | extern double transx, transy; /* translation vector */ |
57 | extern double xscale, yscale, xstart, ystart; |
||
8102 | bpr | 58 | extern int sizex, sizey, saved; |
8158 | bpr | 59 | extern int color_white, color_black, color_bounder, color_frame, lstep; |
8414 | bpr | 60 | extern int width, width2; |
8158 | bpr | 61 | extern double tend, tstart, tstep, plotjump, animstep; |
62 | extern int vimg_enable, vimg_ready; |
||
8102 | bpr | 63 | extern FILE *vimgf; |
64 | extern char vimgfilename[1024], imagefilename[1024]; |
||
14873 | georgesk | 65 | /** |
66 | * GK 2020-04-18 |
||
67 | * defining global variables in a header file is no longer allowed |
||
68 | * with gcc-10, so thses are commented out, and replaced further by |
||
69 | * extern clauses. |
||
70 | int tranged; |
||
8134 | bpr | 71 | double parallogram_fonda[6]; |
72 | char *substit(char *p); |
||
14873 | georgesk | 73 | * the actual variable "tranged" is defined in flydraw.c, line 32 |
74 | * the actual value of "parallogram_fonda" is defined in flydraw.c, line 63 |
||
75 | * the actual variable "substit" is defined in flydraw.c, line 83 |
||
76 | **/ |
||
77 | extern int tranged; |
||
78 | extern double parallogram_fonda[6]; |
||
79 | extern char *substit(char *p); |
||
80 | |||
8102 | bpr | 81 | void output(void); |
82 | /* from wimg.c */ |
||
83 | void vimg_init (void); |
||
84 | void vimg_close (void); |
||
8158 | bpr | 85 | void vimg_arc (double x0, double y0, double rx, double ry, double a1, double a2); |
8102 | bpr | 86 | void vimg_ellipse (double x0, double y0, double rx, double ry); |
8158 | bpr | 87 | void vimg_line (double x1, double y1, double x2, double y2); |
8102 | bpr | 88 | void vimg_polyline (double xy[], int cnt, int closed); |
89 | void vimg_rect (double x1, double y1, double x2, double y2); |
||
90 | void vimg_plotstart (void); |
||
91 | void vimg_plot1 (double x, double y); |
||
92 | void vimg_plotend (void); |
||
93 | |||
94 | |||
95 | /* from flylines.c */ |
||
96 | char *find_name_start(char *p); |
||
97 | char *find_name_end(char *p); |
||
8195 | bpr | 98 | void fly_error(char *p); |
8102 | bpr | 99 | void scale(double dbuf[], int ibuf[], int cnt); |
100 | /* scale without displacement */ |
||
101 | void scale2(double xin, double yin, double *xout, double *yout); |
||
102 | int widthcolor(int w, int color); |
||
103 | int getcolor(int r, int g, int b); |
||
104 | void setvar(char *p, double v); |
||
105 | void collapse_item(char *p, int n); |
||
106 | int ggetline(char buf[]); |
||
107 | |||
108 | /* from nametab.c */ |
||
109 | enum {t_prep,t_color,t_obj}; |
||
8158 | bpr | 110 | typedef struct objparm{ int p[MAX_PARMS]; double pd[MAX_PARMS]; int pcnt, color[2], fill; |
111 | char str[MAX_LINELEN+1], font[16]; } objparm; |
||
8102 | bpr | 112 | enum {p_and,p_from,p_to,p_thru,p_center,p_color,p_font, |
113 | p_diameter,p_radius,p_width,p_height }; |
||
114 | |||
115 | extern struct preptab { char *name;int typ; } preptab[]; |
||
116 | extern struct objtab { |
||
8878 | bpr | 117 | char *name; int required_parms, color_pos, fill_tag, subst; |
8102 | bpr | 118 | void (*routine) (objparm *pm); } objtab[]; |
119 | |||
120 | extern struct colortab {char *name;char *def;} colortab[]; |
||
121 | extern struct nametab {char *name;int type;int serial;} nametab[]; |
||
122 | extern int nametab_no, prep_no, obj_no, color_no; |
||
123 | |||
124 | /* from objects.c */ |
||
125 | int obj_main(char *p); |