Subversion Repositories wimsdev

Rev

Rev 18068 | Rev 18125 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 reyssat 1
#! /bin/sh
2
 
3
tablist="prep color obj"
4
prepstruct="
5
        char *name;
6
        int typ;
7
"
8
colorstruct="
9
        char *name;
10
        char *def;
11
"
12
objstruct="
13
        char *name;
14
        int required_parms,color_pos,fill_tag,subst;
15
        void (*routine) (objparm *pm);
16
"
17
export prepstruct colorstruct objstruct
18
 
19
header="
20
        /* This file is automatically generated! Do not edit it. */
8102 bpr 21
#include \"flydraw.h\"
10 reyssat 22
"
23
 
24
names=`cat <<@
25
brush   t_color "-1,-1,-255"
26
brushed t_color "-1,-1,-255"
27
style   t_color "-1,-255,-1"
28
styled  t_color "-1,-255,-1"
29
tile    t_color "-255,-1,-1"
30
tiled   t_color "-255,-1,-1"
31
 
32
color   t_prep  p_color
33
colour  t_prep  p_color
34
colors  t_prep  p_color
35
colours t_prep  p_color
36
 
37
tiny    t_prep  p_font
38
small   t_prep  p_font
39
medium  t_prep  p_font
40
large   t_prep  p_font
41
huge    t_prep  p_font
42
giant   t_prep  p_font
43
 
44
affine          t_obj   6,0,0,0,        obj_affine
18047 bpr 45
arrow           t_obj   5,1,0,1,        obj_arrow
1024 bpr 46
arrow2          t_obj   5,1,0,1,        obj_arrow2
18047 bpr 47
arrows          t_obj   5,-1,0,1,       obj_arrows
48
arrows2         t_obj   5,-1,0,1,       obj_arrows2
10 reyssat 49
darrow          t_obj   5,1,-1,1,       obj_arrow
1024 bpr 50
darrow2         t_obj   5,1,-1,1,       obj_arrow2
18047 bpr 51
darrows         t_obj   5,-1,-1,1,      obj_arrows
52
darrows2        t_obj   5,-1,-1,1,      obj_arrows2
10 reyssat 53
dasharrow       t_obj   5,1,-1,1,       obj_arrow
1024 bpr 54
dasharrow2      t_obj   5,1,-1,1,       obj_arrow2
10 reyssat 55
dashedarrow     t_obj   5,1,-1,1,       obj_arrow
1024 bpr 56
dashedarrow2    t_obj   5,1,-1,1,       obj_arrow2
17662 bpr 57
arc             t_obj   6,1,0,3, obj_arc
17676 bpr 58
angle t_obj 5,1,0,3, obj_angle
10 reyssat 59
ball            t_obj   3,1,1,0,        obj_circle
60
circle          t_obj   3,1,0,3,        obj_circle
18118 bpr 61
circles         t_obj   3,-1,0,3,       obj_circles
10 reyssat 62
comment         t_obj   0,0,0,0,        obj_comment
63
copy            t_obj   6,0,0,0,        obj_copy
64
copyresized     t_obj   8,0,0,0,        obj_copyresize
8414 bpr 65
crosshair       t_obj   2,1,0,1,        obj_crosshair
66
crosshairs      t_obj   2,-1,0,1,       obj_crosshairs
67
crosshairsize   t_obj   1,0,0,0,        obj_crosshairsize
18065 bpr 68
curve   t_obj   0,-1,0,1,       obj_plot
18068 bpr 69
dashhalfline    t_obj   4,1,-1,3,       obj_halfline
10 reyssat 70
dashedline      t_obj   4,1,0,1,        obj_dline
71
dashedlines     t_obj   4,-1,0,1,       obj_dlines
72
dashline        t_obj   4,1,0,1,        obj_dline
73
dashlines       t_obj   4,-1,0,1,       obj_dlines
8414 bpr 74
dashsegment     t_obj   4,1,0,1,        obj_dline
18065 bpr 75
demiline        t_obj   4,1,0,3,        obj_halfline
10 reyssat 76
diafill         t_obj   4,1,1,0,        obj_diafill
77
diamondfill     t_obj   4,1,1,0,        obj_diafill
78
disk            t_obj   3,1,1,0,        obj_circle
79
diskfill        t_obj   4,1,1,0,        obj_dotfill
80
dline           t_obj   4,1,0,1,        obj_dline
81
dlines          t_obj   4,-1,0,1,       obj_dlines
82
dhline          t_obj   2,1,-1,1,       obj_hline
8520 bpr 83
dpolyline       t_obj   4,-1,0,1,       obj_dlines
10 reyssat 84
dotfill         t_obj   4,1,1,0,        obj_dotfill
6578 bpr 85
dplot           t_obj   0,-1,0,1,       obj_dplot
8414 bpr 86
dsegment        t_obj   4,1,0,1,        obj_dline
10 reyssat 87
dvline          t_obj   2,1,-1,1,       obj_vline
88
ellipse         t_obj   4,1,0,3,        obj_ellipse
17656 bpr 89
ellipses        t_obj   4,-1,0,3,       obj_ellipses
10 reyssat 90
existing        t_obj   0,0,0,0,        obj_existing
91
fcircle         t_obj   3,1,1,0,        obj_circle
18118 bpr 92
fcircles                t_obj   3,-1,1,3,       obj_circles
10 reyssat 93
fellipse        t_obj   4,1,1,0,        obj_ellipse
94
fill            t_obj   2,1,1,0,        obj_fill
95
filledcircle    t_obj   3,1,1,0,        obj_circle
96
filledellipse   t_obj   4,1,1,0,        obj_ellipse
97
filledpoly      t_obj   4,-1,1,0,       obj_poly
98
filledpolygon   t_obj   4,-1,1,0,       obj_poly
99
filledrect      t_obj   4,1,1,0,        obj_rect
100
filledrectangle t_obj   4,1,1,0,        obj_rect
101
filledsquare    t_obj   3,1,1,0,        obj_square
102
filledtriangle  t_obj   6,1,1,0,        obj_triangle
103
fillcircle      t_obj   3,1,1,0,        obj_circle
104
fillellipse     t_obj   4,1,1,0,        obj_ellipse
105
fillpoly        t_obj   4,-1,1,0,       obj_poly
106
fillpolygon     t_obj   4,-1,1,0,       obj_poly
107
fillrect        t_obj   4,1,1,0,        obj_rect
108
fillrectangle   t_obj   4,1,1,0,        obj_rect
109
fillsquare      t_obj   3,1,1,0,        obj_square
110
filltriangle    t_obj   6,1,1,0,        obj_triangle
111
filltoborder    t_obj   2,2,1,0,        obj_fillb
112
flood           t_obj   2,1,1,0,        obj_fill
113
floodfill       t_obj   2,1,1,0,        obj_fill
114
fpoly           t_obj   4,-1,1,0,       obj_poly
115
fpolygon        t_obj   4,-1,1,0,       obj_poly
116
frect           t_obj   4,1,1,0,        obj_rect
117
frectangle      t_obj   4,1,1,0,        obj_rect
118
fsquare         t_obj   3,1,1,0,        obj_square
119
ftriangle       t_obj   6,1,1,0,        obj_triangle
120
gridfill        t_obj   4,1,1,0,        obj_gridfill
18065 bpr 121
halfline        t_obj   4,1,0,3,        obj_halfline
10 reyssat 122
hatchfill       t_obj   4,1,1,0,        obj_hatchfill
123
hline           t_obj   2,1,0,3,        obj_hline
124
hdline          t_obj   2,1,-1,1,       obj_hline
125
insert          t_obj   6,0,0,0,        obj_copy
126
interlace       t_obj   0,0,0,0,        obj_interlace
127
killaffine      t_obj   0,0,0,0,        obj_killaffine
128
killbrush       t_obj   0,0,0,0,        obj_killbrush
129
killlinear      t_obj   0,0,0,0,        obj_killlinear
130
killrotate      t_obj   0,0,0,0,        obj_killlinear
131
killrotation    t_obj   0,0,0,0,        obj_killlinear
132
killstyle       t_obj   0,0,0,0,        obj_killstyle
133
killtile        t_obj   0,0,0,0,        obj_killtile
134
killtranslate   t_obj   0,0,0,0,        obj_killtranslation
135
killtranslation t_obj   0,0,0,0,        obj_killtranslation
136
lattice         t_obj   8,1,0,1,        obj_lattice
137
line            t_obj   4,1,0,3,        obj_line
138
linear          t_obj   4,0,0,0,        obj_linear
139
lines           t_obj   4,-1,0,3,       obj_lines
140
rays            t_obj   4,-1,0,3,       obj_rays
141
linewidth       t_obj   1,0,0,0,        obj_linewidth
142
new             t_obj   0,0,0,0,        obj_new
143
output          t_obj   0,0,0,0,        obj_output
144
parallel        t_obj   7,1,0,3,        obj_parallel
145
pixels          t_obj   2,-1,-1,0,      obj_points
146
point           t_obj   2,1,0,1,        obj_point
147
pointfill       t_obj   4,1,1,0,        obj_dotfill
148
points          t_obj   2,-1,0,1,       obj_points
149
poly            t_obj   4,-1,0,3,       obj_poly
150
polygon         t_obj   4,-1,0,3,       obj_poly
8414 bpr 151
polyline        t_obj   4,-1,0,3,       obj_lines
16344 bpr 152
brokenline              t_obj   4,-1,0,3,       obj_lines
10 reyssat 153
print           t_obj   2,-1,0,0,       obj_string
154
range           t_obj   4,0,0,0,        obj_range
155
rangex          t_obj   2,0,0,0,        obj_xrange
156
rangey          t_obj   2,0,0,0,        obj_yrange
157
ranget          t_obj   2,0,0,0,        obj_trange
158
rect            t_obj   4,1,0,3,        obj_rect
159
rectangle       t_obj   4,1,0,3,        obj_rect
160
rotate          t_obj   1,0,0,0,        obj_rotation
161
rotation        t_obj   1,0,0,0,        obj_rotation
162
seg             t_obj   4,1,0,3,        obj_line
163
segment         t_obj   4,1,0,3,        obj_line
16344 bpr 164
segments                t_obj   4,-1,0,3,       obj_segments
10 reyssat 165
setbrush        t_obj   0,0,0,0,        obj_setbrush
166
setpixel        t_obj   2,1,-1,0,       obj_point
167
setstyle        t_obj   0,0,0,0,        obj_setstyle
168
settile         t_obj   0,0,-1,0,       obj_setbrush
169
size            t_obj   2,0,0,0,        obj_size
170
square          t_obj   3,1,0,3,        obj_square
171
string          t_obj   2,-1,0,0,       obj_string
172
stringup        t_obj   2,-1,-1,0,      obj_string
173
text            t_obj   2,-1,0,0,       obj_string
174
textup          t_obj   2,-1,-1,0,      obj_string
175
translate       t_obj   2,0,0,0,        obj_translation
176
translation     t_obj   2,0,0,0,        obj_translation
177
transparent     t_obj   0,-1,0,0,       obj_transp
178
triangle        t_obj   6,1,0,3,        obj_triangle
179
vline           t_obj   2,1,0,3,        obj_vline
180
vdline          t_obj   2,1,-1,1,       obj_vline
181
write           t_obj   2,-1,0,0,       obj_string
182
writeup         t_obj   2,-1,-1,0,      obj_string
183
xrange          t_obj   2,0,0,0,        obj_xrange
184
yrange          t_obj   2,0,0,0,        obj_yrange
185
trange          t_obj   2,0,0,0,        obj_trange
186
tstep           t_obj   1,0,0,0,        obj_tstep
187
tsteps          t_obj   1,0,0,0,        obj_tstep
188
plotstep        t_obj   1,0,0,0,        obj_tstep
189
plotsteps       t_obj   1,0,0,0,        obj_tstep
190
plot            t_obj   0,-1,0,1,       obj_plot
191
plotjump        t_obj   1,0,0,0,        obj_plotjump
192
levelcurve      t_obj   0,-1,0,1,       obj_levelcurve
193
levelstep       t_obj   1,0,0,0,        obj_levelstep
194
animstep        t_obj   1,0,0,0,        obj_animstep
195
wims_linecount  t_obj   1,0,0,0,        obj_linecount
196
wims_end        t_obj   0,0,0,0,        obj_end
197
setmatrix       t_obj   5,0,0,0,        obj_setmatrix
198
resetmatrix     t_obj   1,0,0,0,        obj_resetmatrix
199
setvector       t_obj   3,0,0,0,        obj_setvector
200
resetvector     t_obj   1,0,0,0,        obj_resetvector
201
settransform    t_obj   7,0,0,0,        obj_settransform
202
resettransform  t_obj   1,0,0,0,        obj_resettransform
203
setparallelogram        t_obj   6,0,0,0,        obj_setparallelogram
204
resetparallelogram      t_obj   0,0,0,0,        obj_resetparallelogram
205
multicopy       t_obj   0,0,0,0,        obj_multicopy
1024 bpr 206
vimgfile        t_obj   0,0,0,0,        obj_vimgfile
207
vimg            t_obj   1,0,0,0,        obj_vimg
17574 bpr 208
tikzfile                t_obj   0,0,0,0,        obj_tikzfile
10 reyssat 209
@
210
`
211
namecolor=`awk 'NF==2 {print $1"        t_color \""$2"\""}' colors`
212
namelist=`sort -k 1,1 <<@ | uniq
213
$namecolor
214
$names
215
@
216
`
217
 
