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

  1. Newsgroups: comp.sources.misc
  2. From: woo@playfair.stanford.edu ("Alexander Woo")
  3. Subject: v40i039:  gnuplot - interactive function plotting utility, Part27/33
  4. Message-ID: <1993Oct25.030201.2547@sparky.sterling.com>
  5. X-Md4-Signature: f1c4bcc61f93d150dd3d938e9af164e9
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 25 Oct 1993 03:02:01 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
  12. Posting-number: Volume 40, Issue 39
  13. Archive-name: gnuplot/part27
  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/0README gnuplot/README.3d
  22. #   gnuplot/demo/contours.dem gnuplot/demo/stat.inc
  23. #   gnuplot/makefile.msw gnuplot/os2/gnupmdrv.rc gnuplot/term.h
  24. #   gnuplot/term/dumb.trm gnuplot/term/excl.trm gnuplot/term/hppj.trm
  25. #   gnuplot/term/sun.trm gnuplot/term/win.trm
  26. # Wrapped by kent@sparky on Wed Oct 20 17:14:59 1993
  27. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  28. echo If this archive is complete, you will see the following message:
  29. echo '          "shar: End of archive 27 (of 33)."'
  30. if test -f 'gnuplot/0README' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'gnuplot/0README'\"
  32. else
  33.   echo shar: Extracting \"'gnuplot/0README'\" \(6071 characters\)
  34.   sed "s/^X//" >'gnuplot/0README' <<'END_OF_FILE'
  35. XGnuplot is a command-line driven interactive function plotting utility
  36. Xfor UNIX, MSDOS, and VMS platforms.  The software is copyrighted but
  37. Xfreely distributed (i.e., you don't have to pay for it).  It was
  38. Xoriginally intended as graphical program which would allow scientists
  39. Xand students to visualize mathematical functions and data.  Gnuplot
  40. Xsupports many different types of terminals, plotters, and printers
  41. X(including many color devices, and pseudo-devices like LaTeX) and is
  42. Xeasily extensible to include new devices.  [ The "GNU" in gnuplot is
  43. XNOT related to the Free Software Foundation, the naming is just a
  44. Xcoincidence (and a long story). Thus gnuplot is not covered by the Gnu
  45. Xcopyleft, but rather by its own copyright statement, included in all
  46. Xsource code files.]
  47. X
  48. XGnuplot handles both curves (2 dimensions) and surfaces (3
  49. Xdimensions). Surfaces can be plotted as a mesh fitting the specified
  50. Xfunction, floating in the 3-d coordinate space, or as a contour plot
  51. Xon the x-y plane. For 2-d plots, there are also many plot styles,
  52. Xincluding lines, points, lines with points, error bars, and impulses
  53. X(crude bar graphs). Graphs may be labeled with arbitrary labels and
  54. Xarrows, axes labels, a title, date and time, and a key.  The interface
  55. Xincludes command-line editing and history on most platforms.
  56. X
  57. XThe new gnuplot user should begin by reading the general information
  58. Xavailable by typing `help` after running gnuplot. Then read about the
  59. X`plot` command (type `help plot`).  The manual for gnuplot (which is a
  60. Xnicely formatted version of the on-line help information) can be
  61. Xprinted either with TeX, troff or nroff.  Look at the docs/Makefile
  62. Xfor the appropriate option.
  63. X
  64. X                      Help and Bug Reports
  65. X
  66. XAdditional help can be obtained from the USENET newsgroup
  67. X        comp.graphics.gnuplot.
  68. XThis newsgroup is the first place to ask for routine help.  It is is
  69. Xgatewayed to a mailing list info-gnuplot@dartmouth.edu.  If you cannot
  70. Xobtain a USENET feed and wish to join the above mailing list (or get
  71. Xyourself off), mail to
  72. X        info-gnuplot-request@dartmouth.edu.
  73. XPlease do not ask to sign up if you can read comp.graphics.gnuplot.
  74. X
  75. XNote that since gnuplot has nothing to do with the GNU project, please
  76. Xdon't ask them for help or information about gnuplot; also, please
  77. Xdon't ask us about GNU stuff.
  78. X
  79. XThere is another list specifically for documented bug reports
  80. Xand the submissions of fixes and modifications, bug-gnuplot@dartmouth.edu.
  81. XTo join this list send mail to bug-gnuplot-request@dartmouth.edu.
  82. X
  83. X"bug-gnuplot" is NOT an appropriate place to ask questions on how to
  84. Xsolve a gnuplot problem or even to report a bug that you haven't
  85. Xinvestigated personally.  It is far more likely you'll get the help
  86. Xyou need for this kind of problem from comp.graphics.gnuplot.
  87. X
  88. X"bug-gnuplot" is appropriate for turning in a formal bug report
  89. Xthat does not require timely action.  In other words, if you spend
  90. Xtime and investigate a bug, and especially if you fix a bug, then
  91. Xsend it to bug-report and your fix will be considered for the next
  92. Xrelease of gnuplot.  Fixes should be in ``diff -c'' format done
  93. Xagainst the most current official version of gnuplot or the latest
  94. Xalpha or beta release of the next version.  All major modifications
  95. Xshould include documentation and a demo file.  Finally, it is
  96. Xmuch easier to integrate smaller stepwise modifications rather
  97. Xthan one gigantic diff file which represented months of changes.
  98. XAll messages to bug-gnuplot should include the machine you are using, the
  99. Xoperating system and it's version, plotting devices, and the version
  100. Xof gnuplot that you are running.
  101. X
  102. X                   Where to get updates to GNUPLOT
  103. X
  104. XCongratulations on getting this version of GNUPLOT! Unfortunately, it
  105. Xmay not be the most recent version ("you never know where this version
  106. Xhas been!"). You can be sure that it IS the most recent version by
  107. Xchecking one of the official distribution sites, guaranteed to be kept
  108. Xup to date (of course, if you got this file from one of those sites,
  109. Xyou don't need to check!).
  110. X
  111. XTo hear automatically about future releases (and other GNUPLOT news),
  112. Xread the newsgroup; see above.
  113. X
  114. XAt the time of this writing, the following are the official
  115. Xdistribution sites and transfer instructions. Note that
  116. Xprep.ai.mit.edu is NOT an official site, and may not be up to date.
  117. XAlso, comp.sources.misc is usually a month or so behind us.
  118. X
  119. XDate: Fri Aug 27 05:21:33 GMT 1993
  120. X
  121. X
  122. XVersion: 3.5
  123. X
  124. XIn general, GNUPLOT 3.5 is available as the file gnuplot3.5.tar.Z.
  125. XThere will patches to bring 3.4 to 3.5 as well called gp34to35.shar.Z.
  126. X(Version 3.3 was skipped because of possible confusion
  127. Xwith the numerous BETA releases.)  It will be made available to simtel20 
  128. Xand its mirrors in ZIP format, along with a DOS, MS-Windows 3.1 and
  129. XOS/2 2.0 executables.
  130. X
  131. XAlso, some sites will have gpdoc_ps.zip which contains
  132. XPostScript versions of the manuals and tutorials.
  133. X
  134. XPlease obtain gnuplot from the site
  135. Xnearest you.
  136. X
  137. XUSENET users:
  138. X
  139. X    GNUPLOT 3.5 will posted to comp.sources.misc.
  140. X
  141. X
  142. XNORTH AMERICA:
  143. X
  144. X     Anonymous ftp to ftp.dartmouth.edu (129.170.16.4)
  145. X     Fetch
  146. X        pub/gnuplot/gnuplot3.5.tar.Z
  147. X     in binary mode.
  148. X
  149. X     Users without ftp capability can obtain it through a mail ftp
  150. X     server. Send a mail message saying 'help' to
  151. X     BITFTP@pucc.princeton.edu for instructions. For a uuencoded
  152. X     copy of the gnuplot sources (compressed tar file), send this
  153. X     message to BITFTP@pucc.princeton.edu:
  154. X         FTP DARTMOUTH.EDU UUENCODE
  155. X         USER ANONYMOUS
  156. X         CD pub/gnuplot
  157. X         BINARY
  158. X         GET gnuplot3.5.tar.Z
  159. X         QUIT
  160. X
  161. X
  162. XAUSTRALIA:
  163. X
  164. X     Anonymous ftp to monu1.cc.monash.edu.au (130.194.1.101).
  165. X     Fetch pub/gnuplot3.5.tar.Z in binary mode.
  166. X
  167. X
  168. XEUROPE:
  169. X
  170. X     Anonymous ftp to irisa.irisa.fr (131.254.2.3).
  171. X     Fetch pub/gnuplot3.5.tar.Z in binary mode.
  172. X
  173. X----
  174. X
  175. X     DISCLAIMER - This product is not related in any way to
  176. X     Pixar or any other commercial venture.
  177. X
  178. X----
  179. X
  180. X                                        -Thomas Williams-
  181. X                                        -Alex Woo-
  182. END_OF_FILE
  183.   if test 6071 -ne `wc -c <'gnuplot/0README'`; then
  184.     echo shar: \"'gnuplot/0README'\" unpacked with wrong size!
  185.   fi
  186.   # end of 'gnuplot/0README'
  187. fi
  188. if test -f 'gnuplot/README.3d' -a "${1}" != "-c" ; then 
  189.   echo shar: Will not clobber existing file \"'gnuplot/README.3d'\"
  190. else
  191.   echo shar: Extracting \"'gnuplot/README.3d'\" \(6205 characters\)
  192.   sed "s/^X//" >'gnuplot/README.3d' <<'END_OF_FILE'
  193. X
  194. X                   A tutorial on explicit/parametric
  195. X                                   and
  196. X                    everything you did not dare to ask
  197. X                                  about
  198. X                           curves and surfaces
  199. X                                    in
  200. X                                  gnuplot
  201. X
  202. XSeveral types of curves and surface are supported in gnuplot. Of those
  203. Xnot every operation is supported for every curve or surface type and it
  204. Xcan be therefore useful to understand the different types, their advantages
  205. Xand limitations.
  206. X
  207. XCurves in gnuplot are almost always planar (with one exception which we
  208. Xwill deal with in the end) and are assumed to be in the XY plane.
  209. XTherefore only X and Y coordinates are needed for plotting curves.
  210. XThe simplest curve is the `explicit function`. This curve is in fact a
  211. Xfunction and for each given x, there is one and only one y value associated
  212. Xwith it. A gnuplot example for such type is `plot sin(x)` or
  213. X`plot "datafile" using 1". Note the later is using only a single column from
  214. Xthe data file which is assumed to be the y values.
  215. X
  216. XAlternatively one can define a `parametric curve` form. In this case
  217. Xx and y are both functions of a third free parameter t, while independent
  218. Xof each other. A circle can be expressed parametrically as x = cos(t),
  219. Xy = sin(t) and be plotted using gnuplot as
  220. X'set parametric; plot cos(t),sin(t)'.
  221. XThis form is not a function since there can be unlimited number of y values
  222. Xassociated with same x. Furthermore the explicit form is a special case of
  223. Xthe parametric representation by letting x equal to t. The curve y = sin(x)
  224. Xcan be written in parametric form as y = sin(t), x = t.
  225. X
  226. XWe are used to think of the plane in cartesian coordinate system.
  227. XIn practice, some coordinate systems may be easier to use then others
  228. Xunder some circumstances. The polar form uses a different basis
  229. Xto span the XY plane. In this representation the cartesian x coordinate
  230. Xis equal to r cos(t) and the cartesian y coordinate is equal to r sin(t).
  231. XTo draw a unit circle using the polar coordinate system in gnuplot use the
  232. Xfollowing simple command: 'set polar; plot 1'. To better understand this
  233. Xexplicit form lets backup a little.
  234. XWhen we plot a regular explicit function like `y = sin(x)` we march in equal
  235. Xsteps in x, evaluate the provided function and plot a piecewise linear curve
  236. Xbetween the sampled points approximating the real function. In the polar
  237. Xexplicit form we do exactly the same thing, but we march along the angular
  238. Xdirection - we turn around the origin, computing the length of the radius
  239. Xat that angle. Since for the unit circle, this radius is a constant 1,
  240. X`plot 1` in polar form plots a circle (if t domain is from 0 or 2Pi).
  241. XNote the polar form is explicit in that for each angle there is only a
  242. Xsingle radius.
  243. X
  244. XSurprisingly (or maybe not so surprising) surfaces share the same
  245. Xrepresentations. Since surfaces are two dimensional entities, they
  246. Xrequire two free parameters (like t for curves).
  247. X
  248. XA surface explicit function uses x and y as the free parameters. For
  249. Xeach such pair it provides a single z value. An example for this form
  250. Xcan be `splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)` for a three dimensional
  251. Xsinc function or `splot 'datafile' using 1`. As for curves, the single column
  252. Xused from the data file defines the function value or z in this case.
  253. XThe order of the x and y function values is very strict in this form and
  254. Xsimply defines a rectangular grid in the XY plane. Fortunately this
  255. Xstrict form allows us to apply a very simplistic hidden line algorithm
  256. Xcalled "the floating horizon". This hidden line algorithm exploits the
  257. Xrectangular XY domain of the surface and therefore may be used for this
  258. Xtype of surfaces only. Since in gnuplot this is the only form of hidden
  259. Xlines removing algorithm provided, only explicit surfaces may have their
  260. Xhidden lines removed.
  261. X
  262. XParametric surfaces are the exact extension for explicit surfaces as in
  263. Xthe curves case. the x, y, and z are defined in terms of two new free
  264. Xvariables and are totally independent of each other as x(u, v), y(u, v),
  265. Xand z(u, v). Again the explicit surface is a special case of the parametric
  266. Xrepresentation where x = u, and y = v. Examples for plotting parametric
  267. Xsurfaces in gnuplot can be `splot cos(u)*cos(v),cos(u)*sin(v),sin(u)` which
  268. Xdefines a sphere, or `splot "datafile" using 1:2:3`. Since these are
  269. Xparametric surfaces, gnuplot must be informed to handle them by issuing
  270. X`set parametric`.
  271. X
  272. XThe curve polar form takes the obvious extensions in the surface world.
  273. XThe first possible extension is spherical coordinate system, while the
  274. Xsecond is the cylindrical one. These modes currently work for data files
  275. Xonly and both requires two parameters, theta and phi for mapping onto the
  276. Xunit sphere, and theta and z form mapping on a unit radius cylinder as follow:
  277. X
  278. X        Spherical coord.                        Cylin. coord.
  279. X        ----------------                        -------------
  280. X        x = cos( theta ) * cos( phi )           x = cos( theta )
  281. X        y = sin( theta ) * cos( phi )           y = sin( theta )
  282. X        z = sin( phi )                          z = z
  283. X
  284. XThis subject brings us back to non planar curves. When surfaces are displayed
  285. Xunder gnuplot, isocurves are actually getting plotted. An isocurve is a
  286. Xcurve on the surface in which one of the two free parameters of the
  287. Xsurface is fixed. For example the u isolines of a surface are drawn by
  288. Xsetting u to be fixed and varying v along the entire v domain. The v isolines
  289. Xare similarly drawn by fixing v. When data files are specified they are
  290. Xclassified internally into two types. A surface is tagged to have grid
  291. Xtopology if all its specified isolines are of the same length. A data mesh
  292. Xof five isolines, seven points each is an example. In such a case the
  293. Xsurface cross isolines are drawn as well. Seven isolines with five points
  294. Xeach will be automatically created and drawn for grid type data. If
  295. Xhowever, isolines of different length are found in the data, it is
  296. Xtagged as nongrid surface and in fact is nothing more than a collection
  297. Xof three dimensional curves. Only the provided data is plotted in that
  298. Xcase (see world.dem for such an example).
  299. END_OF_FILE
  300.   if test 6205 -ne `wc -c <'gnuplot/README.3d'`; then
  301.     echo shar: \"'gnuplot/README.3d'\" unpacked with wrong size!
  302.   fi
  303.   # end of 'gnuplot/README.3d'
  304. fi
  305. if test -f 'gnuplot/demo/contours.dem' -a "${1}" != "-c" ; then 
  306.   echo shar: Will not clobber existing file \"'gnuplot/demo/contours.dem'\"
  307. else
  308.   echo shar: Extracting \"'gnuplot/demo/contours.dem'\" \(4657 characters\)
  309.   sed "s/^X//" >'gnuplot/demo/contours.dem' <<'END_OF_FILE'
  310. X#
  311. X# $Id: contours.dem%v 3.38.2.146 1993/06/30 21:24:08 woo Exp woo $
  312. X#
  313. Xset samples 20
  314. Xset isosamples 21
  315. Xset xlabel "X axis" -5,-2
  316. Xset ylabel "Y axis" 4,-1
  317. Xset zlabel "Z axis"
  318. Xset title "3D gnu plot demo - contour plot"
  319. Xset contour
  320. Xsplot x*y
  321. Xpause -1 "Hit return to continue (1)"
  322. Xset cntrparam levels 20
  323. Xset title "3D gnu plot demo - contour plot (more contours)"
  324. Xreplot
  325. Xpause -1 "Hit return to continue (2)"
  326. Xset cntrparam levels incr -100,10,100
  327. Xset title "3D gnu plot demo - contour plot (every 10, starting at -100)"
  328. Xreplot
  329. Xpause -1 "Hit return to continue (3)"
  330. Xset cntrparam levels disc -75,-50,0
  331. Xset title "3D gnu plot demo - contour plot (at -75, -50, 0)"
  332. Xreplot
  333. Xpause -1 "Hit return to continue (4)"
  334. Xset cntrparam levels auto 10
  335. Xset title "3D gnu plot demo - contour plot on base grid"
  336. Xset contour base
  337. Xsplot x**2-y**2
  338. Xpause -1 "Hit return to continue (5)"
  339. Xset title "3D gnu plot demo - contour plot on surface"
  340. Xset contour surface
  341. Xreplot
  342. Xpause -1 "Hit return to continue (6)"
  343. Xset title "3D gnu plot demo - contour plot on both"
  344. Xset contour both
  345. Xreplot
  346. Xpause -1 "Hit return to continue (7)"
  347. Xset contour base
  348. Xset title "3D gnu plot demo - 2 surfaces
  349. Xsplot x**2*y**3, x**3*y**2
  350. Xpause -1 "Hit return to continue (8)"
  351. Xset title "3D gnu plot demo - some more interesting contours"
  352. Xsplot x*y / (x**2 + y**2 + 0.1)
  353. Xpause -1 "Hit return to continue (9)"
  354. Xsplot [x=-3:3] [y=-3:3] sin(x) * cos(y)
  355. Xpause -1 "Hit return to continue (10)"
  356. Xset zrange [-0.5:0.5]
  357. Xreplot
  358. Xpause -1 "Hit return to continue (11)"
  359. Xset samples 6
  360. Xset isosamples 6
  361. Xset cntrparam levels 5
  362. Xset title "3D gnu plot demo - low resolution (6x6)"
  363. Xreplot
  364. Xpause -1 "Hit return to continue (12)"
  365. Xset cntrparam bspline
  366. Xset title "3D gnu plot demo - low resolution (6x6) using bspline approx."
  367. Xreplot
  368. Xpause -1 "Hit return to continue (13)"
  369. Xset cntrparam order 8
  370. Xset title "3D gnu plot demo - low resolution (6x6) raise bspline order."
  371. Xreplot
  372. Xpause -1 "Hit return to continue (14)"
  373. Xset cntrparam linear
  374. Xset auto
  375. Xset title "3D gnu plot demo - low resolution (6x6) using linear contours."
  376. Xsplot x*y
  377. Xpause -1 "Hit return to continue (15)"
  378. Xset cntrparam order 4
  379. Xset cntrparam bspline
  380. Xset title "3D gnu plot demo - low resolution (6x6) using bspline approx."
  381. Xreplot
  382. Xpause -1 "Hit return to continue (16)"
  383. Xset samples 25
  384. Xset isosamples 26
  385. Xset title "3D gnu plot demo - contour of Sinc function"
  386. Xsplot [-5:5.01] [-5:5.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
  387. Xpause -1 "Hit return to continue (17)"
  388. Xsplot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
  389. Xpause -1 "Hit return to continue (18)"
  390. Xset cntrparam levels 10
  391. Xset xrange [0:15]
  392. Xset yrange [0:15]
  393. Xset auto
  394. Xset zrange [-0.6:0.6]
  395. Xset data style lines
  396. Xset title "3D gnu plot demo - contour of data grid plotting"
  397. Xset parametric
  398. Xsplot "glass.dat"
  399. Xpause -1 "Hit return to continue (19)"
  400. Xset zrange [-1.2:1.2]
  401. Xset noparametric
  402. Xsplot "glass.dat" using 1
  403. Xpause -1 "Hit return to continue (20)"
  404. Xset view 0,0,1
  405. Xset nosurface
  406. Xset title "3D gnu plot demo - 2D contour projection of last plot"
  407. Xreplot
  408. Xpause -1 "Hit return to continue (21)"
  409. X
  410. X#From: shen@athena.cs.uga.edu (Mingzuo Shen)
  411. X#Subject: Rosenbrock's function: some answers and thanks
  412. X#Date: Wed, 23 Jun 1993 20:50:36 GMT
  413. X#
  414. X#    Last night I asked for help with a contour plot for the function:
  415. X#
  416. X#    (1-x)**2 + 100 * (y - x**2)**2
  417. X#
  418. X#which should have a minimum at (x=1,y=1). This is the 2D case of a more
  419. X#general function named after Rosenbrock (the book I am reading does not
  420. X#give a reference to any paper/book by this person):
  421. X#
  422. X#    for even integer n,
  423. X#
  424. X#    f(x) = \sum_{j=1,3,5,\ldots,n} [(1 - x_j)^2 + 100(x_{j+1} - x_j^2)^2]
  425. X#
  426. X#where x is a vector (x1, x2, ..., x_n). This function also have a minimum
  427. X#at (1,1,...,1), which lies at the base of a "banana-shaped valley".
  428. X#Here are the new commands I have tried.
  429. X#
  430. Xset auto
  431. Xset surface
  432. Xset nocontour
  433. Xset cntrparam levels 5
  434. Xset cntrparam linear
  435. Xset samples 100
  436. Xset logscale z
  437. Xset hidden3d
  438. Xset isosamples 20
  439. Xset view 70,335,1
  440. Xset xlabel "x"
  441. Xset ylabel "y"
  442. Xset title "Rosenbrock Function"
  443. Xsplot [0.9:1.1] [0.9:1.1] (1-x)**2 + 100*(y - x**2)**2
  444. Xpause -1 "Hit Return to Continue (22)"
  445. X
  446. Xset logscale z
  447. Xset hidden3d
  448. Xset isosamples 60
  449. Xset view 20,340,1,2
  450. Xset xlabel "x"
  451. Xset ylabel "y"
  452. Xsplot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2
  453. Xpause -1 "Hit Return to Continue (23)"
  454. Xset contour
  455. Xset nosurface
  456. Xreplot
  457. Xpause -1 "Hit Return to Continue (24)"
  458. X#
  459. X# Clean up:
  460. X#
  461. Xset nolog
  462. Xset surface
  463. Xset nocontour
  464. Xset cntrparam levels 5
  465. Xset cntrparam linear
  466. Xset samples 100
  467. Xset isosamples 10
  468. Xset view 60,30,1,1
  469. Xset xrange [-10:10]
  470. Xset yrange [-10:10]
  471. Xset zrange [-10:10]
  472. Xset auto
  473. Xset title "" 0,0
  474. Xset xlabel "" 0,0
  475. Xset ylabel "" 0,0
  476. Xset zlabel "" 0,0
  477. END_OF_FILE
  478.   if test 4657 -ne `wc -c <'gnuplot/demo/contours.dem'`; then
  479.     echo shar: \"'gnuplot/demo/contours.dem'\" unpacked with wrong size!
  480.   fi
  481.   # end of 'gnuplot/demo/contours.dem'
  482. fi
  483. if test -f 'gnuplot/demo/stat.inc' -a "${1}" != "-c" ; then 
  484.   echo shar: Will not clobber existing file \"'gnuplot/demo/stat.inc'\"
  485. else
  486.   echo shar: Extracting \"'gnuplot/demo/stat.inc'\" \(6353 characters\)
  487.   sed "s/^X//" >'gnuplot/demo/stat.inc' <<'END_OF_FILE'
  488. X#
  489. X# $Id: stat.inc 3.38.2.6 1992/11/14 02:25:21 woo Exp $
  490. X#
  491. X# Library of Statistical Functions version 3.0
  492. X#
  493. X# Permission granted to distribute freely for non-commercial purposes only
  494. X#
  495. X# Copyright (c) 1991, 1992 Jos van der Woude, jvdwoude@hut.nl
  496. X
  497. X# If you don't have the gamma() and/or lgamma() functions in your library,
  498. X# you can use the following recursive definitions. They are correct for all
  499. X# values i / 2 with i = 1, 2, 3, ... This is sufficient for most statistical
  500. X# needs.
  501. X#logsqrtpi = log(sqrt(pi))
  502. X#lgamma(x) = (x<=0.5)?logsqrtpi:((x==1)?0:log(x-1)+lgamma(x-1))
  503. X#gamma(x) = exp(lgamma(x))
  504. X
  505. X# If you have the lgamma() function compiled into gnuplot, you can use
  506. X# alternate definitions for some PDFs. For larger arguments this will result
  507. X# in more efficient evalution. Just uncomment the definitions containing the
  508. X# string `lgamma', while at the same time commenting out the originals.
  509. X# NOTE: In these cases the recursive definition for lgamma() is NOT sufficient!
  510. X
  511. X# Some PDFs have alternate definitions of a recursive nature. I suppose these
  512. X# are not really very efficient, but I find them aesthetically pleasing to the
  513. X# brain.
  514. X
  515. X# Define useful constants
  516. Xfourinvsqrtpi=4.0/sqrt(pi)
  517. Xinvpi=1.0/pi
  518. Xinvsqrt2pi=1.0/sqrt(2.0*pi)
  519. Xlog2=log(2.0)
  520. Xsqrt2=sqrt(2.0)
  521. Xsqrt2invpi=sqrt(2.0/pi)
  522. Xtwopi=2.0*pi
  523. X
  524. X# define variables plus default values used as parameters in PDFs
  525. X# some are integers, others MUST be reals
  526. Xa=1.0
  527. Xalpha=0.5
  528. Xb=2.0
  529. Xdf1=1
  530. Xdf2=1
  531. Xg=1.0
  532. Xlambda=1.0
  533. Xm=0.0
  534. Xmm=1
  535. Xmu=0.0
  536. Xnn=2
  537. Xn=2
  538. Xp=0.5
  539. Xq=0.5
  540. Xr=1
  541. Xrho=1.0
  542. Xsigma=1.0
  543. Xu=1.0
  544. X
  545. X#
  546. X#define 1.0/Beta function
  547. X#
  548. XBinv(p,q)=exp(lgamma(p+q)-lgamma(p)-lgamma(q))
  549. X
  550. X#
  551. X#define Probability Density Functions (PDFs)
  552. X#
  553. X
  554. X# NOTE:
  555. X# The discrete PDFs are calulated for all real values, using the int()
  556. X# function to truncate to integers. This is a monumental waste of processing
  557. X# power, but I see no other easy solution. If anyone has any smart ideas
  558. X# about this, I would like to know. Setting the sample size to a larger value
  559. X# makes the discrete PDFs look better, but takes even more time.
  560. X
  561. X# Arcsin PDF
  562. Xarcsin(x)=invpi/sqrt(r*r-x*x)
  563. X
  564. X# Beta PDF
  565. Xbeta(x)=Binv(p,q)*x**(p-1.0)*(1.0-x)**(q-1.0)
  566. X
  567. X# Binomial PDF
  568. X#binom(x)=n!/(n-int(x))!/int(x)!*p**int(x)*(1.0-p)**(n-int(x))
  569. X
  570. Xbin_s(x)=n!/(n-int(x))!/int(x)!*p**int(x)*(1.0-p)**(n-int(x))
  571. Xbin_l(x)=exp(lgamma(n+1)-lgamma(n-int(x)+1)-lgamma(int(x)+1)\
  572. X+int(x)*log(p)+(n-int(x))*log(1.0-p))
  573. Xbinom(x)=(n<50)?bin_s(x):bin_l(x)
  574. X
  575. X# Cauchy PDF
  576. Xcauchy(x)=b/(pi*(b*b+(x-a)**2))
  577. X
  578. X# Chi-square PDF
  579. X#chi(x)=x**(0.5*df1-1.0)*exp(-0.5*x)/gamma(0.5*df1)/2**(0.5*df1)
  580. Xchi(x)=exp((0.5*df1-1.0)*log(x)-0.5*x-lgamma(0.5*df1)-df1*0.5*log2)
  581. X
  582. X# Erlang PDF
  583. Xerlang(x)=lambda**n/(n-1)!*x**(n-1)*exp(-lambda*x)
  584. X
  585. X# Extreme (Gumbel extreme value) PDF
  586. Xextreme(x)=alpha*(exp(-alpha*(x-u)-exp(-alpha*(x-u))))
  587. X
  588. X# F PDF
  589. Xf(x)=Binv(0.5*df1,0.5*df2)*(df1/df2)**(0.5*df1)*x**(0.5*df1-1.0)/\
  590. X(1.0+df1/df2*x)**(0.5*(df1+df2))
  591. X
  592. X# Gamma PDF
  593. X#g(x)=lambda**rho*x**(rho-1.0)*exp(-lambda*x)/gamma(rho)
  594. Xg(x)=exp(rho*log(lambda)+(rho-1.0)*log(x)-lgamma(rho)-lambda*x)
  595. X
  596. X# Geometric PDF
  597. X#geometric(x)=p*(1.0-p)**int(x)
  598. Xgeometric(x)=exp(log(p)+int(x)*log(1.0-p))
  599. X
  600. X# Half normal PDF
  601. Xhalfnormal(x)=sqrt2invpi/sigma*exp(-0.5*(x/sigma)**2)
  602. X
  603. X# Hypergeometric PDF
  604. Xhypgeo(x)=(int(x)>mm||int(x)<mm+n-nn)?0:\
  605. Xmm!/(mm-int(x))!/int(x)!*(nn-mm)!/(n-int(x))!/(nn-mm-n+int(x))!*(nn-n)!*n!/nn!
  606. X
  607. X# Laplace PDF
  608. Xlaplace(x)=0.5/b*exp(-abs(x-a)/b)
  609. X
  610. X# Logistic PDF
  611. Xlogistic(x)=lambda*exp(-lambda*(x-a))/(1.0+exp(-lambda*(x-a)))**2
  612. X
  613. X# Lognormal PDF
  614. Xlognormal(x)=invsqrt2pi/sigma/x*exp(-0.5*((log(x)-mu)/sigma)**2)
  615. X
  616. X# Maxwell PDF
  617. Xmaxwell(x)=fourinvsqrtpi*a**3*x*x*exp(-a*a*x*x)
  618. X
  619. X# Negative binomial PDF
  620. X#negbin(x)=(r+int(x)-1)!/int(x)!/(r-1)!*p**r*(1.0-p)**int(x)
  621. Xnegbin(x)=exp(lgamma(r+int(x))-lgamma(r)-lgamma(int(x)+1)+\
  622. Xr*log(p)+int(x)*log(1.0-p))
  623. X
  624. X# Negative exponential PDF
  625. Xnexp(x)=lambda*exp(-lambda*x)
  626. X
  627. X# Normal PDF
  628. Xnormal(x)=invsqrt2pi/sigma*exp(-0.5*((x-mu)/sigma)**2)
  629. X
  630. X# Pareto PDF
  631. Xpareto(x)=x<a?0:b/x*(a/x)**b
  632. X
  633. X# Poisson PDF
  634. Xpoisson(x)=mu**int(x)/int(x)!*exp(-mu)
  635. X#poisson(x)=exp(int(x)*log(mu)-lgamma(int(x)+1)-mu)
  636. X#poisson(x)=(x<1)?exp(-mu):mu/int(x)*poisson(x-1)
  637. X#lpoisson(x)=(x<1)?-mu:log(mu)-log(int(x))+lpoisson(x-1)
  638. X
  639. X# Rayleigh PDF
  640. Xrayleigh(x)=lambda*2.0*x*exp(-lambda*x*x)
  641. X
  642. X# Sine PDF
  643. Xsine(x)=2.0/a*sin(n*pi*x/a)**2
  644. X
  645. X# t (Student's t) PDF
  646. Xt(x)=Binv(0.5*df1,0.5)/sqrt(df1)*(1.0+(x*x)/df1)**(-0.5*(df1+1.0))
  647. X
  648. X# Triangular PDF
  649. Xtriangular(x)=1.0/g-abs(x-m)/(g*g)
  650. X
  651. X# Uniform PDF
  652. Xuniform(x)=1.0/(b-a)
  653. X
  654. X# Weibull PDF
  655. Xweibull(x)=lambda*n*x**(n-1)*exp(-lambda*x**n)
  656. X
  657. X#
  658. X#define Cumulative Distribution Functions (CDFs)
  659. X#
  660. X
  661. X# Arcsin CDF
  662. Xcarcsin(x)=0.5+invpi*asin(x/r)
  663. X
  664. X# incomplete Beta CDF
  665. Xcbeta(x)=ibeta(p,q,x)
  666. X
  667. X# Binomial CDF
  668. X#cbinom(x)=(x<1)?binom(0):binom(x)+cbinom(x-1)
  669. Xcbinom(x)=ibeta(n-x,x+1.0,1.0-p)
  670. X
  671. X# Cauchy CDF
  672. Xccauchy(x)=0.5+invpi*atan((x-a)/b)
  673. X
  674. X# Chi-square CDF
  675. Xcchi(x)=igamma(0.5*df1,0.5*x)
  676. X
  677. X# Erlang CDF
  678. X# approximation, using first three terms of expansion
  679. Xcerlang(x)=1.0-exp(-lambda*x)*(1.0+lambda*x+0.5*(lambda*x)**2)
  680. X
  681. X# Extreme (Gumbel extreme value) CDF
  682. Xcextreme(x)=exp(-exp(-alpha*(x-u)))
  683. X
  684. X# F CDF
  685. Xcf(x)=1.0-ibeta(0.5*df2,0.5*df1,df2/(df2+df1*x))
  686. X
  687. X# incomplete Gamma CDF
  688. Xcgamma(x)=igamma(rho,x)
  689. X
  690. X# Geometric CDF
  691. Xcgeometric(x)=(x<1)?geometric(0):geometric(x)+cgeometric(x-1)
  692. X
  693. X# Half normal CDF
  694. Xchalfnormal(x)=erf(x/sigma/sqrt2)
  695. X
  696. X# Hypergeometric CDF
  697. Xchypgeo(x)=(x<1)?hypgeo(0):hypgeo(x)+chypgeo(x-1)
  698. X
  699. X# Laplace CDF
  700. Xclaplace(x)=(x<a)?0.5*exp((x-a)/b):1.0-0.5*exp(-(x-a)/b)
  701. X
  702. X# Logistic CDF
  703. Xclogistic(x)=1.0/(1.0+exp(-lambda*(x-a)))
  704. X
  705. X# Lognormal CDF
  706. Xclognormal(x)=cnormal(log(x))
  707. X
  708. X# Maxwell CDF
  709. Xcmaxwell(x)=igamma(1.5,a*a*x*x)
  710. X
  711. X# Negative binomial CDF
  712. Xcnegbin(x)=(x<1)?negbin(0):negbin(x)+cnegbin(x-1)
  713. X
  714. X# Negative exponential CDF
  715. Xcnexp(x)=1.0-exp(-lambda*x)
  716. X
  717. X# Normal CDF
  718. Xcnormal(x)=0.5+0.5*erf((x-mu)/sigma/sqrt2)
  719. X#cnormal(x)=0.5+((x>mu)?0.5:-0.5)*igamma(0.5,0.5*((x-mu)/sigma)**2)
  720. X
  721. X# Pareto CDF
  722. Xcpareto(x)=x<a?0:1.0-(a/x)**b
  723. X
  724. X# Poisson CDF
  725. X#cpoisson(x)=(x<1)?poisson(0):poisson(x)+cpoisson(x-1)
  726. Xcpoisson(x)=1.0-igamma(x+1.0,mu)
  727. X
  728. X# Rayleigh CDF
  729. Xcrayleigh(x)=1.0-exp(-lambda*x*x)
  730. X
  731. X# Sine CDF
  732. Xcsine(x)=x/a-sin(n*twopi*x/a)/(n*twopi)
  733. X
  734. X# t (Student's t) CDF
  735. Xct(x)=(x<0.0)?0.5*ibeta(0.5*df1,0.5,df1/(df1+x*x)):\
  736. X1.0-0.5*ibeta(0.5*df1,0.5,df1/(df1+x*x))
  737. X
  738. X# Triangular PDF
  739. Xctriangular(x)=0.5+(x-m)/g-(x-m)*abs(x-m)/(2.0*g*g)
  740. X
  741. X# Uniform CDF
  742. Xcuniform(x)=(x-a)/(b-a)
  743. X
  744. X# Weibull CDF
  745. Xcweibull(x)=1.0-exp(-lambda*x**n)
  746. END_OF_FILE
  747.   if test 6353 -ne `wc -c <'gnuplot/demo/stat.inc'`; then
  748.     echo shar: \"'gnuplot/demo/stat.inc'\" unpacked with wrong size!
  749.   fi
  750.   # end of 'gnuplot/demo/stat.inc'
  751. fi
  752. if test -f 'gnuplot/makefile.msw' -a "${1}" != "-c" ; then 
  753.   echo shar: Will not clobber existing file \"'gnuplot/makefile.msw'\"
  754. else
  755.   echo shar: Extracting \"'gnuplot/makefile.msw'\" \(6444 characters\)
  756.   sed "s/^X//" >'gnuplot/makefile.msw' <<'END_OF_FILE'
  757. X#
  758. X# $Id: makefile.msw%v 3.50 1993/07/09 05:35:24 woo Exp $
  759. X#
  760. X# Make file for Microsoft C  Version 7.0 Windows Version
  761. X# and Microsoft Program Maintenance Utility  Version 1.20
  762. X# 
  763. X
  764. X# where to place gnuplot.gih helpfile
  765. XHELPFILE = wgnuplot.hlp
  766. XTOP = .
  767. X
  768. X# /c  means don't link
  769. X# /AL means large memory model (large code, large data)
  770. X# /DLITE means remove hiddenline capability
  771. X# /Gt128 means make data object > 128 FAR
  772. X# /W1 means lower warning level
  773. X# /I  means extra include directory
  774. X# /GD means windows DLL
  775. X# /GA means windows application
  776. X# /Fm means produce link map
  777. X# /Od means suppress optimizations (esp. for debug)
  778. X# /Zi mean prepare for codeview
  779. XCFLAGS = /c /ALw /FmGNUPLOT /GA /Gt128 /W1 /D__MSC__ /DREADLINE /I$(TOP) #/Zi #/Od
  780. XDLLCC = cl /c /Asnw /FmGNUPLIB /GD /W1 /D__MSC__ /D__DLL__ /I$(TOP) #/Zi #/Od
  781. X
  782. X# see other terminal defines in term.h
  783. XTERMFLAGS = 
  784. X
  785. X# /NOE means NO EXTernal Dictionary
  786. X# /NOI means NO ignore case
  787. X# /NOD means no default library (or :specified)
  788. X# /CO prepare for codeview
  789. XLINKFLAGS = /NOE /NOI /NOD:LLIBCE /ONERROR:NOEXE #/CO 
  790. XDLLLINKFLAGS = /NOE /NOI /NOD /MAP #/CO
  791. X
  792. XOBJS =  bitmap.obj command.obj contour.obj eval.obj graphics.obj graph3d.obj \
  793. X    internal.obj misc.obj parse.obj plot.obj readline.obj scanner.obj \
  794. X    setshow.obj specfun.obj standard.obj term.obj util.obj version.obj \
  795. X    gnubin.obj binary.obj winmain.obj
  796. X
  797. XCSOURCE5 = term\aed.trm term\cgi.trm term\dumb.trm term\dxy.trm \
  798. X    term\eepic.trm term\epson.trm term\fig.trm term\hp26.trm \
  799. X    term\hp2648.trm term\hpgl.trm term\hpljii.trm 
  800. XCSOURCE6 = term\impcodes.h term\imagen.trm term\object.h \
  801. X    term\iris4d.trm term\kyo.trm term\latex.trm term/pbm.trm term\win.trm
  802. XCSOURCE7 = term\post.trm term\qms.trm term\regis.trm term\sun.trm \
  803. X    term\t410x.trm term\tek.trm term\unixpc.trm term\unixplot.trm \
  804. X    term\v384.trm term\x11.trm
  805. XCSOURCE8 = contour.c specfun.c gnubin.c binary.c
  806. XWINDOWS = makefile.win makefile.msw README.win win\wcommon.h \
  807. X    win\wgnuplib.c win\wgnuplib.def win\wgnuplib.h win\wgnuplib.rc\
  808. X    win\wgnuplot.def win\wgnuplot.hpj win\wgnuplot.mnu win\wgnuplot.rc \
  809. X    win\wgraph.c win\winmain.c win\wmenu.c win\wpause.c \
  810. X    win\wprinter.c win\wresourc.h win\wtext.c win\wtext.h \
  811. X    win\geticon.c docs\doc2rtf.c term\win.trm
  812. X
  813. Xdefault: wgnuplot.exe wgnuplot.dll $(HELPFILE) wgnuplot.mnu demo\bf_test.exe
  814. X
  815. X# default rules
  816. X.c.obj:
  817. X    cl $(CFLAGS) $*.c
  818. X
  819. X.asm.obj:
  820. X    masm $*;
  821. X
  822. Xlinkopt2.msw: makefile.msw
  823. X    echo winmain+bitmap+command+eval+graphics+ >linkopt2.msw
  824. X    echo graph3d+internal+misc+parse+ >>linkopt2.msw
  825. X    echo plot+scanner+setshow+specfun+ >>linkopt2.msw
  826. X    echo standard+term+util+version+contour+ >>linkopt2.msw
  827. X    echo gnubin+binary+readline >>linkopt2.msw
  828. X    echo wgnuplot,wgnuplot, >>linkopt2.msw
  829. X    echo wgnuplot+libw+llibcew, >>linkopt2.msw
  830. X    echo win\wgnuplot.def >>linkopt2.msw
  831. X    echo ; >>linkopt2.msw
  832. X
  833. Xwgnuplot.exe: $(OBJS) win\wgnuplot.def win\wgnuplot.rc winmain.obj wgnuplot.lib linkopt2.msw texticon.ico grpicon.ico
  834. X    link $(LINKFLAGS) @linkopt2.msw
  835. X    rc -30 -k -dMSRC win\wgnuplot.rc wgnuplot.exe
  836. X
  837. X# rules
  838. X
  839. Xpcgraph.obj: pcgraph.asm header.mac lineproc.mac
  840. X
  841. Xcorgraph.obj: corgraph.asm header.mac lineproc.mac
  842. X
  843. Xhrcgraph.obj: hrcgraph.asm header.mac lineproc.mac
  844. X
  845. Xbinary.obj: binary.c 
  846. X
  847. Xbitmap.obj: bitmap.c bitmap.h plot.h
  848. X
  849. Xcommand.obj: command.c plot.h setshow.h help.h
  850. X    cl $(CFLAGS) /DHELPFILE=\"$(HELPFILE)\" command.c
  851. X
  852. Xcontour.obj: contour.c plot.h
  853. X
  854. Xeval.obj: eval.c plot.h
  855. X
  856. Xgnubin.obj: gnubin.c
  857. X
  858. Xgraphics.obj: graphics.c plot.h setshow.h
  859. X
  860. Xgraph3d.obj: graphics.c plot.h setshow.h
  861. X
  862. Xhelp.obj: help.c plot.h help.h
  863. X
  864. Xinternal.obj: internal.c plot.h
  865. X
  866. Xmisc.obj: misc.c plot.h setshow.h
  867. X
  868. Xparse.obj: parse.c plot.h
  869. X
  870. Xplot.obj: plot.c plot.h setshow.h
  871. X
  872. Xreadline.obj: readline.c
  873. X
  874. Xscanner.obj: scanner.c plot.h
  875. X
  876. Xsetshow.obj: setshow.c plot.h setshow.h
  877. X
  878. Xstandard.obj: standard.c plot.h
  879. X
  880. Xspecfun.obj: specfun.c plot.h
  881. X
  882. Xterm.obj: term.c term.h plot.h setshow.h bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  883. X    cl $(CFLAGS) $(TERMFLAGS) /Iterm term.c
  884. X
  885. Xutil.obj: util.c plot.h
  886. X
  887. Xversion.obj: version.c
  888. X
  889. Xwinmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
  890. X    cl $(CFLAGS) /DHELPFILE=\"$(HELPFILE)\"  win\winmain.c
  891. X
  892. Xwgnuplot.mnu: win\wgnuplot.mnu
  893. X    copy win\wgnuplot.mnu wgnuplot.mnu
  894. X
  895. X# extract icons from wgnuplot.rc
  896. Xtexticon.ico: grpicon.ico
  897. X
  898. Xgrpicon.ico: geticon.exe win\wgnuplot.rc
  899. X    geticon win\wgnuplot.rc
  900. X
  901. Xgeticon.exe: win\geticon.c
  902. X    cl /AS /W1 win\geticon.c
  903. X
  904. X# different compiler options for DLL's */
  905. XDLLOBJS = wgnuplib.obj wtext.obj wmenu.obj wpause.obj wgraph.obj wprinter.obj
  906. X
  907. Xlinkopt1.msw: makefile.msw
  908. X    echo wgnuplib+wtext+wmenu+wpause+wgraph+wprinter > linkopt1.msw
  909. X    echo wgnuplot.dll  >> linkopt1.msw
  910. X    echo wgnuplib.map >> linkopt1.msw
  911. X    echo libw+commdlg+shell+sdllcew >> linkopt1.msw
  912. X    echo win\wgnuplib.def >> linkopt1.msw
  913. X    echo ; >> linkopt1.msw
  914. X
  915. Xwgnuplot.lib: wgnuplot.dll
  916. X    implib wgnuplot.lib wgnuplot.dll
  917. X
  918. Xwgnuplot.dll: $(DLLOBJS) win/wgnuplib.def win/wgnuplib.rc linkopt1.msw
  919. X    link $(DLLLINKFLAGS) @linkopt1.msw
  920. X    rc -30 -t win\wgnuplib.rc wgnuplot.dll
  921. X
  922. Xwgnuplib.obj: win/wgnuplib.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  923. X    $(DLLCC) win/wgnuplib.c
  924. X    
  925. Xwmenu.obj: win/wmenu.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  926. X    $(DLLCC) win/wmenu.c
  927. X
  928. Xwtext.obj: win/wtext.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  929. X    $(DLLCC) win/wtext.c
  930. X    
  931. Xwpause.obj: win/wpause.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  932. X    $(DLLCC) win/wpause.c
  933. X    
  934. Xwprinter.obj: win/wprinter.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  935. X    $(DLLCC) win/wprinter.c
  936. X    
  937. Xwgraph.obj: win/wgraph.c win/wgnuplib.h win/wcommon.h win/wresourc.h
  938. X    $(DLLCC) win/wgraph.c
  939. X    
  940. X# convert gnuplot.doc to gnuplot.gih
  941. X$(HELPFILE): doc2rtf.exe docs\gnuplot.doc win\wgnuplot.hpj
  942. X    doc2rtf docs\gnuplot.doc win\gnuplot.rtf
  943. X    hc31 win\wgnuplot.hpj 
  944. X
  945. Xdoc2rtf.exe: docs\doc2rtf.c
  946. X    cl /AS /F 5000 /W1 docs\doc2rtf.c
  947. X
  948. X#make binary demo files
  949. Xdemo\bf_test.exe: bf_test.c dbinary.obj
  950. X        cl /AL /D__MSC__ /F 5000 /W1 /Fedemo\bf_test.exe bf_test.c dbinary.obj
  951. X    cd demo
  952. X    bf_test
  953. X    cd ..
  954. X
  955. Xdbinary.obj: binary.c
  956. X        cl /c /AL /DPC /D__MSC__ /F 5000 /W1 /Fodbinary.obj binary.c
  957. X
  958. X# clean up temporary files
  959. Xclean:
  960. X    del *.obj
  961. X    del wgnuplot.map
  962. X    del win\wgnuplot.res
  963. X    del win\gnuplot.rtf
  964. X    del doc2rtf.exe
  965. X    del win\wgnuplib.res
  966. X    del wgnuplib.map
  967. X    del wgnuplot.lib
  968. X    del demo\bf_test.exe
  969. X    del linkopt1.msw
  970. X    del linkopt2.msw
  971. X        del *.ico
  972. X        del geticon.exe
  973. X    
  974. Xveryclean: clean
  975. X    del wgnuplot.exe
  976. X    del wgnuplot.hlp
  977. X    del wgnuplot.mnu
  978. X    del wgnuplot.dll
  979. X    del demo\binary1
  980. X    del demo\binary2
  981. X    del demo\binary3
  982. END_OF_FILE
  983.   if test 6444 -ne `wc -c <'gnuplot/makefile.msw'`; then
  984.     echo shar: \"'gnuplot/makefile.msw'\" unpacked with wrong size!
  985.   fi
  986.   # end of 'gnuplot/makefile.msw'
  987. fi
  988. if test -f 'gnuplot/os2/gnupmdrv.rc' -a "${1}" != "-c" ; then 
  989.   echo shar: Will not clobber existing file \"'gnuplot/os2/gnupmdrv.rc'\"
  990. else
  991.   echo shar: Extracting \"'gnuplot/os2/gnupmdrv.rc'\" \(6139 characters\)
  992.   sed "s/^X//" >'gnuplot/os2/gnupmdrv.rc' <<'END_OF_FILE'
  993. X#include <os2.h>
  994. X#include "dialogs.h"
  995. X
  996. XICON 1 "gnuplot.ico"
  997. X
  998. X
  999. XMENU 1
  1000. XBEGIN
  1001. X    SUBMENU  "~Options" , IDM_FILE
  1002. X    BEGIN
  1003. X        MENUITEM    "Prin~ters...", IDM_PRINTSETUP
  1004. X        MENUITEM    "~Print..."   , IDM_PRINT
  1005. X        MENUITEM    "~Fonts...", IDM_FONTS
  1006. X        MENUITEM    "~Colours",  IDM_COLOURS,,MIA_CHECKED
  1007. X        SUBMENU     "~Lines", IDM_LINES
  1008. X        BEGIN
  1009. X            MENUITEM  "~Solid", IDM_LINES_SOLID,,MIA_CHECKED
  1010. X            MENUITEM  "~Thick", IDM_LINES_THICK
  1011. X        END
  1012. X        SUBMENU     "Pa~use mode", IDM_PAUSEOPT
  1013. X        BEGIN
  1014. X            MENUITEM  "~Dialog box", IDM_PAUSEDLG,,MIA_CHECKED
  1015. X            MENUITEM  "~Menu bar", IDM_PAUSEBTN
  1016. X            MENUITEM  "~Gnuplot", IDM_PAUSEGNU
  1017. X        END
  1018. X        MENUITEM  SEPARATOR
  1019. X        MENUITEM    "~Save settings", IDM_SAVE
  1020. X    END
  1021. X    MENUITEM "~Gnuplot" , IDM_COMMAND
  1022. X    MENUITEM "~Continue" , IDM_CONTINUE,,MIA_DISABLED
  1023. X    SUBMENU "~Help", 1
  1024. X    BEGIN
  1025. X        MENUITEM "~Help for Help...",    IDM_HELPFORHELP
  1026. X        MENUITEM "~Extended Help...",    IDM_EXTENDEDHELP
  1027. X        MENUITEM "~Keys Help...",        IDM_KEYSHELP
  1028. X        MENUITEM "Help ~index...",       IDM_HELPINDEX
  1029. X        MENUITEM SEPARATOR
  1030. X        MENUITEM "A~bout...",            IDM_ABOUT
  1031. X    END
  1032. XEND
  1033. X
  1034. XACCELTABLE 1
  1035. XBEGIN
  1036. X    VK_ESC, IDM_COMMAND, VIRTUALKEY 
  1037. XEND
  1038. X
  1039. XDLGTEMPLATE ID_ABOUT LOADONCALL MOVEABLE DISCARDABLE
  1040. XBEGIN
  1041. X    DIALOG  "", ID_ABOUT, 22, 17, 144, 75, 
  1042. X    BEGIN
  1043. X        CTEXT           "GnuplotPM", -1, 8, 65, 128, 8
  1044. X        CTEXT           "Gnuplot display for OS/2", -1, 8, 50, 128, 8
  1045. X        CTEXT           "$Revision: 3.50 $", -1, 8, 35, 128, 8
  1046. X        DEFPUSHBUTTON   "OK", DID_OK, 56, 10, 32, 14, WS_GROUP
  1047. X    END
  1048. XEND
  1049. X
  1050. XDLGTEMPLATE ID_QPRINT LOADONCALL MOVEABLE DISCARDABLE
  1051. XBEGIN
  1052. X    DIALOG  "GnuplotPM: printer setup", ID_QPRINT, 83, 7, 220, 175, 
  1053. X            FS_NOBYTEALIGN | WS_VISIBLE, FCF_TITLEBAR
  1054. X    BEGIN
  1055. X        DEFPUSHBUTTON   "OK", DID_OK, 6, 5, 38, 13
  1056. X        PUSHBUTTON      "Cancel", DID_CANCEL, 52, 5, 38, 13
  1057. X        PUSHBUTTON      "Help", 310, 176, 5, 38, 13, BS_HELP
  1058. X        GROUPBOX        "Set plot area", -1, 2, 41, 214, 116
  1059. X        PUSHBUTTON      "Adjust...", IDD_QPRTRACK, 7, 111, 56, 13
  1060. X        CONTROL         "Text", IDD_QPRBOX, 84, 96, 98, 49, WC_STATIC, 
  1061. X                        SS_FGNDRECT | WS_VISIBLE
  1062. X        CONTROL         "", IDD_QPRFRAME, 86, 98, 71, 34, WC_STATIC, 
  1063. X                        SS_HALFTONERECT | WS_VISIBLE
  1064. X        ENTRYFIELD      "Text", IDD_QPRXSIZE, 83, 47, 36, 12, ES_RIGHT | NOT 
  1065. X                        ES_AUTOSCROLL | ES_READONLY
  1066. X        ENTRYFIELD      "", IDD_QPRXFRAC, 168, 47, 39, 8, NOT ES_AUTOSCROLL | 
  1067. X                        ES_MARGIN
  1068. X        LTEXT           "Vertical size:", -1, 8, 63, 66, 8, NOT WS_GROUP
  1069. X        LTEXT           "Horizontal size:", -1, 8, 47, 70, 8, NOT WS_GROUP
  1070. X        ENTRYFIELD      "Text", IDD_QPRYSIZE, 83, 63, 36, 12, ES_RIGHT | NOT 
  1071. X                        ES_AUTOSCROLL | ES_READONLY
  1072. X        ENTRYFIELD      "", IDD_QPRYFRAC, 168, 63, 39, 8, NOT ES_AUTOSCROLL | 
  1073. X                        ES_MARGIN
  1074. X        LTEXT           "Or enter fraction of indicated size:", -1, 9, 79, 
  1075. X                        143, 8, NOT WS_GROUP
  1076. X        LTEXT           "cm", -1, 125, 63, 13, 8, NOT WS_GROUP
  1077. X        LTEXT           "cm", -1, 125, 47, 13, 8
  1078. X        PUSHBUTTON      "Job properties...", IDD_QPRSETPR, 98, 5, 72, 13
  1079. X        LTEXT           "Print to file named:", IDD_PRINTQNAME, 8, 28, 80, 8, 
  1080. X                        DT_HALFTONE
  1081. X        ENTRYFIELD      "", IDD_QPRNAME, 91, 28, 87, 8, NOT ES_AUTOSCROLL | 
  1082. X                        ES_MARGIN
  1083. X        LTEXT           "Adjust using", -1, 8, 136, 72, 8
  1084. X        LTEXT           "mouse...", -1, 8, 127, 37, 8
  1085. X        LTEXT           "Current printer:", -1, 8, 161, 64, 8
  1086. X        ENTRYFIELD      "", IDD_PRINTNAME, 74, 161, 139, 8, ES_MARGIN
  1087. X    END
  1088. XEND
  1089. X
  1090. XDLGTEMPLATE IDD_QUERYPRINT LOADONCALL MOVEABLE DISCARDABLE
  1091. XBEGIN
  1092. X    DIALOG  "GnuplotPM: printer selection", IDD_QUERYPRINT, 59, 44, 243, 99, 
  1093. X            FS_NOBYTEALIGN | WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR
  1094. X    BEGIN
  1095. X        LTEXT           "Select printer:", IDD_QPTEXT, 4, 89, 65, 8
  1096. X        LISTBOX         IDD_QPRSLIST, 5, 29, 232, 60
  1097. X        DEFPUSHBUTTON   "OK", DID_OK, 5, 5, 38, 13, WS_GROUP
  1098. X        PUSHBUTTON      "Cancel", DID_CANCEL, 54, 5, 38, 13
  1099. X        PUSHBUTTON      "Help", 310, 102, 5, 38, 13, BS_HELP
  1100. X    END
  1101. XEND
  1102. X
  1103. XDLGTEMPLATE IDD_PAUSEBOX LOADONCALL MOVEABLE DISCARDABLE
  1104. XBEGIN
  1105. X    DIALOG  "Gnuplot: pause", IDD_PAUSEBOX, 69, 27, 148, 33, WS_VISIBLE, 
  1106. X            FCF_TITLEBAR | FCF_MINBUTTON
  1107. X    BEGIN
  1108. X        PUSHBUTTON      "Continue", DID_OK, 1, 0, 40, 14
  1109. X        PUSHBUTTON      "Cancel", DID_CANCEL, 54, 0, 40, 14
  1110. X        PUSHBUTTON      "Help", 310, 106, 0, 40, 14, BS_HELP
  1111. X        LTEXT           "Text", IDD_PAUSETEXT, 0, 20, 148, 8
  1112. X    END
  1113. XEND
  1114. X
  1115. XHELPSUBTABLE 1
  1116. XBEGIN
  1117. X    HELPSUBITEM  IDH_EXTENDED, IDH_EXTENDED
  1118. X    HELPSUBITEM  IDM_PRINTSETUP ,IDM_PRINTSETUP 
  1119. X    HELPSUBITEM  IDM_PRINT ,IDM_PRINT 
  1120. X    HELPSUBITEM  IDM_FONTS ,IDM_FONTS 
  1121. X    HELPSUBITEM  IDM_FILE ,IDM_FILE 
  1122. X    HELPSUBITEM  IDM_ABOUT ,IDM_ABOUT 
  1123. X    HELPSUBITEM  IDM_COLOURS ,IDM_COLOURS 
  1124. X    HELPSUBITEM  IDM_LINES ,IDM_LINES 
  1125. X    HELPSUBITEM  IDM_LINES_THICK ,IDM_LINES_THICK 
  1126. X    HELPSUBITEM  IDM_LINES_SOLID ,IDM_LINES_SOLID
  1127. X    HELPSUBITEM  IDM_SAVE ,IDM_SAVE 
  1128. X    HELPSUBITEM  IDM_COMMAND ,IDM_COMMAND  
  1129. X    HELPSUBITEM  IDM_CONTINUE,IDM_CONTINUE
  1130. X    HELPSUBITEM  IDM_PAUSEDLG,IDM_PAUSEDLG 
  1131. X    HELPSUBITEM  IDM_PAUSEOPT,IDM_PAUSEOPT 
  1132. X    HELPSUBITEM  IDM_PAUSEBTN,IDM_PAUSEBTN 
  1133. X    HELPSUBITEM  IDM_PAUSEGNU,IDM_PAUSEGNU 
  1134. XEND
  1135. XHELPSUBTABLE ID_PRINT
  1136. XBEGIN
  1137. X    HELPSUBITEM  ID_PRINT, ID_PRINT
  1138. XEND
  1139. XHELPSUBTABLE ID_QPRINT
  1140. XBEGIN
  1141. X    HELPSUBITEM  ID_QPRINT, ID_QPRINT
  1142. XEND
  1143. XHELPSUBTABLE IDD_QUERYPRINT
  1144. XBEGIN
  1145. X    HELPSUBITEM  IDD_QUERYPRINT, IDD_QUERYPRINT
  1146. XEND
  1147. XHELPSUBTABLE IDD_PAUSEBOX
  1148. XBEGIN
  1149. X    HELPSUBITEM  IDD_PAUSEBOX, IDD_PAUSEBOX
  1150. XEND
  1151. XHELPTABLE 1
  1152. XBEGIN
  1153. X    HELPITEM 1, 1, IDH_EXTENDED
  1154. X    HELPITEM ID_QPRINT, ID_QPRINT, ID_QPRINT
  1155. X    HELPITEM ID_PRINT, ID_PRINT, ID_PRINT
  1156. X    HELPITEM IDD_QUERYPRINT, IDD_QUERYPRINT, IDD_QUERYPRINT
  1157. X    HELPITEM IDD_PAUSEBOX, IDD_PAUSEBOX, IDD_PAUSEBOX
  1158. XEND
  1159. X
  1160. X
  1161. END_OF_FILE
  1162.   if test 6139 -ne `wc -c <'gnuplot/os2/gnupmdrv.rc'`; then
  1163.     echo shar: \"'gnuplot/os2/gnupmdrv.rc'\" unpacked with wrong size!
  1164.   fi
  1165.   # end of 'gnuplot/os2/gnupmdrv.rc'
  1166. fi
  1167. if test -f 'gnuplot/term.h' -a "${1}" != "-c" ; then 
  1168.   echo shar: Will not clobber existing file \"'gnuplot/term.h'\"
  1169. else
  1170.   echo shar: Extracting \"'gnuplot/term.h'\" \(6048 characters\)
  1171.   sed "s/^X//" >'gnuplot/term.h' <<'END_OF_FILE'
  1172. X
  1173. X/*
  1174. X * $Id: term.h%v 3.50 1993/07/09 05:35:24 woo Exp $
  1175. X *
  1176. X */
  1177. X
  1178. X/* GNUPLOT - term.h */
  1179. X/*
  1180. X * Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley
  1181. X *
  1182. X * Permission to use, copy, and distribute this software and its
  1183. X * documentation for any purpose with or without fee is hereby granted, 
  1184. X * provided that the above copyright notice appear in all copies and 
  1185. X * that both that copyright notice and this permission notice appear 
  1186. X * in supporting documentation.
  1187. X *
  1188. X * Permission to modify the software is granted, but not the right to
  1189. X * distribute the modified code.  Modifications are to be distributed 
  1190. X * as patches to released version.
  1191. X *  
  1192. X * This software is provided "as is" without express or implied warranty.
  1193. X * 
  1194. X *
  1195. X * AUTHORS
  1196. X * 
  1197. X *   Original Software:
  1198. X *     Thomas Williams,  Colin Kelley.
  1199. X * 
  1200. X *   Gnuplot 2.0 additions:
  1201. X *       Russell Lang, Dave Kotz, John Campbell.
  1202. X *
  1203. X *   Gnuplot 3.0 additions:
  1204. X *       Gershon Elber and many others.
  1205. X * 
  1206. X * There is a mailing list for gnuplot users. Note, however, that the
  1207. X * newsgroup 
  1208. X *    comp.graphics.gnuplot 
  1209. X * is identical to the mailing list (they
  1210. X * both carry the same set of messages). We prefer that you read the
  1211. X * messages through that newsgroup, to subscribing to the mailing list.
  1212. X * (If you can read that newsgroup, and are already on the mailing list,
  1213. X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
  1214. X * removed from the mailing list.)
  1215. X *
  1216. X * The address for mailing to list members is
  1217. X *       info-gnuplot@dartmouth.edu
  1218. X * and for mailing administrative requests is 
  1219. X *       info-gnuplot-request@dartmouth.edu
  1220. X * The mailing list for bug reports is 
  1221. X *       bug-gnuplot@dartmouth.edu
  1222. X * The list of those interested in beta-test versions is
  1223. X *       info-gnuplot-beta@dartmouth.edu
  1224. X */
  1225. X
  1226. X/*
  1227. X * term.h: terminal support definitions
  1228. X *   Edit this file depending on the set of terminals you wish to support.
  1229. X * Comment out the terminal types that you don't want or don't have, and
  1230. X * uncomment those that you want included. Be aware that some terminal 
  1231. X * types (eg, SUN, UNIXPLOT) will require changes in the makefile 
  1232. X * LIBS definition. 
  1233. X */
  1234. X
  1235. X/* These terminals are not relevant for MSDOS, OS2, MS-Windows, ATARI or Amiga */
  1236. X#if !defined(MSDOS) && !defined(OS2) && !defined(_Windows) && !defined(ATARI) && !defined(AMIGA_SC_6_1) && !defined(AMIGA_AC_5)
  1237. X
  1238. X#define AED        /* AED 512 and AED 767 */
  1239. X#define BITGRAPH    /* BBN BitGraph */
  1240. X#define COREL           /* CorelDRAW! eps format */
  1241. X/* #define CGI        /* SCO CGI */
  1242. X/* #define IRIS4D    /* IRIS4D series computer */
  1243. X#define KERMIT        /* MS-DOS Kermit Tektronix 4010 emulator */
  1244. X/* #define FIG           /* Fig graphics language */
  1245. X/* #define NEXT        /* NeXT workstation console */
  1246. X/* #define SUN        /* Sun Microsystems Workstation */
  1247. X#define REGIS        /* ReGis graphics (vt125, vt220, vt240, Gigis...) */
  1248. X/* #define RGIP        /* WARNING: requires POSIX: Redwood Graphics Interface Protocol UNIPLEX */
  1249. X#define SELANAR        /* Selanar */
  1250. X#define T410X        /* Tektronix 4106, 4107, 4109 and 420x terminals */
  1251. X#define TEK        /* Tektronix 4010, and probably others */
  1252. X/* #define UNIXPC    /* unixpc (ATT 3b1 or ATT 7300) */
  1253. X/* #define UNIXPLOT    /* unixplot */
  1254. X#define VTTEK        /* VT-like tek40xx emulators */
  1255. X/* #define X11        /* X11R4 window system */
  1256. X
  1257. X#define DXY800A        /* Roland DXY800A plotter */
  1258. X#define EXCL        /* QMS/EXCL laserprinter (Talaris 1590 and others) */
  1259. X
  1260. X#define HP2648        /* HP2648, HP2647 */
  1261. X#define HP26        /* HP2623A and maybe others */
  1262. X/* #define DEBUG        /* debugging terminal */
  1263. X#define HP75        /* HP7580, and probably other HPs */
  1264. X#define IMAGEN      /* Imagen laser printers (300dpi) (requires -Iterm also) */
  1265. X
  1266. X#define PRESCRIBE    /* Kyocera Laser printer */
  1267. X#define QMS        /* QMS/QUIC laserprinter (Talaris 1200 and others) */
  1268. X
  1269. X#define TANDY60        /* Tandy DMP-130 series 60-dot per inch graphics */
  1270. X#define V384        /* Vectrix 384 and tandy color printer */
  1271. X
  1272. X#define TGIF        /* TGIF X-Windows draw tool */
  1273. X
  1274. X#endif /* !MSDOS && !OS2 && !_Windows && !_ATARI && !AMIGA */
  1275. X
  1276. X/* These terminals can be used on any system */
  1277. X#define AIFM        /* Adobe Illustrator Format */
  1278. X#define DUMB
  1279. X
  1280. X
  1281. X#define DXF        /* DXF format for use with AutoCad (Release 10.x) */
  1282. X
  1283. X#define EEPIC        /* EEPIC-extended LaTeX driver, for EEPIC users */
  1284. X#define EMTEX        /* LATEX picture environment with EMTEX specials */
  1285. X#define EPS180        /* Epson-style 180-dot per inch (24 pin) printers */
  1286. X#define EPS60        /* Epson-style 60-dot per inch printers */
  1287. X#define EPSONP        /* Epson LX-800, Star NL-10, NX-1000 and lots of others */
  1288. X/* #define FIG           /* Fig graphics language */
  1289. X#define GPIC        /* gpic for groff */
  1290. X/* #define GRASS    /* GRASS (geographic info system) monitor */
  1291. X#define HP500C        /* HP DeskJet 500 Color */
  1292. X#define HPGL        /* HP7475, HP7220 plotters, and (hopefully) lots of others */
  1293. X#define HPLJII        /* HP LaserJet II */
  1294. X#define HPPJ        /* HP PaintJet */
  1295. X#define LATEX        /* LATEX picture environment */
  1296. X#define MF            /* METAFONT driver */
  1297. X#define MIF            /* Frame Maker MIF 3.00 format driver */
  1298. X#define NEC            /* NEC CP6 pinwriter  and LQ-800 printer */
  1299. X#define OKIDATA        /* OKIDATA  320/321 standard 60-dpi printers */
  1300. X#define PBM            /* PBMPLUS portable bitmap */
  1301. X#define PCL            /* orignal HP LaserJet III */
  1302. X#define POSTSCRIPT    /* PostScript */
  1303. X#define PSLATEX        /* LaTeX picture environment with PostScript \specials */
  1304. X#define PSTRICKS    /* LaTeX picture environment with PSTricks macros */
  1305. X#define STARC        /* Star Color Printer */
  1306. X#define TEXDRAW         /* TeXDraw drawing package for LaTeX */
  1307. X#define TPIC        /* TPIC specials for TeX */
  1308. X
  1309. X/* These are for Amiga only */
  1310. X#if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5)
  1311. X#define AMIGASCREEN    /* Amiga custom screen */
  1312. X#undef  AIFM
  1313. X#undef  DXF
  1314. X#undef  FIG
  1315. X#undef  MIF
  1316. X#endif
  1317. X
  1318. X/* These are for MSDOS only */
  1319. X#ifdef MSDOS
  1320. X#ifdef __TURBOC__
  1321. X#define ATT6300        /* AT&T 6300 graphics */
  1322. X#else
  1323. X#define ATT6300        /* AT&T 6300 graphics */
  1324. X#define CORONA        /* Corona graphics 325 */
  1325. X#define HERCULES    /* IBM PC/Clone with Hercules graphics board */
  1326. X#endif /* __TURBOC__ */
  1327. X#endif /* MSDOS */
  1328. X
  1329. X#ifdef OS2
  1330. X#define OS2PM
  1331. X#endif /*OS2 */
  1332. X
  1333. X#ifdef GISBASE
  1334. X#define GRASS
  1335. X#endif
  1336. END_OF_FILE
  1337.   if test 6048 -ne `wc -c <'gnuplot/term.h'`; then
  1338.     echo shar: \"'gnuplot/term.h'\" unpacked with wrong size!
  1339.   fi
  1340.   # end of 'gnuplot/term.h'
  1341. fi
  1342. if test -f 'gnuplot/term/dumb.trm' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'gnuplot/term/dumb.trm'\"
  1344. else
  1345.   echo shar: Extracting \"'gnuplot/term/dumb.trm'\" \(6308 characters\)
  1346.   sed "s/^X//" >'gnuplot/term/dumb.trm' <<'END_OF_FILE'
  1347. X/*
  1348. X * $Id: dumb.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  1349. X *
  1350. X */
  1351. X
  1352. X/* GNUPLOT - dumb.trm */
  1353. X/*
  1354. X * Copyright (C) 1991, 1992
  1355. X *
  1356. X * Permission to use, copy, and distribute this software and its
  1357. X * documentation for any purpose with or without fee is hereby granted,
  1358. X * provided that the above copyright notice appear in all copies and
  1359. X * that both that copyright notice and this permission notice appear
  1360. X * in supporting documentation.
  1361. X *
  1362. X * Permission to modify the software is granted, but not the right to
  1363. X * distribute the modified code.  Modifications are to be distributed
  1364. X * as patches to released version.
  1365. X *
  1366. X * This software  is provided "as is" without express or implied warranty.
  1367. X *
  1368. X * This file is included by ../term.c.
  1369. X *
  1370. X * This terminal driver supports:
  1371. X *   DUMB terminals
  1372. X *
  1373. X * AUTHORS
  1374. X *   Francois Pinard, 91-04-03
  1375. X *           INTERNET: pinard@iro.umontreal.ca
  1376. X *
  1377. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1378. X *
  1379. X */
  1380. X
  1381. X#define DUMB_AXIS_CONST '\1'
  1382. X#define DUMB_BORDER_CONST '\2'
  1383. X
  1384. X#define DUMB_XMAX 79
  1385. X#define DUMB_YMAX 24
  1386. X
  1387. Xstatic char *dumb_matrix = NULL;      /* matrix of characters */
  1388. Xstatic char *dumb_priority = NULL;    /* matrix of priority at each position */
  1389. Xstatic char dumb_pen;                 /* current character used to draw */
  1390. Xstatic int dumb_x;                    /* current X position */
  1391. Xstatic int dumb_y;                    /* current Y position */
  1392. Xstatic int dumb_xmax = DUMB_XMAX;
  1393. Xstatic int dumb_ymax = DUMB_YMAX;
  1394. X
  1395. X#define DUMB_PIXEL(x,y) dumb_matrix[dumb_xmax*(y)+(x)]
  1396. X
  1397. X
  1398. Xdumb_set_pixel(x,y,v,p)
  1399. Xint x,y,v,p;
  1400. X{
  1401. X  if (p > dumb_priority[dumb_xmax*y+x])
  1402. X    {
  1403. X      dumb_matrix[dumb_xmax*y+x] = v;
  1404. X      dumb_priority[dumb_xmax*y+x] = p;
  1405. X    }
  1406. X}
  1407. X
  1408. X
  1409. XDUMB_options()
  1410. X{
  1411. X  int x,y;
  1412. X  struct value a;
  1413. X  extern struct value *const_express();
  1414. X  extern double real();
  1415. X
  1416. X  if (!END_OF_COMMAND) {
  1417. X    x = (int) real(const_express(&a));
  1418. X    if (!END_OF_COMMAND) {
  1419. X      y = (int) real(const_express(&a));
  1420. X      dumb_xmax = term_tbl[term].xmax = x;
  1421. X      dumb_ymax = term_tbl[term].ymax = y;
  1422. X    }
  1423. X  }
  1424. X
  1425. X  sprintf(term_options, "%d %d",dumb_xmax,dumb_ymax);
  1426. X}
  1427. X
  1428. X
  1429. XDUMB_init()
  1430. X{
  1431. X  if (dumb_matrix)
  1432. X    free(dumb_matrix);
  1433. X
  1434. X  dumb_matrix = alloc ((unsigned long)dumb_xmax * dumb_ymax * 2, "dumb terminal");
  1435. X
  1436. X  dumb_priority = dumb_matrix + dumb_xmax * dumb_ymax;
  1437. X}
  1438. X
  1439. X
  1440. Xchar *
  1441. XDUMB_str_state()
  1442. X{
  1443. X   static char str[80];
  1444. X
  1445. X   sprintf( str, "%d %d", dumb_xmax, dumb_ymax );
  1446. X
  1447. X   return str;
  1448. X}
  1449. X
  1450. X
  1451. XDUMB_graphics ()
  1452. X{
  1453. X  int i;
  1454. X  char *pm = dumb_matrix, *pp = dumb_priority;
  1455. X
  1456. X  for ( i = dumb_xmax * dumb_ymax; i > 0; i-- ) {
  1457. X    *pm++ = ' ';
  1458. X    *pp++ = 0;
  1459. X  }
  1460. X}
  1461. X
  1462. X
  1463. XDUMB_text ()
  1464. X{
  1465. X  int x, y, l;
  1466. X
  1467. X  putc ('\f', outfile);
  1468. X  for (y = dumb_ymax - 1; y >= 0; y--)
  1469. X    {
  1470. X      for (l = dumb_xmax; l > 0 && DUMB_PIXEL (l - 1, y) == ' '; l--)
  1471. X       ;
  1472. X      for (x = 0; x < l; x++)
  1473. X       putc (DUMB_PIXEL (x, y), outfile);
  1474. X      if (y > 0)
  1475. X       putc ('\n', outfile);
  1476. X    }
  1477. X  fflush (outfile);
  1478. X}
  1479. X
  1480. X
  1481. XDUMB_reset()
  1482. X{
  1483. X  free (dumb_matrix);
  1484. X  dumb_matrix = NULL;
  1485. X}
  1486. X
  1487. X
  1488. XDUMB_linetype(linetype)
  1489. Xint linetype;
  1490. X{
  1491. X  static char pen_type[7] = {'*', '#', '$', '%', '@', '&', '='};
  1492. X
  1493. X  if (linetype == -2)
  1494. X    dumb_pen = DUMB_BORDER_CONST;
  1495. X  else if (linetype == -1)
  1496. X    dumb_pen = DUMB_AXIS_CONST;
  1497. X  else
  1498. X    {
  1499. X      linetype = linetype % 7;
  1500. X      dumb_pen = pen_type[linetype];
  1501. X    }
  1502. X}
  1503. X
  1504. X
  1505. XDUMB_move(x, y)
  1506. Xint x, y;
  1507. X{
  1508. X  dumb_x = x;
  1509. X  dumb_y = y;
  1510. X}
  1511. X
  1512. X
  1513. XDUMB_point(x,y,point)
  1514. Xint x,y,point;
  1515. X{
  1516. X  dumb_set_pixel (x, y, point == -1 ? '.' : point % 26 + 'A', 4);
  1517. X}
  1518. X
  1519. X
  1520. XDUMB_vector(x,y)
  1521. Xint x,y;
  1522. X{
  1523. X  char pen, pen1;
  1524. X  int priority;
  1525. X  int delta;
  1526. X
  1527. X  if (abs (y - dumb_y) > abs (x - dumb_x))
  1528. X    {
  1529. X      switch (dumb_pen)
  1530. X       {
  1531. X       case DUMB_AXIS_CONST:
  1532. X         pen = ':';
  1533. X         pen1 = '+';
  1534. X         priority = 1;
  1535. X         break;
  1536. X
  1537. X       case DUMB_BORDER_CONST:
  1538. X         pen = '|';
  1539. X         pen1 = '+';
  1540. X         priority = 2;
  1541. X         break;
  1542. X
  1543. X       default:
  1544. X         pen = dumb_pen;
  1545. X         pen1 = dumb_pen;
  1546. X         priority = 3;
  1547. X         break;
  1548. X       }
  1549. X      dumb_set_pixel (dumb_x, dumb_y, pen1, priority);
  1550. X      for (delta = 1; delta < abs (y - dumb_y); delta++)
  1551. X       dumb_set_pixel (dumb_x
  1552. X                       + (int) ((double) (x - dumb_x) * delta / abs(y - dumb_y)
  1553. X                                + 0.5),
  1554. X                       dumb_y + delta * sign (y - dumb_y),
  1555. X                       pen, priority);
  1556. X      dumb_set_pixel (x, y, pen1, priority);
  1557. X    }
  1558. X  else if (abs (x - dumb_x) > abs (y - dumb_y))
  1559. X    {
  1560. X      switch (dumb_pen)
  1561. X       {
  1562. X       case DUMB_AXIS_CONST:
  1563. X         pen = '.';
  1564. X         pen1 = '+';
  1565. X         priority = 1;
  1566. X         break;
  1567. X
  1568. X       case DUMB_BORDER_CONST:
  1569. X         pen = '-';
  1570. X         pen1 = '+';
  1571. X         priority = 2;
  1572. X         break;
  1573. X
  1574. X       default:
  1575. X         pen = dumb_pen;
  1576. X         pen1 = dumb_pen;
  1577. X         priority = 3;
  1578. X         break;
  1579. X       }
  1580. X      dumb_set_pixel (dumb_x, dumb_y, pen1, priority);
  1581. X      for (delta = 1; delta < abs (x - dumb_x); delta++)
  1582. X       dumb_set_pixel (dumb_x + delta * sign (x - dumb_x),
  1583. X                       dumb_y +
  1584. X                       (int) ((double) (y - dumb_y) * delta / abs(x - dumb_x)
  1585. X                              + 0.5),
  1586. X                       pen, priority);
  1587. X      dumb_set_pixel (x, y, pen1, priority);
  1588. X    }
  1589. X  else
  1590. X    {
  1591. X      switch (dumb_pen)
  1592. X       {
  1593. X       case DUMB_AXIS_CONST:    /* zero length axis */
  1594. X         pen = '+';
  1595. X         priority = 1;
  1596. X         break;
  1597. X
  1598. X       case DUMB_BORDER_CONST:    /* zero length border */
  1599. X         pen = '+';
  1600. X         priority = 2;
  1601. X         break;
  1602. X
  1603. X       default:
  1604. X         pen = dumb_pen;
  1605. X         priority = 3;
  1606. X         break;
  1607. X       }
  1608. X      for (delta = 0; delta <= abs (x - dumb_x); delta++)
  1609. X    dumb_set_pixel (dumb_x + delta * sign (x - dumb_x),
  1610. X            dumb_y + delta * sign (y - dumb_y),
  1611. X            pen, priority);
  1612. X    }
  1613. X  dumb_x = x;
  1614. X  dumb_y = y;
  1615. X}
  1616. X
  1617. X
  1618. XDUMB_put_text(x,y,str)
  1619. Xint x, y;
  1620. Xchar *str;
  1621. X{
  1622. X  int length;
  1623. X
  1624. X  length = strlen(str);
  1625. X  if (x + length > dumb_xmax)
  1626. X    x = max (0, dumb_xmax - length);
  1627. X
  1628. X  for (; x < dumb_xmax && *str; x++, str++)
  1629. X    dumb_set_pixel (x, y, *str, 5);
  1630. X}
  1631. X
  1632. X
  1633. XDUMB_arrow (sx,sy,ex,ey)
  1634. Xint sx,sy,ex,ey;
  1635. X{
  1636. X  char saved_pen;
  1637. X  char saved_x;
  1638. X  char saved_y;
  1639. X
  1640. X  saved_pen = dumb_pen;
  1641. X  saved_x = dumb_x;
  1642. X  saved_y = dumb_y;
  1643. X
  1644. X  dumb_pen = '>';
  1645. X  dumb_x = sx;
  1646. X  dumb_y = sy;
  1647. X  DUMB_vector (ex,ey);
  1648. X
  1649. X  dumb_pen = saved_pen;
  1650. X  dumb_x = saved_x;
  1651. X  dumb_y = saved_y;
  1652. X}
  1653. END_OF_FILE
  1654.   if test 6308 -ne `wc -c <'gnuplot/term/dumb.trm'`; then
  1655.     echo shar: \"'gnuplot/term/dumb.trm'\" unpacked with wrong size!
  1656.   fi
  1657.   # end of 'gnuplot/term/dumb.trm'
  1658. fi
  1659. if test -f 'gnuplot/term/excl.trm' -a "${1}" != "-c" ; then 
  1660.   echo shar: Will not clobber existing file \"'gnuplot/term/excl.trm'\"
  1661. else
  1662.   echo shar: Extracting \"'gnuplot/term/excl.trm'\" \(6188 characters\)
  1663.   sed "s/^X//" >'gnuplot/term/excl.trm' <<'END_OF_FILE'
  1664. X/*
  1665. X * $Id: excl.trm 3.38.2.18 1992/11/23 21:54:22 woo Exp $
  1666. X *
  1667. X */
  1668. X
  1669. X/* Copyright (c) 1992 by P. Klosowski at NIST.  All Rights Reserved 
  1670. X *
  1671. X * Permission to use, copy, and distribute this software and its
  1672. X * documentation for any purpose with or without fee is hereby granted, 
  1673. X * provided that the above copyright notice appear in all copies and 
  1674. X * that both that copyright notice and this permission notice appear 
  1675. X * in supporting documentation.
  1676. X *
  1677. X * Permission to modify the software is granted, but not the right to
  1678. X * distribute the modified code.  Modifications are to be distributed 
  1679. X * as patches to released version.
  1680. X *  
  1681. X * This software  is provided "as is" without express or implied warranty.
  1682. X * 
  1683. X * This file is included by ../term.c.
  1684. X *
  1685. X * 
  1686. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1687. X *
  1688. X ***     $Id: excl.trm 3.38.2.18 1992/11/23 21:54:22 woo Exp $
  1689. X     
  1690. X  NAME
  1691. X     quic
  1692. X   PURPOSE
  1693. X     QUIC driver for GNUPLOT
  1694. X   NOTES
  1695. X     
  1696. X   HISTORY
  1697. X     przemek - Aug 16, 1992: Created.
  1698. X***/
  1699. X/*
  1700. Xc               *****************************************
  1701. Xc               *****************************************
  1702. Xc               ******                              *****
  1703. Xc               ******   EXCL command definitions   *****
  1704. Xc               ******                              *****
  1705. Xc               *****************************************
  1706. Xc               *****************************************
  1707. X*/
  1708. X
  1709. X/*  Define ansi command headers, NUL character */
  1710. X#define ESC "\033"
  1711. X#define GS  "\035"
  1712. X#define CSI "\033["
  1713. X#define DCS "\033P"
  1714. X#define ST  "\033\\"
  1715. X
  1716. X/*
  1717. Xpage numbers are given per "Talaris EXCL programmer's reference manual" M292 rev.2
  1718. XNOTE: EXCL coordinate system places (0,0) at upper left corner of the page
  1719. X
  1720. Xc EXCL commands for initialization
  1721. X
  1722. Xc     TALAMS: set ANSI                                        (p. 162)
  1723. Xc     TALMOD: set emulation *** EXCL                          (p. 164)
  1724. Xc     TALPGO: set page orient *** landscape                   (p.  81)
  1725. Xc     TALFCTL: set paper format *** 8.5x11                    (p.  85)
  1726. Xc     TALTBM: set top/bot margins  ** in land mode to full pg (p.  73)
  1727. Xc     TALLRM: set left/right margins                          (p.  75)
  1728. Xc     PUM:    set units ** units of measure set by TALPRM     (p.  67)
  1729. Xc     TALASF: Absorb cr/ff/lf/vt   ** ON                      (p. 182)
  1730. Xc     TALPOP: pop controller params                           (p. 168)
  1731. Xc     TALPSH: push controller params                          (p. 167)
  1732. Xc     TALPRM: set units of measure ** to 1/1000 inch          (p.  64)
  1733. Xc     TALGLT: set line type ** solid                          (p. 211)
  1734. Xc     TALORG: set page absolute origin ** (0,0) UL corner     (p.  78) 
  1735. Xc     TALPCW: set page clip window *** for landsc/full page   (p.  84)
  1736. Xc     TALGLP: line: **pen7x7mil*draw*smear*glyph112*font5279* (p. 208)
  1737. Xc     TALGLPE: ending for TALGLP command, forcing DRAW mode
  1738. Xc     TALGBB: bounding box; used only by qdrive               (p. 207)
  1739. Xc     TALFPO: Force page out  ** clear bitmap                 (p.  95)
  1740. Xc     TALGDW: graphical draw to hor,vert ** abs  coords       (p. 212)
  1741. Xc     TALGMV: graphical move to hor,vert ** abs  coords       (p. 213)
  1742. X*/
  1743. X#define TALAMS  "\033[0*s"
  1744. X#define TALMOD  "\033[1;0r"
  1745. X#define TALPGO  "\033[1;0p"
  1746. X#define TALFCTL "\033[0;3x"
  1747. X#define TALTBM  "\033[0;8500 v"
  1748. X#define TALLRM  "\033[0;11000v"
  1749. X#define PUM     "\033[11h"
  1750. X#define TALASF  "\033[1 z"
  1751. X#define TALPOP  "\033[*]"
  1752. X#define TALPSH  "\033[*["
  1753. X#define TALPRM  "\033[3y"
  1754. X#define TALGLT  "\033[%s*t"
  1755. X#define TALORG  "\033[0;0o"
  1756. X#define TALCCNT "\033[1;0u"
  1757. X#define TALPCW  "\033[0;8500;11000;0*c"
  1758. X#define TALGLP_init  "\033[7;7;8;1;112;5279*w"
  1759. X#define TALGLP  "\033[%d;%d;8*w"
  1760. X#define TALFPO  "\033[0*F"
  1761. X#define TALGDW "\033[0;%d;%d*d"
  1762. X#define TALGMV "\033[0;%d;%d*m"
  1763. X
  1764. X/*  TALPYL: polyline                                        (p. 222)
  1765. X**        5;0} list of 16-bit signed integers, encoded, mostly relative
  1766. X**        5,1} list of ASCII  absolute coords (if w/o +- signs)(e.g. 315:1222;)
  1767. X*/
  1768. X
  1769. X#define TALPYL  "\033P5;1}"
  1770. X
  1771. X#define EXCL_XMAX 9000
  1772. X#define EXCL_YMAX 6500
  1773. X
  1774. X#define EXCL_XLAST (EXCL_XMAX - 1)
  1775. X#define EXCL_YLAST (EXCL_YMAX - 1)
  1776. X
  1777. X#define EXCL_VCHAR        120
  1778. X#define EXCL_HCHAR        70
  1779. X#define EXCL_VTIC        70
  1780. X#define EXCL_HTIC        70
  1781. X
  1782. XEXCL_init()
  1783. X{
  1784. X  fprintf(outfile,"%s%s%s%s%s%s",
  1785. X                TALPSH,TALAMS,TALMOD,TALCCNT,TALFCTL,TALASF);
  1786. X/*                ^save state   ^setEXCL       ^PaperSize8.5x11       */
  1787. X/*                       ^setANSI      ^copyCount1     ^absorbCtlChar */
  1788. X  fprintf(outfile, "%s%s%s%s%s%s",
  1789. X          PUM,TALPRM,TALPGO,TALPCW,TALORG,TALGLP_init);
  1790. X  fprintf(outfile,                                            TALGLT,"");
  1791. X/*                ^setUnits  ^landscape    ^OriginZero        ^SolidLine   */
  1792. X/*                    ^Units1/1000" ^pageClip     ^SetLine            */
  1793. X}
  1794. X
  1795. XEXCL_graphics()
  1796. X{
  1797. X}
  1798. X
  1799. XEXCL_text()
  1800. X{
  1801. X    fprintf(outfile,TALFPO );
  1802. X    /*              ^pageout  */
  1803. X}
  1804. X
  1805. X
  1806. XEXCL_linetype(linetype)
  1807. Xint linetype;
  1808. X{
  1809. X/* excl line widths in mils: 4 is mimimum, but too thin; then 
  1810. X   7,10,14,17,20,24,27...
  1811. X   exclpen=MOD(NPEN,8)*7
  1812. X   CSI  exclpen; exclpen; TALGLPE
  1813. X*/
  1814. X  static char *type[2+9]={ 
  1815. X    "", "40;40", "",  "42;42",  "14;21",
  1816. X    /*   ....   ----  -- -- --   . . .   */
  1817. X     "",  "49;30",  "14;21",         "",  "49;30",  "14;21"
  1818. X    /*  same pattern, but thicker..  and thicker       */
  1819. X    };
  1820. X  static int width[2+9] = {14, 7,    7, 7, 7, 10, 10, 10, 17, 17, 17};
  1821. X  if (linetype >= 9)
  1822. X    linetype %= 9;
  1823. X  fprintf(outfile,TALGLP,width[linetype+2],width[linetype+2]); 
  1824. X  /*              ^width in dots */
  1825. X  fprintf(outfile,TALGLT,type[linetype+2]);
  1826. X  /*              ^line type     */
  1827. X}
  1828. X
  1829. X
  1830. XEXCL_move(x,y)
  1831. Xint x,y;
  1832. X{
  1833. X    fprintf(outfile,TALGMV, 1000 + x, EXCL_YLAST + 1000 - y);
  1834. X/*                     ^pen up vector*/
  1835. X}
  1836. X
  1837. X
  1838. XEXCL_vector(x2,y2)
  1839. Xint x2,y2;
  1840. X{
  1841. X    fprintf(outfile,TALGDW, 1000 + x2, EXCL_YLAST + 1000 - y2);
  1842. X/*                     ^pen down vector*/
  1843. X}
  1844. X
  1845. X
  1846. XEXCL_put_text(x,y,str)
  1847. Xunsigned int x,y;
  1848. Xchar str[];
  1849. X{
  1850. Xchar ch;
  1851. X    EXCL_move(x,y - EXCL_VCHAR/3);
  1852. X    ch = *str++;
  1853. X    while(ch!='\0') {
  1854. X        putc(ch,outfile);
  1855. X        ch = *str++;
  1856. X    }
  1857. X}
  1858. X
  1859. XEXCL_reset()
  1860. X{
  1861. X    fprintf(outfile,"%s%s", TALFPO, TALPOP);
  1862. X    /*                      ^pageout ^pop  */
  1863. X}
  1864. X
  1865. X
  1866. X
  1867. END_OF_FILE
  1868.   if test 6188 -ne `wc -c <'gnuplot/term/excl.trm'`; then
  1869.     echo shar: \"'gnuplot/term/excl.trm'\" unpacked with wrong size!
  1870.   fi
  1871.   # end of 'gnuplot/term/excl.trm'
  1872. fi
  1873. if test -f 'gnuplot/term/hppj.trm' -a "${1}" != "-c" ; then 
  1874.   echo shar: Will not clobber existing file \"'gnuplot/term/hppj.trm'\"
  1875. else
  1876.   echo shar: Extracting \"'gnuplot/term/hppj.trm'\" \(6012 characters\)
  1877.   sed "s/^X//" >'gnuplot/term/hppj.trm' <<'END_OF_FILE'
  1878. X/*
  1879. X * $Id: hppj.trm%v 3.50.1.11 1993/08/10 03:55:03 woo Exp $
  1880. X *
  1881. X */
  1882. X
  1883. X/* GNUPLOT - hppj.trm */
  1884. X/*
  1885. X * Copyright (C) 1990   
  1886. X *
  1887. X * Permission to use, copy, and distribute this software and its
  1888. X * documentation for any purpose with or without fee is hereby granted, 
  1889. X * provided that the above copyright notice appear in all copies and 
  1890. X * that both that copyright notice and this permission notice appear 
  1891. X * in supporting documentation.
  1892. X *
  1893. X * Permission to modify the software is granted, but not the right to
  1894. X * distribute the modified code.  Modifications are to be distributed 
  1895. X * as patches to released version.
  1896. X *  
  1897. X * This software  is provided "as is" without express or implied warranty.
  1898. X * 
  1899. X * This file is included by ../term.c.
  1900. X *
  1901. X * This terminal driver supports:
  1902. X *  hppj
  1903. X *
  1904. X * AUTHORS
  1905. X *  Dan Merget (danm@sr.hp.com)
  1906. X *
  1907. X * This file was based on the hpljii file by:
  1908. X *  John Engels
  1909. X *  Russell Lang
  1910. X *  Maurice Castro
  1911. X *
  1912. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1913. X * 
  1914. X */
  1915. X
  1916. X/* The following HP laserjet series II driver uses generic bit mapped graphics
  1917. X * routines from bitmap.c to build up a bit map in memory.
  1918. X */
  1919. X
  1920. X#ifdef HPPJ
  1921. X
  1922. X/* We define 3 different font sizes: 5x9, 9x17, and 13x25 */
  1923. X
  1924. X#define HPPJ_DPI 180   /* dots per inch */
  1925. X#define HPPJ_PLANES 3  /* color planes */
  1926. X#define HPPJ_COLORS (1 << HPPJ_PLANES)
  1927. X/* make XMAX and YMAX a multiple of 8 */
  1928. X#define HPPJ_XMAX (8*(unsigned int)(9.5 * HPPJ_DPI / 8.0 + 0.9))
  1929. X#define HPPJ_YMAX (8 * HPPJ_DPI)
  1930. X
  1931. X/* default values for term_tbl */
  1932. X#define HPPJ_9x17_VCHAR FNT9X17_VCHAR
  1933. X#define HPPJ_9x17_HCHAR FNT9X17_HCHAR
  1934. X#define HPPJ_9x17_VTIC (FNT9X17_VCHAR / 2)
  1935. X#define HPPJ_9x17_HTIC (FNT9X17_HCHAR / 2)
  1936. X
  1937. Xstatic int hppj_font = FNT9X17;
  1938. X
  1939. XHPPJoptions()
  1940. X{
  1941. X    char opt[10];
  1942. X#define HPPJERROR "expecting font size FNT5X9, FNT9X17, or FNT13X25"
  1943. X
  1944. X    term_options[0]='\0'; /* default to empty string and 9x17 font */
  1945. X    hppj_font = FNT9X17;  /* in case of error or empty options     */
  1946. X
  1947. X    if ( !END_OF_COMMAND ) {
  1948. X        if ( token[c_token].length > 8 ) {
  1949. X            int_error(HPPJERROR, c_token);
  1950. X       }
  1951. X
  1952. X        capture(opt, c_token, c_token);
  1953. X        if ( !strcmp(opt, "FNT5X9") ) {
  1954. X            hppj_font = FNT5X9;
  1955. X            strcpy(term_options, "FNT5X9");
  1956. X    } else if ( !strcmp(opt, "FNT9X17") ) {
  1957. X           hppj_font = FNT9X17;
  1958. X            strcpy(term_options, "FNT9X17");
  1959. X    } else if ( !strcmp(opt, "FNT13X25") ) {
  1960. X           hppj_font = FNT13X25;
  1961. X            strcpy(term_options, "FNT13X25");
  1962. X    } else {
  1963. X        int_error(HPPJERROR, c_token);
  1964. X    }
  1965. X    c_token++;
  1966. X    }
  1967. X}
  1968. X
  1969. X
  1970. XHPPJinit()
  1971. X{
  1972. X#ifdef REOPEN_BINARY
  1973. X    reopen_binary();
  1974. X#endif
  1975. X}
  1976. X
  1977. X
  1978. XHPPJreset()
  1979. X{
  1980. X#ifdef vms
  1981. X    fflush_binary();
  1982. X#endif /* vms */
  1983. X}
  1984. X
  1985. X
  1986. XHPPJgraphics()
  1987. X{
  1988. X    switch ( hppj_font ) {
  1989. X      case FNT5X9 :
  1990. X    term_tbl[term].v_char = FNT5X9_VCHAR;
  1991. X    term_tbl[term].h_char = FNT5X9_HCHAR;
  1992. X    term_tbl[term].v_tic = FNT5X9_VCHAR / 2;
  1993. X    term_tbl[term].h_tic = FNT5X9_HCHAR / 2;
  1994. X    break;
  1995. X      case FNT9X17 :
  1996. X    term_tbl[term].v_char = FNT9X17_VCHAR;
  1997. X    term_tbl[term].h_char = FNT9X17_HCHAR;
  1998. X    term_tbl[term].v_tic = FNT9X17_VCHAR / 2;
  1999. X    term_tbl[term].h_tic = FNT9X17_HCHAR / 2;
  2000. X    break;
  2001. X      case FNT13X25 :
  2002. X    term_tbl[term].v_char = FNT13X25_VCHAR;
  2003. X    term_tbl[term].h_char = FNT13X25_HCHAR;
  2004. X    term_tbl[term].v_tic = FNT13X25_VCHAR / 2;
  2005. X    term_tbl[term].h_tic = FNT13X25_HCHAR / 2;
  2006. X    break;
  2007. X    }
  2008. X    b_charsize(hppj_font);
  2009. X
  2010. X    b_makebitmap(HPPJ_XMAX, HPPJ_YMAX, HPPJ_PLANES);
  2011. X}
  2012. X
  2013. X
  2014. XHPPJtext()
  2015. X{
  2016. X    int x, plane, y;    /* loop indexes */
  2017. X    int minRow, maxRow;    /* loop bounds */
  2018. X    int numBytes;    /* Number of run-length coded bytes to output */
  2019. X    int numReps;    /* Number of times the current byte is repeated */
  2020. X
  2021. X    fprintf(outfile, "\033E\033*t%dR\033*r%dS", HPPJ_DPI, HPPJ_YMAX);
  2022. X    fprintf(outfile, "\033*b0X\033*b0Y\033*r%dU", HPPJ_PLANES);
  2023. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI", 90, 88, 85, 0);
  2024. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI", 53,  8, 14, 1);
  2025. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI",  3, 26, 22, 2);
  2026. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI",  4,  4, 29, 3);
  2027. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI", 53,  5, 25, 4);
  2028. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI",  2, 22, 64, 5);
  2029. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI", 89, 83, 13, 6);
  2030. X    fprintf(outfile, "\033*v%dA\033*v%dB\033*v%dC\033*v%dI",  4,  4,  6, 7);
  2031. X    fprintf(outfile, "\033*b1M\033*r1A");
  2032. X
  2033. X    /* dump bitmap in raster mode using run-length encoding */
  2034. X    for ( x = HPPJ_XMAX - 1 ; x >= 0 ; --x ) {
  2035. X        for ( plane = 0 ; plane < HPPJ_PLANES ; plane++ ) {
  2036. X            minRow = b_psize * plane;
  2037. X            maxRow = b_psize * plane + b_psize - 1;
  2038. X
  2039. X            /* Print column header */
  2040. X            numBytes = 0;
  2041. X            for ( y = maxRow ; y >= minRow ; --y ) {
  2042. X                if ( y == minRow || *((*b_p)[y]+x) != *((*b_p)[y-1]+x) ) {
  2043. X                    numBytes += 2;
  2044. X                }
  2045. X            }
  2046. X            fprintf(outfile, "\033*b%d", numBytes);
  2047. X            (void) fputc((char)(plane < HPPJ_PLANES - 1 ? 'V' : 'W'), outfile);
  2048. X
  2049. X            /* Print remainder of column */
  2050. X            numReps = 0;
  2051. X            for ( y = maxRow ; y >= minRow ; --y ) {
  2052. X                if ( y == minRow || *((*b_p)[y]+x) != *((*b_p)[y-1]+x) ) {
  2053. X                    (void) fputc( (char)(numReps), outfile );
  2054. X                    (void) fputc( (char)(*((*b_p)[y]+x)), outfile );
  2055. X                    numReps = 0;
  2056. X                } else {
  2057. X                    numReps++;
  2058. X                }
  2059. X            }
  2060. X        }
  2061. X    }
  2062. X    fprintf(outfile, "\033*r1B\033E");
  2063. X
  2064. X    b_freebitmap();
  2065. X}
  2066. X
  2067. X
  2068. XHPPJlinetype(linetype)
  2069. X    int linetype;
  2070. X{
  2071. X    if ( linetype >= 0 ) {
  2072. X        b_setlinetype(0);
  2073. X        b_setvalue((linetype % (HPPJ_COLORS-1)) + 1);
  2074. X    } else {
  2075. X        b_setlinetype(linetype + 2);
  2076. X        b_setvalue(HPPJ_COLORS - 1);
  2077. X    }
  2078. X}
  2079. X
  2080. X
  2081. X#define HPPJmove       b_move
  2082. X#define HPPJvector     b_vector
  2083. X#define HPPJtext_angle b_text_angle
  2084. X#define HPPJput_text   b_put_text
  2085. X
  2086. X#endif /* HPPJ */
  2087. END_OF_FILE
  2088.   if test 6012 -ne `wc -c <'gnuplot/term/hppj.trm'`; then
  2089.     echo shar: \"'gnuplot/term/hppj.trm'\" unpacked with wrong size!
  2090.   fi
  2091.   # end of 'gnuplot/term/hppj.trm'
  2092. fi
  2093. if test -f 'gnuplot/term/sun.trm' -a "${1}" != "-c" ; then 
  2094.   echo shar: Will not clobber existing file \"'gnuplot/term/sun.trm'\"
  2095. else
  2096.   echo shar: Extracting \"'gnuplot/term/sun.trm'\" \(6218 characters\)
  2097.   sed "s/^X//" >'gnuplot/term/sun.trm' <<'END_OF_FILE'
  2098. X/*
  2099. X * $Id: sun.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  2100. X *
  2101. X */
  2102. X
  2103. X/* GNUPLOT - sun.trm */
  2104. X/*
  2105. X * Copyright (C) 1990 - 1993   
  2106. X *
  2107. X * Permission to use, copy, and distribute this software and its
  2108. X * documentation for any purpose with or without fee is hereby granted, 
  2109. X * provided that the above copyright notice appear in all copies and 
  2110. X * that both that copyright notice and this permission notice appear 
  2111. X * in supporting documentation.
  2112. X *
  2113. X * Permission to modify the software is granted, but not the right to
  2114. X * distribute the modified code.  Modifications are to be distributed 
  2115. X * as patches to released version.
  2116. X *  
  2117. X * This software  is provided "as is" without express or implied warranty.
  2118. X * 
  2119. X * This file is included by ../term.c.
  2120. X *
  2121. X * This terminal driver supports:
  2122. X *   SUNview windowing system
  2123. X *
  2124. X * AUTHORS
  2125. X *  Maurice Castro
  2126. X * 
  2127. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  2128. X * 
  2129. X */
  2130. X
  2131. X#include <suntool/sunview.h>
  2132. X#include <suntool/canvas.h>
  2133. X#include <suntool/scrollbar.h>
  2134. X#include <suntool/panel.h>
  2135. X#include <pixrect/pixrect_hs.h>
  2136. X
  2137. X#define SUN_XMAX 600
  2138. X#define SUN_YMAX 512
  2139. X
  2140. X#define SUN_VCHAR (12)        /* default, will be changed */
  2141. X#define SUN_HCHAR (8)        /* default, will be changed */
  2142. X#define SUN_VTIC (SUN_YMAX/80)
  2143. X#define SUN_HTIC (SUN_XMAX/80)
  2144. X#define MARGIN 5
  2145. X#define MINWIN 128
  2146. X
  2147. Xstatic Frame frame;
  2148. Xstatic Canvas canvas;
  2149. Xstatic Pixwin *pw;
  2150. Xstatic struct pixfont *sun_font = NULL;
  2151. X
  2152. Xstatic enum JUSTIFY sun_justify=LEFT;
  2153. X
  2154. Xstatic Notify_value local_notice_destroy();
  2155. X
  2156. Xextern Notify_error notify_dispatch();
  2157. X  
  2158. X/* dotted line generator */
  2159. Xunsigned int sun_value = 1;    /* this can be used for colour */
  2160. Xunsigned int sun_line_mask = 0xffff;    /* 16 bit mask for dotted lines */
  2161. Xstatic unsigned int sun_pattern[] = {0xffff, 0x1111,
  2162. X    0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
  2163. Xint sun_mask_count = 0;
  2164. Xunsigned int sun_lastx, sun_lasty;    /* last pixel set - used by sun_line */
  2165. X
  2166. X
  2167. XSUN_init()
  2168. X{
  2169. X  struct termentry *t = &term_tbl[term];
  2170. X  struct pr_subregion bound;
  2171. X
  2172. X  frame = window_create(NULL, FRAME, 
  2173. X            FRAME_LABEL,               "Gnuplot",
  2174. X            0);
  2175. X  notify_interpose_destroy_func(frame,local_notice_destroy);
  2176. X  canvas = window_create(frame, CANVAS,
  2177. X            CANVAS_AUTO_EXPAND,        TRUE,
  2178. X            CANVAS_AUTO_SHRINK,        TRUE,
  2179. X            CANVAS_MARGIN,             MARGIN,
  2180. X            0);
  2181. X  notify_do_dispatch();
  2182. X  pw = canvas_pixwin(canvas);
  2183. X  window_set(frame, WIN_SHOW, TRUE, 0);
  2184. X
  2185. X  /* figure out font and rough size */
  2186. X  sun_font = pf_default();
  2187. X  pf_textbound(&bound, 1, sun_font, "M");
  2188. X  t->v_char = bound.size.y;
  2189. X  t->h_char = bound.size.x;
  2190. X
  2191. X  return;
  2192. X}
  2193. X
  2194. XSUN_graphics()
  2195. X{
  2196. X  term_tbl[term].xmax = (int) window_get(canvas,CANVAS_WIDTH);
  2197. X  term_tbl[term].ymax = (int) window_get(canvas,CANVAS_HEIGHT);
  2198. X  pw_writebackground(pw,0,0,term_tbl[term].xmax, term_tbl[term].ymax, PIX_SRC );
  2199. X  notify_dispatch();
  2200. X  /* do not let the user make the window too small */
  2201. X  if ((term_tbl[term].xmax)<MINWIN)
  2202. X  {
  2203. X      window_set(frame,
  2204. X            WIN_WIDTH,                MINWIN+2*MARGIN+24,
  2205. X            0);
  2206. X      notify_dispatch();
  2207. X      SUN_graphics();
  2208. X      }
  2209. X  if ((term_tbl[term].ymax) <MINWIN)
  2210. X  {
  2211. X      window_set(frame,
  2212. X            WIN_HEIGHT,               MINWIN+2*MARGIN+24,
  2213. X            0);
  2214. X      notify_dispatch();
  2215. X      SUN_graphics();
  2216. X      }
  2217. X  notify_dispatch();
  2218. X  return;
  2219. X}
  2220. X
  2221. XSUN_text()
  2222. X{
  2223. X  notify_dispatch();
  2224. X  return; /* enter text from another window!!! */
  2225. X}
  2226. X
  2227. XSUN_linetype(linetype)
  2228. Xint linetype;
  2229. X{
  2230. X    if (linetype>=7)
  2231. X        linetype %= 7;
  2232. X    sun_line_mask = sun_pattern[linetype+2];
  2233. X    sun_mask_count=0;
  2234. X}
  2235. X
  2236. X
  2237. XSUN_move(x, y)
  2238. Xunsigned int x, y;
  2239. X{
  2240. X  sun_lastx = x;
  2241. X  sun_lasty = y;
  2242. X  notify_dispatch();
  2243. X  return;
  2244. X}
  2245. X
  2246. XSUN_vector(x, y)
  2247. Xunsigned int x, y;
  2248. X{
  2249. X  if ( (x>=term_tbl[term].xmax) || (y>=term_tbl[term].ymax) )
  2250. X    return;
  2251. X  sun_line(sun_lastx,x,sun_lasty,y);
  2252. X  canvas_pixwin(canvas);
  2253. X  notify_dispatch();
  2254. X  return;
  2255. X}
  2256. X
  2257. X
  2258. XSUN_put_text(x,y,str)
  2259. Xunsigned int x, y;
  2260. Xchar *str;
  2261. X{
  2262. X  struct pr_subregion bound;
  2263. X
  2264. X  if ( (x>=term_tbl[term].xmax) || (y>=term_tbl[term].ymax) )
  2265. X    return;
  2266. X
  2267. X  pf_textbound(&bound, strlen(str), sun_font, str);
  2268. X  y = term_tbl[term].ymax-1-y + bound.size.y/3; /* vertical centering */
  2269. X
  2270. X  switch(sun_justify) {
  2271. X     case LEFT:   break;
  2272. X     case CENTRE: x -= bound.size.x/2; break;
  2273. X     case RIGHT:  x -= bound.size.x; break;
  2274. X  }
  2275. X  pw_text(pw, x,y, PIX_SRC | PIX_DST, 0, str); 
  2276. X  canvas_pixwin(canvas);
  2277. X  notify_dispatch();
  2278. X  return;
  2279. X}
  2280. X
  2281. Xint SUN_justify_text(mode)
  2282. X    enum JUSTIFY mode;
  2283. X{
  2284. X    sun_justify = mode;
  2285. X    return (TRUE);
  2286. X}
  2287. X  
  2288. X  
  2289. X
  2290. X
  2291. XSUN_reset()
  2292. X{
  2293. X  
  2294. X  term_tbl[term].xmax = SUN_XMAX;
  2295. X  term_tbl[term].ymax = SUN_YMAX;
  2296. X  window_set(frame, WIN_SHOW, FALSE, 0);
  2297. X  return;
  2298. X}
  2299. X
  2300. X
  2301. X
  2302. Xsun_setmaskpixel(x,y,value)
  2303. Xunsigned int x,y,value;
  2304. X{
  2305. X    /* dotted line generator */
  2306. X    if ((sun_line_mask>>sun_mask_count)&(unsigned int)(1)) {
  2307. X        pw_put(pw,x,term_tbl[term].ymax-1-y,sun_value);
  2308. X    }
  2309. X    sun_mask_count= (sun_mask_count+1) % 16;
  2310. X    sun_lastx= x;  /* last pixel set with mask */
  2311. X    sun_lasty= y;
  2312. X}
  2313. X
  2314. X
  2315. X
  2316. X
  2317. Xsun_line(x1,x2,y1,y2)
  2318. Xunsigned int x1,x2,y1,y2;
  2319. X{
  2320. Xint runcount;
  2321. Xint dx,dy;
  2322. Xint xinc,yinc;
  2323. Xunsigned int xplot,yplot;
  2324. X
  2325. X    runcount=0;
  2326. X    dx = abs((int)(x1)-(int)(x2));
  2327. X    if (x2>x1)  xinc=  1;
  2328. X    if (x2==x1) xinc=  0;
  2329. X    if (x2<x1)  xinc= -1;
  2330. X    dy = abs((int)(y1)-(int)(y2));
  2331. X    if (y2>y1)  yinc=  1;
  2332. X    if (y2==y1) yinc=  0;
  2333. X    if (y2<y1)  yinc= -1;
  2334. X    xplot=x1;
  2335. X    yplot=y1;
  2336. X    if (dx>dy) {
  2337. X        /* iterate x */
  2338. X        if ( (sun_line_mask==0xffff) ||
  2339. X            ((xplot!=sun_lastx) && (yplot!=sun_lasty)) )
  2340. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2341. X        while (xplot!=x2) { 
  2342. X            xplot+=xinc;
  2343. X            runcount+=dy;
  2344. X            if (runcount>=(dx-runcount)) {
  2345. X                yplot+=yinc;
  2346. X                runcount-=dx;
  2347. X            }
  2348. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2349. X        } 
  2350. X    } else {
  2351. X        /* iterate y */
  2352. X        if ( (sun_line_mask==0xffff) ||
  2353. X            ((xplot!=sun_lastx) && (yplot!=sun_lasty)) )
  2354. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2355. X        while (yplot!=y2) {
  2356. X            yplot+=yinc;
  2357. X            runcount+=dx;
  2358. X            if (runcount>=(dy-runcount)) {
  2359. X                xplot+=xinc;
  2360. X                runcount-=dy;
  2361. X            }
  2362. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2363. X        } 
  2364. X    }
  2365. X}
  2366. X
  2367. X
  2368. Xstatic Notify_value local_notice_destroy(frame, status)
  2369. X   Frame frame;
  2370. X   Destroy_status status;
  2371. X{
  2372. X   if (status != DESTROY_CHECKING)
  2373. X   {
  2374. X      SUN_reset();
  2375. X      term_init = FALSE;
  2376. X      }
  2377. X   return(NOTIFY_DONE);
  2378. X   }
  2379. X
  2380. END_OF_FILE
  2381.   if test 6218 -ne `wc -c <'gnuplot/term/sun.trm'`; then
  2382.     echo shar: \"'gnuplot/term/sun.trm'\" unpacked with wrong size!
  2383.   fi
  2384.   # end of 'gnuplot/term/sun.trm'
  2385. fi
  2386. if test -f 'gnuplot/term/win.trm' -a "${1}" != "-c" ; then 
  2387.   echo shar: Will not clobber existing file \"'gnuplot/term/win.trm'\"
  2388. else
  2389.   echo shar: Extracting \"'gnuplot/term/win.trm'\" \(6130 characters\)
  2390.   sed "s/^X//" >'gnuplot/term/win.trm' <<'END_OF_FILE'
  2391. X/* GNUPLOT - term/win.trm */
  2392. X/*
  2393. X * Copyright (C) 1992   Maurice Castro, Russell Lang
  2394. X *
  2395. X * Permission to use, copy, and distribute this software and its
  2396. X * documentation for any purpose with or without fee is hereby granted, 
  2397. X * provided that the above copyright notice appear in all copies and 
  2398. X * that both that copyright notice and this permission notice appear 
  2399. X * in supporting documentation.
  2400. X *
  2401. X * Permission to modify the software is granted, but not the right to
  2402. X * distribute the modified code.  Modifications are to be distributed 
  2403. X * as patches to released version.
  2404. X *  
  2405. X * This software is provided "as is" without express or implied warranty.
  2406. X * 
  2407. X *
  2408. X * AUTHORS
  2409. X * 
  2410. X *   Gnuplot for Windows:
  2411. X *       Maurice Castro, Russell Lang
  2412. X * 
  2413. X * There is a mailing list for gnuplot users. Note, however, that the
  2414. X * newsgroup 
  2415. X *    comp.graphics.gnuplot 
  2416. X * is identical to the mailing list (they
  2417. X * both carry the same set of messages). We prefer that you read the
  2418. X * messages through that newsgroup, to subscribing to the mailing list.
  2419. X * (If you can read that newsgroup, and are already on the mailing list,
  2420. X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
  2421. X * removed from the mailing list.)
  2422. X *
  2423. X * The address for mailing to list members is
  2424. X *       info-gnuplot@dartmouth.edu
  2425. X * and for mailing administrative requests is 
  2426. X *       info-gnuplot-request@dartmouth.edu
  2427. X * The mailing list for bug reports is 
  2428. X *       bug-gnuplot@dartmouth.edu
  2429. X * The list of those interested in beta-test versions is
  2430. X *       info-gnuplot-beta@dartmouth.edu
  2431. X */
  2432. X
  2433. X
  2434. X/* This file implements the terminal and printer display for gnuplot  */
  2435. X/* under Microsoft Windows. The code currently compiles only with the */
  2436. X/* Borland C++ 3.1 compiler.                                          */
  2437. X/*                                                                    */
  2438. X/* The modifications to allow Gnuplot to run under Windows were made  */
  2439. X/* by Maurice Castro (maurice@bruce.cs.monash.edu.au)                 */
  2440. X/* and Russell Lang (rjl@monu1.cc.monash.edu.au)         19 Nov 1992  */
  2441. X/*                                                                    */
  2442. X
  2443. X/* Edit this file with tabstop=4 (vi :se ts=4)                        */
  2444. X
  2445. X#include <windows.h>
  2446. X#include "../win/wgnuplib.h"
  2447. X
  2448. Xextern GW graphwin;
  2449. X
  2450. Xchar win_prntmp[256];    /* printer temporary file */
  2451. X
  2452. X/* Initialization values - Guess Now Scale later */
  2453. X#define WIN_XMAX (2400)
  2454. X#define WIN_YMAX (1800)
  2455. X#define WIN_HCHAR (WIN_XMAX/75) 
  2456. X#define WIN_VCHAR (WIN_YMAX/25)
  2457. X#define WIN_HTIC (WIN_XMAX/160)
  2458. X#define WIN_VTIC WIN_HTIC
  2459. X
  2460. X/* Interface routines - create list of actions for Windows */
  2461. X
  2462. XWIN_options()
  2463. X{
  2464. X    extern struct value *const_express();
  2465. X    extern double real();
  2466. X
  2467. X    if (!END_OF_COMMAND) {
  2468. X        if (almost_equals(c_token,"d$efault")) {
  2469. X            graphwin.color=TRUE;
  2470. X            strcpy(graphwin.fontname,WINFONT);
  2471. X            graphwin.fontsize = WINFONTSIZE;
  2472. X            c_token++;
  2473. X        }
  2474. X    }
  2475. X
  2476. X    if (!END_OF_COMMAND) {
  2477. X        if (almost_equals(c_token,"m$onochrome")) {
  2478. X            graphwin.color=FALSE;
  2479. X            c_token++;
  2480. X        }
  2481. X        else if (almost_equals(c_token,"c$olor")) {
  2482. X            graphwin.color=TRUE;
  2483. X            c_token++;
  2484. X        }
  2485. X    }
  2486. X
  2487. X    if (!END_OF_COMMAND && isstring(c_token)) {
  2488. X        quote_str(graphwin.fontname,c_token);
  2489. X        c_token++;
  2490. X    }
  2491. X
  2492. X    if (!END_OF_COMMAND) {
  2493. X        /* We have font size specified */
  2494. X        struct value a;
  2495. X        graphwin.fontsize = (int)real(const_express(&a));
  2496. X    }
  2497. X
  2498. X    if (graphwin.fontname[0] == '\0')
  2499. X      sprintf(term_options,"%s", graphwin.color ? "color" :  "monochrome");
  2500. X    else
  2501. X      sprintf(term_options,"%s \"%s\" %d", graphwin.color ? "color" :  "monochrome" ,
  2502. X        graphwin.fontname, graphwin.fontsize);
  2503. X    if (IsWindow(graphwin.hWndGraph) && IsIconic(graphwin.hWndGraph)) {
  2504. X        ShowWindow(graphwin.hWndGraph, SW_SHOWNORMAL);
  2505. X    }
  2506. X    GraphRedraw(&graphwin);
  2507. X}
  2508. X
  2509. X/* We don't actually do scaling, but we need to fix up the text size
  2510. X * if the user has resized the window */
  2511. Xint WIN_scale()
  2512. X{
  2513. X    term_tbl[term].h_char = graphwin.hchar;
  2514. X    term_tbl[term].v_char = graphwin.vchar;
  2515. X    sprintf(term_options,"%s \"%s\" %d", graphwin.color ? "color" :  "monochrome" ,
  2516. X        graphwin.fontname, graphwin.fontsize);
  2517. X    return FALSE ;    /* can't be done */
  2518. X}
  2519. X
  2520. XWIN_init()
  2521. X{
  2522. X    if (!graphwin.hWndGraph) {
  2523. X        graphwin.xmax = WIN_XMAX;
  2524. X        graphwin.ymax = WIN_YMAX;
  2525. X        graphwin.htic = WIN_HTIC;
  2526. X        graphwin.vtic = WIN_VTIC;
  2527. X        GraphInit(&graphwin);
  2528. X        SetClassWord(graphwin.hWndGraph, GCW_HICON, LoadIcon(graphwin.hInstance, "grpicon"));
  2529. X        graphwin.resized = FALSE;
  2530. X    }
  2531. X}
  2532. X
  2533. X
  2534. XWIN_reset()
  2535. X{
  2536. X}
  2537. X
  2538. XWIN_text()
  2539. X{
  2540. X    GraphEnd(&graphwin);
  2541. X}
  2542. X
  2543. XWIN_graphics()
  2544. X{
  2545. X    GraphStart(&graphwin);
  2546. X}
  2547. X
  2548. XWIN_move(x, y)
  2549. Xunsigned int x, y;
  2550. X{
  2551. X    GraphOp(&graphwin, W_move, x, y, NULL);
  2552. X}
  2553. X
  2554. XWIN_vector(x,y)
  2555. Xunsigned int x, y;
  2556. X{
  2557. X    GraphOp(&graphwin, W_vect, x, y, NULL);
  2558. X}
  2559. X
  2560. XWIN_linetype(lt)
  2561. Xint lt;
  2562. X{
  2563. X    GraphOp(&graphwin, W_line_type, lt, 0, NULL);
  2564. X}
  2565. X
  2566. XWIN_put_text(x,y,str)
  2567. Xint x, y;
  2568. Xchar *str;
  2569. X{
  2570. X    GraphOp(&graphwin, W_put_text, x, y, str);
  2571. X}
  2572. X
  2573. Xint WIN_justify_text(mode)
  2574. Xenum JUSTIFY mode;
  2575. X{
  2576. X    GraphOp(&graphwin, W_justify, mode, 0, NULL);
  2577. X    return(TRUE);
  2578. X}
  2579. X
  2580. Xint WIN_text_angle(ang)
  2581. Xint ang;
  2582. X{
  2583. X    if (graphwin.rotate)
  2584. X        GraphOp(&graphwin, W_text_angle, ang, 0, NULL);
  2585. X    return graphwin.rotate;
  2586. X}
  2587. X
  2588. XWIN_point(x,y,number)
  2589. Xint x,y;
  2590. Xint number;
  2591. X{
  2592. X    /* draw point shapes later to save memory */
  2593. X    graphwin.htic = term_tbl[term].h_tic / 2;     /* size of point symbols */
  2594. X    graphwin.vtic = term_tbl[term].v_tic / 2;
  2595. X    if (number>=0)
  2596. X        number %= POINT_TYPES;
  2597. X    number += 1;
  2598. X    GraphOp(&graphwin, W_dot + number, x, y, NULL);
  2599. X}
  2600. X
  2601. X
  2602. X/* Windows PRN emulation */
  2603. XFILE *
  2604. Xopen_printer()
  2605. X{
  2606. Xchar *temp;
  2607. X    if ((temp = getenv("TEMP")) == (char *)NULL)
  2608. X        *win_prntmp='\0';
  2609. X    else  {
  2610. X        strncpy(win_prntmp,temp,MAX_ID_LEN-1);
  2611. X        /* stop X's in path being converted by mktemp */
  2612. X        for (temp=win_prntmp; *temp; temp++)
  2613. X            *temp = tolower(*temp);
  2614. X        if ( strlen(win_prntmp) && (win_prntmp[strlen(win_prntmp)-1]!='\\') )
  2615. X            strcat(win_prntmp,"\\");
  2616. X    }
  2617. X    strncat(win_prntmp, "_gptmp",MAX_ID_LEN-strlen(win_prntmp));
  2618. X    strncat(win_prntmp, "XXXXXX",MAX_ID_LEN-strlen(win_prntmp));
  2619. X    mktemp(win_prntmp);
  2620. X    return fopen(win_prntmp, "w");
  2621. X}
  2622. X
  2623. Xvoid
  2624. Xclose_printer()
  2625. X{
  2626. X    fclose(outfile);
  2627. X    DumpPrinter(graphwin.hWndGraph, graphwin.Title, win_prntmp);
  2628. X}
  2629. X
  2630. Xvoid
  2631. Xscreen_dump(void)
  2632. X{
  2633. X    GraphPrint(&graphwin);
  2634. X}
  2635. END_OF_FILE
  2636.   if test 6130 -ne `wc -c <'gnuplot/term/win.trm'`; then
  2637.     echo shar: \"'gnuplot/term/win.trm'\" unpacked with wrong size!
  2638.   fi
  2639.   # end of 'gnuplot/term/win.trm'
  2640. fi
  2641. echo shar: End of archive 27 \(of 33\).
  2642. cp /dev/null ark27isdone
  2643. MISSING=""
  2644. 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
  2645.     if test ! -f ark${I}isdone ; then
  2646.     MISSING="${MISSING} ${I}"
  2647.     fi
  2648. done
  2649. if test "${MISSING}" = "" ; then
  2650.     echo You have unpacked all 33 archives.
  2651.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2652. else
  2653.     echo You still must unpack the following archives:
  2654.     echo "        " ${MISSING}
  2655. fi
  2656. exit 0
  2657. exit 0 # Just in case...
  2658.