Subversion Repositories wimsdev

Rev

Rev 18527 | 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
18266 bpr 18
# for fill_tag, -1:dashed, 1:filled, 0: nothing
10 reyssat 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
 
18159 bpr 44
reset t_obj     0,0,0,0,        obj_reset
45
noreset t_obj   0,0,0,0,        obj_noreset
18125 bpr 46
dashed t_obj    0,0,0,0,        obj_dashed
47
filled t_obj    0,0,0,0,        obj_filled
10 reyssat 48
affine          t_obj   6,0,0,0,        obj_affine
18047 bpr 49
arrow           t_obj   5,1,0,1,        obj_arrow
1024 bpr 50
arrow2          t_obj   5,1,0,1,        obj_arrow2
18047 bpr 51
arrows          t_obj   5,-1,0,1,       obj_arrows
52
arrows2         t_obj   5,-1,0,1,       obj_arrows2
10 reyssat 53
darrow          t_obj   5,1,-1,1,       obj_arrow
1024 bpr 54
darrow2         t_obj   5,1,-1,1,       obj_arrow2
18047 bpr 55
darrows         t_obj   5,-1,-1,1,      obj_arrows
56
darrows2        t_obj   5,-1,-1,1,      obj_arrows2
10 reyssat 57
dasharrow       t_obj   5,1,-1,1,       obj_arrow
1024 bpr 58
dasharrow2      t_obj   5,1,-1,1,       obj_arrow2
10 reyssat 59
dashedarrow     t_obj   5,1,-1,1,       obj_arrow
1024 bpr 60
dashedarrow2    t_obj   5,1,-1,1,       obj_arrow2
17662 bpr 61
arc             t_obj   6,1,0,3, obj_arc
17676 bpr 62
angle t_obj 5,1,0,3, obj_angle
10 reyssat 63
ball            t_obj   3,1,1,0,        obj_circle
64
circle          t_obj   3,1,0,3,        obj_circle
18118 bpr 65
circles         t_obj   3,-1,0,3,       obj_circles
10 reyssat 66
comment         t_obj   0,0,0,0,        obj_comment
67
copy            t_obj   6,0,0,0,        obj_copy
68
copyresized     t_obj   8,0,0,0,        obj_copyresize
8414 bpr 69
crosshair       t_obj   2,1,0,1,        obj_crosshair
70
crosshairs      t_obj   2,-1,0,1,       obj_crosshairs
71
crosshairsize   t_obj   1,0,0,0,        obj_crosshairsize
18065 bpr 72
curve   t_obj   0,-1,0,1,       obj_plot
18068 bpr 73
dashhalfline    t_obj   4,1,-1,3,       obj_halfline
10 reyssat 74
dashedline      t_obj   4,1,0,1,        obj_dline
75
dashedlines     t_obj   4,-1,0,1,       obj_dlines
76
dashline        t_obj   4,1,0,1,        obj_dline
77
dashlines       t_obj   4,-1,0,1,       obj_dlines
8414 bpr 78
dashsegment     t_obj   4,1,0,1,        obj_dline
18065 bpr 79
demiline        t_obj   4,1,0,3,        obj_halfline
10 reyssat 80
diafill         t_obj   4,1,1,0,        obj_diafill
81
diamondfill     t_obj   4,1,1,0,        obj_diafill
82
disk            t_obj   3,1,1,0,        obj_circle
83
diskfill        t_obj   4,1,1,0,        obj_dotfill
18339 bpr 84
dline           t_obj   4,1,-1,1,       obj_fullline
85
dlines          t_obj   4,-1,-1,1,      obj_fulllines
10 reyssat 86
dhline          t_obj   2,1,-1,1,       obj_hline
18125 bpr 87
dpolyline       t_obj   4,-1,-1,1,      obj_dlines
10 reyssat 88
dotfill         t_obj   4,1,1,0,        obj_dotfill
6578 bpr 89
dplot           t_obj   0,-1,0,1,       obj_dplot
8414 bpr 90
dsegment        t_obj   4,1,0,1,        obj_dline
10 reyssat 91
dvline          t_obj   2,1,-1,1,       obj_vline
92
ellipse         t_obj   4,1,0,3,        obj_ellipse
17656 bpr 93
ellipses        t_obj   4,-1,0,3,       obj_ellipses
10 reyssat 94
existing        t_obj   0,0,0,0,        obj_existing
95
fcircle         t_obj   3,1,1,0,        obj_circle
18118 bpr 96
fcircles                t_obj   3,-1,1,3,       obj_circles
10 reyssat 97
fellipse        t_obj   4,1,1,0,        obj_ellipse
18523 bpr 98
fhypcircles             t_obj   3,-1,1,3,       obj_hypcircles
18432 bpr 99
fhyppolygon     t_obj   4,-1,1,0,       obj_hyppoly
18352 bpr 100
fhyptriangle    t_obj   6,1,1,0,        obj_hyptriangle
10 reyssat 101
fill            t_obj   2,1,1,0,        obj_fill
102
filledcircle    t_obj   3,1,1,0,        obj_circle
103
filledellipse   t_obj   4,1,1,0,        obj_ellipse
104
filledpoly      t_obj   4,-1,1,0,       obj_poly
105
filledpolygon   t_obj   4,-1,1,0,       obj_poly
106
filledrect      t_obj   4,1,1,0,        obj_rect
107
filledrectangle t_obj   4,1,1,0,        obj_rect
108
filledsquare    t_obj   3,1,1,0,        obj_square
109
filledtriangle  t_obj   6,1,1,0,        obj_triangle
110
fillcircle      t_obj   3,1,1,0,        obj_circle
111
fillellipse     t_obj   4,1,1,0,        obj_ellipse
112
fillpoly        t_obj   4,-1,1,0,       obj_poly
113
fillpolygon     t_obj   4,-1,1,0,       obj_poly
114
fillrect        t_obj   4,1,1,0,        obj_rect
115
fillrectangle   t_obj   4,1,1,0,        obj_rect
116
fillsquare      t_obj   3,1,1,0,        obj_square
117
filltriangle    t_obj   6,1,1,0,        obj_triangle
118
filltoborder    t_obj   2,2,1,0,        obj_fillb
119
flood           t_obj   2,1,1,0,        obj_fill
120
floodfill       t_obj   2,1,1,0,        obj_fill
121
fpoly           t_obj   4,-1,1,0,       obj_poly
122
fpolygon        t_obj   4,-1,1,0,       obj_poly
123
frect           t_obj   4,1,1,0,        obj_rect
124
frectangle      t_obj   4,1,1,0,        obj_rect
125
fsquare         t_obj   3,1,1,0,        obj_square
126
ftriangle       t_obj   6,1,1,0,        obj_triangle
127
gridfill        t_obj   4,1,1,0,        obj_gridfill
18065 bpr 128
halfline        t_obj   4,1,0,3,        obj_halfline
10 reyssat 129
hatchfill       t_obj   4,1,1,0,        obj_hatchfill
130
hline           t_obj   2,1,0,3,        obj_hline
18668 bpr 131
hlines  t_obj   2,-1,0,3,       obj_hlines
10 reyssat 132
hdline          t_obj   2,1,-1,1,       obj_hline
18521 bpr 133
hypcircles t_obj        3,-1,0,3,       obj_hypcircles
18352 bpr 134
hyplines t_obj  4,-1,0,3,       obj_hyplines
18432 bpr 135
hyppolygon      t_obj   4,-1,0,3,       obj_hyppoly
18527 bpr 136
hyprays t_obj   4,-1,0,3,       obj_hyprays
18352 bpr 137
hypsegments t_obj       4,-1,0,3,       obj_hypgeods
138
hyptriangle     t_obj   6,1,0,3,        obj_hyptriangle
10 reyssat 139
insert          t_obj   6,0,0,0,        obj_copy
140
interlace       t_obj   0,0,0,0,        obj_interlace
141
killaffine      t_obj   0,0,0,0,        obj_killaffine
142
killbrush       t_obj   0,0,0,0,        obj_killbrush
143
killlinear      t_obj   0,0,0,0,        obj_killlinear
144
killrotate      t_obj   0,0,0,0,        obj_killlinear
145
killrotation    t_obj   0,0,0,0,        obj_killlinear
146
killstyle       t_obj   0,0,0,0,        obj_killstyle
147
killtile        t_obj   0,0,0,0,        obj_killtile
148
killtranslate   t_obj   0,0,0,0,        obj_killtranslation
149
killtranslation t_obj   0,0,0,0,        obj_killtranslation
150
lattice         t_obj   8,1,0,1,        obj_lattice
18339 bpr 151
line            t_obj   4,1,0,3,        obj_fullline
10 reyssat 152
linear          t_obj   4,0,0,0,        obj_linear
18339 bpr 153
lines           t_obj   4,-1,0,3,       obj_fulllines
10 reyssat 154
rays            t_obj   4,-1,0,3,       obj_rays
155
linewidth       t_obj   1,0,0,0,        obj_linewidth
156
new             t_obj   0,0,0,0,        obj_new
157
output          t_obj   0,0,0,0,        obj_output
158
parallel        t_obj   7,1,0,3,        obj_parallel
159
pixels          t_obj   2,-1,-1,0,      obj_points
160
point           t_obj   2,1,0,1,        obj_point
161
pointfill       t_obj   4,1,1,0,        obj_dotfill
162
points          t_obj   2,-1,0,1,       obj_points
163
poly            t_obj   4,-1,0,3,       obj_poly
164
polygon         t_obj   4,-1,0,3,       obj_poly
8414 bpr 165
polyline        t_obj   4,-1,0,3,       obj_lines
16344 bpr 166
brokenline              t_obj   4,-1,0,3,       obj_lines
10 reyssat 167
print           t_obj   2,-1,0,0,       obj_string
168
range           t_obj   4,0,0,0,        obj_range
169
rangex          t_obj   2,0,0,0,        obj_xrange
170
rangey          t_obj   2,0,0,0,        obj_yrange
171
ranget          t_obj   2,0,0,0,        obj_trange
172
rect            t_obj   4,1,0,3,        obj_rect
173
rectangle       t_obj   4,1,0,3,        obj_rect
174
rotate          t_obj   1,0,0,0,        obj_rotation
175
rotation        t_obj   1,0,0,0,        obj_rotation
176
seg             t_obj   4,1,0,3,        obj_line
177
segment         t_obj   4,1,0,3,        obj_line
16344 bpr 178
segments                t_obj   4,-1,0,3,       obj_segments
10 reyssat 179
setbrush        t_obj   0,0,0,0,        obj_setbrush
180
setpixel        t_obj   2,1,-1,0,       obj_point
181
setstyle        t_obj   0,0,0,0,        obj_setstyle
182
settile         t_obj   0,0,-1,0,       obj_setbrush
183
size            t_obj   2,0,0,0,        obj_size
184
square          t_obj   3,1,0,3,        obj_square
185
string          t_obj   2,-1,0,0,       obj_string
186
stringup        t_obj   2,-1,-1,0,      obj_string
187
text            t_obj   2,-1,0,0,       obj_string
188
textup          t_obj   2,-1,-1,0,      obj_string
189
translate       t_obj   2,0,0,0,        obj_translation
190
translation     t_obj   2,0,0,0,        obj_translation
191
transparent     t_obj   0,-1,0,0,       obj_transp
192
triangle        t_obj   6,1,0,3,        obj_triangle
193
vline           t_obj   2,1,0,3,        obj_vline
18668 bpr 194
vlines          t_obj   2,-1,0,3,       obj_vlines
10 reyssat 195
vdline          t_obj   2,1,-1,1,       obj_vline
196
write           t_obj   2,-1,0,0,       obj_string
197
writeup         t_obj   2,-1,-1,0,      obj_string
198
xrange          t_obj   2,0,0,0,        obj_xrange
199
yrange          t_obj   2,0,0,0,        obj_yrange
200
trange          t_obj   2,0,0,0,        obj_trange
201
tstep           t_obj   1,0,0,0,        obj_tstep
202
tsteps          t_obj   1,0,0,0,        obj_tstep
203
plotstep        t_obj   1,0,0,0,        obj_tstep
204
plotsteps       t_obj   1,0,0,0,        obj_tstep
205
plot            t_obj   0,-1,0,1,       obj_plot
206
plotjump        t_obj   1,0,0,0,        obj_plotjump
207
levelcurve      t_obj   0,-1,0,1,       obj_levelcurve
208
levelstep       t_obj   1,0,0,0,        obj_levelstep
209
animstep        t_obj   1,0,0,0,        obj_animstep
210
wims_linecount  t_obj   1,0,0,0,        obj_linecount
211
wims_end        t_obj   0,0,0,0,        obj_end
212
setmatrix       t_obj   5,0,0,0,        obj_setmatrix
213
resetmatrix     t_obj   1,0,0,0,        obj_resetmatrix
214
setvector       t_obj   3,0,0,0,        obj_setvector
215
resetvector     t_obj   1,0,0,0,        obj_resetvector
216
settransform    t_obj   7,0,0,0,        obj_settransform
217
resettransform  t_obj   1,0,0,0,        obj_resettransform
218
setparallelogram        t_obj   6,0,0,0,        obj_setparallelogram
219
resetparallelogram      t_obj   0,0,0,0,        obj_resetparallelogram
220
multicopy       t_obj   0,0,0,0,        obj_multicopy
1024 bpr 221
vimgfile        t_obj   0,0,0,0,        obj_vimgfile
222
vimg            t_obj   1,0,0,0,        obj_vimg
17574 bpr 223
tikzfile                t_obj   0,0,0,0,        obj_tikzfile
10 reyssat 224
@
225
`
226
namecolor=`awk 'NF==2 {print $1"        t_color \""$2"\""}' colors`
227
namelist=`sort -k 1,1 <<@ | uniq
228
$namecolor
229
$names
230
@
231
`
18129 bpr 232
 
10 reyssat 233
o_list=`echo "$namelist" | grep t_obj | awk '{print substr($4,5)}' | sort | uniq`
234
 
235
cd `dirname $0`
236
echo "$header" >nametab.c
237
for o in $o_list
238
do
239
 echo "void obj_$o(objparm *pm);" >>nametab.c
240
done
241
 
242
tab=tab
243
no=_no
244
for t in $tablist
245
do
246
 eval def='$'$t'struct'
247
 list=`echo "$namelist" | grep t_$t`
248
 ll=`echo "$list" | awk '
249
        NF>1 {print "{\""$1"\", "$3" "$4" "$5"},"}
250
        '`
251
 echo "$list" | awk '
8102 bpr 252
        BEGIN {a=0};
10 reyssat 253
        NF>1 {print "\""$1"\",  ",$2",  "a; a=a+1;};
254
'>.nametab.$t
8102 bpr 255
 echo "struct $t$tab $t$tab[]={
10 reyssat 256
$ll
257
};
258
 
8102 bpr 259
int $t$no=(sizeof($t$tab)/sizeof($t$tab[0]));
10 reyssat 260
" >>nametab.c
261
done
262
 
263
list=`cat .nametab.* | sort -k 1,1 | awk '{print "{"$0"},"}'`
264
cat <<@ >>nametab.c
8102 bpr 265
struct nametab nametab[]={
10 reyssat 266
$list
267
};
268
 
8102 bpr 269
int nametab_no=(sizeof(nametab)/sizeof(nametab[0]));
10 reyssat 270
 
271
@
272
 
1522 bpr 273
rm -f .nametab.* >/dev/null 2>&1