home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume40 / gnuplot / part26 < prev    next >
Text File  |  1993-10-24  |  83KB  |  2,922 lines

  1. Newsgroups: comp.sources.misc
  2. From: woo@playfair.stanford.edu ("Alexander Woo")
  3. Subject: v40i038:  gnuplot - interactive function plotting utility, Part26/33
  4. Message-ID: <1993Oct25.025925.2074@sparky.sterling.com>
  5. X-Md4-Signature: 7441b8a628a8d3886f351b64b8c4f058
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 25 Oct 1993 02:59:25 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
  12. Posting-number: Volume 40, Issue 38
  13. Archive-name: gnuplot/part26
  14. Environment: UNIX, MS-DOS, VMS
  15. Supersedes: gnuplot3: Volume 24, Issue 23-48
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  gnuplot/demo/hemisphr.dat gnuplot/demo/polar.dat
  22. #   gnuplot/docs/gnuplot.1 gnuplot/os2/gnupmdrv.c gnuplot/term/README
  23. #   gnuplot/term/ai.trm gnuplot/term/hp2648.trm gnuplot/term/pbm.trm
  24. #   gnuplot/term/pm.trm gnuplot/term/tek.trm gnuplot/term/texdraw.trm
  25. # Wrapped by kent@sparky on Wed Oct 20 17:14:59 1993
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 26 (of 33)."'
  29. if test -f 'gnuplot/demo/hemisphr.dat' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'gnuplot/demo/hemisphr.dat'\"
  31. else
  32.   echo shar: Extracting \"'gnuplot/demo/hemisphr.dat'\" \(6975 characters\)
  33.   sed "s/^X//" >'gnuplot/demo/hemisphr.dat' <<'END_OF_FILE'
  34. X0.687151 -0.636061 0.351070
  35. X0.641845 -0.232436 0.730759
  36. X0.273514 -0.848211 0.453572
  37. X-0.550699 0.813122 0.188582
  38. X-0.347821 0.841382 0.413639
  39. X-0.829282 -0.509933 0.228604
  40. X0.399696 0.466770 0.788903
  41. X0.736650 0.020192 0.675973
  42. X-0.274921 -0.182391 0.944008
  43. X0.222153 -0.841996 0.491621
  44. X-0.461820 -0.755197 0.465189
  45. X0.294122 0.670369 0.681247
  46. X0.261892 0.211723 0.941587
  47. X-0.554902 0.477345 0.681341
  48. X-0.316651 -0.647984 0.692711
  49. X0.940858 -0.324848 0.096228
  50. X0.455903 -0.594463 0.662394
  51. X0.144714 -0.941617 0.304000
  52. X-0.417407 0.068704 0.906119
  53. X0.227478 -0.641231 0.732855
  54. X-0.636961 -0.237343 0.733450
  55. X0.302450 -0.701212 0.645620
  56. X0.355187 0.625974 0.694261
  57. X0.126868 0.938774 0.320325
  58. X-0.198825 -0.825277 0.528571
  59. X-0.605855 0.466076 0.644758
  60. X-0.979983 0.196939 0.029143
  61. X0.730081 -0.677485 0.089423
  62. X-0.733658 -0.065519 0.676353
  63. X0.593833 -0.583880 0.553576
  64. X0.630038 -0.757773 0.169798
  65. X0.214063 0.953829 0.210682
  66. X-0.210639 0.045720 0.976494
  67. X0.502269 -0.672584 0.543467
  68. X-0.713914 -0.019685 0.699956
  69. X-0.102652 0.225742 0.968764
  70. X-0.575935 0.679368 0.454707
  71. X-0.552680 0.325656 0.767133
  72. X-0.105718 0.489948 0.865318
  73. X-0.642008 0.237217 0.729077
  74. X0.912208 -0.302322 0.276546
  75. X0.685076 0.723350 0.086233
  76. X-0.730777 -0.226034 0.644107
  77. X-0.733895 -0.430285 0.525597
  78. X0.643521 -0.710952 0.283598
  79. X0.206564 0.497907 0.842271
  80. X-0.388945 -0.813833 0.431738
  81. X0.514538 -0.817664 0.258216
  82. X0.658314 0.496308 0.565952
  83. X0.588167 0.708096 0.390716
  84. X0.552130 0.427566 0.715779
  85. X-0.705121 0.320760 0.632390
  86. X-0.689813 0.688923 0.222582
  87. X0.553844 0.711779 0.432004
  88. X-0.046413 0.212599 0.976037
  89. X0.399406 -0.766162 0.503458
  90. X-0.233463 -0.160645 0.959004
  91. X0.529336 -0.621840 0.577163
  92. X0.606825 0.629365 0.485451
  93. X0.501835 0.612707 0.610534
  94. X-0.683857 0.450334 0.574055
  95. X-0.882283 0.443548 0.157614
  96. X0.586683 0.464120 0.663623
  97. X-0.595482 0.233864 0.768576
  98. X0.237607 -0.846347 0.476696
  99. X-0.409129 0.625441 0.664407
  100. X0.664685 -0.741902 0.088182
  101. X-0.588147 -0.803628 0.090915
  102. X-0.682428 -0.728175 0.063668
  103. X0.540892 0.542901 0.642413
  104. X0.117736 -0.786009 0.606900
  105. X0.846712 -0.474373 0.240934
  106. X-0.739743 -0.661408 0.123773
  107. X-0.674807 -0.295222 0.676373
  108. X0.612938 0.564586 0.552766
  109. X-0.200352 -0.584274 0.786437
  110. X-0.583626 -0.608199 0.538028
  111. X-0.842820 -0.537921 0.017206
  112. X-0.914848 -0.365948 0.170690
  113. X-0.722029 -0.691806 0.008805
  114. X-0.749203 0.647075 0.141379
  115. X0.542856 0.713704 0.442644
  116. X0.708415 0.597082 0.376353
  117. X-0.514737 -0.622752 0.589258
  118. X0.517661 -0.651774 0.554273
  119. X0.964970 -0.229158 0.127752
  120. X-0.896947 -0.320221 0.304868
  121. X-0.806679 0.191888 0.558970
  122. X-0.449889 0.492534 0.744990
  123. X-0.121829 0.701839 0.701840
  124. X-0.136385 -0.726159 0.673864
  125. X0.141310 0.776791 0.613700
  126. X0.730240 0.567015 0.381108
  127. X-0.096403 0.876852 0.470997
  128. X-0.407930 0.721095 0.560014
  129. X-0.617285 0.119734 0.777575
  130. X-0.516675 0.784493 0.342954
  131. X-0.409966 -0.414935 0.812254
  132. X0.172975 0.141665 0.974685
  133. X-0.421979 0.745663 0.515674
  134. X-0.657963 -0.199035 0.726271
  135. X0.579425 0.685534 0.440805
  136. X-0.214461 0.856536 0.469418
  137. X0.809815 -0.403364 0.426025
  138. X-0.706903 0.588917 0.391745
  139. X0.585611 0.463666 0.664886
  140. X0.438727 0.698150 0.565779
  141. X-0.464391 -0.446944 0.764580
  142. X-0.657744 0.534413 0.530825
  143. X0.537112 -0.749640 0.386718
  144. X0.007187 -0.597134 0.802109
  145. X-0.356817 -0.675864 0.644895
  146. X0.682514 -0.090759 0.725216
  147. X-0.759950 -0.640982 0.107787
  148. X0.314462 0.320252 0.893618
  149. X0.794300 -0.091894 0.600535
  150. X0.231465 -0.737745 0.634159
  151. X-0.493894 -0.137710 0.858548
  152. X-0.636201 0.372391 0.675703
  153. X0.851855 -0.078785 0.517819
  154. X-0.252937 0.823486 0.507832
  155. X-0.501036 -0.558527 0.661068
  156. X-0.667380 -0.740968 0.074628
  157. X0.826057 -0.356650 0.436383
  158. X0.676558 0.736342 0.008355
  159. X0.356317 0.717007 0.599115
  160. X-0.702754 -0.252940 0.664950
  161. X0.241305 0.873806 0.422179
  162. X-0.444469 0.694911 0.565284
  163. X0.285538 0.893811 0.345789
  164. X-0.816376 -0.543964 0.193993
  165. X0.411338 -0.215215 0.885711
  166. X-0.685665 0.175779 0.706375
  167. X-0.370169 -0.144937 0.917588
  168. X0.415254 -0.282774 0.864640
  169. X0.342285 -0.791855 0.505773
  170. X-0.442990 -0.543366 0.713101
  171. X0.737523 0.300789 0.604637
  172. X-0.648119 0.560986 0.515012
  173. X0.832393 -0.080222 0.548349
  174. X-0.745494 -0.022420 0.666135
  175. X-0.343740 -0.929656 0.132602
  176. X0.632050 -0.340980 0.695878
  177. X-0.670904 0.696398 0.254790
  178. X-0.691893 -0.369253 0.620433
  179. X-0.644716 -0.667477 0.372578
  180. X0.511738 -0.534049 0.672990
  181. X0.542618 -0.778095 0.316437
  182. X-0.369727 -0.900054 0.230662
  183. X-0.681421 -0.572227 0.456313
  184. X0.200343 -0.968269 0.149389
  185. X-0.897349 0.345346 0.274776
  186. X-0.524090 -0.266174 0.809000
  187. X-0.863974 0.483194 0.141680
  188. X-0.549403 -0.740878 0.386336
  189. X0.206515 -0.791156 0.575694
  190. X-0.617364 0.470918 0.630157
  191. X0.964888 0.246811 0.089862
  192. X0.681090 0.695442 0.229080
  193. X-0.635200 -0.708299 0.307949
  194. X0.388299 0.158032 0.907882
  195. X0.573002 0.727986 0.376438
  196. X0.601183 -0.586111 0.543188
  197. X-0.235470 -0.811948 0.534130
  198. X0.155904 -0.681863 0.714672
  199. X-0.672889 0.588006 0.448852
  200. X0.306393 0.874114 0.376892
  201. X0.032428 0.271616 0.961859
  202. X0.107372 0.155924 0.981916
  203. X0.592487 0.224923 0.773543
  204. X-0.585302 -0.568462 0.578163
  205. X0.663301 0.728159 0.172675
  206. X-0.513634 0.781053 0.355157
  207. X0.810010 -0.386643 0.440898
  208. X-0.139469 0.655629 0.742091
  209. X0.621210 0.615790 0.484666
  210. X-0.051261 0.216594 0.974915
  211. X0.658176 -0.726097 0.198966
  212. X0.603351 0.247584 0.758070
  213. X0.686614 -0.089142 0.721537
  214. X0.226818 0.552577 0.802005
  215. X-0.741481 0.327178 0.585799
  216. X-0.366696 0.771805 0.519472
  217. X0.238979 0.647361 0.723749
  218. X-0.672754 -0.332136 0.661126
  219. X0.696711 -0.471073 0.541004
  220. X0.160743 0.905419 0.392909
  221. X-0.912978 0.232968 0.334959
  222. X-0.285567 -0.185395 0.940255
  223. X-0.619693 -0.706342 0.342142
  224. X0.382874 0.892396 0.238822
  225. X-0.381917 0.512306 0.769209
  226. X-0.652722 -0.575238 0.493006
  227. X0.240731 0.522574 0.817902
  228. X-0.047170 0.578270 0.814481
  229. X-0.769256 0.592413 0.239359
  230. X0.517803 -0.372629 0.770083
  231. X0.879867 -0.153159 0.449862
  232. X-0.408953 0.473917 0.779846
  233. X-0.611694 0.790628 0.027172
  234. X0.082968 0.088643 0.992602
  235. X0.329262 0.745222 0.579854
  236. X-0.093733 0.752980 0.651334
  237. X-0.876795 -0.216424 0.429408
  238. X0.659021 0.742999 0.116803
  239. X0.471778 -0.608160 0.638410
  240. X-0.771241 0.625579 0.117638
  241. X0.666548 0.601906 0.439799
  242. X-0.177481 -0.887762 0.424711
  243. X-0.544219 -0.682418 0.487987
  244. X-0.232865 0.617965 0.750929
  245. X-0.761795 -0.037050 0.646758
  246. X0.261925 0.847441 0.461778
  247. X-0.447484 -0.545276 0.708824
  248. X-0.005218 -0.773747 0.633474
  249. X0.216045 0.575576 0.788693
  250. X-0.018365 0.656245 0.754325
  251. X0.305420 0.594325 0.743973
  252. X-0.508168 -0.512279 0.692341
  253. X0.478855 0.493185 0.726269
  254. X0.451841 0.584772 0.673707
  255. X0.253152 -0.875528 0.411540
  256. X-0.653601 0.507497 0.561474
  257. X0.486897 0.719655 0.495003
  258. X0.497595 -0.353890 0.791935
  259. X-0.044254 -0.938949 0.341197
  260. X-0.781823 -0.038665 0.622300
  261. X-0.486930 -0.527387 0.696249
  262. X0.869944 -0.440150 0.222408
  263. X0.279697 0.693758 0.663679
  264. X0.593555 0.421221 0.685759
  265. X0.519810 -0.396648 0.756616
  266. X-0.862087 0.275232 0.425503
  267. X0.237904 -0.755351 0.610612
  268. X-0.614121 -0.664634 0.425579
  269. X0.328900 0.035730 0.943689
  270. X0.769607 0.633896 0.076682
  271. X-0.575359 -0.794269 0.195191
  272. X-0.608405 0.637947 0.472087
  273. X-0.658203 0.089686 0.747479
  274. X-0.913833 -0.389451 0.115050
  275. X0.272020 -0.871201 0.408673
  276. X-0.519856 -0.851058 0.073831
  277. X0.411266 0.672267 0.615563
  278. X0.686633 0.578928 0.439747
  279. X-0.097612 -0.192980 0.976335
  280. X-0.710703 -0.205920 0.672680
  281. X-0.622197 0.068071 0.779896
  282. X-0.296696 0.405710 0.864506
  283. END_OF_FILE
  284.   if test 6975 -ne `wc -c <'gnuplot/demo/hemisphr.dat'`; then
  285.     echo shar: \"'gnuplot/demo/hemisphr.dat'\" unpacked with wrong size!
  286.   fi
  287.   # end of 'gnuplot/demo/hemisphr.dat'
  288. fi
  289. if test -f 'gnuplot/demo/polar.dat' -a "${1}" != "-c" ; then 
  290.   echo shar: Will not clobber existing file \"'gnuplot/demo/polar.dat'\"
  291. else
  292.   echo shar: Extracting \"'gnuplot/demo/polar.dat'\" \(6598 characters\)
  293.   sed "s/^X//" >'gnuplot/demo/polar.dat' <<'END_OF_FILE'
  294. X#
  295. X# $Id: polar.dat 3.38.2.6 1992/11/14 02:25:21 woo Exp $
  296. X#
  297. X# Input data ncmain.d4 generated by genpat2.f:Tx antenna pattern
  298. X# x,y,z of center point B in coord 3
  299. X#     -5.12000     0.00000    -1.50000  
  300. X# euler matrix
  301. X#      0.00000    -1.00000     0.00000  
  302. X#      0.70710     0.00000     0.70710  
  303. X#     -0.70710     0.00000     0.70710  
  304. X#  theta(deg)    phi(deg)  E-theta(dB)  phase     E-phi(dB)    phase
  305. X      0.000      0.000   -200.000      0.000     18.992      0.000 
  306. X      2.000      0.000   -200.000      0.000     18.898      0.000 
  307. X      4.000      0.000   -200.000      0.000     18.619      0.000 
  308. X      6.000      0.000   -200.000      0.000     18.152      0.000 
  309. X      8.000      0.000   -200.000      0.000     17.497      0.000 
  310. X     10.000      0.000   -200.000      0.000     16.651      0.000 
  311. X     12.000      0.000   -200.000      0.000     15.614      0.000 
  312. X     14.000      0.000   -200.000      0.000     14.382      0.000 
  313. X     16.000      0.000   -200.000      0.000     12.952      0.000 
  314. X     18.000      0.000   -200.000      0.000     11.320      0.000 
  315. X     20.000      0.000   -200.000      0.000      9.483      0.000 
  316. X     22.000      0.000   -200.000      0.000      7.434      0.000 
  317. X     24.000      0.000   -200.000      0.000      5.169      0.000 
  318. X     26.000      0.000   -200.000      0.000      2.680      0.000 
  319. X     28.000      0.000   -200.000      0.000     -0.039      0.000 
  320. X     30.000      0.000   -200.000      0.000     -2.998      0.000 
  321. X     32.000      0.000   -200.000      0.000     -6.204      0.000 
  322. X     34.000      0.000   -200.000      0.000     -9.670      0.000 
  323. X     36.000      0.000   -200.000      0.000    -13.407      0.000 
  324. X     38.000      0.000   -200.000      0.000    -17.429      0.000 
  325. X     40.000      0.000   -200.000      0.000    -21.751      0.000 
  326. X     42.000      0.000   -200.000      0.000    -26.391      0.000 
  327. X     44.000      0.000   -200.000      0.000    -31.368      0.000 
  328. X     46.000      0.000   -200.000      0.000    -36.705      0.000 
  329. X     48.000      0.000   -200.000      0.000    -42.429      0.000 
  330. X     50.000      0.000   -200.000      0.000    -48.569      0.000 
  331. X     52.000      0.000   -200.000      0.000    -55.160      0.000 
  332. X     54.000      0.000   -200.000      0.000    -62.243      0.000 
  333. X     56.000      0.000   -200.000      0.000    -69.867      0.000 
  334. X     58.000      0.000   -200.000      0.000    -78.087      0.000 
  335. X     60.000      0.000   -200.000      0.000    -86.971      0.000 
  336. X     62.000      0.000   -200.000      0.000    -96.602      0.000 
  337. X     64.000      0.000   -200.000      0.000   -107.080      0.000 
  338. X     66.000      0.000   -200.000      0.000   -118.530      0.000 
  339. X     68.000      0.000   -200.000      0.000   -131.110      0.000 
  340. X     70.000      0.000   -200.000      0.000   -145.022      0.000 
  341. X     72.000      0.000   -200.000      0.000   -160.534      0.000 
  342. X     74.000      0.000   -200.000      0.000   -177.982      0.000 
  343. X     76.000      0.000   -200.000      0.000   -195.848      0.000 
  344. X     78.000      0.000   -200.000      0.000   -199.967      0.000 
  345. X     80.000      0.000   -200.000      0.000   -200.000      0.000 
  346. X     82.000      0.000   -200.000      0.000   -200.000      0.000 
  347. X     84.000      0.000   -200.000      0.000   -200.000      0.000 
  348. X     86.000      0.000   -200.000      0.000   -200.000      0.000 
  349. X     88.000      0.000   -200.000      0.000   -200.000      0.000 
  350. X     90.000      0.000   -200.000      0.000   -200.000      0.000 
  351. X     92.000      0.000   -200.000      0.000   -200.000      0.000 
  352. X     94.000      0.000   -200.000      0.000   -200.000      0.000 
  353. X     96.000      0.000   -200.000      0.000   -200.000      0.000 
  354. X     98.000      0.000   -200.000      0.000   -200.000      0.000 
  355. X    100.000      0.000   -200.000      0.000   -200.000      0.000 
  356. X    102.000      0.000   -200.000      0.000   -200.000      0.000 
  357. X    104.000      0.000   -200.000      0.000   -200.000      0.000 
  358. X    106.000      0.000   -200.000      0.000   -200.000      0.000 
  359. X    108.000      0.000   -200.000      0.000   -200.000      0.000 
  360. X    110.000      0.000   -200.000      0.000   -200.000      0.000 
  361. X    112.000      0.000   -200.000      0.000   -200.000      0.000 
  362. X    114.000      0.000   -200.000      0.000   -200.000      0.000 
  363. X    116.000      0.000   -200.000      0.000   -200.000      0.000 
  364. X    118.000      0.000   -200.000      0.000   -200.000      0.000 
  365. X    120.000      0.000   -200.000      0.000   -200.000      0.000 
  366. X    122.000      0.000   -200.000      0.000   -200.000      0.000 
  367. X    124.000      0.000   -200.000      0.000   -200.000      0.000 
  368. X    126.000      0.000   -200.000      0.000   -200.000      0.000 
  369. X    128.000      0.000   -200.000      0.000   -200.000      0.000 
  370. X    130.000      0.000   -200.000      0.000   -200.000      0.000 
  371. X    132.000      0.000   -200.000      0.000   -200.000      0.000 
  372. X    134.000      0.000   -200.000      0.000   -200.000      0.000 
  373. X    136.000      0.000   -200.000      0.000   -200.000      0.000 
  374. X    138.000      0.000   -200.000      0.000   -200.000      0.000 
  375. X    140.000      0.000   -200.000      0.000   -200.000      0.000 
  376. X    142.000      0.000   -200.000      0.000   -200.000      0.000 
  377. X    144.000      0.000   -200.000      0.000   -200.000      0.000 
  378. X    146.000      0.000   -200.000      0.000   -200.000      0.000 
  379. X    148.000      0.000   -200.000      0.000   -200.000      0.000 
  380. X    150.000      0.000   -200.000      0.000   -200.000      0.000 
  381. X    152.000      0.000   -200.000      0.000   -200.000      0.000 
  382. X    154.000      0.000   -200.000      0.000   -200.000      0.000 
  383. X    156.000      0.000   -200.000      0.000   -200.000      0.000 
  384. X    158.000      0.000   -200.000      0.000   -200.000      0.000 
  385. X    160.000      0.000   -200.000      0.000   -200.000      0.000 
  386. X    162.000      0.000   -200.000      0.000   -200.000      0.000 
  387. X    164.000      0.000   -200.000      0.000   -200.000      0.000 
  388. X    166.000      0.000   -200.000      0.000   -200.000      0.000 
  389. X    168.000      0.000   -200.000      0.000   -200.000      0.000 
  390. X    170.000      0.000   -200.000      0.000   -200.000      0.000 
  391. X    172.000      0.000   -200.000      0.000   -200.000      0.000 
  392. X    174.000      0.000   -200.000      0.000   -200.000      0.000 
  393. X    176.000      0.000   -200.000      0.000   -200.000      0.000 
  394. X    178.000      0.000   -200.000      0.000   -200.000      0.000 
  395. X    180.000      0.000   -200.000      0.000   -200.000      0.000 
  396. END_OF_FILE
  397.   if test 6598 -ne `wc -c <'gnuplot/demo/polar.dat'`; then
  398.     echo shar: \"'gnuplot/demo/polar.dat'\" unpacked with wrong size!
  399.   fi
  400.   # end of 'gnuplot/demo/polar.dat'
  401. fi
  402. if test -f 'gnuplot/docs/gnuplot.1' -a "${1}" != "-c" ; then 
  403.   echo shar: Will not clobber existing file \"'gnuplot/docs/gnuplot.1'\"
  404. else
  405.   echo shar: Extracting \"'gnuplot/docs/gnuplot.1'\" \(7472 characters\)
  406.   sed "s/^X//" >'gnuplot/docs/gnuplot.1' <<'END_OF_FILE'
  407. X.\" dummy line
  408. X.TH GNUPLOT 1 "31 August 1990"
  409. X.UC 4
  410. X.SH NAME
  411. Xgnuplot \- an interactive plotting program
  412. X.SH SYNOPSIS
  413. X.B gnuplot
  414. X[ X11 options ] [file ...]
  415. X.br
  416. X.SH DESCRIPTION
  417. X.I Gnuplot
  418. Xis a command-driven interactive function plotting program.
  419. X.PP
  420. XIf files are given,
  421. X.I gnuplot
  422. Xloads each file with the
  423. X.I load
  424. Xcommand, in the order specified.
  425. X.I Gnuplot
  426. Xexits after the last file is processed.
  427. X.PP
  428. XHere are some of its features:
  429. X.PP
  430. XPlots any number of functions, built up of C operators, C library
  431. Xfunctions, and some things C doesn't have like **, sgn(), etc.  Also
  432. Xsupport for plotting data files, to compare actual
  433. Xdata to theoretical curves.
  434. X.PP
  435. XUser-defined X and Y ranges (optional auto-ranging), smart axes scaling,
  436. Xsmart tic marks.
  437. X.PP
  438. XLabelling of X and Y axes.
  439. X.PP
  440. XUser-defined constants and functions.
  441. X.PP
  442. XSupport through a generalized graphics driver for
  443. XAED 512,
  444. XAED 767,
  445. XBBN BitGraph,
  446. XCommodore Amiga,
  447. XRoland DXY800A,
  448. XEEPIC,
  449. XTeXDraw,
  450. XEmTeX,
  451. XEpson 60dpi printers,
  452. XEpson LX-800,
  453. XFig,
  454. XHP2623,
  455. XHP2648,
  456. XHP75xx,
  457. XHPGL,
  458. XHP LaserJet II,
  459. XImagen,
  460. XIris 4D,
  461. XMS-DOS Kermit,
  462. XKyocera laser printer,
  463. XLaTeX,
  464. XNEC CP6 pinwriter,
  465. XPostScript,
  466. XQMS QUIC,
  467. XReGis (VT125 and VT2xx),
  468. XSCO Xenix CGI,
  469. XSelanar,
  470. XStar color printer,
  471. XTandy DMP-130 printer,
  472. XTek 401x,
  473. XTek 410x,
  474. XVectrix 384,
  475. XVT like Tektronix emulator,
  476. XUnix PC (ATT 3b1 or ATT 7300),
  477. Xunixplot,
  478. Xand X11.
  479. XThe PC version compiled by Microsoft C
  480. Xsupports IBM CGA, EGA, VGA, Hercules, ATT 6300,
  481. Xand Corona 325 graphics.
  482. XThe PC version compiled by Borland C++
  483. Xsupports IBM CGA, EGA, MCGA, VGA, Hercules and ATT 6300 graphics.
  484. XOther devices can be added simply, but will require recompiling.
  485. X.PP
  486. XShell escapes and command line substitution.
  487. X.PP
  488. XLoad and save capability.
  489. X.PP
  490. XOutput redirection.
  491. X.PP
  492. XAll computations performed in the complex domain.  Just the real part is
  493. Xplotted by default, but functions like imag() and abs() and arg() are
  494. Xavailable to override this.
  495. X.SH X11 OPTIONS
  496. X.I Gnuplot
  497. Xprovides the \fIx11\fP terminal type for use
  498. Xwith X servers. This terminal type is set automatically at startup if
  499. Xthe \fBDISPLAY\fR environment variable is set, if the \fBTERM\fR environment
  500. Xvariable is set to \fBxterm\fR, or if the \fB\-display\fR command line
  501. Xoption is used.
  502. XFor terminal type \fIx11\fR, \fIgnuplot\fP
  503. Xaccepts the standard X Toolkit options and resources such as geometry, font,
  504. Xand background. See the X(1) man page for a description of
  505. Xthe options.
  506. XIn addition to the X Toolkit options:
  507. X.PP
  508. X\fB\-mono\fP forces monochrome rendering on color displays.
  509. X.PP
  510. X\fB\-gray\fP requests grayscale rendering on grayscale or color displays.
  511. X(Grayscale displays receive monochrome rendering by default.)
  512. X.PP
  513. X\fB\-clear\fP requests that the window be cleared momentarily before a
  514. Xnew plot is displayed.
  515. X.PP
  516. X\fB\-tvtwm\fP requests that geometry specifications
  517. Xfor position of the window be made relative to the currently displayed
  518. Xportion of the virtual root.
  519. X.PP
  520. XThese options may also be controlled with resources in your \fB.Xdefaults\fR
  521. Xfile.
  522. XFor example: \fBgnuplot*gray: on\fP .
  523. X.PP
  524. X\fIGnuplot\fP provides a command line option (\fB\-pointsize \fIv\fR) and
  525. Xa resource (\fBgnuplot*pointsize: \fIv\fR) to control the size of points
  526. Xplotted with the "points" plotting style. The value \fIv\fR is a real
  527. Xnumber (greater than 0 and less than or equal to ten) used as a
  528. Xscaling factor for point sizes. For example, \fB\-pointsize 2\fR uses
  529. Xpoints twice the default size, and \fB\-pointsize 0.5\fR uses points
  530. Xhalf the normal size.
  531. X.PP
  532. XFor monochrome displays, \fIgnuplot\fR does not honor foreground or
  533. Xbackground colors. The default is black-on-white. \fB\-rv\fP or
  534. X\fBgnuplot*reverseVideo: on\fP requests white-on-black.
  535. X.PP
  536. XFor color displays \fIgnuplot\fP honors
  537. Xthe following resources (shown here with default values). The values
  538. Xmay be color names in the X11 rgb.txt file on your system, hexadecimal
  539. XRGB color specifications (see X11 documentation), or a color name
  540. Xfollowed by a comma and an \fIintensity\fR value from 0 to 1. For example,
  541. X\fBblue,.5\fR means a half intensity blue.
  542. X.sp
  543. X.B  "gnuplot*background: white"
  544. X.br
  545. X.B  "gnuplot*textColor: black"
  546. X.br
  547. X.B  "gnuplot*borderColor: black"
  548. X.br
  549. X.B  "gnuplot*axisColor: black"
  550. X.br
  551. X.B  "gnuplot*line1Color: red"
  552. X.br
  553. X.B  "gnuplot*line2Color: green"
  554. X.br
  555. X.B  "gnuplot*line3Color: blue"
  556. X.br
  557. X.B  "gnuplot*line4Color: magenta"
  558. X.br
  559. X.B  "gnuplot*line5Color: cyan"
  560. X.br
  561. X.B  "gnuplot*line6Color: sienna"
  562. X.br
  563. X.B  "gnuplot*line7Color: orange"
  564. X.br
  565. X.B  "gnuplot*line8Color: coral"
  566. X.br
  567. X
  568. XWhen \fB\-gray\fP is selected, \fIgnuplot\fP honors
  569. Xthe following resources for grayscale or color displays (shown here with
  570. Xdefault values). Note that the default background is black.
  571. X.sp
  572. X.B  "gnuplot*background: black"
  573. X.br
  574. X.B  "gnuplot*textGray: white"
  575. X.br
  576. X.B  "gnuplot*borderGray: gray50"
  577. X.br
  578. X.B  "gnuplot*axisGray: gray50"
  579. X.br
  580. X.B  "gnuplot*line1Gray: gray100"
  581. X.br
  582. X.B  "gnuplot*line2Gray: gray60"
  583. X.br
  584. X.B  "gnuplot*line3Gray: gray80"
  585. X.br
  586. X.B  "gnuplot*line4Gray: gray40"
  587. X.br
  588. X.B  "gnuplot*line5Gray: gray90"
  589. X.br
  590. X.B  "gnuplot*line6Gray: gray50"
  591. X.br
  592. X.B  "gnuplot*line7Gray: gray70"
  593. X.br
  594. X.B  "gnuplot*line8Gray: gray30"
  595. X.br
  596. X
  597. X\fIGnuplot\fP honors the following resources for setting the width in
  598. Xpixels of plot lines (shown here with default values.) 0 or 1 means
  599. Xa minimal width line of 1 pixel width. A value of 2 or 3 may
  600. Ximprove the  appearance of some plots.
  601. X.sp
  602. X.br
  603. X.B  "gnuplot*borderWidth: 2"
  604. X.br
  605. X.B  "gnuplot*axisWidth: 0"
  606. X.br
  607. X.B  "gnuplot*line1Width: 0"
  608. X.br
  609. X.B  "gnuplot*line2Width: 0"
  610. X.br
  611. X.B  "gnuplot*line3Width: 0"
  612. X.br
  613. X.B  "gnuplot*line4Width: 0"
  614. X.br
  615. X.B  "gnuplot*line5Width: 0"
  616. X.br
  617. X.B  "gnuplot*line6Width: 0"
  618. X.br
  619. X.B  "gnuplot*line7Width: 0"
  620. X.br
  621. X.B  "gnuplot*line8Width: 0"
  622. X.br
  623. X
  624. X\fIGnuplot\fP honors the following resources for setting the dash style
  625. Xused for plotting lines.  0 means a solid line. A 2 digit number \fIjk\fR
  626. X(\fIj\fP and \fIk\fP are >= 1  and <= 9) means a dashed line with a
  627. Xrepeated pattern of \fIj\fR pixels on followed by \fIk\fR pixels off.
  628. XFor example, '16' is a "dotted" line with 1 pixel on followed by 6 pixels
  629. Xoff.  More elaborate on/off patterns can be specified with a 4 digit value.
  630. XFor example, '4441' is 4 on, 4 off, 4 on, 1 off. The default values shown
  631. Xbelow are for monochrome displays or monochrome rendering on color or
  632. Xgrayscale displays. For color displays, the defaults for all are 0
  633. X(solid line) except for \fBaxisDashes\fR which defaults to a '16' dotted
  634. Xline.
  635. X.sp
  636. X.br
  637. X.B  "gnuplot*borderDashes: 0"
  638. X.br
  639. X.B  "gnuplot*axisDashes: 16"
  640. X.br
  641. X.B  "gnuplot*line1Dashes: 0"
  642. X.br
  643. X.B  "gnuplot*line2Dashes: 42"
  644. X.br
  645. X.B  "gnuplot*line3Dashes: 13"
  646. X.br
  647. X.B  "gnuplot*line4Dashes: 44"
  648. X.br
  649. X.B  "gnuplot*line5Dashes: 15"
  650. X.br
  651. X.B  "gnuplot*line6Dashes: 4441"
  652. X.br
  653. X.B  "gnuplot*line7Dashes: 42"
  654. X.br
  655. X.B  "gnuplot*line8Dashes: 13"
  656. X.br
  657. X.PP
  658. XThe size or aspect ratio of a plot may be changed by resizing the
  659. X.I gnuplot
  660. Xwindow.
  661. X.SH AUTHORS
  662. XThomas Williams, Pixar Corporation,
  663. X.br
  664. X(info-gnuplot@dartmouth.edu)
  665. X.br
  666. Xand Colin Kelley.
  667. X.PP
  668. XAdditions for labelling by Russell Lang, Monash University, Australia.
  669. X.br
  670. X(rjl@monu1.cc.monash.edu.au)
  671. X.br
  672. XFurther additions by David Kotz, Dartmouth College, New Hampshire, USA
  673. X(formerly of Duke University, North Carolina, USA).
  674. X.br
  675. X(David.Kotz@Dartmouth.edu)
  676. X.SH BUGS
  677. XThe atan() function does not work correctly for complex arguments.
  678. X.br
  679. XThe bessel functions do not work for complex arguments.
  680. X.br
  681. XSee the
  682. X.I help bugs
  683. Xcommand in gnuplot.
  684. X.SH SEE ALSO
  685. XSee the printed manual or the on-line help for details on specific commands.
  686. X.br
  687. XX(1).
  688. END_OF_FILE
  689.   if test 7472 -ne `wc -c <'gnuplot/docs/gnuplot.1'`; then
  690.     echo shar: \"'gnuplot/docs/gnuplot.1'\" unpacked with wrong size!
  691.   fi
  692.   # end of 'gnuplot/docs/gnuplot.1'
  693. fi
  694. if test -f 'gnuplot/os2/gnupmdrv.c' -a "${1}" != "-c" ; then 
  695.   echo shar: Will not clobber existing file \"'gnuplot/os2/gnupmdrv.c'\"
  696. else
  697.   echo shar: Extracting \"'gnuplot/os2/gnupmdrv.c'\" \(6295 characters\)
  698.   sed "s/^X//" >'gnuplot/os2/gnupmdrv.c' <<'END_OF_FILE'
  699. X#ifdef INCRCSDATA
  700. Xstatic char RCSid[]="$Id: gnupmdrv.c%v 3.50 1993/07/09 05:35:24 woo Exp $" ;
  701. X#endif
  702. X
  703. X/****************************************************************************
  704. X
  705. X    PROGRAM: gnupmdrv
  706. X    
  707. X    Outboard PM driver for GNUPLOT 3.3
  708. X
  709. X    MODULE:  gnupmdrv.c
  710. X        
  711. X    This file contains the startup procedures for gnupmdrv
  712. X       
  713. X****************************************************************************/
  714. X
  715. X/*
  716. X * PM driver for GNUPLOT
  717. X * Copyright (C) 1992   Roger Fearick
  718. X *
  719. X * Permission to use, copy, and distribute this software and its
  720. X * documentation for any purpose with or without fee is hereby granted, 
  721. X * provided that the above copyright notice appear in all copies and 
  722. X * that both that copyright notice and this permission notice appear 
  723. X * in supporting documentation.
  724. X *
  725. X * Permission to modify the software is granted, but not the right to
  726. X * distribute the modified code.  Modifications are to be distributed 
  727. X * as patches to released version.
  728. X *  
  729. X * This software is provided "as is" without express or implied warranty.
  730. X * 
  731. X *
  732. X * AUTHOR
  733. X * 
  734. X *   Gnuplot driver for OS/2:  Roger Fearick
  735. X * 
  736. X * Send your comments or suggestions to 
  737. X *  info-gnuplot@dartmouth.edu.
  738. X * This is a mailing list; to join it send a note to 
  739. X *  info-gnuplot-request@dartmouth.edu.  
  740. X * Send bug reports to
  741. X *  bug-gnuplot@dartmouth.edu.
  742. X**/
  743. X
  744. X#define INCL_PM
  745. X#define INCL_WIN
  746. X#define INCL_SPL
  747. X#define INCL_SPLDOSPRINT
  748. X#define INCL_DOSMEMMGR
  749. X#define INCL_DOSPROCESS
  750. X#define INCL_DOSFILEMGR
  751. X#include <os2.h>
  752. X#include <string.h>
  753. X#include <stdio.h>
  754. X#include <stdlib.h>
  755. X#include "gnupmdrv.h"
  756. X
  757. X/*==== g l o b a l    d a t a ================================================*/
  758. X
  759. Xchar szIPCName[256] ;
  760. X#define IPCDEFAULT "gnuplot"
  761. X
  762. X/*==== l o c a l    d a t a ==================================================*/
  763. X
  764. X            /* class names for window registration */
  765. X
  766. Xstatic char szChildName []     = "Gnuchild" ;
  767. X
  768. X/*==== f u n c t i o n s =====================================================*/
  769. X
  770. XBOOL             QueryIni( HAB ) ;
  771. Xint              main( int, char** ) ;
  772. Xstatic HWND      InitHelp( HAB, HWND ) ;
  773. X
  774. X/*==== c o d e ===============================================================*/
  775. X
  776. Xint main ( int argc, char **argv )
  777. X/*
  778. X** args:  argv[1] : name to be used for IPC (pipes/semaphores) with gnuplot 
  779. X** 
  780. X** Standard PM initialisation:
  781. X** -- set up message processing loop
  782. X** -- register all window classes
  783. X** -- start up main window
  784. X** -- subclass main window for help and dde message trapping to frame window
  785. X** -- init help system
  786. X** -- check command line and open any filename found there
  787. X**
  788. X*/
  789. X    {
  790. X    static ULONG flFrameFlags = (FCF_ACCELTABLE|FCF_STANDARD);//&(~FCF_TASKLIST) ;
  791. X    static ULONG flClientFlags = WS_VISIBLE ;
  792. X    HMQ          hmq ;
  793. X    QMSG         qmsg ;
  794. X    PFNWP        pfnOldFrameWndProc ;
  795. X    HWND         hwndHelp ;        
  796. X    BOOL         bPos ;
  797. X
  798. X    if( argc <= 1 ) strcpy( szIPCName, IPCDEFAULT ) ;
  799. X    else            strcpy( szIPCName, argv[1] ) ; 
  800. X
  801. X    hab = WinInitialize( 0 ) ;    
  802. X    hmq = WinCreateMsgQueue( hab, 50 ) ;
  803. X
  804. X                // get defaults from gnupmdrv.ini
  805. X
  806. X    bPos = QueryIni( hab ) ;
  807. X                
  808. X                // register window and child window classes
  809. X
  810. X    if( ! WinRegisterClass( hab,        /* Exit if can't register */
  811. X                            APP_NAME,
  812. X                            (PFNWP)DisplayClientWndProc,
  813. X                            CS_SIZEREDRAW,
  814. X                            0 ) 
  815. X                            ) return 0L ;
  816. X
  817. X                // create main window
  818. X
  819. X    hwndFrame = WinCreateStdWindow (
  820. X                    HWND_DESKTOP,
  821. X                    0,//WS_VISIBLE,
  822. X                    &flFrameFlags,
  823. X                    APP_NAME,
  824. X                    NULL,
  825. X                    flClientFlags,
  826. X                    0L,
  827. X                    1,
  828. X                    &hApp) ;
  829. X
  830. X    if ( ! hwndFrame ) return NULL ;
  831. X
  832. X                // subclass window for help & DDE trapping
  833. X
  834. X    pfnOldFrameWndProc = WinSubclassWindow( hwndFrame, (PFNWP)NewFrameWndProc ) ;
  835. X    WinSetWindowULong( hwndFrame, QWL_USER, (ULONG) pfnOldFrameWndProc ) ;
  836. X
  837. X                // init the help manager
  838. X
  839. X    hwndHelp = InitHelp( hab, hwndFrame ) ;        
  840. X
  841. X                // set window title and make it active
  842. X
  843. X    WinSetWindowText( hwndFrame, APP_NAME ) ;
  844. X        
  845. X                // process window messages 
  846. X      
  847. X    while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
  848. X         WinDispatchMsg (hab, &qmsg) ;
  849. X
  850. X                // shut down
  851. X
  852. X    WinDestroyHelpInstance( hwndHelp ) ;
  853. X    WinDestroyWindow (hwndFrame) ;
  854. X    WinDestroyMsgQueue (hmq) ;
  855. X    WinTerminate (hab) ;
  856. X
  857. X    return 0 ;
  858. X    }
  859. X
  860. Xstatic HWND InitHelp( HAB hab, HWND hwnd )
  861. X/*
  862. X**  initialise the help system
  863. X*/
  864. X    {
  865. X    static HELPINIT helpinit = { sizeof(HELPINIT),
  866. X                                 0L,
  867. X                                 NULL,
  868. X                                 (PHELPTABLE)MAKELONG(1, 0xFFFF),
  869. X                                 0L,
  870. X                                 0L,
  871. X                                 0,
  872. X                                 0,
  873. X                                 "GnuplotPM Help",
  874. X                                 CMIC_HIDE_PANEL_ID,
  875. X                                 "gnupmdrv.hlp" } ;
  876. X    HWND hwndHelp ;
  877. X    
  878. X    hwndHelp = WinCreateHelpInstance( hab, &helpinit ) ;
  879. X    WinAssociateHelpInstance( hwndHelp, hwnd ) ;
  880. X    return hwndHelp ;
  881. X    }
  882. X
  883. XMRESULT EXPENTRY NewFrameWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
  884. X/*
  885. X**  Subclasses top-level frame window to trap help & dde messages
  886. X*/
  887. X    {
  888. X    PFNWP       pfnOldFrameWndProc ;
  889. X    
  890. X    pfnOldFrameWndProc = (PFNWP) WinQueryWindowULong( hwnd, QWL_USER ) ; 
  891. X    switch( msg ) {
  892. X        default: 
  893. X            break ;
  894. X
  895. X        case HM_QUERY_KEYS_HELP:
  896. X            return (MRESULT) IDH_KEYS ;            
  897. X        }
  898. X    return (*pfnOldFrameWndProc)(hwnd, msg, mp1, mp2) ;    
  899. X    }
  900. X
  901. X
  902. XMRESULT EXPENTRY About( HWND hDlg, ULONG message, MPARAM mp1, MPARAM mp2)
  903. X/*
  904. X** 'About' box dialog function
  905. X*/
  906. X    {
  907. X  /*  switch (message) {
  908. X
  909. X        case WM_COMMAND:
  910. X            if (SHORT1FROMMP(mp1) == DID_OK) {
  911. X                WinDismissDlg( hDlg, DID_OK );
  912. X                return 0L;
  913. X                }
  914. X            break;
  915. X        }*/
  916. X    return WinDefDlgProc( hDlg, message, mp1, mp2 ) ;
  917. X    }
  918. X
  919. END_OF_FILE
  920.   if test 6295 -ne `wc -c <'gnuplot/os2/gnupmdrv.c'`; then
  921.     echo shar: \"'gnuplot/os2/gnupmdrv.c'\" unpacked with wrong size!
  922.   fi
  923.   # end of 'gnuplot/os2/gnupmdrv.c'
  924. fi
  925. if test -f 'gnuplot/term/README' -a "${1}" != "-c" ; then 
  926.   echo shar: Will not clobber existing file \"'gnuplot/term/README'\"
  927. else
  928.   echo shar: Extracting \"'gnuplot/term/README'\" \(7115 characters\)
  929.   sed "s/^X//" >'gnuplot/term/README' <<'END_OF_FILE'
  930. XDOCUMENTATION FOR GNUPLOT TERMINAL DRIVER WRITERS
  931. XBy Russell Lang 1/90
  932. X
  933. XInformation on each terminal device driver is contained in term.c and
  934. Xthe term/*.trm files.  Each driver is contained in a .trm file and is 
  935. X#include'd into term.c.  Each driver has a set of initialisers in 
  936. Xterm.c for term_tbl[], an array of struct termentry.
  937. X
  938. XHere is the definition of the struct termentry from plot.h:
  939. X
  940. Xstruct termentry {
  941. X    char *name;
  942. X    char *description;
  943. X    unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
  944. X    FUNC_PTR options,init,reset,text,scale,graphics,move,vector,linetype,
  945. X        put_text,text_angle,justify_text,point,arrow;
  946. X};
  947. X
  948. XHere's a brief description of each variable:
  949. X
  950. XThe char *name is a pointer to a string containing the name
  951. Xof the terminal.  This name is used by the 'set terminal' and 
  952. X'show terminal' commands.  
  953. XThe name must be unique and must not be confused with an abbreviation 
  954. Xof another name.  For example if the name "postscript" exists, it is not
  955. Xpossible to have another name "postscript2".
  956. XKeep the name under 15 characters.
  957. X
  958. XThe char *description is a pointer to a string containing a
  959. Xdescription of the terminal, which is displayed in response
  960. Xto the 'set terminal' command.  
  961. XKeep the description under 60 characters.
  962. X
  963. Xxmax is the maximum number of points in the x direction.  
  964. XThe range of points used by gnuplot is 0 to xmax-1.
  965. X
  966. Xymax is the maximum number of points in the y direction.  
  967. XThe range of points used by gnuplot is 0 to ymax-1.
  968. X
  969. Xv_char is the height of characters, in the same units as xmax and ymax.
  970. XThe border for labelling at the top and bottom of the plot is 
  971. Xcalculated using v_char.  
  972. Xv_char is used as the vertical line spacing for characters.
  973. X
  974. Xh_char is the width of characters, in the same units as xmax and ymax.
  975. XThe border for labelling at the left and right of the plot is 
  976. Xcalculated using h_char.  
  977. XIf the _justify_text function returns FALSE, h_char is used to justify 
  978. Xtext right or centre.  If characters are not fixed width, then the 
  979. X_justify_text function must correctly justify the text.
  980. X
  981. Xv_tic is the vertical size of tics along the x axis, 
  982. Xin the same units as ymax.
  983. X
  984. Xh_tic is the horizontal size of tics along the y axis, 
  985. Xin the same units as xmax.
  986. X
  987. X
  988. XHere's a brief description of what each term.c function does:
  989. X
  990. X_options()  Called when terminal type is selected.  
  991. XThis procedure should parse options on the command line.  A list of the 
  992. Xcurrently selected options should be stored in term_options[] in a form 
  993. Xsuitable for use with the set term command.  term_options[] is used by 
  994. Xthe save command.  Use options_null() if no options are available. 
  995. X
  996. X_init()  Called once, when the device is first selected.  This procedure
  997. Xshould set up things that only need to be set once, like handshaking and
  998. Xcharacter sets etc...
  999. X
  1000. X_reset()  Called when gnuplot is exited, the output device changed or
  1001. Xthe terminal type changed.  This procedure should reset the device, 
  1002. Xpossibly flushing a buffer somewhere or generating a form feed.
  1003. X
  1004. X_scale(xs,ys) Called just before _graphics(). This takes the x and y
  1005. Xscaling factors as information. If the terminal would like to do its
  1006. Xown scaling, it returns TRUE. Otherwise, it can ignore the information
  1007. Xand return FALSE: do_plot will do the scaling for you. null_scale is
  1008. Xprovided to do just this, so most drivers can ignore this function
  1009. Xentirely. The Latex driver is currently the only one providing its own
  1010. Xscaling.
  1011. X
  1012. X_graphics()  Called just before a plot is going to be displayed.  This
  1013. Xprocedure should set the device into graphics mode.  Devices which can't
  1014. Xbe used as terminals (like plotters) will probably be in graphics mode 
  1015. Xalways and therefore won't need this.
  1016. X
  1017. X_text()  Called immediately after a plot is displayed.  This procedure 
  1018. Xshould set the device back into text mode if it is also a terminal, so
  1019. Xthat commands can be seen as they're typed.  Again, this will probably
  1020. Xdo nothing if the device can't be used as a terminal.
  1021. X
  1022. X_move(x,y)  Called at the start of a line.  The cursor should move to the
  1023. X(x,y) position without drawing.
  1024. X
  1025. X_vector(x,y)  Called when a line is to be drawn.  This should display a line
  1026. Xfrom the last (x,y) position given by _move() or _vector() to this new (x,y)
  1027. Xposition.
  1028. X
  1029. X_linetype(lt)  Called to set the line type before text is displayed or
  1030. Xline(s) plotted.  This procedure should select a pen color or line
  1031. Xstyle if the device has these capabilities.  
  1032. Xlt is an integer from -2 to 0 or greater.  
  1033. XAn lt of -2 is used for the border of the plot.
  1034. XAn lt of -1 is used for the X and Y axes.  
  1035. Xlt 0 and upwards are used for plots 0 and upwards.
  1036. XIf _linetype() is called with lt greater than the available line types, 
  1037. Xit should map it to one of the available line types.
  1038. XMost drivers provide 9 different linetypes (lt is 0 to 8).
  1039. X
  1040. X_put_text(x,y,str)  Called to display text at the (x,y) position, 
  1041. Xwhile in graphics mode.   The text should be vertically (with respect 
  1042. Xto the text) justified about (x,y).  The text is rotated according 
  1043. Xto _text_angle and then horizontally (with respect to the text)
  1044. Xjustified according to _justify_text.
  1045. X
  1046. X_text_angle(ang)  Called to rotate the text angle when placing the y label.
  1047. XIf ang = 0 then text is horizontal.  If ang = 1 then text is vertically
  1048. Xupwards.  Returns TRUE if text can be rotated, FALSE otherwise.
  1049. X
  1050. X_justify_text(mode)  Called to justify text left, right or centre.
  1051. XIf mode = LEFT then text placed by _put_text is flushed left against (x,y).
  1052. XIf mode = CENTRE then centre of text is at (x,y).  
  1053. XIf mode = RIGHT then text is placed flushed right against (x,y).
  1054. XReturns TRUE if text can be justified
  1055. XReturns FALSE otherwise and then _put_text assumes text is flushed left;
  1056. Xjustification of text is then performed by calculating the text width
  1057. Xusing strlen(text) * h_char.
  1058. X
  1059. X_point(x,y,point)  Called to place a point at position (x,y).
  1060. Xpoint is -1 or an integer from 0 upwards.  
  1061. X6 point types (numbered 0 to 5) are normally provided.  
  1062. XPoint type -1 is a dot.
  1063. XIf point is more than the available point types then it should 
  1064. Xbe mapped back to one of the available points.
  1065. XTwo _point() functions called do_point() and line_and_point() are 
  1066. Xprovided in term.c and should be suitable for most drivers.  
  1067. Xdo_point() draws the points in the current line type.
  1068. XIf your driver uses dotted line types (generally because it is
  1069. Xmonochrome), you should use line_and_point() which changes to 
  1070. Xline type 0 before drawing the point.  line type 0 should be solid.
  1071. X
  1072. X_arrow(sx,sy,ex,ey,head)  Called to draw an arrrow from (sx,sy) to (ex,ey).
  1073. XA head is drawn on the arrow if head = TRUE.
  1074. XAn _arrow() function called do_arrow() is provided in term.c which will
  1075. Xdraw arrows using the _move() and _vector() functions.  
  1076. XDrivers should use do_arrow unless it causes problems.
  1077. X
  1078. XThe following should illustrate the order in which calls to these
  1079. Xroutines are made:
  1080. X
  1081. X  _init()
  1082. X    _scale(xs,ys)
  1083. X    _graphics()
  1084. X      _linetype(lt)
  1085. X      _move(x,y)
  1086. X      _vector(x,y)
  1087. X      _point(x,y,point)
  1088. X      _text_angle(angle)
  1089. X      _justify(mode)
  1090. X      _put_text(x,y,text)
  1091. X      _arrow(sx,sy,ex,ey)
  1092. X    _text()
  1093. X    _graphics()
  1094. X      .
  1095. X      .
  1096. X    _text()
  1097. X  _reset()
  1098. X
  1099. X
  1100. END_OF_FILE
  1101.   if test 7115 -ne `wc -c <'gnuplot/term/README'`; then
  1102.     echo shar: \"'gnuplot/term/README'\" unpacked with wrong size!
  1103.   fi
  1104.   # end of 'gnuplot/term/README'
  1105. fi
  1106. if test -f 'gnuplot/term/ai.trm' -a "${1}" != "-c" ; then 
  1107.   echo shar: Will not clobber existing file \"'gnuplot/term/ai.trm'\"
  1108. else
  1109.   echo shar: Extracting \"'gnuplot/term/ai.trm'\" \(7393 characters\)
  1110.   sed "s/^X//" >'gnuplot/term/ai.trm' <<'END_OF_FILE'
  1111. X/*
  1112. X * $Id: ai.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  1113. X *
  1114. X */
  1115. X
  1116. X/* GNUPLOT - ai.trm */
  1117. X/*
  1118. X * Copyright (C) 1991, 1992   
  1119. X *
  1120. X * Permission to use, copy, and distribute this software and its
  1121. X * documentation for any purpose with or without fee is hereby granted, 
  1122. X * provided that the above copyright notice appear in all copies and 
  1123. X * that both that copyright notice and this permission notice appear 
  1124. X * in supporting documentation.
  1125. X *
  1126. X * Permission to modify the software is granted, but not the right to
  1127. X * distribute the modified code.  Modifications are to be distributed 
  1128. X * as patches to released version.
  1129. X *  
  1130. X * This software  is provided "as is" without express or implied warranty.
  1131. X * 
  1132. X * This file is included by ../term.c.
  1133. X *
  1134. X * This terminal driver supports:
  1135. X *     aifm
  1136. X *
  1137. X * AUTHORS
  1138. X *  Ray Ghanbari
  1139. X * 
  1140. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1141. X *
  1142. X * The 'aifm' driver produces files editable by Adobe Illustrator 3.0
  1143. X * To change font to Courier and font size to 20pts use 
  1144. X * 'set term aifm "Courier" 20'.
  1145. X * To switch to color output use
  1146. X * 'set term aifm color'.
  1147. X */
  1148. X
  1149. X
  1150. X/* AIFM driver by Ray Ghanbari, ray@mtl.mit.edu, 
  1151. X *    based on PostScript driver by Russell Lang, rjl@monu1.cc.monash.edu.au */
  1152. X
  1153. Xchar ai_font[MAX_ID_LEN+1] = "Times-Roman" ; /* name of font */
  1154. Xint ai_fontsize = 14;                     /* size of font in pts */
  1155. XTBOOLEAN ai_color = FALSE;
  1156. XTBOOLEAN ai_stroke = FALSE;
  1157. Xint ai_page=0;            /* page count */
  1158. Xint ai_path_count=0;     /* count of lines in path */
  1159. Xint ai_ang=0;            /* text angle */
  1160. Xenum JUSTIFY ai_justify=LEFT;    /* text is flush left */
  1161. X
  1162. X
  1163. X#define AI_XOFF    50    /* page offset in pts */
  1164. X#define AI_YOFF    50
  1165. X
  1166. X#define AI_XMAX 5000
  1167. X#define AI_YMAX 3500
  1168. X
  1169. X#define AI_XLAST (AI_XMAX - 1)
  1170. X#define AI_YLAST (AI_YMAX - 1)
  1171. X
  1172. X#define AI_VTIC (AI_YMAX/80)
  1173. X#define AI_HTIC (AI_YMAX/80)
  1174. X
  1175. X#define AI_SC (10.0)                /* scale is 1pt = 10 units */
  1176. X#define AI_LW (0.5*AI_SC)        /* linewidth = 0.5 pts */
  1177. X
  1178. X#define AI_VCHAR (14*AI_SC)        /* default is 14 point characters */
  1179. X#define AI_HCHAR (14*AI_SC*6/10)
  1180. X
  1181. X
  1182. XAI_options()
  1183. X{
  1184. X    extern struct value *const_express();
  1185. X    extern double real();
  1186. X
  1187. X    if (!END_OF_COMMAND) {
  1188. X        if (almost_equals(c_token,"d$efault")) {
  1189. X            ai_color=FALSE;
  1190. X            strcpy(ai_font,"Times-Roman");
  1191. X            ai_fontsize = 14;
  1192. X            c_token++;
  1193. X        }
  1194. X    }
  1195. X
  1196. X    if (!END_OF_COMMAND) {
  1197. X        if (almost_equals(c_token,"m$onochrome")) {
  1198. X            ai_color=FALSE;
  1199. X            c_token++;
  1200. X        }
  1201. X        else if (almost_equals(c_token,"c$olor")) {
  1202. X            ai_color=TRUE;
  1203. X            c_token++;
  1204. X        }
  1205. X    }
  1206. X
  1207. X    if (!END_OF_COMMAND && isstring(c_token)) {
  1208. X        quote_str(ai_font,c_token);
  1209. X        c_token++;
  1210. X    }
  1211. X
  1212. X    if (!END_OF_COMMAND) {
  1213. X        /* We have font size specified */
  1214. X        struct value a;
  1215. X        ai_fontsize = (int)real(const_express(&a));
  1216. X        c_token++;
  1217. X        term_tbl[term].v_char = (unsigned int)(ai_fontsize*AI_SC);
  1218. X        term_tbl[term].h_char = (unsigned int)(ai_fontsize*AI_SC*6/10);
  1219. X    }
  1220. X
  1221. X    sprintf(term_options,"%s \"%s\" %d",
  1222. X        ai_color ? "color" : "monochrome",ai_font,ai_fontsize);
  1223. X}
  1224. X
  1225. X
  1226. XAI_init()
  1227. X{
  1228. X    ai_page = 0;
  1229. X    fprintf(outfile,"%%!PS-Adobe-2.0 EPSF-1.2\n");
  1230. X    fprintf(outfile,"%%%%BoundingBox: %d %d %d %d\n", AI_XOFF,AI_YOFF,
  1231. X        (int)((AI_XMAX)/AI_SC+0.5+AI_XOFF), 
  1232. X        (int)((AI_YMAX)/AI_SC+0.5+AI_YOFF) );
  1233. X    fprintf(outfile,"%%%%Template:\n");
  1234. X    fprintf(outfile,"%%%%EndComments\n");
  1235. X    fprintf(outfile,"%%%%EndProlog\n");
  1236. X}
  1237. X
  1238. X
  1239. XAI_graphics()
  1240. X{
  1241. X    ai_page++;
  1242. X/*    fprintf(outfile,"%%%%Page: %d %d\n",ai_page,ai_page);*/
  1243. X    fprintf(outfile,"0 G\n");
  1244. X    fprintf(outfile,"1 j\n");
  1245. X    fprintf(outfile,"1 J\n");
  1246. X    fprintf(outfile,"u\n");
  1247. X    ai_path_count = 0;
  1248. X    ai_stroke = FALSE;
  1249. X}
  1250. X
  1251. X
  1252. XAI_text()
  1253. X{
  1254. X    if (ai_stroke) {
  1255. X        fprintf(outfile,"S\n");
  1256. X        ai_stroke = FALSE;
  1257. X    }
  1258. X    fprintf(outfile,"U\n");
  1259. X    ai_path_count = 0;
  1260. X}
  1261. X
  1262. X
  1263. XAI_reset()
  1264. X{
  1265. X    fprintf(outfile,"%%%%Trailer\n");
  1266. X/*    fprintf(outfile,"%%%%Pages: %d\n",ai_page);*/
  1267. X}
  1268. X
  1269. X
  1270. XAI_linetype(linetype)
  1271. Xint linetype;
  1272. X{
  1273. X    if (ai_stroke) {
  1274. X        fprintf(outfile,"S\n");
  1275. X        ai_stroke = FALSE;
  1276. X    }
  1277. X    switch(linetype) {
  1278. X        case -2 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC*2.0);
  1279. X                if (ai_color) {
  1280. X                    fprintf(outfile,"0 0 0 1 K\n");
  1281. X                }
  1282. X                else {                
  1283. X                    fprintf(outfile,"[] 0 d\n");
  1284. X                }
  1285. X                break;
  1286. X                
  1287. X        case -1 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC/2.0);
  1288. X                if (ai_color) {
  1289. X                    fprintf(outfile,"0 0 0 1 K\n");
  1290. X                }
  1291. X                else {                
  1292. X                    fprintf(outfile,"[1 2] 0 d\n");
  1293. X                }
  1294. X                break;
  1295. X                
  1296. X        case 0 :  fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1297. X                if (ai_color) {
  1298. X                    fprintf(outfile,"1 0 1 0 K\n");
  1299. X                }
  1300. X                else {                
  1301. X                    fprintf(outfile,"[] 0 d\n");
  1302. X                }
  1303. X                break;
  1304. X                
  1305. X        case 1 :  fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1306. X                if (ai_color) {
  1307. X                    fprintf(outfile,"1 1 0 0 K\n");
  1308. X                }
  1309. X                else {                
  1310. X                    fprintf(outfile,"[4 2] 0 d\n");
  1311. X                }
  1312. X                break;
  1313. X                
  1314. X        case 2 :  fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1315. X                if (ai_color) {
  1316. X                    fprintf(outfile,"0 1 1 0 K\n");
  1317. X                }
  1318. X                else {                
  1319. X                    fprintf(outfile,"[2 3] 0 d\n");
  1320. X                }
  1321. X                break;
  1322. X                
  1323. X        case 3 :  fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1324. X                if (ai_color) {
  1325. X                    fprintf(outfile,"0 1 0 0 K\n");
  1326. X                }
  1327. X                else {                
  1328. X                    fprintf(outfile,"[1 1.5] 0 d\n");
  1329. X                }
  1330. X                break;
  1331. X                
  1332. X        case 4 :  fprintf(outfile,"%f w\n",AI_LW/AI_SC);
  1333. X                if (ai_color) {
  1334. X                    fprintf(outfile,"1 0 0 0 K\n");
  1335. X                }
  1336. X                else {                
  1337. X                    fprintf(outfile,"[5 2 1 2] 0 d\n");
  1338. X                }
  1339. X                break;
  1340. X                
  1341. X        case 5 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1342. X                if (ai_color) {
  1343. X                    fprintf(outfile,"0 0 1 0 K\n");
  1344. X                }
  1345. X                else {                
  1346. X                    fprintf(outfile,"[4 3 1 3] 0 d\n");
  1347. X                }
  1348. X                break;
  1349. X                
  1350. X        case 6 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1351. X                if (ai_color) {
  1352. X                    fprintf(outfile,"0 0 0 1 K\n");
  1353. X                }
  1354. X                else {                
  1355. X                    fprintf(outfile,"[2 2 2 4] 0 d\n");
  1356. X                }
  1357. X                break;
  1358. X                
  1359. X        case 7 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1360. X                if (ai_color) {
  1361. X                    fprintf(outfile,"0 0.7 1 0 K\n");
  1362. X                }
  1363. X                else {                
  1364. X                    fprintf(outfile,"[2 2 2 2 2 4] 0 d\n");
  1365. X                }
  1366. X                break;
  1367. X                
  1368. X        case 8 : fprintf(outfile,"%.2f w\n",AI_LW/AI_SC);
  1369. X                if (ai_color) {
  1370. X                    fprintf(outfile,"0.5 0.5 0.5 0 K\n");
  1371. X                }
  1372. X                else {                
  1373. X                    fprintf(outfile,"[2 2 2 2 2 2 2 4] 0 d\n");
  1374. X                }
  1375. X                break;
  1376. X        }
  1377. X                
  1378. X    ai_path_count = 0;
  1379. X}
  1380. X
  1381. X
  1382. XAI_move(x,y)
  1383. Xunsigned int x,y;
  1384. X{
  1385. X    if (ai_stroke) fprintf(outfile,"S\n");
  1386. X    fprintf(outfile,"%.2f %.2f m\n", x/AI_SC, y/AI_SC);
  1387. X    ai_path_count += 1;
  1388. X    ai_stroke = TRUE;
  1389. X}
  1390. X
  1391. X
  1392. XAI_vector(x,y)
  1393. Xunsigned int x,y;
  1394. X{
  1395. X    fprintf(outfile,"%.2f %.2f l\n", x/AI_SC, y/AI_SC);
  1396. X    ai_path_count += 1;
  1397. X    ai_stroke = TRUE;
  1398. X    if (ai_path_count >= 400) {
  1399. X        fprintf(outfile,"S\n%.2f %.2f m\n",x/AI_SC,y/AI_SC);
  1400. X        ai_path_count = 0;
  1401. X    }
  1402. X}
  1403. X
  1404. X
  1405. XAI_put_text(x,y,str)
  1406. Xunsigned int x, y;
  1407. Xchar *str;
  1408. X{
  1409. Xchar ch;
  1410. X    if (ai_stroke) {
  1411. X        fprintf(outfile,"S\n");
  1412. X        ai_stroke = FALSE;
  1413. X    }
  1414. X    switch(ai_justify) {
  1415. X        case LEFT :   fprintf(outfile,"/_%s %d 0 0 0 z\n",ai_font,ai_fontsize);
  1416. X            break;
  1417. X        case CENTRE : fprintf(outfile,"/_%s %d 0 0 1 z\n",ai_font,ai_fontsize);
  1418. X            break;
  1419. X        case RIGHT :  fprintf(outfile,"/_%s %d 0 0 2 z\n",ai_font,ai_fontsize);
  1420. X            break;
  1421. X    }
  1422. X    if (ai_ang==0) {
  1423. X        fprintf(outfile,"[ 1 0 0 1 %.2f %.2f] e\n",
  1424. X            x/AI_SC,y/AI_SC - ai_fontsize/3.0);
  1425. X    }
  1426. X    else {
  1427. X        fprintf(outfile,"[ 0 1 -1 0 %.2f %.2f] e\n",
  1428. X            x/AI_SC - ai_fontsize/3.0,y/AI_SC);
  1429. X    }
  1430. X        
  1431. X    putc('(',outfile);
  1432. X    ch = *str++;
  1433. X    while(ch!='\0') {
  1434. X        if ( (ch=='(') || (ch==')') || (ch=='\\') )
  1435. X            putc('\\',outfile);
  1436. X        putc(ch,outfile);
  1437. X        ch = *str++;
  1438. X    }
  1439. X    fprintf(outfile,") t\nT\n");
  1440. X    ai_path_count = 0;
  1441. X}
  1442. X
  1443. Xint AI_text_angle(ang)
  1444. Xint ang;
  1445. X{
  1446. X    ai_ang=ang;
  1447. X    return TRUE;
  1448. X}
  1449. X
  1450. Xint AI_justify_text(mode)
  1451. Xenum JUSTIFY mode;
  1452. X{
  1453. X    ai_justify=mode;
  1454. X    return TRUE;
  1455. X}
  1456. X
  1457. END_OF_FILE
  1458.   if test 7393 -ne `wc -c <'gnuplot/term/ai.trm'`; then
  1459.     echo shar: \"'gnuplot/term/ai.trm'\" unpacked with wrong size!
  1460.   fi
  1461.   # end of 'gnuplot/term/ai.trm'
  1462. fi
  1463. if test -f 'gnuplot/term/hp2648.trm' -a "${1}" != "-c" ; then 
  1464.   echo shar: Will not clobber existing file \"'gnuplot/term/hp2648.trm'\"
  1465. else
  1466.   echo shar: Extracting \"'gnuplot/term/hp2648.trm'\" \(2187 characters\)
  1467.   sed "s/^X//" >'gnuplot/term/hp2648.trm' <<'END_OF_FILE'
  1468. X/*
  1469. X * $Id: hp2648.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  1470. X *
  1471. X */
  1472. X
  1473. X/* GNUPLOT -  hp2648.trm */
  1474. X/*
  1475. X * Copyright (C) 1990 - 1993   
  1476. X *
  1477. X * Permission to use, copy, and distribute this software and its
  1478. X * documentation for any purpose with or without fee is hereby granted, 
  1479. X * provided that the above copyright notice appear in all copies and 
  1480. X * that both that copyright notice and this permission notice appear 
  1481. X * in supporting documentation.
  1482. X *
  1483. X * Permission to modify the software is granted, but not the right to
  1484. X * distribute the modified code.  Modifications are to be distributed 
  1485. X * as patches to released version.
  1486. X *  
  1487. X * This software  is provided "as is" without express or implied warranty.
  1488. X * 
  1489. X * This file is included by ../term.c.
  1490. X *
  1491. X * This terminal driver supports:
  1492. X *  HP2648 and HP2647
  1493. X *
  1494. X * AUTHORS
  1495. X *  Russell Lang
  1496. X * 
  1497. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1498. X * 
  1499. X */
  1500. X
  1501. X#define HP2648XMAX 720             
  1502. X#define HP2648YMAX 360
  1503. X
  1504. X#define HP2648XLAST (HP2648XMAX - 1)
  1505. X#define HP2648YLAST (HP2648YMAX - 1)
  1506. X
  1507. X#define HP2648VCHAR        12      
  1508. X#define HP2648HCHAR        7        
  1509. X#define HP2648VTIC        8
  1510. X#define HP2648HTIC        8
  1511. X
  1512. X
  1513. XHP2648init()
  1514. X{
  1515. X    fprintf(outfile,"\033*m1m1n136,1cZ");
  1516. X/*                   1     2 3     4
  1517. X    1. mode
  1518. X    2. textsize=1
  1519. X    3. textangle=1
  1520. X        4. define line type 2 to be *   *   *   * etc.
  1521. X*/
  1522. X}
  1523. X
  1524. X
  1525. XHP2648graphics()
  1526. X{
  1527. X    fprintf(outfile,"\033*dacZ");
  1528. X/*                   1     23
  1529. X    1. mode
  1530. X    2. clear grahics screen
  1531. X    3. graphics video on
  1532. X*/
  1533. X}
  1534. X
  1535. X
  1536. XHP2648text()
  1537. X{
  1538. X}
  1539. X
  1540. X
  1541. XHP2648linetype(linetype)
  1542. Xint linetype;
  1543. X{
  1544. X    static int hpline[] = {1,7,1,4,5,6,8,9,10,7,2};
  1545. X    fprintf(outfile,"\033*m%dbZ",hpline[(linetype+2)%11]);
  1546. X}
  1547. X
  1548. X
  1549. XHP2648move(x,y)
  1550. Xint x,y;
  1551. X{
  1552. X    fprintf(outfile,"\033*paf%d,%dZ",x,y);
  1553. X    /*               1     23     4
  1554. X    1    plot mode
  1555. X    2    "pen up"
  1556. X    3    goto absolute x,y
  1557. X    4    end command
  1558. X    */
  1559. X}
  1560. X
  1561. X
  1562. XHP2648vector(x,y)
  1563. Xint x,y;
  1564. X{
  1565. X    fprintf(outfile,"\033*pbf%d,%dZ",x,y);
  1566. X    /*                     1 
  1567. X    1    "pen down"
  1568. X    */
  1569. X}
  1570. X
  1571. X
  1572. XHP2648put_text(x,y,str)
  1573. Xint x, y;
  1574. Xchar *str;
  1575. X{
  1576. X    HP2648move(x,y-HP2648VCHAR/2 + 1);
  1577. X    fprintf(outfile,"\033*l%s\n",str);
  1578. X}
  1579. X
  1580. X
  1581. Xint HP2648_text_angle(ang)
  1582. Xint ang;
  1583. X{
  1584. X    fprintf(outfile,"\033*m%dnZ\n",ang+1);
  1585. X    return TRUE;
  1586. X}
  1587. X    
  1588. XHP2648reset()
  1589. X{
  1590. X}
  1591. X
  1592. END_OF_FILE
  1593.   if test 2187 -ne `wc -c <'gnuplot/term/hp2648.trm'`; then
  1594.     echo shar: \"'gnuplot/term/hp2648.trm'\" unpacked with wrong size!
  1595.   fi
  1596.   # end of 'gnuplot/term/hp2648.trm'
  1597. fi
  1598. if test -f 'gnuplot/term/pbm.trm' -a "${1}" != "-c" ; then 
  1599.   echo shar: Will not clobber existing file \"'gnuplot/term/pbm.trm'\"
  1600. else
  1601.   echo shar: Extracting \"'gnuplot/term/pbm.trm'\" \(7401 characters\)
  1602.   sed "s/^X//" >'gnuplot/term/pbm.trm' <<'END_OF_FILE'
  1603. X/*
  1604. X * $Id: pbm.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  1605. X *
  1606. X */
  1607. X
  1608. X/* GNUPLOT - pbm.trm */
  1609. X/*
  1610. X * Copyright (C) 1990 - 1993   
  1611. X *
  1612. X * Permission to use, copy, and distribute this software and its
  1613. X * documentation for any purpose with or without fee is hereby granted, 
  1614. X * provided that the above copyright notice appear in all copies and 
  1615. X * that both that copyright notice and this permission notice appear 
  1616. X * in supporting documentation.
  1617. X *
  1618. X * Permission to modify the software is granted, but not the right to
  1619. X * distribute the modified code.  Modifications are to be distributed 
  1620. X * as patches to released version.
  1621. X *  
  1622. X * This software  is provided "as is" without express or implied warranty.
  1623. X * 
  1624. X * This file is included by ../term.c.
  1625. X *
  1626. X * This terminal driver supports:
  1627. X *  pbm
  1628. X *
  1629. X * AUTHORS
  1630. X *  Russell Lang
  1631. X *
  1632. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1633. X * 
  1634. X */
  1635. X
  1636. X/* The following pbmplus drivers use the generic bit mapped graphics
  1637. X   routines from bitmap.c to build up a bit map in memory.  The driver
  1638. X   interchanges colomns and lines in order to access entire lines
  1639. X   easily and returns the lines to get bits in the right order :
  1640. X   (x,y) -> (y,XMAX-1-x). */
  1641. X/* This interchange is done by calling b_makebitmap() with reversed 
  1642. X   xmax and ymax, and then setting b_rastermode to TRUE.  b_setpixel()
  1643. X   will then perform the interchange before each pixel is plotted */
  1644. X/* See Jef Poskanzer's excellent PBMplus package for more details of
  1645. X   the Portable BitMap format and for programs to convert PBM files  
  1646. X   to other bitmap formats. */
  1647. X
  1648. X#ifdef PBM
  1649. X
  1650. X/* make XMAX and YMAX a multiple of 8 */
  1651. X#define PBM_XMAX (640)
  1652. X#define PBM_YMAX (480)
  1653. X#define PBM_VCHAR (FNT5X9_VCHAR)
  1654. X#define PBM_HCHAR (FNT5X9_VCHAR)
  1655. X#define PBM_VTIC FNT5X9_HBITS
  1656. X#define PBM_HTIC FNT5X9_HBITS
  1657. X
  1658. Xstatic int pbm_font=1;    /* small font */
  1659. Xstatic int pbm_mode=0;  /* 0:monochrome 1:gray 2:color */
  1660. X
  1661. X/* 7=black, 0=white */
  1662. Xstatic int pgm_gray[]={7,1,6,5,4,3,2,1,7};  /* grays  */
  1663. X/* bit3=!intensify, bit2=!red, bit1=!green, bit0=!blue */
  1664. Xstatic int ppm_color[]={15,8,3,5,6,4,2,1,11,13,14}; /* colors */
  1665. X
  1666. XPBMoptions()
  1667. X{
  1668. X  pbm_font=1;
  1669. X  pbm_mode=0;
  1670. X
  1671. X  term_options[0]='\0';
  1672. X
  1673. X  while (!END_OF_COMMAND) {
  1674. X    if (almost_equals(c_token,"s$mall"))
  1675. X      pbm_font=1;
  1676. X    else if (almost_equals(c_token,"me$dium"))
  1677. X      pbm_font=2;
  1678. X    else if (almost_equals(c_token,"l$arge"))
  1679. X      pbm_font=3;
  1680. X    else if (almost_equals(c_token,"mo$nochrome"))
  1681. X      pbm_mode=0;
  1682. X    else if (almost_equals(c_token,"g$ray"))
  1683. X      pbm_mode=1;
  1684. X    else if (almost_equals(c_token,"c$olor"))
  1685. X      pbm_mode=2;
  1686. X    else {
  1687. X      pbm_font=1; /* reset to default, since term is already set */
  1688. X      pbm_mode=0;
  1689. X      int_error("expecting: {small, medium, large} and {monochrome, gray, color}",c_token);
  1690. X    }
  1691. X    c_token++;
  1692. X  }
  1693. X
  1694. X  /* setup options string */
  1695. X
  1696. X  switch(pbm_font) {
  1697. X    case 1: strcat(term_options,"small"); break;
  1698. X    case 2: strcat(term_options,"medium"); break;
  1699. X    case 3: strcat(term_options,"large"); break;
  1700. X  }
  1701. X
  1702. X  switch(pbm_mode) {
  1703. X    case 0: strcat(term_options," monochrome"); break;
  1704. X    case 1: strcat(term_options," gray"); break;
  1705. X    case 2: strcat(term_options," color"); break;
  1706. X  }
  1707. X}
  1708. X
  1709. X
  1710. XPBMinit()
  1711. X{
  1712. X#ifdef REOPEN_BINARY
  1713. X   reopen_binary();
  1714. X#endif /* REOPEN_BINARY */
  1715. X}
  1716. X
  1717. X
  1718. XPBMreset()
  1719. X{
  1720. X#ifdef vms
  1721. X   fflush_binary();
  1722. X#endif /* vms */
  1723. X}
  1724. X
  1725. X
  1726. XPBMsetfont()
  1727. X{
  1728. X    switch(pbm_font) {
  1729. X        case 1:
  1730. X            b_charsize(FNT5X9);
  1731. X            term_tbl[term].v_char = FNT5X9_VCHAR;
  1732. X            term_tbl[term].h_char = FNT5X9_HCHAR;
  1733. X            term_tbl[term].v_tic = FNT5X9_HBITS;
  1734. X            term_tbl[term].h_tic = FNT5X9_HBITS;
  1735. X            break;
  1736. X        case 2:
  1737. X            b_charsize(FNT9X17);
  1738. X            term_tbl[term].v_char = FNT9X17_VCHAR;
  1739. X            term_tbl[term].h_char = FNT9X17_HCHAR;
  1740. X            term_tbl[term].v_tic = FNT9X17_HBITS;
  1741. X            term_tbl[term].h_tic = FNT9X17_HBITS;
  1742. X            break;
  1743. X        case 3:
  1744. X            b_charsize(FNT13X25);
  1745. X            term_tbl[term].v_char = FNT13X25_VCHAR;
  1746. X            term_tbl[term].h_char = FNT13X25_HCHAR;
  1747. X            term_tbl[term].v_tic = FNT13X25_HBITS;
  1748. X            term_tbl[term].h_tic = FNT13X25_HBITS;
  1749. X            break;
  1750. X    }
  1751. X}
  1752. X
  1753. X
  1754. XPBMgraphics()
  1755. X{
  1756. X  int numplanes;
  1757. X
  1758. X  switch(pbm_mode) {
  1759. X    case 0: numplanes=1; break;
  1760. X    case 1: numplanes=3; break;
  1761. X    case 2: numplanes=4; break;
  1762. X  }
  1763. X
  1764. X  PBMsetfont();
  1765. X  /* rotate plot -90 degrees by reversing XMAX and YMAX and by 
  1766. X  setting b_rastermode to TRUE */
  1767. X  b_makebitmap((unsigned int)(PBM_YMAX*ysize),
  1768. X               (unsigned int)(PBM_XMAX*xsize),numplanes);
  1769. X  b_rastermode = TRUE;
  1770. X
  1771. X  if(pbm_mode!=0)
  1772. X    b_setlinetype(0); /* solid lines */
  1773. X}
  1774. X
  1775. X
  1776. XPBMmonotext()
  1777. X{
  1778. X  register int x,j,row;
  1779. X
  1780. X   fprintf(outfile,"P4\n");
  1781. X   fprintf(outfile,"%u %u\n", b_ysize, b_xsize);
  1782. X
  1783. X   /* dump bitmap in raster mode */
  1784. X   for (x = b_xsize-1; x >= 0; x--) {
  1785. X      row = (b_ysize/8)-1;
  1786. X      for (j = row; j >= 0; j--) {
  1787. X         (void) fputc( (char)(*((*b_p)[j]+x)), outfile );
  1788. X      }
  1789. X   }
  1790. X
  1791. X   b_freebitmap();
  1792. X}
  1793. X
  1794. XPBMgraytext()
  1795. X{
  1796. X  register int x,j,row;
  1797. X  register int i,value;
  1798. X  int mask, plane1, plane2, plane3;
  1799. X
  1800. X   fprintf(outfile,"P5\n");
  1801. X   fprintf(outfile,"%u %u\n", b_ysize, b_xsize);
  1802. X   fprintf(outfile,"%u\n",7);
  1803. X
  1804. X   /* dump bitmap in raster mode */
  1805. X   for (x = b_xsize-1; x >= 0; x--) {
  1806. X      row = (b_ysize/8)-1;
  1807. X      for (j = row; j >= 0; j--) {
  1808. X         mask = 0x80;
  1809. X         plane1=(*((*b_p)[j]+x));
  1810. X         plane2=(*((*b_p)[j+b_psize]+x));
  1811. X         plane3=(*((*b_p)[j+b_psize+b_psize]+x));
  1812. X         for (i=0; i<8; i++) {
  1813. X            value=7;
  1814. X            if (plane1 & mask)  value-=1;
  1815. X            if (plane2 & mask)  value-=2;
  1816. X            if (plane3 & mask)  value-=4;
  1817. X            (void) fputc( (char)(value), outfile );
  1818. X            mask>>=1;
  1819. X         }
  1820. X      }
  1821. X   }
  1822. X
  1823. X   b_freebitmap();
  1824. X}
  1825. X
  1826. XPBMcolortext()
  1827. X{
  1828. X  register int x,j,row;
  1829. X  register int i;
  1830. X  int mask, plane1, plane2, plane3, plane4;
  1831. X  int red, green, blue;
  1832. X
  1833. X   fprintf(outfile,"P6\n");
  1834. X   fprintf(outfile,"%u %u\n", b_ysize, b_xsize);
  1835. X   fprintf(outfile,"%u\n",3);
  1836. X
  1837. X   /* dump bitmap in raster mode */
  1838. X   for (x = b_xsize-1; x >= 0; x--) {
  1839. X      row = (b_ysize/8)-1;
  1840. X      for (j = row; j >= 0; j--) {
  1841. X         mask = 0x80;
  1842. X         plane1=(*((*b_p)[j]+x));
  1843. X         plane2=(*((*b_p)[j+b_psize]+x));
  1844. X         plane3=(*((*b_p)[j+b_psize+b_psize]+x));
  1845. X         plane4=(*((*b_p)[j+b_psize+b_psize+b_psize]+x));
  1846. X         for (i=0; i<8; i++) {
  1847. X            red = (plane3 & mask) ? 1 : 3;
  1848. X            green = (plane2 & mask) ? 1 : 3;
  1849. X            blue = (plane1 & mask) ? 1 : 3;
  1850. X            if (plane4 & mask) {
  1851. X               red--; green--; blue--;
  1852. X            }
  1853. X            (void) fputc( (char)(red), outfile );
  1854. X            (void) fputc( (char)(green), outfile );
  1855. X            (void) fputc( (char)(blue), outfile );
  1856. X            mask>>=1;
  1857. X         }
  1858. X      }
  1859. X   }
  1860. X
  1861. X   b_freebitmap();
  1862. X}
  1863. X
  1864. XPBMtext()
  1865. X{
  1866. X  switch(pbm_mode) {
  1867. X    case 0: PBMmonotext(); break;
  1868. X    case 1: PBMgraytext(); break;
  1869. X    case 2: PBMcolortext(); break;
  1870. X  }
  1871. X}
  1872. X
  1873. X
  1874. XPBMlinetype(linetype)
  1875. Xint linetype;
  1876. X{
  1877. X  switch(pbm_mode) {
  1878. X    case 0:
  1879. X      b_setlinetype(linetype);
  1880. X    break;
  1881. X    case 1:
  1882. X      if (linetype>=7)
  1883. X        linetype %= 7;
  1884. X      b_setvalue(pgm_gray[linetype+2]);
  1885. X    break;
  1886. X    case 2:
  1887. X      if (linetype>=9)
  1888. X        linetype %= 9;
  1889. X      b_setvalue(ppm_color[linetype+2]);
  1890. X    break;
  1891. X  }
  1892. X}
  1893. X
  1894. XPBMpoint(x,y,point)
  1895. Xint x,y,point;
  1896. X{
  1897. X  if(pbm_mode==0) line_and_point(x,y,point);
  1898. X  else            do_point(x,y,point);
  1899. X}
  1900. X
  1901. X#define PBMmove b_move
  1902. X#define PBMvector b_vector
  1903. X#define PBMtext_angle b_text_angle
  1904. X#define PBMput_text b_put_text
  1905. X
  1906. X#endif /* PBM */
  1907. END_OF_FILE
  1908.   if test 7401 -ne `wc -c <'gnuplot/term/pbm.trm'`; then
  1909.     echo shar: \"'gnuplot/term/pbm.trm'\" unpacked with wrong size!
  1910.   fi
  1911.   # end of 'gnuplot/term/pbm.trm'
  1912. fi
  1913. if test -f 'gnuplot/term/pm.trm' -a "${1}" != "-c" ; then 
  1914.   echo shar: Will not clobber existing file \"'gnuplot/term/pm.trm'\"
  1915. else
  1916.   echo shar: Extracting \"'gnuplot/term/pm.trm'\" \(7141 characters\)
  1917.   sed "s/^X//" >'gnuplot/term/pm.trm' <<'END_OF_FILE'
  1918. X/*
  1919. X *    pm.trm  --- inboard terminal driver for Presentation Manager
  1920. X *            --- after X-11 driver, by R.W.Fearick 31/1/92.
  1921. X *    v1.1 11/8/92 -- speed things up        
  1922. X */
  1923. X
  1924. X#include <stdio.h>
  1925. X#include <process.h>
  1926. X
  1927. X/* 
  1928. X   include all stuff from os2.h as GNUPLOT uses INT as an enum and
  1929. X   this clashes with #defines in os2.h 
  1930. X*/
  1931. X
  1932. Xtypedef unsigned short USHORT;
  1933. Xtypedef USHORT *PUSHORT;
  1934. Xtypedef void *PVOID ;
  1935. Xtypedef char *PCHAR ;
  1936. X
  1937. Xtypedef long LONG;
  1938. Xtypedef LONG *PLONG;
  1939. X
  1940. Xtypedef unsigned long ULONG;
  1941. Xtypedef ULONG *PULONG;
  1942. Xtypedef struct
  1943. X{
  1944. X  ULONG  tib2_ultid;
  1945. X  ULONG  tib2_ulpri;
  1946. X  ULONG  tib2_version;
  1947. X  USHORT tib2_usMCCount;
  1948. X  USHORT tib2_fMCForceFlag;
  1949. X} TIB2;
  1950. Xtypedef TIB2 *PTIB2;
  1951. X
  1952. Xtypedef struct
  1953. X{
  1954. X  PVOID tib_pexchain;
  1955. X  PVOID tib_pstack;
  1956. X  PVOID tib_pstacklimit;
  1957. X  PTIB2 tib_ptib2;
  1958. X  ULONG tib_version;
  1959. X  ULONG tib_ordinal;
  1960. X} TIB;
  1961. Xtypedef TIB *PTIB;
  1962. X
  1963. Xtypedef struct
  1964. X{
  1965. X  ULONG pib_ulpid;
  1966. X  ULONG pib_ulppid;
  1967. X  ULONG pib_hmte;
  1968. X  PCHAR pib_pchcmd;
  1969. X  PCHAR pib_pchenv;
  1970. X  ULONG pib_flstatus;
  1971. X  ULONG pib_ultype;
  1972. X} PIB;
  1973. Xtypedef PIB *PPIB;
  1974. Xtypedef ULONG HEV;
  1975. Xtypedef HEV *PHEV;
  1976. X
  1977. XULONG DosCreateEventSem (const char *, PHEV, ULONG, ULONG);
  1978. XULONG DosWaitEventSem (HEV, ULONG);
  1979. XULONG DosGetInfoBlocks (PTIB *, PPIB *);
  1980. XULONG DosSearchPath( ULONG, char*, char*, char*, ULONG ) ;
  1981. X
  1982. X/* define PM world coordinate limits */
  1983. X#define PM_XMAX 4096
  1984. X#define PM_YMAX 4096
  1985. X
  1986. X/* approximations for typical font/screen sizes */
  1987. X
  1988. X#define PM_VCHAR (PM_YMAX/30) 
  1989. X#define PM_HCHAR (PM_XMAX/80) 
  1990. X#define PM_VTIC (PM_YMAX/100)
  1991. X#define PM_HTIC (PM_XMAX/150)
  1992. X
  1993. X/* graphics commands */
  1994. X#define SET_GRAPHICS    'G'
  1995. X#define SET_TEXT        'E'
  1996. X#define SET_LINE        'L'
  1997. X#define SET_ANGLE       'A'
  1998. X#define SET_JUSTIFY     'J'
  1999. X#define SET_POINTMODE   'D'
  2000. X#define GR_MOVE         'M'
  2001. X#define GR_DRAW         'V'
  2002. X#define GR_RESET        'R'
  2003. X#define GR_TEXT         'T'
  2004. X#define GR_PAUSE        'P'
  2005. X#define GR_HELP         'H'
  2006. X#define PM_nopts 1
  2007. X
  2008. Xstatic char PM_path[256] = "" ;  /* path for pm program */
  2009. Xstatic int  PM_mode      = 0 ;   /* track mode to avoid redraw after hitting break */
  2010. Xstatic     HEV hev ;
  2011. X
  2012. Xchar PM_opts[PM_nopts][20] = {
  2013. X   " "
  2014. X   };
  2015. Xint PM_optarg[PM_nopts] = { 
  2016. X   0
  2017. X   };
  2018. X
  2019. XFILE *PM_pipe=NULL, *fopen();
  2020. Xchar PM_command[1024]= "gnuplot_PM -name gnuplot";
  2021. X
  2022. X
  2023. X/*   PM_args - scan gnuplot command line for options */
  2024. X
  2025. XPM_args(argc, argv) int argc; char *argv[]; {
  2026. X   int nPM = 0, n;
  2027. X   if( PM_path[0]=='\0' ) getcwd( PM_path, 256 ) ;
  2028. X   return(nPM);
  2029. X   }
  2030. X
  2031. XPM_init() 
  2032. X    { 
  2033. X    static char buffer[1024] ;
  2034. X    int pid ;
  2035. X    int rc ;
  2036. X    PPIB pib ;
  2037. X    PTIB tib ;
  2038. X    char semname[32] ;
  2039. X    char pipename[32] ;
  2040. X    char tempname[32] ;
  2041. X    if( PM_pipe == NULL ) {
  2042. X        strcpy( tempname, "gpXXXXXX" ) ;
  2043. X        if( mktemp( tempname ) == NULL ) {
  2044. X            fprintf( stderr, "Temp name failure !\n" ) ;
  2045. X            abort() ;   
  2046. X            }
  2047. X        strcpy( semname, "\\sem32\\" ) ;
  2048. X        strcpy( pipename, "\\pipe\\" ) ;
  2049. X        strcat( semname, tempname ) ;
  2050. X        strcat( pipename, tempname ) ;
  2051. X        strcat( PM_path, "\\gnupmdrv.exe" ) ;
  2052. X        rc = access( PM_path, 0 ) ;
  2053. X            /* find exe file */ 
  2054. X  
  2055. X        if( rc != 0 ) 
  2056. X            rc = DosSearchPath( 0x0002, /* search GNUPLOT environment */
  2057. X                                "GNUPLOT",
  2058. X                                "gnupmdrv.exe",
  2059. X                                PM_path,
  2060. X                                256 ) ; 
  2061. X
  2062. X        if( rc != 0 ) 
  2063. X            rc = DosSearchPath( 0x0003,  /* then try current directory & path */
  2064. X                                "PATH",
  2065. X                                "gnupmdrv.exe",
  2066. X                                PM_path,
  2067. X                                256 ) ; 
  2068. X        if( rc != 0 ) {
  2069. X            fprintf( stderr, "Can't find gnupmdrv.exe !\n" ) ;
  2070. X            abort() ;   
  2071. X            }
  2072. X                            
  2073. X        rc = DosCreateEventSem( semname, &hev, 1, 0 ) ;
  2074. X        if( rc != 0 ) {
  2075. X            fprintf( stderr, "Can't create semaphore !\n" ) ;
  2076. X            abort() ;   
  2077. X            }
  2078. X        pid=spawnl( P_SESSION|P_DEFAULT, PM_path, "GnuplotPM", tempname, NULL ) ;
  2079. X        if( rc == -1 ) {
  2080. X            fprintf( stderr, "Can't spawn gnupmdrv.exe !\n" ) ;
  2081. X            abort() ;   
  2082. X            }
  2083. X
  2084. X        DosGetInfoBlocks( &tib, &pib ) ;
  2085. X        DosWaitEventSem( hev, 10000 ) ;        
  2086. X        PM_pipe = fopen( pipename, "r+b" ) ; 
  2087. X        if( PM_pipe == NULL ) {
  2088. X            fprintf( stderr, "Can't open pipe to gnupmdrv.exe !\n" ) ;
  2089. X            abort() ;   
  2090. X            }
  2091. X        setvbuf( PM_pipe, buffer, _IOFBF, 1024 ) ;
  2092. X        pid = pib->pib_ulpid ;
  2093. X        fwrite( &pid, 1, 4, PM_pipe ) ;
  2094. X        fflush( PM_pipe ) ;
  2095. X        }
  2096. X    }
  2097. X
  2098. XPM_reset() {
  2099. X        putc( GR_RESET, PM_pipe); 
  2100. X        fflush(PM_pipe);
  2101. X        }
  2102. X
  2103. XPM_text() 
  2104. X    {
  2105. X    if( PM_mode != SET_TEXT ) { 
  2106. X        putc( SET_TEXT, PM_pipe); 
  2107. X        fflush(PM_pipe);
  2108. X        }
  2109. X    PM_mode = SET_TEXT ;
  2110. X    }
  2111. X
  2112. XPM_graphics() 
  2113. X    { 
  2114. X    putc( SET_GRAPHICS, PM_pipe); 
  2115. X    PM_mode = SET_GRAPHICS ;
  2116. X    }
  2117. X
  2118. XPM_move(unsigned int x, unsigned int y) 
  2119. X    { 
  2120. X    putc( GR_MOVE, PM_pipe ) ;
  2121. X    fwrite( &x, sizeof(int), 1, PM_pipe ) ;
  2122. X    fwrite( &y, sizeof(int), 1, PM_pipe ) ;
  2123. X    }
  2124. X
  2125. XPM_vector(unsigned int x, unsigned int y)
  2126. X    { 
  2127. X    putc( GR_DRAW, PM_pipe ) ;
  2128. X    fwrite( &x, sizeof(int), 1, PM_pipe ) ;
  2129. X    fwrite( &y, sizeof(int), 1, PM_pipe ) ;
  2130. X    }
  2131. X
  2132. XPM_linetype(int lt)
  2133. X    { 
  2134. X    putc( SET_LINE, PM_pipe ) ;
  2135. X    fwrite( <, sizeof(int), 1, PM_pipe ) ;
  2136. X    }
  2137. X
  2138. XPM_text_angle( int ta)
  2139. X    { 
  2140. X    putc( SET_ANGLE, PM_pipe ) ;
  2141. X    fwrite( &ta, sizeof(int), 1, PM_pipe ) ;
  2142. X    return(TRUE) ; 
  2143. X    }
  2144. X
  2145. XPM_put_text(unsigned int x, unsigned int y, char *str) 
  2146. X    {
  2147. X    int len ;
  2148. X    putc( GR_TEXT, PM_pipe ) ;
  2149. X    fwrite( &x, sizeof(int), 1, PM_pipe ) ;
  2150. X    fwrite( &y, sizeof(int), 1, PM_pipe ) ;
  2151. X    len = strlen( str ) + 1 ;
  2152. X    fwrite( &len, sizeof(int), 1, PM_pipe ) ;
  2153. X    fwrite( str, 1, len, PM_pipe ) ;
  2154. X    for( len=sizeof(int)-len%sizeof(int); len > 0 ; len-- )  /* pad rest of int with zeros */
  2155. X        putc( '\0', PM_pipe ) ;
  2156. X    }
  2157. X
  2158. XPM_justify_text( enum JUSTIFY mode ) 
  2159. X    {
  2160. X    putc( SET_JUSTIFY, PM_pipe ) ;
  2161. X    fwrite( &mode, sizeof(int), 1, PM_pipe ) ;
  2162. X    return(TRUE);
  2163. X    }
  2164. X
  2165. XPM_point( int x, int y, int number )
  2166. X/*
  2167. X** tell the driver we are plotting a point so it can decide whether to
  2168. X** use colour or not
  2169. X*/
  2170. X    {
  2171. X    int mode ;
  2172. X    mode=1 ;
  2173. X    putc( SET_POINTMODE, PM_pipe ) ;
  2174. X    fwrite( &mode, sizeof(int), 1, PM_pipe ) ;
  2175. X    do_point( x, y, number ) ;
  2176. X    mode = 0 ;
  2177. X    putc( SET_POINTMODE, PM_pipe ) ;
  2178. X    fwrite( &mode, sizeof(int), 1, PM_pipe ) ;
  2179. X    }
  2180. X
  2181. XPM_pause( char *str )
  2182. X/*
  2183. X** pause - using message box on PM screen
  2184. X*/
  2185. X    {
  2186. X    int len, cbR, rc ;
  2187. X    unsigned long ul ;
  2188. X    char buf[256] ;
  2189. X    char *bp ;
  2190. X
  2191. X    if( PM_pipe == NULL ) return 2 ;
  2192. X    bp=buf ;
  2193. X    putc( GR_PAUSE, PM_pipe ) ;
  2194. X    len = strlen( str ) + 1 ;
  2195. X    fwrite( &len, sizeof(int), 1, PM_pipe ) ;
  2196. X    fwrite( str, 1, len, PM_pipe ) ;
  2197. X    for( rc=sizeof(int)-len%sizeof(int); rc > 0 ; rc-- )  /* pad rest of int with zeros */
  2198. X        putc( '\0', PM_pipe ) ;
  2199. X    fflush(PM_pipe ) ;
  2200. X    rc=DosRead( fileno(PM_pipe), &len, sizeof(int), &cbR ) ;
  2201. X    return len ;
  2202. X    }
  2203. END_OF_FILE
  2204.   if test 7141 -ne `wc -c <'gnuplot/term/pm.trm'`; then
  2205.     echo shar: \"'gnuplot/term/pm.trm'\" unpacked with wrong size!
  2206.   fi
  2207.   # end of 'gnuplot/term/pm.trm'
  2208. fi
  2209. if test -f 'gnuplot/term/tek.trm' -a "${1}" != "-c" ; then 
  2210.   echo shar: Will not clobber existing file \"'gnuplot/term/tek.trm'\"
  2211. else
  2212.   echo shar: Extracting \"'gnuplot/term/tek.trm'\" \(6797 characters\)
  2213.   sed "s/^X//" >'gnuplot/term/tek.trm' <<'END_OF_FILE'
  2214. X/*
  2215. X * $Id: tek.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  2216. X *
  2217. X */
  2218. X
  2219. X/* GNUPLOT - tek.trm */
  2220. X/*
  2221. X * Copyright (C) 1990 - 1993   
  2222. X *
  2223. X * Permission to use, copy, and distribute this software and its
  2224. X * documentation for any purpose with or without fee is hereby granted, 
  2225. X * provided that the above copyright notice appear in all copies and 
  2226. X * that both that copyright notice and this permission notice appear 
  2227. X * in supporting documentation.
  2228. X *
  2229. X * Permission to modify the software is granted, but not the right to
  2230. X * distribute the modified code.  Modifications are to be distributed 
  2231. X * as patches to released version.
  2232. X *  
  2233. X * This software  is provided "as is" without express or implied warranty.
  2234. X * 
  2235. X * This file is included by ../term.c.
  2236. X *
  2237. X * This terminal driver supports:
  2238. X *  tek40xx, bitgraph, kermit_color_tek40xx, kermit_mono_tek40xx, selanar
  2239. X *  ln03plus
  2240. X *
  2241. X * AUTHORS
  2242. X *   Colin Kelley, Thomas Williams, Russell Lang
  2243. X * 
  2244. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  2245. X * 
  2246. X */
  2247. X
  2248. X#ifdef TEK
  2249. X
  2250. X#define TEK40XMAX 1024
  2251. X#define TEK40YMAX 780
  2252. X
  2253. X#define TEK40XLAST (TEK40XMAX - 1)
  2254. X#define TEK40YLAST (TEK40YMAX - 1)
  2255. X
  2256. X#define TEK40VCHAR        25
  2257. X#define TEK40HCHAR        14
  2258. X#define TEK40VTIC        11
  2259. X#define TEK40HTIC        11    
  2260. X
  2261. X#define HX 0x20        /* bit pattern to OR over 5-bit data */
  2262. X#define HY 0x20
  2263. X#define LX 0x40
  2264. X#define LY 0x60
  2265. X
  2266. X#define LOWER5 31
  2267. X#define UPPER5 (31<<5)
  2268. X
  2269. X
  2270. XTEK40init()
  2271. X{
  2272. X}
  2273. X
  2274. X
  2275. XTEK40graphics()
  2276. X{
  2277. X#ifdef vms
  2278. X    term_pasthru();
  2279. X#endif /* vms */
  2280. X    fprintf(outfile,"\033\014");
  2281. X/*                   1
  2282. X    1. clear screen
  2283. X*/
  2284. X    (void) fflush(outfile);
  2285. X    sleep(1);  
  2286. X    /* sleep 1 second to allow screen time to clear on real 
  2287. X       tektronix terminals */
  2288. X}
  2289. X
  2290. XTEK40text()
  2291. X{
  2292. X    TEK40move(0,12);
  2293. X    fprintf(outfile,"\037");
  2294. X/*                   1
  2295. X    1. into alphanumerics
  2296. X*/
  2297. X#ifdef vms
  2298. X    term_nopasthru();
  2299. X#endif /* vms */
  2300. X}
  2301. X
  2302. X
  2303. XTEK40linetype(linetype)
  2304. Xint linetype;
  2305. X{
  2306. X}
  2307. X
  2308. XTEK40move(x,y)
  2309. Xunsigned int x,y;
  2310. X{
  2311. X    (void) putc('\035', outfile);    /* into graphics */
  2312. X    TEK40vector(x,y);
  2313. X}
  2314. X
  2315. X
  2316. XTEK40vector(x,y)
  2317. Xunsigned int x,y;
  2318. X{
  2319. X    (void) putc((HY | (y & UPPER5)>>5), outfile);
  2320. X    (void) putc((LY | (y & LOWER5)), outfile);
  2321. X    (void) putc((HX | (x & UPPER5)>>5), outfile);
  2322. X    (void) putc((LX | (x & LOWER5)), outfile);
  2323. X}
  2324. X
  2325. X
  2326. XTEK40put_text(x,y,str)
  2327. Xunsigned int x,y;
  2328. Xchar str[];
  2329. X{
  2330. X    TEK40move(x,y-11);
  2331. X    fprintf(outfile,"\037%s\n",str);
  2332. X}
  2333. X
  2334. X
  2335. XTEK40reset()
  2336. X{
  2337. X}
  2338. X
  2339. X#endif /* TEK */
  2340. X
  2341. X
  2342. X
  2343. X/* thanks to dukecdu!evs (Ed Simpson) for the BBN BitGraph driver */
  2344. X
  2345. X#ifdef BITGRAPH
  2346. X
  2347. X#define BG_XMAX                 768 /* width of plot area */
  2348. X#define BG_YMAX                 768 /* height of plot area */
  2349. X#define BG_SCREEN_HEIGHT    1024 /* full screen height */
  2350. X
  2351. X#define BG_XLAST     (BG_XMAX - 1)
  2352. X#define BG_YLAST     (BG_YMAX - 1)
  2353. X
  2354. X#define BG_VCHAR    16
  2355. X#define BG_HCHAR     9
  2356. X#define BG_VTIC         8
  2357. X#define BG_HTIC         8    
  2358. X
  2359. X
  2360. X#define BG_init TEK40init
  2361. X
  2362. X#define BG_graphics TEK40graphics
  2363. X
  2364. X
  2365. X#define BG_linetype TEK40linetype
  2366. X
  2367. X#define BG_move TEK40move
  2368. X
  2369. X#define BG_vector TEK40vector
  2370. X
  2371. X
  2372. XBG_text()
  2373. X{
  2374. X    BG_move(0, BG_SCREEN_HEIGHT - 2 * BG_VCHAR);
  2375. X    fprintf(outfile,"\037");
  2376. X/*                   1
  2377. X    1. into alphanumerics
  2378. X*/
  2379. X}
  2380. X
  2381. X
  2382. XBG_put_text(x,y,str)
  2383. Xunsigned int x,y;
  2384. Xchar str[];
  2385. X{
  2386. X    BG_move(x,y-11);
  2387. X    fprintf(outfile,"\037%s\n",str);
  2388. X}
  2389. X
  2390. X
  2391. X#define BG_reset TEK40reset
  2392. X
  2393. X#endif /* BITGRAPH */
  2394. X
  2395. X
  2396. X/* Color and Monochrome specials for the MS-DOS Kermit Tektronix Emulator
  2397. X   by Russell Lang,  eln272v@monu1.cc.monash.oz  */
  2398. X
  2399. X#ifdef KERMIT
  2400. X
  2401. X#define KTEK40HCHAR        13
  2402. X
  2403. XKTEK40graphics()
  2404. X{
  2405. X#ifdef vms
  2406. X        term_mode_tek();
  2407. X    term_pasthru();
  2408. X#endif /* vms */
  2409. X    fprintf(outfile,"\033\014");
  2410. X/*                   1
  2411. X    1. clear screen
  2412. X*/
  2413. X    /* kermit tektronix emulation doesn't need to wait */
  2414. X}
  2415. X
  2416. XKTEK40Ctext()
  2417. X{
  2418. X    TEK40text();
  2419. X    KTEK40Clinetype(0);  /* change to green */
  2420. X#ifdef vms
  2421. X    term_nopasthru();
  2422. X#endif /* vms */
  2423. X}
  2424. X
  2425. X/* special color linetypes for MS-DOS Kermit v2.31 tektronix emulator */
  2426. X/*    0 = normal, 1 = bright 
  2427. X    foreground color (30-37) = 30 + colors
  2428. X        where colors are   1=red, 2=green, 4=blue */
  2429. Xstatic char *kermit_color[15]= {"\033[0;37m","\033[1;30m",
  2430. X        "\033[0;32m","\033[0;36m","\033[0;31m","\033[0;35m",
  2431. X        "\033[1;34m","\033[1;33m","\033[1;31m","\033[1;37m",
  2432. X        "\033[1;35m","\033[1;32m","\033[1;36m","\033[0;34m",
  2433. X        "\033[0;33m"};
  2434. X
  2435. XKTEK40Clinetype(linetype)
  2436. Xint linetype;
  2437. X{
  2438. X    if (linetype >= 13)
  2439. X        linetype %= 13;
  2440. X    fprintf(outfile,"%s",kermit_color[linetype+2]);
  2441. X}
  2442. X
  2443. X
  2444. X/* linetypes for MS-DOS Kermit v2.30 tektronix emulator */
  2445. X/* `=solid, a=fine dots, b=short dashes, c=dash dot, 
  2446. X   d=long dash dot, e=dash dot dot */
  2447. Xstatic char *kerm_linetype = "`a`abcde" ;
  2448. X
  2449. XKTEK40Mlinetype(linetype)
  2450. Xint linetype;
  2451. X{
  2452. X    if (linetype >= 6)
  2453. X        linetype %= 6;
  2454. X    fprintf(outfile,"\033%c",kerm_linetype[linetype+2]);
  2455. X}
  2456. X
  2457. XKTEK40reset()
  2458. X{
  2459. X    fprintf(outfile,"\030\n");  /* turn off Tek emulation */
  2460. X#ifdef vms
  2461. X    term_mode_native();
  2462. X#endif /* vms */
  2463. X}
  2464. X
  2465. X#endif /* KERMIT */
  2466. X
  2467. X
  2468. X/* thanks to sask!macphed (Geoff Coleman and Ian Macphedran) for the
  2469. X   Selanar driver */
  2470. X
  2471. X#ifdef SELANAR
  2472. X
  2473. XSEL_init()
  2474. X{
  2475. X    fprintf(outfile,"\033\062");
  2476. X/*                    1
  2477. X    1. set to ansi mode
  2478. X*/
  2479. X}
  2480. X
  2481. X
  2482. XSEL_graphics()
  2483. X{
  2484. X    fprintf(outfile,"\033[H\033[J\033\061\033\014");
  2485. X/*                   1           2       3
  2486. X    1. clear ANSI screen
  2487. X    2. set to TEK mode
  2488. X    3. clear screen
  2489. X*/
  2490. X}
  2491. X
  2492. X
  2493. XSEL_text()
  2494. X{
  2495. X    TEK40move(0,12);
  2496. X    fprintf(outfile,"\033\062");
  2497. X/*                   1
  2498. X    1. into ANSI mode
  2499. X*/
  2500. X}
  2501. X
  2502. XSEL_reset()
  2503. X{
  2504. X    fprintf(outfile,"\033\061\033\012\033\062\033[H\033[J");
  2505. X/*                   1        2       3      4
  2506. X1       set tek mode
  2507. X2       clear screen
  2508. X3       set ansi mode
  2509. X4       clear screen
  2510. X*/
  2511. X}
  2512. X#endif /* SELANAR */
  2513. X
  2514. X#ifdef VTTEK
  2515. X
  2516. XVTTEK40init()
  2517. X{
  2518. X        fprintf(outfile,"\033[?38h");
  2519. X        fflush(outfile);
  2520. X        sleep(1);
  2521. X        /* sleep 1 second to allow screen time to clear on some terminals */
  2522. X#ifdef vms
  2523. X        term_mode_tek();
  2524. X#endif /* vms */
  2525. X}
  2526. X
  2527. XVTTEK40reset()
  2528. X{
  2529. X        fprintf(outfile,"\033[?38l");
  2530. X        fflush(outfile);
  2531. X        sleep(1);
  2532. X        /* sleep 1 second to allow screen time to clear on some terminals */
  2533. X#ifdef vms
  2534. X        term_mode_native();
  2535. X#endif /* vms */
  2536. X}
  2537. X
  2538. X/* linetypes for VT-type terminals in tektronix emulator mode */
  2539. X/* `=solid, a=fine dots, b=short dashes, c=dash dot,
  2540. X   d=long dash dot, h=bold solid, i=bold fine dots, j=bold short dashes,
  2541. X   k=bold dash dot, l=bold long dash dot */
  2542. Xstatic char *vt_linetype = "`a`abcdhijkl" ;
  2543. Xstatic int last_vt_linetype = 0;
  2544. XVTTEK40linetype(linetype)
  2545. Xint linetype;
  2546. X{
  2547. X        if (linetype >= 10)
  2548. X                linetype %= 10;
  2549. X        fprintf(outfile,"\033%c",vt_linetype[linetype+2]);
  2550. X        last_vt_linetype = linetype;
  2551. X}
  2552. X
  2553. XVTTEK40put_text(x,y,str)
  2554. Xunsigned int x,y;
  2555. Xchar str[];
  2556. X{
  2557. X        int linetype;
  2558. X        linetype = last_vt_linetype;
  2559. X        VTTEK40linetype(0);
  2560. X        TEK40put_text(x,y,str);
  2561. X        VTTEK40linetype(linetype);
  2562. X}
  2563. X
  2564. X#endif /* VTTEK */
  2565. X
  2566. X#ifdef LN03P
  2567. X
  2568. XLN03Pinit()
  2569. X{
  2570. X    fprintf(outfile,"\033[?38h");
  2571. X}
  2572. X
  2573. XLN03Preset()
  2574. X{
  2575. X    fprintf(outfile,"\033[?38l");
  2576. X}
  2577. X#endif /* LN03P */
  2578. END_OF_FILE
  2579.   if test 6797 -ne `wc -c <'gnuplot/term/tek.trm'`; then
  2580.     echo shar: \"'gnuplot/term/tek.trm'\" unpacked with wrong size!
  2581.   fi
  2582.   # end of 'gnuplot/term/tek.trm'
  2583. fi
  2584. if test -f 'gnuplot/term/texdraw.trm' -a "${1}" != "-c" ; then 
  2585.   echo shar: Will not clobber existing file \"'gnuplot/term/texdraw.trm'\"
  2586. else
  2587.   echo shar: Extracting \"'gnuplot/term/texdraw.trm'\" \(7694 characters\)
  2588.   sed "s/^X//" >'gnuplot/term/texdraw.trm' <<'END_OF_FILE'
  2589. X/*
  2590. X * $Id: texdraw.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  2591. X */
  2592. X
  2593. X/* GNUPLOT - texdraw.trm */
  2594. X/*
  2595. X * Copyright (C) 1990
  2596. X *
  2597. X * Permission to use, copy, and distribute this software and its
  2598. X * documentation for any purpose with or without fee is hereby granted,
  2599. X * provided that the above copyright notice appear in all copies and
  2600. X * that both that copyright notice and this permission notice appear
  2601. X * in supporting documentation.
  2602. X *
  2603. X * Permission to modify the software is granted, but not the right to
  2604. X * distribute the modified code.  Modifications are to be distributed
  2605. X * as patches to released version.
  2606. X *
  2607. X * This software  is provided "as is" without express or implied warranty.
  2608. X *
  2609. X * This file is included by ../term.c.
  2610. X *
  2611. X * This terminal driver supports:
  2612. X *   The TEXDRAW macros for LaTeX.
  2613. X *
  2614. X * AUTHORS
  2615. X *   Khun Yee Fung. Modified from eepic.trm.
  2616. X *   clipper@csd.uwo.ca
  2617. X *   January 20, 1992
  2618. X *
  2619. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  2620. X *
  2621. X */
  2622. X
  2623. X/*
  2624. X *  This file contains the texdraw terminal driver, intended for use with the
  2625. X *  texdraw macro package for LaTeX. This is an alternative to the
  2626. X *  latex driver. You need texdraw.sty, and texdraw.tex in the texdraw package.
  2627. X *
  2628. X */
  2629. X
  2630. X#define TEXDRAW_PTS_PER_INCH (72.27)
  2631. X#define DOTS_PER_INCH (300)    /* resolution of printer we expect to use */
  2632. X#define TEXDRAW_UNIT (TEXDRAW_PTS_PER_INCH/DOTS_PER_INCH) /* dot size in pt */
  2633. X
  2634. X/* 5 inches wide by 3 inches high (default) */
  2635. X#define TEXDRAW_XMAX (5*DOTS_PER_INCH)
  2636. X#define TEXDRAW_YMAX (3*DOTS_PER_INCH)
  2637. X
  2638. X#define TEXDRAW_HTIC (5*DOTS_PER_INCH/72)    /* (5./TEXDRAW_UNIT) */
  2639. X#define TEXDRAW_VTIC (5*DOTS_PER_INCH/72)    /* (5./TEXDRAW_UNIT) */
  2640. X#define TEXDRAW_HCHAR (DOTS_PER_INCH*53/10/72)    /* (5.3/TEXDRAW_UNIT) */
  2641. X#define TEXDRAW_VCHAR (DOTS_PER_INCH*11/72)    /* (11./TEXDRAW_UNIT) */
  2642. X
  2643. Xstatic unsigned int TEXDRAW_posx;
  2644. Xstatic unsigned int TEXDRAW_posy;
  2645. Xenum JUSTIFY TEXDRAW_justify = LEFT;
  2646. Xenum JUSTIFY TEXDRAW_last_justify = LEFT;
  2647. Xstatic int TEXDRAW_angle = 0;
  2648. Xstatic float TEXDRAW_scalefactor = 0.2409;
  2649. Xstatic double TEXDRAW_xscale = 1.0, TEXDRAW_yscale = 1.0;
  2650. X
  2651. X/* for DOTS point style */
  2652. X#define TEXDRAW_TINY_DOT "\\htext{$\\cdot$}"
  2653. X
  2654. X/* POINTS */
  2655. X#define TEXDRAW_POINT_TYPES 12    /* we supply more point types */
  2656. Xstatic char GPFAR * GPFAR TEXDRAW_points[] =
  2657. X{
  2658. X  "\\rmove(0 4)\\htext{$\\Diamond$}",
  2659. X  "\\htext{$+$}",
  2660. X  "\\rmove(0 4)\\htext{$\\Box$}",
  2661. X  "\\htext{$\\times$}",
  2662. X  "\\htext{$\\triangle$}",
  2663. X  "\\htext{$\\star$}",
  2664. X  "\\lcir f:9",
  2665. X  "\\lcir f:12",
  2666. X  "\\lcir f:16",
  2667. X  "\\fcir f:0.9 r:9",
  2668. X  "\\fcir f:0.9 r:12",
  2669. X  "\\fcir f:0.9 r:16"
  2670. X};
  2671. X
  2672. X/* LINES */
  2673. X#define TEXDRAW_NUMLINES 5    /* number of linetypes below */
  2674. Xstatic int TEXDRAW_lines[] =
  2675. X{
  2676. X  4,        /* -2 border */
  2677. X  3,        /* -1 axes */
  2678. X  3,        /*  0 solid thin  */
  2679. X  4,        /*  1 solid thick */
  2680. X  6,        /*  2 solid Thick */
  2681. X};
  2682. X
  2683. Xstatic int TEXDRAW_last_type = 0; /* The line type selected most recently */
  2684. Xstatic int TEXDRAW_type;    /* current line type */
  2685. Xstatic TBOOLEAN TEXDRAW_inline = FALSE;    /* are we in the middle of a line */
  2686. Xstatic void TEXDRAW_endline();    /* terminate any line in progress */
  2687. Xstatic int TEXDRAW_linecount = 0;    /* number of points in line so far */
  2688. X#define TEXDRAW_LINEMAX 5    /* max value for linecount */
  2689. X
  2690. XTEXDRAW_init()
  2691. X{
  2692. X  TEXDRAW_posx = TEXDRAW_posy = 0;
  2693. X  TEXDRAW_linetype(-1);
  2694. X  fprintf(outfile, "%% GNUPLOT: LaTeX using TEXDRAW macros\n");
  2695. X}
  2696. X
  2697. X
  2698. XTEXDRAW_scale(xs, ys)
  2699. Xdouble xs, ys;            /* scaling factors */
  2700. X{
  2701. X  register struct termentry *t = &term_tbl[term];
  2702. X
  2703. X  /* we change the table for use in graphics.c */
  2704. X  t->xmax = (unsigned int) (TEXDRAW_XMAX * xs);
  2705. X  t->ymax = (unsigned int) (TEXDRAW_YMAX * ys);
  2706. X
  2707. X  TEXDRAW_xscale = xs;
  2708. X  TEXDRAW_yscale = ys;
  2709. X
  2710. X  return (TRUE);
  2711. X}
  2712. X
  2713. XTEXDRAW_graphics()
  2714. X{
  2715. Xstatic char GPFAR tdg1[] = "\
  2716. X\\begin{texdraw}\n\
  2717. X\\normalsize\n\
  2718. X\\ifx\\pathDEFINED\\relax\\else\\let\\pathDEFINED\\relax\n\
  2719. X \\def\\QtGfr{\\ifx (\\TGre \\let\\YhetT\\cpath\\else\\let\\YhetT\\relax\\fi\\YhetT}\n\
  2720. X \\def\\path (#1 #2){\\move (#1 #2)\\futurelet\\TGre\\QtGfr}\n\
  2721. X \\def\\cpath (#1 #2){\\lvec (#1 #2)\\futurelet\\TGre\\QtGfr}\n\
  2722. X\\fi\n\
  2723. X\\drawdim pt\n\
  2724. X\\setunitscale %2.2f\n\
  2725. X\\linewd %d\n\
  2726. X\\textref h:L v:C\n";
  2727. X  fprintf(outfile, tdg1, 
  2728. X    TEXDRAW_scalefactor,
  2729. X    TEXDRAW_lines[2]);
  2730. X  TEXDRAW_last_type = 0;
  2731. X  TEXDRAW_type = 0;
  2732. X}
  2733. X
  2734. X
  2735. XTEXDRAW_text()
  2736. X{
  2737. X  TEXDRAW_endline();
  2738. X  fprintf(outfile, "\\end{texdraw}\n");
  2739. X}
  2740. X
  2741. X
  2742. XTEXDRAW_linetype(linetype)
  2743. Xint linetype;
  2744. X{
  2745. X  TEXDRAW_endline();
  2746. X
  2747. X  if (linetype >= TEXDRAW_NUMLINES - 2)
  2748. X    linetype %= (TEXDRAW_NUMLINES - 2);
  2749. X
  2750. X  TEXDRAW_type = linetype;
  2751. X}
  2752. X
  2753. X
  2754. XTEXDRAW_move(x, y)
  2755. Xunsigned int x, y;
  2756. X{
  2757. X  TEXDRAW_endline();
  2758. X
  2759. X  TEXDRAW_posx = x;
  2760. X  TEXDRAW_posy = y;
  2761. X}
  2762. X
  2763. X
  2764. XTEXDRAW_point(x, y, number)
  2765. Xunsigned int x, y;
  2766. Xint number;
  2767. X{
  2768. X  TEXDRAW_move(x, y);
  2769. X
  2770. X  /* Print the character defined by 'number'; number < 0 means
  2771. X        to use a dot, otherwise one of the defined points. */
  2772. X  fprintf(outfile, "\\move (%d %d)\n",
  2773. X      (int)((double) x * TEXDRAW_xscale),
  2774. X      (int)((double) y * TEXDRAW_yscale));
  2775. X  if (TEXDRAW_last_justify != CENTRE) {
  2776. X    fprintf(outfile, "\\textref h:C v:C ");
  2777. X    TEXDRAW_last_justify = CENTRE;
  2778. X  }
  2779. X  fprintf(outfile, "%s\n",
  2780. X      (number < 0 ?
  2781. X       TEXDRAW_TINY_DOT :
  2782. X       TEXDRAW_points[number % TEXDRAW_POINT_TYPES]));
  2783. X}
  2784. X
  2785. X
  2786. XTEXDRAW_vector(ux, uy)
  2787. Xunsigned int ux, uy;
  2788. X{
  2789. X  if (!TEXDRAW_inline) {
  2790. X    TEXDRAW_inline = TRUE;
  2791. X
  2792. X    /* Start a new line. This depends on line type */
  2793. X    if (TEXDRAW_type != TEXDRAW_last_type){
  2794. X      if (TEXDRAW_lines[TEXDRAW_type+2] != TEXDRAW_lines[TEXDRAW_last_type+2])
  2795. X    fprintf(outfile, "\\linewd %d\n", TEXDRAW_lines[TEXDRAW_type + 2]);
  2796. X      TEXDRAW_last_type = TEXDRAW_type;
  2797. X    }
  2798. X    fprintf(outfile, "\\path (%d %d)",
  2799. X        (int)((double) TEXDRAW_posx * TEXDRAW_xscale),
  2800. X        (int)((double) TEXDRAW_posy * TEXDRAW_yscale));
  2801. X    TEXDRAW_linecount = 1;
  2802. X  }
  2803. X  else {
  2804. X    /* Even though we are in middle of a path,
  2805. X     * we may want to start a new path command.
  2806. X     * If they are too long then latex will choke.
  2807. X     */
  2808. X    if (TEXDRAW_linecount++ >= TEXDRAW_LINEMAX) {
  2809. X      fprintf(outfile, "\n\\cpath ");
  2810. X      TEXDRAW_linecount = 1;
  2811. X    }
  2812. X  }
  2813. X  fprintf(outfile, "(%d %d)",
  2814. X      (int)((double) ux * TEXDRAW_xscale),
  2815. X      (int)((double) uy * TEXDRAW_yscale));
  2816. X  TEXDRAW_posx = ux;
  2817. X  TEXDRAW_posy = uy;
  2818. X}
  2819. X
  2820. Xstatic void TEXDRAW_endline()
  2821. X{
  2822. X  if (TEXDRAW_inline) {
  2823. X    fprintf(outfile, "\n");
  2824. X    TEXDRAW_inline = FALSE;
  2825. X  }
  2826. X}
  2827. X
  2828. X
  2829. XTEXDRAW_arrow(sx, sy, ex, ey, head)
  2830. Xint sx, sy, ex, ey;
  2831. XTBOOLEAN head;
  2832. X{
  2833. X  char text;
  2834. X
  2835. X  if (head)
  2836. X    text = 'a';
  2837. X  else
  2838. X    text = 'l';
  2839. X  fprintf(outfile, "\\move (%d %d)\\%cvec (%d %d)",
  2840. X      (int)((double) sx * TEXDRAW_xscale),
  2841. X      (int)((double) sy * TEXDRAW_yscale),
  2842. X      text,
  2843. X      (int)((double) ex * TEXDRAW_xscale),
  2844. X      (int)((double) ey * TEXDRAW_yscale));
  2845. X  TEXDRAW_posx = ex;
  2846. X  TEXDRAW_posy = ey;
  2847. X}
  2848. X
  2849. X
  2850. XTEXDRAW_put_text(x, y, str)
  2851. Xint x, y;            /* reference point of string */
  2852. Xchar str[];            /* the text */
  2853. X{
  2854. X  char text;
  2855. X
  2856. X  TEXDRAW_endline();
  2857. X
  2858. X  fprintf(outfile, "\\move (%d %d)",
  2859. X      (int)((double) x * TEXDRAW_xscale),
  2860. X      (int)((double) y * TEXDRAW_yscale));
  2861. X
  2862. X  if (!TEXDRAW_angle)
  2863. X    text = 'h';
  2864. X  else
  2865. X    text = 'v';
  2866. X
  2867. X  if (TEXDRAW_last_justify != TEXDRAW_justify) {
  2868. X    TEXDRAW_last_justify = TEXDRAW_justify;
  2869. X    if (TEXDRAW_justify == LEFT)
  2870. X      fprintf(outfile, "\\textref h:L v:C ");
  2871. X    else if (TEXDRAW_justify == CENTRE)
  2872. X      fprintf(outfile, "\\textref h:C v:C ");
  2873. X    else if (TEXDRAW_justify == RIGHT)
  2874. X      fprintf(outfile, "\\textref h:R v:C ");
  2875. X  }
  2876. X  fprintf(outfile, "\\%ctext{%s}\n", text, str);
  2877. X}
  2878. X
  2879. X
  2880. Xint TEXDRAW_justify_text(mode)
  2881. Xenum JUSTIFY mode;
  2882. X{
  2883. X  TEXDRAW_justify = mode;
  2884. X  return (TRUE);
  2885. X}
  2886. X
  2887. Xint TEXDRAW_text_angle(angle)
  2888. Xint angle;
  2889. X{
  2890. X  TEXDRAW_angle = angle;
  2891. X  return (TRUE);
  2892. X}
  2893. X
  2894. XTEXDRAW_reset()
  2895. X{
  2896. X  TEXDRAW_endline();
  2897. X  TEXDRAW_posx = TEXDRAW_posy = 0;
  2898. X}
  2899. END_OF_FILE
  2900.   if test 7694 -ne `wc -c <'gnuplot/term/texdraw.trm'`; then
  2901.     echo shar: \"'gnuplot/term/texdraw.trm'\" unpacked with wrong size!
  2902.   fi
  2903.   # end of 'gnuplot/term/texdraw.trm'
  2904. fi
  2905. echo shar: End of archive 26 \(of 33\).
  2906. cp /dev/null ark26isdone
  2907. MISSING=""
  2908. for I in 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 ; do
  2909.     if test ! -f ark${I}isdone ; then
  2910.     MISSING="${MISSING} ${I}"
  2911.     fi
  2912. done
  2913. if test "${MISSING}" = "" ; then
  2914.     echo You have unpacked all 33 archives.
  2915.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2916. else
  2917.     echo You still must unpack the following archives:
  2918.     echo "        " ${MISSING}
  2919. fi
  2920. exit 0
  2921. exit 0 # Just in case...
  2922.