Subversion Repositories wimsdev

Rev

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