File: mksymbols

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (85 lines) | stat: -rwxr-xr-x 1,771 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/sh
#
# Generate component symbol images for drag-and-drop uses.
#
# For the time being the only available size factor is 20.

cd `dirname $0`
home=`pwd`
whome=../../../..

flydraw=$whome/other/bin/flydraw
datafile=compdata
outdir=$whome/public_html/gifs/symbols/20

header="new 41,41
xrange -1,1.05
yrange -1.05,1
trange 0,1
fill 0,0,white
transparent white
linewidth 1
"

if [ ! -s $datafile.for_sh ] || [ $datafile -nt $datafile.for_sh ] || [ mksymbols -nt $datafile ]; then
 awk 'BEGIN {b=0};
   /=/ {b=1};
   {if(match($0,/\\$/) || b==0) print; else {print $0"\""; b=0}};' $datafile |\
   sed 's/=/="/;s/\\//;s/_color_/black/g;s/\$slib_dotwidth/8/g;s/\$slib_textsize/large/g' >$datafile.for_sh
 . ./$datafile.for_sh
fi

complist=`echo $comp_all | tr ',' ' '`
## doesnot work : copy the list in compdata in the corresponding line below
##compnorotate=`echo $comp_norotate | tr ' ' '|'`


mkdir -p $outdir
for c in $complist; do
 rm -f $outdir/$c-h.gif $outdir/$c-v.gif $outdir/${c}R-h.gif $outdir/${c}R-v.gif
 export comp_$c
 draw=`sh -c "echo \"\\$comp_$c\""`
 $flydraw <<@
$header
$draw
output $outdir/$c-h.gif
@
 case $c in
  acsrc|ammeter|ammeterN|lamp|lampN|meter|motor|num|voltmeter|voltmeterN)
   ln -s $c-h.gif $outdir/$c-v.gif
   ln -s $c-h.gif $outdir/${c}R-h.gif
   ln -s $c-h.gif $outdir/${c}R-v.gif
   ;;
  cap|lamp|res|term2|wire)
   $flydraw <<@
$header
affine 0,-1,1,0,0,0
$draw
output $outdir/$c-v.gif
@
   ln -s $c-h.gif $outdir/${c}R-h.gif
   ln -s $c-v.gif $outdir/${c}R-v.gif
   ;;
  *)
   $flydraw <<@
$header
affine 0,-1,1,0,0,0
$draw
output $outdir/$c-v.gif
@
   $flydraw <<@
$header
affine -1,0,0,-1,0,0
$draw
output $outdir/${c}R-h.gif
@
   $flydraw <<@
$header
affine 0,1,-1,0,0,0
$draw
output $outdir/${c}R-v.gif
@
  ;;
 esac
done