Subversion Repositories wimsdev

Rev

Rev 18432 | Rev 18523 | 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. 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. fhyppolygon     t_obj   4,-1,1,0,       obj_hyppoly
  99. fhyptriangle    t_obj   6,1,1,0,        obj_hyptriangle
  100. fill            t_obj   2,1,1,0,        obj_fill
  101. filledcircle    t_obj   3,1,1,0,        obj_circle
  102. filledellipse   t_obj   4,1,1,0,        obj_ellipse
  103. filledpoly      t_obj   4,-1,1,0,       obj_poly
  104. filledpolygon   t_obj   4,-1,1,0,       obj_poly
  105. filledrect      t_obj   4,1,1,0,        obj_rect
  106. filledrectangle t_obj   4,1,1,0,        obj_rect
  107. filledsquare    t_obj   3,1,1,0,        obj_square
  108. filledtriangle  t_obj   6,1,1,0,        obj_triangle
  109. fillcircle      t_obj   3,1,1,0,        obj_circle
  110. fillellipse     t_obj   4,1,1,0,        obj_ellipse
  111. fillpoly        t_obj   4,-1,1,0,       obj_poly
  112. fillpolygon     t_obj   4,-1,1,0,       obj_poly
  113. fillrect        t_obj   4,1,1,0,        obj_rect
  114. fillrectangle   t_obj   4,1,1,0,        obj_rect
  115. fillsquare      t_obj   3,1,1,0,        obj_square
  116. filltriangle    t_obj   6,1,1,0,        obj_triangle
  117. filltoborder    t_obj   2,2,1,0,        obj_fillb
  118. flood           t_obj   2,1,1,0,        obj_fill
  119. floodfill       t_obj   2,1,1,0,        obj_fill
  120. fpoly           t_obj   4,-1,1,0,       obj_poly
  121. fpolygon        t_obj   4,-1,1,0,       obj_poly
  122. frect           t_obj   4,1,1,0,        obj_rect
  123. frectangle      t_obj   4,1,1,0,        obj_rect
  124. fsquare         t_obj   3,1,1,0,        obj_square
  125. ftriangle       t_obj   6,1,1,0,        obj_triangle
  126. gridfill        t_obj   4,1,1,0,        obj_gridfill
  127. halfline        t_obj   4,1,0,3,        obj_halfline
  128. hatchfill       t_obj   4,1,1,0,        obj_hatchfill
  129. hline           t_obj   2,1,0,3,        obj_hline
  130. hdline          t_obj   2,1,-1,1,       obj_hline
  131. hypcircles t_obj        3,-1,0,3,       obj_hypcircles
  132. hyplines t_obj  4,-1,0,3,       obj_hyplines
  133. hyppolygon      t_obj   4,-1,0,3,       obj_hyppoly
  134. hypsegments t_obj       4,-1,0,3,       obj_hypgeods
  135. hyptriangle     t_obj   6,1,0,3,        obj_hyptriangle
  136. insert          t_obj   6,0,0,0,        obj_copy
  137. interlace       t_obj   0,0,0,0,        obj_interlace
  138. killaffine      t_obj   0,0,0,0,        obj_killaffine
  139. killbrush       t_obj   0,0,0,0,        obj_killbrush
  140. killlinear      t_obj   0,0,0,0,        obj_killlinear
  141. killrotate      t_obj   0,0,0,0,        obj_killlinear
  142. killrotation    t_obj   0,0,0,0,        obj_killlinear
  143. killstyle       t_obj   0,0,0,0,        obj_killstyle
  144. killtile        t_obj   0,0,0,0,        obj_killtile
  145. killtranslate   t_obj   0,0,0,0,        obj_killtranslation
  146. killtranslation t_obj   0,0,0,0,        obj_killtranslation
  147. lattice         t_obj   8,1,0,1,        obj_lattice
  148. line            t_obj   4,1,0,3,        obj_fullline
  149. linear          t_obj   4,0,0,0,        obj_linear
  150. lines           t_obj   4,-1,0,3,       obj_fulllines
  151. rays            t_obj   4,-1,0,3,       obj_rays
  152. linewidth       t_obj   1,0,0,0,        obj_linewidth
  153. new             t_obj   0,0,0,0,        obj_new
  154. output          t_obj   0,0,0,0,        obj_output
  155. parallel        t_obj   7,1,0,3,        obj_parallel
  156. pixels          t_obj   2,-1,-1,0,      obj_points
  157. point           t_obj   2,1,0,1,        obj_point
  158. pointfill       t_obj   4,1,1,0,        obj_dotfill
  159. points          t_obj   2,-1,0,1,       obj_points
  160. poly            t_obj   4,-1,0,3,       obj_poly
  161. polygon         t_obj   4,-1,0,3,       obj_poly
  162. polyline        t_obj   4,-1,0,3,       obj_lines
  163. brokenline              t_obj   4,-1,0,3,       obj_lines
  164. print           t_obj   2,-1,0,0,       obj_string
  165. range           t_obj   4,0,0,0,        obj_range
  166. rangex          t_obj   2,0,0,0,        obj_xrange
  167. rangey          t_obj   2,0,0,0,        obj_yrange
  168. ranget          t_obj   2,0,0,0,        obj_trange
  169. rect            t_obj   4,1,0,3,        obj_rect
  170. rectangle       t_obj   4,1,0,3,        obj_rect
  171. rotate          t_obj   1,0,0,0,        obj_rotation
  172. rotation        t_obj   1,0,0,0,        obj_rotation
  173. seg             t_obj   4,1,0,3,        obj_line
  174. segment         t_obj   4,1,0,3,        obj_line
  175. segments                t_obj   4,-1,0,3,       obj_segments
  176. setbrush        t_obj   0,0,0,0,        obj_setbrush
  177. setpixel        t_obj   2,1,-1,0,       obj_point
  178. setstyle        t_obj   0,0,0,0,        obj_setstyle
  179. settile         t_obj   0,0,-1,0,       obj_setbrush
  180. size            t_obj   2,0,0,0,        obj_size
  181. square          t_obj   3,1,0,3,        obj_square
  182. string          t_obj   2,-1,0,0,       obj_string
  183. stringup        t_obj   2,-1,-1,0,      obj_string
  184. text            t_obj   2,-1,0,0,       obj_string
  185. textup          t_obj   2,-1,-1,0,      obj_string
  186. translate       t_obj   2,0,0,0,        obj_translation
  187. translation     t_obj   2,0,0,0,        obj_translation
  188. transparent     t_obj   0,-1,0,0,       obj_transp
  189. triangle        t_obj   6,1,0,3,        obj_triangle
  190. vline           t_obj   2,1,0,3,        obj_vline
  191. vdline          t_obj   2,1,-1,1,       obj_vline
  192. write           t_obj   2,-1,0,0,       obj_string
  193. writeup         t_obj   2,-1,-1,0,      obj_string
  194. xrange          t_obj   2,0,0,0,        obj_xrange
  195. yrange          t_obj   2,0,0,0,        obj_yrange
  196. trange          t_obj   2,0,0,0,        obj_trange
  197. tstep           t_obj   1,0,0,0,        obj_tstep
  198. tsteps          t_obj   1,0,0,0,        obj_tstep
  199. plotstep        t_obj   1,0,0,0,        obj_tstep
  200. plotsteps       t_obj   1,0,0,0,        obj_tstep
  201. plot            t_obj   0,-1,0,1,       obj_plot
  202. plotjump        t_obj   1,0,0,0,        obj_plotjump
  203. levelcurve      t_obj   0,-1,0,1,       obj_levelcurve
  204. levelstep       t_obj   1,0,0,0,        obj_levelstep
  205. animstep        t_obj   1,0,0,0,        obj_animstep
  206. wims_linecount  t_obj   1,0,0,0,        obj_linecount
  207. wims_end        t_obj   0,0,0,0,        obj_end
  208. setmatrix       t_obj   5,0,0,0,        obj_setmatrix
  209. resetmatrix     t_obj   1,0,0,0,        obj_resetmatrix
  210. setvector       t_obj   3,0,0,0,        obj_setvector
  211. resetvector     t_obj   1,0,0,0,        obj_resetvector
  212. settransform    t_obj   7,0,0,0,        obj_settransform
  213. resettransform  t_obj   1,0,0,0,        obj_resettransform
  214. setparallelogram        t_obj   6,0,0,0,        obj_setparallelogram
  215. resetparallelogram      t_obj   0,0,0,0,        obj_resetparallelogram
  216. multicopy       t_obj   0,0,0,0,        obj_multicopy
  217. vimgfile        t_obj   0,0,0,0,        obj_vimgfile
  218. vimg            t_obj   1,0,0,0,        obj_vimg
  219. tikzfile                t_obj   0,0,0,0,        obj_tikzfile
  220. @
  221. `
  222. namecolor=`awk 'NF==2 {print $1"        t_color \""$2"\""}' colors`
  223. namelist=`sort -k 1,1 <<@ | uniq
  224. $namecolor
  225. $names
  226. @
  227. `
  228.  
  229. o_list=`echo "$namelist" | grep t_obj | awk '{print substr($4,5)}' | sort | uniq`
  230.  
  231. cd `dirname $0`
  232. echo "$header" >nametab.c
  233. for o in $o_list
  234. do
  235.  echo "void obj_$o(objparm *pm);" >>nametab.c
  236. done
  237.  
  238. tab=tab
  239. no=_no
  240. for t in $tablist
  241. do
  242.  eval def='$'$t'struct'
  243.  list=`echo "$namelist" | grep t_$t`
  244.  ll=`echo "$list" | awk '
  245.         NF>1 {print "{\""$1"\", "$3" "$4" "$5"},"}
  246.         '`
  247.  echo "$list" | awk '
  248.         BEGIN {a=0};
  249.         NF>1 {print "\""$1"\",  ",$2",  "a; a=a+1;};
  250. '>.nametab.$t
  251.  echo "struct $t$tab $t$tab[]={
  252. $ll
  253. };
  254.  
  255. int $t$no=(sizeof($t$tab)/sizeof($t$tab[0]));
  256. " >>nametab.c
  257. done
  258.  
  259. list=`cat .nametab.* | sort -k 1,1 | awk '{print "{"$0"},"}'`
  260. cat <<@ >>nametab.c
  261. struct nametab nametab[]={
  262. $list
  263. };
  264.  
  265. int nametab_no=(sizeof(nametab)/sizeof(nametab[0]));
  266.  
  267. @
  268.  
  269. rm -f .nametab.* >/dev/null 2>&1
  270.