218
o_list=`echo "$namelist" | grep t_obj | awk '{print substr($4,5)}' | sort | uniq`
219
 
220
cd `dirname $0`
221
echo "$header" >nametab.c
222
for o in $o_list
223
do
224
 echo "void obj_$o(objparm *pm);" >>nametab.c
225
done
226
 
227
tab=tab
228
no=_no
229
for t in $tablist
230
do
231
 eval def='$'$t'struct'
232
 list=`echo "$namelist" | grep t_$t`
233
 ll=`echo "$list" | awk '
234
        NF>1 {print "{\""$1"\", "$3" "$4" "$5"},"}
235
        '`
236
 echo "$list" | awk '
8102 bpr 237
        BEGIN {a=0};
10 reyssat 238
        NF>1 {print "\""$1"\",  ",$2",  "a; a=a+1;};
239
'>.nametab.$t
8102 bpr 240
 echo "struct $t$tab $t$tab[]={
10 reyssat 241
$ll
242
};
243
 
8102 bpr 244
int $t$no=(sizeof($t$tab)/sizeof($t$tab[0]));
10 reyssat 245
" >>nametab.c
246
done
247
 
248
list=`cat .nametab.* | sort -k 1,1 | awk '{print "{"$0"},"}'`
249
cat <<@ >>nametab.c
8102 bpr 250
struct nametab nametab[]={
10 reyssat 251
$list
252
};
253
 
8102 bpr 254
int nametab_no=(sizeof(nametab)/sizeof(nametab[0]));
10 reyssat 255
 
256
@
257
 
1522 bpr 258
rm -f .nametab.* >/dev/null 2>&1