Subversion Repositories wimsdev

Rev

Rev 8414 | Rev 17574 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

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