Subversion Repositories wimsdev

Rev

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