home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume2 / sunplot < prev    next >
Encoding:
Internet Message Format  |  1991-08-07  |  30.0 KB

  1. From: sjoerd@cs.vu.nl (Sjoerd Mullender)
  2. Newsgroups: comp.sources.misc
  3. Subject: v02i047: sunplot - Unix plot backend for Sun
  4. Message-ID: <7195@ncoast.UUCP>
  5. Date: 6 Feb 88 01:29:14 GMT
  6. Approved: allbery@ncoast.UUCP
  7.  
  8. Comp.sources.misc: Volume 2, Issue 47
  9. Submitted-By: "Sjoerd Mullender" <sjoerd@cs.vu.nl>
  10. Archive-Name: sunplot
  11.  
  12. This is a backend for Unix plot code (see plot(5)) for the Sun workstation.
  13. It creates a window in which the plot is displayed.
  14.  
  15. : This is a shar archive.  Extract with sh, not csh.
  16. : This archive ends with exit, so do not worry about trailing junk.
  17. : --------------------------- cut here --------------------------
  18. PATH=/bin:/usr/bin:/usr/ucb
  19. echo Extracting 'README'
  20. sed 's/^X//' > 'README' << '+ END-OF-FILE ''README'
  21. XThis program was written on a Sun 3/50 running SunOS 3.2.
  22. XIt also compiles and runs on a Sun 3/50 running SunOS 3.4.
  23. X
  24. XTo make simply type ``make''.
  25. XTo install, check the Makefile to see if all the names are correct.  Then
  26. Xtype ``make install''.
  27. X
  28. XIf you find any bugs or if you have any suggestions or improvements, please
  29. Xdrop me a note at the address below.
  30. X
  31. XYou might try the command
  32. X    echo 0 0 1 1 2 4 3 9 4 16 | spline | graph | sunplot
  33. Xafter which a window pops up.  Then click the ``Next Page'' button.
  34. X
  35. XSjoerd Mullender
  36. XDept. of Mathematics and Computer Science
  37. XFree University
  38. XAmsterdam
  39. XNetherlands
  40. X
  41. XEmail: sjoerd@cs.vu.nl
  42. XIf this doesn't work, try ...!seismo!mcvax!cs.vu.nl!sjoerd or
  43. X...!seismo!mcvax!vu44!sjoerd or sjoerd%cs.vu.nl@seismo.css.gov.
  44. + END-OF-FILE README
  45. chmod 'u=rw,g=r,o=r' 'README'
  46. set `wc -c 'README'`
  47. count=$1
  48. case $count in
  49. 756)    :;;
  50. *)    echo 'Bad character count in ''README' >&2
  51.         echo 'Count should be 756' >&2
  52. esac
  53. echo Extracting 'Makefile'
  54. sed 's/^X//' > 'Makefile' << '+ END-OF-FILE ''Makefile'
  55. X# The names of the installed binary and manual page.
  56. X# Feel free to change.
  57. XBINARY    = /usr/local/sunplot
  58. XMANUAL    = /usr/man/manl/sunplot.l
  59. X
  60. XCFLAGS    = -O
  61. X
  62. Xsunplot:    sunplot.o
  63. X        $(CC) -o sunplot sunplot.o -lsuntool -lsunwindow -lpixrect
  64. X
  65. Xinstall:    sunplot
  66. X        cp sunplot $(BINARY)
  67. X        cp sunplot.1 $(MANUAL)
  68. X
  69. Xclean:
  70. X        rm -f sunplot *.o core make.out
  71. X
  72. Xsunplot.o:    sunplot.icon
  73. + END-OF-FILE Makefile
  74. chmod 'u=rw,g=r,o=r' 'Makefile'
  75. set `wc -c 'Makefile'`
  76. count=$1
  77. case $count in
  78. 364)    :;;
  79. *)    echo 'Bad character count in ''Makefile' >&2
  80.         echo 'Count should be 364' >&2
  81. esac
  82. echo Extracting 'sunplot.1'
  83. sed 's/^X//' > 'sunplot.1' << '+ END-OF-FILE ''sunplot.1'
  84. X.TH SUNPLOT 1
  85. X.SH NAME
  86. Xsunplot \- plotter backend for Sun workstation
  87. X.SH SYNOPSIS
  88. X.B sunplot
  89. X[
  90. X.B \-c
  91. X.I canvas_size
  92. X] [
  93. X.B \-h
  94. X.I horizontal_size
  95. X] [
  96. X.B \-v
  97. X.I vertical_size
  98. X] [
  99. X.B \-f
  100. X.I font_name
  101. X] [
  102. X.B \-r
  103. X] [
  104. X.B \-x
  105. X] [
  106. X.B \-y
  107. X] [
  108. X.B \-l
  109. X] [
  110. X.B \-s
  111. X]
  112. X.SH DESCRIPTION
  113. X.I Sunplot
  114. Xreads UNIX plotter code (see
  115. X.IR plot (5))
  116. Xfrom standard input and displays it in a Sun window.
  117. XThe window consists of two subwindows.
  118. XAt the top is a control panel with a number of buttons and below it is
  119. Xa window with a canvas on which
  120. X.I sunplot
  121. Xdraws and a horizontal and a vertical scrollbar with which you can select
  122. Xwhich part of the canvas you want to see in the window.
  123. XThe buttons in the control panel have the following functions:
  124. X.TP
  125. X.B "Next Page"
  126. XDraw the next page.
  127. XPages are separated by an
  128. X.B e
  129. X(the
  130. X.I erase
  131. Xfunction in the
  132. X.IR plot (3X)
  133. Xlibrary).
  134. XWhile
  135. X.I sunplot
  136. Xis still reading a page this button is not displayed.
  137. X.TP
  138. X.B Redraw
  139. XRedraw the current page.
  140. X.TP
  141. X.B Zoom
  142. XZoom the current page.
  143. X.I Sunplot
  144. Xfinds the most extreme x- and y-coordinates in the current page and uses
  145. Xthose values in stead of the values given by the
  146. X.B s
  147. Xcommand (the
  148. X.I space
  149. Xfunction) for scaling.
  150. X.TP
  151. X.B Options
  152. X.I Sunplot
  153. Xdisplays a window where you can set certain options.
  154. XSee the description below.
  155. X.TP
  156. X.B Dump
  157. X.I Sunplot
  158. Xdisplays a window with three items.
  159. XYou should type a file name after the string
  160. X.B Dump to file:
  161. Xand then press the
  162. X.B Done
  163. Xbutton.
  164. X.I Sunplot
  165. Xwill then dump the plot into the named file in the format chosen with the
  166. X.B Dump format
  167. Xitem.
  168. XThe dump can be in either
  169. X.IR rasterfile (5)
  170. Xor
  171. X.I icon
  172. Xformat.
  173. XIf the file name is empty,
  174. X.I sunplot
  175. Xwill do nothing.
  176. X.TP
  177. X.B "Fit Screen"
  178. XResize the window so that the canvas fits.
  179. X.TP
  180. X.B Quit
  181. XExit
  182. X.IR sunplot .
  183. X.SH OPTIONS
  184. XWhen the
  185. X.B Options
  186. Xbutton is pressed
  187. X.I sunplot
  188. Xwill display a window with the following items.
  189. X.TP
  190. X.B Done
  191. XDone setting options.
  192. X.I Sunplot
  193. Xwill automatically do a redraw of the page with the new settings.
  194. X.TP
  195. X.B Rotate
  196. XRotate the plot by 90 degrees counter-clockwise.
  197. X.TP
  198. X.B "X Mirror"
  199. XMirror the plot in the x-axis.
  200. X.TP
  201. X.B "Y Mirror"
  202. XMirror the plot in the y-axis.
  203. X.TP
  204. X.B Label
  205. XIf on, display labels.
  206. X.TP
  207. X.B Square
  208. XIf on, the canvas is square, otherwise you can set the horizontal and vertical
  209. Xsizes of the canvas separately.
  210. X.TP
  211. X.B Reverse
  212. XDisplay the canvas in reverse video.
  213. X.TP
  214. X.B "Font name"
  215. XThe name of the font to be used for the labels.
  216. XIf the name is not absolute it is taken to be relative to the system's fonts
  217. Xdirectory /usr/lib/fonts/fixedwidthfonts.
  218. XIf no name is given or the named file does not contain a font, the default
  219. Xfont is used.
  220. X.TP
  221. X.B "Canvas size"
  222. XThe size of the canvas.
  223. XThe size of the canvas is measured in pixels.
  224. XThis is only displayed when the
  225. X.B Square
  226. Xtoggle is on.
  227. X.TP
  228. X.B "Horizontal size"
  229. XThe horizontal size of the canvas.
  230. XThis is only displayed when the
  231. X.B Square
  232. Xtoggle is off.
  233. X.TP
  234. X.B "Vertical size"
  235. XThe vertical size of the canvas.
  236. XThis is only displayed when the
  237. X.B Square
  238. Xtoggle is off.
  239. X.PP
  240. XThe following command line options are recognized.
  241. X.IP "\f3\-c\fP \f2canvas_size\fP"
  242. XSet the canvas size.
  243. X.I Canvas_size
  244. Xmust be between 64 and 2048.
  245. XThis also switches on the
  246. X.B Square
  247. Xtoggle.
  248. X.IP "\f3\-h\fP \f2horizontal_size\fP"
  249. XSet the horizontal size.
  250. X.I Horizontal_size
  251. Xmust be between 64 and 2048.
  252. XThis also switches off the
  253. X.B Square
  254. Xtoggle.
  255. X.IP "\f3\-v\fP \f2vertical_size\fP"
  256. XSet the vertical size.
  257. X.I Vertical_size
  258. Xmust be between 64 and 2048.
  259. XThis also switches off the
  260. X.B Square
  261. Xtoggle.
  262. X.IP "\f3\-f\fP \f2font_name\fP"
  263. XSet the font to be used for labels.
  264. XThis is independent from the font that is used for the text in the control
  265. Xpanel and the options and dump windows.
  266. XA name not starting with ``/'' is taken to be relative to the system's font
  267. Xdirectory /usr/lib/fonts/fixedwidthfonts.
  268. X.IP \f3\-r\fP
  269. XRotate the plot by 90 degrees counter-clockwise.
  270. X.IP \f3\-x\fP
  271. XMirror the plot in the x-axis.
  272. X.IP \f3\-y\fP
  273. XMirror the plot in the y-axis.
  274. X.IP \f3\-l\fP
  275. XToggle labeling.
  276. X.IP \f3\-s\fP
  277. XToggle square mode.
  278. X.PP
  279. XThe
  280. X.BR \-r ,
  281. X.B \-x
  282. Xand
  283. X.B \-y
  284. Xoptions are evaluated left to right and can be repeated to get cumulative
  285. Xeffect.
  286. X.I Sunplot
  287. Xalso recognizes the generic tool arguments; see
  288. X.IR suntools (1)
  289. Xfor a list of these arguments.
  290. X.PP
  291. XThe defaults are: batching on, labels printed, square canvas, canvas is 512
  292. Xby 512 pixels, the point
  293. X.I "(0,\ 0)"
  294. Xis in the lower left-hand corner.
  295. X.SH BUGS
  296. XThe
  297. X.I linemod
  298. Xfunction is not implemented.
  299. X.PP
  300. XThe
  301. X.B zoom
  302. Xcommand doesn't take the height of labels into account.
  303. X.SH "SEE ALSO"
  304. X.IR plot (3X),
  305. X.IR plot (5),
  306. Xand
  307. X.IR rasterfile (5).
  308. X.SH AUTHOR
  309. XSjoerd Mullender, Free University, Amsterdam <sjoerd@cs.vu.nl>
  310. + END-OF-FILE sunplot.1
  311. chmod 'u=rw,g=r,o=r' 'sunplot.1'
  312. set `wc -c 'sunplot.1'`
  313. count=$1
  314. case $count in
  315. 4672)    :;;
  316. *)    echo 'Bad character count in ''sunplot.1' >&2
  317.         echo 'Count should be 4672' >&2
  318. esac
  319. echo Extracting 'sunplot.c'
  320. sed 's/^X//' > 'sunplot.c' << '+ END-OF-FILE ''sunplot.c'
  321. X/*
  322. X * Sunplot - plotter backend for Sun workstation
  323. X *
  324. X * Copyright (c) 1987 by Sjoerd Mullender, Vrije Universiteit, Amsterdam.
  325. X *
  326. X * This program may be redistributed without fee as long as this copyright
  327. X * notice is in tact.
  328. X * Any commercial use is strictly prohibited.
  329. X */
  330. X
  331. X#include <stdio.h>
  332. X#include <suntool/sunview.h>
  333. X#include <suntool/scrollbar.h>
  334. X#include <suntool/panel.h>
  335. X#include <suntool/canvas.h>
  336. X
  337. X/*
  338. X * Configurable definitions
  339. X */
  340. X#define INIT_CANVAS_SIZE    512
  341. X#define DEFAULT_SPACE        4096
  342. X#define MAX_NAME_LENGTH        128
  343. X
  344. X/*
  345. X * Unconfigurable definitions
  346. X */
  347. X#define BIG            0x7FFFFFFF
  348. X
  349. X#define FORMAT_RASTER        0
  350. X#define FORMAT_ICON        1
  351. X
  352. X#define LABEL            0
  353. X#define SQUARE            1
  354. X#define REVERSE            2
  355. X
  356. Xint client_object;        /* used for notifier */
  357. Xint *me = &client_object;    /* idem */
  358. X
  359. Xint curx, cury;            /* current position on plot */
  360. Xint lox, loy, hix = DEFAULT_SPACE, hiy = DEFAULT_SPACE;    /* current space */
  361. Xint slox, shix, sloy, shiy;    /* saved space settings for zooming */
  362. Xint minx, maxx, miny, maxy;    /* minimum and maximum values encountered */
  363. Xint hor_size, ver_size;        /* canvas size */
  364. Xint turned, xmirror, ymirror;    /* orientation of plot */
  365. Xint zooming;
  366. Xint make_label = TRUE;        /* print labels */
  367. Xint square = TRUE;        /* canvas is square */
  368. Xint reverse = FALSE;        /* reverse video */
  369. XFrame frame, dump_frame, options_frame;
  370. XPanel panel, dump_panel, options_panel;
  371. XPanel_item next_page_item;
  372. XPanel_item hor_size_item, ver_size_item, toggle_item, font_item;
  373. XPanel_item dump_format, dump_file_item;
  374. XCanvas canvas;
  375. XPixwin *pw;
  376. XPixfont *font;
  377. Xchar font_name[MAX_NAME_LENGTH];
  378. Xchar font_dir[] = "/usr/lib/fonts/fixedwidthfonts/";
  379. X
  380. Xshort sunplot_icon_image[] = {
  381. X#include "sunplot.icon"
  382. X};
  383. Xmpr_static(sunplot_icon, 64, 64, 1, sunplot_icon_image);
  384. X
  385. Xchar *malloc(), *realloc();
  386. X
  387. X/*
  388. X *  input module
  389. X */
  390. X
  391. Xstatic char *plotcommands, *plptr;
  392. Xstatic int plotlength;
  393. Xstatic int maxplotlength;
  394. Xstatic int eof_seen;
  395. X
  396. Xgetchr()
  397. X{
  398. X    register c;
  399. X
  400. X    if (plptr < plotcommands + plotlength)
  401. X        return *plptr++ & 0xFF;
  402. X    if (eof_seen || (c = getchar()) == EOF) {
  403. X        eof_seen = 1;
  404. X        return EOF;
  405. X    }
  406. X    if (plotlength >= maxplotlength) {
  407. X        plotcommands = realloc(plotcommands, maxplotlength *= 2);
  408. X        plptr = plotcommands + plotlength;
  409. X    }
  410. X    *plptr++ = c;
  411. X    plotlength++;
  412. X    return c;
  413. X}
  414. X
  415. Xgetint()
  416. X{
  417. X    register n;
  418. X
  419. X    n = getchr();
  420. X    n = n | getchr() << 8;
  421. X    if (n & 0x8000)            /* sign extend */
  422. X        n |= ~0x7FFF;
  423. X    return n;
  424. X}
  425. X
  426. Xchar *getstr()
  427. X{
  428. X    register i = plptr - plotcommands;
  429. X    register c;
  430. X
  431. X    while ((c = getchr()) != EOF && c != '\0' && c != '\n')
  432. X        ;
  433. X    plptr[-1] = 0;
  434. X    return plotcommands + i;
  435. X}
  436. X
  437. X/*
  438. X * plot module
  439. X */
  440. X
  441. X#define point(x,y)    pw_put(pw, plotx(x, y), ploty(x, y), !reverse)
  442. X
  443. X#define line(x0,y0,x1,y1)    pw_vector(pw,plotx(x0,y0),ploty(x0,y0),plotx(x1,y1),ploty(x1,y1),PIX_SRC,!reverse)
  444. X
  445. X#define convx(x,s)    (((x) - lox) * (s) / (hix - lox))
  446. X#define convy(y,s)    (((y) - loy) * (s) / (hiy - loy))
  447. X
  448. Xinitplot()
  449. X{
  450. X    plptr = plotcommands = malloc(maxplotlength = 1024);
  451. X    plotlength = 0;
  452. X}
  453. X
  454. Xplotx(x, y)
  455. X{
  456. X    register a;
  457. X
  458. X    switch (turned) {
  459. X    case 0: a = convx(x, hor_size); break;
  460. X    case 1: a = hor_size - 1 - convy(y, hor_size); break;
  461. X    case 2: a = hor_size - 1 - convx(x, hor_size); break;
  462. X    case 3: a = convy(y, hor_size); break;
  463. X    }
  464. X    return xmirror ? hor_size - 1 - a : a;
  465. X}
  466. X
  467. Xploty(x, y)
  468. X{
  469. X    register a;
  470. X
  471. X    switch (turned) {
  472. X    case 0: a = ver_size - 1 - convy(y, ver_size); break;
  473. X    case 1: a = ver_size - 1 - convx(x, ver_size); break;
  474. X    case 2: a = convy(y, ver_size); break;
  475. X    case 3: a = convx(x, ver_size); break;
  476. X    }
  477. X    a = ymirror ? ver_size - 1 - a : a;
  478. X    return zooming ? a+1 : a;
  479. X}
  480. X
  481. Xlabel(s)
  482. Xchar *s;
  483. X{
  484. X    struct pr_size pr_size;
  485. X
  486. X    if (!make_label)
  487. X        return 0;
  488. X    pw_text(pw, plotx(curx, cury), ploty(curx, cury), reverse ? PIX_NOT(PIX_SRC)&PIX_DST : PIX_SRC|PIX_DST, font, s);
  489. X    pr_size = pf_textwidth(strlen(s), font, s);
  490. X    return pr_size.x * (hix - lox) / hor_size;
  491. X}
  492. X
  493. Xisqrt(n)
  494. X{
  495. X    int a, b, c;
  496. X
  497. X    a = n;
  498. X    b = n;
  499. X    if (n > 1) {
  500. X        while (a > 0) {
  501. X            a = a >> 2;
  502. X            b = b >> 1;
  503. X        }
  504. X        do {
  505. X            a = b;
  506. X            c = n / b;
  507. X            b = (c + a) >> 1;
  508. X        } while ((a - c) < -1 || (a - c) > 1);
  509. X    }
  510. X    return b;
  511. X}
  512. X
  513. Xstatic setcir(x, y, a1, b1, c1, a2, b2, c2)
  514. X{
  515. X    if (a1 * y - b1 * x >= c1 && a2 * y - b2 * x <= c2)
  516. X        point(x, y);
  517. X}
  518. X
  519. Xarc(x, y, x1, y1, x2, y2)
  520. X{
  521. X    register a1 = x1 - x, b1 = y1 - y, a2 = x2 - x, b2 = y2 - y;
  522. X    register c1 = a1 * y - b1 * x, c2 = a2 * y - b2 * x;
  523. X    register r2 = a1 * a1 + b1 * b1;
  524. X    register i, di, sqrt, dx, dy;
  525. X
  526. X    dx = (hix - lox) / hor_size;
  527. X    dy = (hiy - loy) / ver_size;
  528. X    di = dx < dy ? dx : dy;
  529. X    if (di <= 0)
  530. X        di = 1;
  531. X    for (i = isqrt(r2 >> 1); i >= 0; i -= di) {
  532. X        sqrt = isqrt(r2 - i * i);
  533. X        setcir(x + i, y + sqrt, a1, b1, c1, a2, b2, c2);
  534. X        setcir(x + i, y - sqrt, a1, b1, c1, a2, b2, c2);
  535. X        setcir(x - i, y + sqrt, a1, b1, c1, a2, b2, c2);
  536. X        setcir(x - i, y - sqrt, a1, b1, c1, a2, b2, c2);
  537. X        setcir(x + sqrt, y + i, a1, b1, c1, a2, b2, c2);
  538. X        setcir(x + sqrt, y - i, a1, b1, c1, a2, b2, c2);
  539. X        setcir(x - sqrt, y + i, a1, b1, c1, a2, b2, c2);
  540. X        setcir(x - sqrt, y - i, a1, b1, c1, a2, b2, c2);
  541. X    }
  542. X}
  543. X
  544. Xcircle(x, y, r)
  545. X{
  546. X    arc(x, y, x + r, y, x - r, y);
  547. X    arc(x, y, x - r, y, x + r, y);
  548. X}
  549. X
  550. XNotify_value input_reader(me, fd)
  551. Xint *me;
  552. Xint fd;
  553. X{
  554. X    int newx, newy, x, y, r;
  555. X    register char *p;
  556. X
  557. X    do {
  558. X        switch (getchr()) {
  559. X        case 'm':                /* move */
  560. X            curx = getint();
  561. X            cury = getint();
  562. X            if (curx < minx) minx = curx;
  563. X            if (curx > maxx) maxx = curx;
  564. X            if (cury < miny) miny = cury;
  565. X            if (cury > maxy) maxy = cury;
  566. X            break;
  567. X        case 'n':                /* cont */
  568. X            newx = getint();
  569. X            newy = getint();
  570. X            line(curx, cury, newx, newy);
  571. X            curx = newx;
  572. X            cury = newy;
  573. X            if (curx < minx) minx = curx;
  574. X            if (curx > maxx) maxx = curx;
  575. X            if (cury < miny) miny = cury;
  576. X            if (cury > maxy) maxy = cury;
  577. X            break;
  578. X        case 'p':                /* point */
  579. X            curx = getint();
  580. X            cury = getint();
  581. X            point(curx, cury);
  582. X            if (curx < minx) minx = curx;
  583. X            if (curx > maxx) maxx = curx;
  584. X            if (cury < miny) miny = cury;
  585. X            if (cury > maxy) maxy = cury;
  586. X            break;
  587. X        case 'l':                /* line */
  588. X            newx = getint();
  589. X            newy = getint();
  590. X            curx = getint();
  591. X            cury = getint();
  592. X            line(newx, newy, curx, cury);
  593. X            if (newx < minx) minx = newx;
  594. X            if (newx > maxx) maxx = newx;
  595. X            if (newy < miny) miny = newy;
  596. X            if (newy > maxy) maxy = newy;
  597. X            if (curx < minx) minx = curx;
  598. X            if (curx > maxx) maxx = curx;
  599. X            if (cury < miny) miny = cury;
  600. X            if (cury > maxy) maxy = cury;
  601. X            break;
  602. X        case 't':                /* label */
  603. X            p = getstr();
  604. X            curx += label(p);
  605. X            if (curx < minx) minx = curx;
  606. X            if (curx > maxx) maxx = curx;
  607. X            break;
  608. X        case 'a':                /* arc */
  609. X            x = getint();
  610. X            y = getint();
  611. X            newx = getint();
  612. X            newy = getint();
  613. X            curx = getint();
  614. X            cury = getint();
  615. X            arc(x, y, newx, newy, curx, cury);
  616. X            if (x < minx) minx = x;
  617. X            if (x > maxx) maxx = x;
  618. X            if (y < miny) miny = y;
  619. X            if (y > maxy) maxy = y;
  620. X            if (newx < minx) minx = newx;
  621. X            if (newx > maxx) maxx = newx;
  622. X            if (newy < miny) miny = newy;
  623. X            if (newy > maxy) maxy = newy;
  624. X            if (curx < minx) minx = curx;
  625. X            if (curx > maxx) maxx = curx;
  626. X            if (cury < miny) miny = cury;
  627. X            if (cury > maxy) maxy = cury;
  628. X            break;
  629. X        case 'c':                /* circle */
  630. X            curx = getint();
  631. X            cury = getint();
  632. X            r = getint();
  633. X            circle(curx, cury, r);
  634. X            if (curx - r < minx) minx = curx - r;
  635. X            if (curx + r > maxx) maxx = curx + r;
  636. X            if (cury - r < miny) miny = cury - r;
  637. X            if (cury + r > maxy) maxy = cury + r;
  638. X            break;
  639. X        case 'e':                /* erase */
  640. X            panel_set(next_page_item, PANEL_SHOW_ITEM, TRUE, 0);
  641. X            /* fall through */
  642. X        case EOF:
  643. X            notify_set_input_func(me, NOTIFY_FUNC_NULL, fd);
  644. X            if (zooming) {
  645. X                lox = slox;
  646. X                hix = shix;
  647. X                loy = sloy;
  648. X                hiy = shiy;
  649. X                zooming = 0;
  650. X            }
  651. X            return NOTIFY_DONE;
  652. X        case 'f':                /* linemod */
  653. X            getstr();
  654. X            break;
  655. X        case 's':                /* space */
  656. X            if (zooming) {
  657. X                slox = getint();
  658. X                sloy = getint();
  659. X                shix = getint();
  660. X                shiy = getint();
  661. X            } else {
  662. X                lox = getint();
  663. X                loy = getint();
  664. X                hix = getint();
  665. X                hiy = getint();
  666. X            }
  667. X            break;
  668. X        }
  669. X    } while (plptr < plotcommands + plotlength || stdin->_cnt > 0);
  670. X    return NOTIFY_DONE;
  671. X}
  672. X
  673. X/*
  674. X * button routines
  675. X */
  676. X
  677. Xrestartplot()
  678. X{
  679. X    minx = BIG;
  680. X    maxx = -BIG;
  681. X    miny = BIG;
  682. X    maxy = -BIG;
  683. X    plptr = plotcommands;
  684. X
  685. X    /* clear the canvas */
  686. X    pw_writebackground(pw, 0, 0, (int) window_get(canvas, CANVAS_WIDTH),
  687. X                (int) window_get(canvas, CANVAS_HEIGHT),
  688. X                reverse ? PIX_SET : PIX_CLR);
  689. X}
  690. X
  691. Xresetplot()
  692. X{
  693. X    restartplot();
  694. X    plotlength = 0;
  695. X}
  696. X
  697. Xvoid redraw()
  698. X{
  699. X    if (zooming) {
  700. X        lox = slox;
  701. X        hix = shix;
  702. X        loy = sloy;
  703. X        hiy = shiy;
  704. X        zooming = 0;
  705. X    }
  706. X    restartplot();
  707. X    input_reader(me, fileno(stdin));
  708. X}
  709. X
  710. Xvoid nextpage()
  711. X{
  712. X    resetplot();
  713. X    panel_set(next_page_item, PANEL_SHOW_ITEM, FALSE, 0);
  714. X    notify_set_input_func(me, input_reader, fileno(stdin));
  715. X    if (stdin->_cnt > 0)
  716. X        input_reader(me, fileno(stdin));
  717. X}
  718. X
  719. Xvoid zoom()
  720. X{
  721. X    int a;
  722. X
  723. X    if (!zooming) {
  724. X        slox = lox;
  725. X        shix = hix;
  726. X        sloy = loy;
  727. X        shiy = hiy;
  728. X        zooming = 1;
  729. X    }
  730. X    if (maxx == minx) {
  731. X        maxx++;
  732. X        minx--;
  733. X    }
  734. X    if (maxy == miny) {
  735. X        maxy++;
  736. X        miny--;
  737. X    }
  738. X    if ((a = (maxx-minx) * (shiy-sloy) / (shix-slox)) >= maxy-miny) {
  739. X        loy = miny - (a - maxy + miny) / 2;
  740. X        hiy = loy + a;
  741. X        lox = minx;
  742. X        hix = maxx;
  743. X    } else {
  744. X        a = (maxy - miny) * (shix - slox) / (shiy - sloy);
  745. X        lox = minx - (a - maxx + minx) / 2;
  746. X        hix = lox + a;
  747. X        loy = miny;
  748. X        hiy = maxy;
  749. X    }
  750. X    hix++;
  751. X    hiy++;
  752. X    restartplot();
  753. X    input_reader(me, fileno(stdin));
  754. X}
  755. X
  756. Xvoid quit()
  757. X{
  758. X    /* don't ask for confirmation */
  759. X    if (font)
  760. X        pf_close(font);
  761. X    window_set(frame, FRAME_NO_CONFIRM, TRUE, 0);
  762. X    window_destroy(frame);
  763. X}
  764. X
  765. Xvoid turn()
  766. X{
  767. X    int tmp;
  768. X
  769. X    turned = (turned + 1) & 3;
  770. X    tmp = xmirror;
  771. X    xmirror = ymirror;
  772. X    ymirror = tmp;
  773. X}
  774. X
  775. Xvoid mirrorx()
  776. X{
  777. X    xmirror ^= 1;
  778. X}
  779. X
  780. Xvoid mirrory()
  781. X{
  782. X    ymirror ^= 1;
  783. X}
  784. X
  785. Xvoid toggle_proc()
  786. X{
  787. X    if ((int) panel_get(toggle_item, PANEL_TOGGLE_VALUE, SQUARE)) {
  788. X        panel_set(ver_size_item,
  789. X            PANEL_SHOW_ITEM,    FALSE,
  790. X            0);
  791. X        panel_set(hor_size_item,
  792. X            PANEL_LABEL_STRING,    "Canvas size:     ",
  793. X            0);
  794. X    } else {
  795. X        panel_set(ver_size_item,
  796. X            PANEL_SHOW_ITEM,    TRUE,
  797. X            0);
  798. X        panel_set(hor_size_item,
  799. X            PANEL_LABEL_STRING,    "Horizontal size: ",
  800. X            0);
  801. X    }
  802. X}
  803. X
  804. Xvoid options()
  805. X{
  806. X    window_set(options_frame, WIN_SHOW, TRUE, 0);
  807. X}
  808. X
  809. Xvoid options_done()
  810. X{
  811. X    register int r;
  812. X    char *f;
  813. X    Cursor cursor;
  814. X
  815. X    window_set(options_frame, WIN_SHOW, FALSE, 0);
  816. X    r = (int) panel_get(hor_size_item, PANEL_VALUE);
  817. X    if (r != hor_size) {
  818. X        window_set(canvas, CANVAS_WIDTH, r, 0);
  819. X        hor_size = r;
  820. X    }
  821. X    if (square)
  822. X        r = hor_size;
  823. X    else
  824. X        r = (int) panel_get(ver_size_item, PANEL_VALUE);
  825. X    if (r != ver_size) {
  826. X        window_set(canvas, CANVAS_HEIGHT, r, 0);
  827. X        ver_size = r;
  828. X    }
  829. X    f = (char *) panel_get_value(font_item);
  830. X    if (f == 0 || *f == 0) {
  831. X        if (font_name[0] != 0) {
  832. X            font_name[0] = 0;
  833. X            if (font)
  834. X                pf_close(font);
  835. X            font = pf_default();
  836. X        }
  837. X    } else {
  838. X        if (font_name[0] == 0 || strcmp(f, font_name) != 0) {
  839. X            strcpy(font_name, f);
  840. X            f = font_name;
  841. X            if (*f != '/') {
  842. X                f = malloc(strlen(font_dir)+strlen(font_name)+1);
  843. X                strcpy(f, font_dir);
  844. X                strcat(f, font_name);
  845. X            }
  846. X            if (font)
  847. X                pf_close(font);
  848. X            font = pf_open(f);
  849. X            if (f != font_name)
  850. X                free(f);
  851. X        }
  852. X    }
  853. X    if (font == 0) {
  854. X        font_name[0] = 0;
  855. X        font = pf_default();
  856. X    }
  857. X    make_label = (int) panel_get(toggle_item, PANEL_TOGGLE_VALUE, LABEL);
  858. X    square = (int) panel_get(toggle_item, PANEL_TOGGLE_VALUE, SQUARE);
  859. X    reverse = (int) panel_get(toggle_item, PANEL_TOGGLE_VALUE, REVERSE);
  860. X    cursor = (Cursor) window_get(canvas, WIN_CURSOR);
  861. X    cursor_set(cursor,
  862. X            CURSOR_OP, reverse ? PIX_SRC^PIX_DST : PIX_SRC|PIX_DST,
  863. X            0);
  864. X    window_set(canvas, WIN_CURSOR, cursor, 0);
  865. X    redraw();
  866. X}
  867. X
  868. Xvoid dump()
  869. X{
  870. X    window_set(dump_frame, WIN_SHOW, TRUE, 0);
  871. X}
  872. X
  873. Xvoid dump_done()
  874. X{
  875. X    char *file;
  876. X    int width, height;
  877. X    register int x, y;
  878. X    register char *s;
  879. X    register short *p;
  880. X    FILE *f;
  881. X
  882. X    /* we use the fact that the canvas is retained */
  883. X    file = (char *) panel_get_value(dump_file_item);
  884. X    if (file != 0 && *file != 0 && (f = fopen(file, "w")) != 0) {
  885. X        width = (int) window_get(canvas, CANVAS_WIDTH);
  886. X        height = (int) window_get(canvas, CANVAS_HEIGHT);
  887. X        switch ((int) panel_get_value(dump_format)) {
  888. X        case FORMAT_RASTER:
  889. X            pr_dump(pw->pw_prretained, f, (colormap_t *) 0,
  890. X                            RT_STANDARD, 0);
  891. X            break;
  892. X        case FORMAT_ICON:
  893. X            p = mpr_d(pw->pw_prretained)->md_image;
  894. X            fprintf(f, "\
  895. X/* Format_version=1, Width=%d, Height=%d, Depth=1, Valid_bits_per_item=16\n\
  896. X */\n", (width+15) & ~15, height);
  897. X            for (y = 0; y < height; y++) {
  898. X                s = "\t";
  899. X                for (x = 0; x < width; x += 16) {
  900. X                    fprintf(f, "%s0x%04x,", s, *p & 0xFFFF);
  901. X                    p++;
  902. X                    s = "";
  903. X                }
  904. X                fprintf(f, "\n");
  905. X            }
  906. X            break;
  907. X        }
  908. X        fclose(f);
  909. X    }
  910. X    window_set(dump_frame, WIN_SHOW, FALSE, 0);
  911. X}
  912. X
  913. Xvoid fit_screen()
  914. X{
  915. X    register int w, h;
  916. X    
  917. X    w = hor_size + (int) scrollbar_get((Scrollbar) window_get(canvas, WIN_VERTICAL_SCROLLBAR), SCROLL_THICKNESS);
  918. X    h = ver_size + (int) scrollbar_get((Scrollbar) window_get(canvas, WIN_HORIZONTAL_SCROLLBAR), SCROLL_THICKNESS);
  919. X    window_set(canvas, WIN_WIDTH, w, WIN_HEIGHT, h, 0);
  920. X    window_set(canvas, CANVAS_WIDTH, hor_size, CANVAS_HEIGHT, ver_size, 0);
  921. X    window_set(panel, WIN_WIDTH, w, 0);
  922. X    window_fit(frame);
  923. X}
  924. X
  925. X/*
  926. X * initialization
  927. X */
  928. X
  929. Xvoid dump_init()
  930. X{
  931. X    register Pixrect *pr;
  932. X
  933. X    dump_frame = window_create(frame, FRAME,
  934. X            FRAME_DONE_PROC,    dump_done,
  935. X            0);
  936. X    dump_panel = window_create(dump_frame, PANEL, 0);
  937. X    pr = panel_button_image(dump_panel, "Done", 0, (Pixfont *) 0);
  938. X    (void) panel_create_item(dump_panel, PANEL_BUTTON,
  939. X            PANEL_LABEL_IMAGE,    pr,
  940. X            PANEL_NOTIFY_PROC,    dump_done,
  941. X            0);
  942. X    /* order of strings is important (see definitions of FORMAT_*) */
  943. X    dump_format = panel_create_item(dump_panel, PANEL_CYCLE,
  944. X            PANEL_LABEL_STRING,    "Dump format:",
  945. X            PANEL_CHOICE_STRINGS,    "Rasterfile format",
  946. X                        "Icon format",
  947. X                        (char *) 0,
  948. X            0);
  949. X    dump_file_item = panel_create_item(dump_panel, PANEL_TEXT,
  950. X            PANEL_LABEL_X,        ATTR_COL(0),
  951. X            PANEL_LABEL_Y,        ATTR_ROW(1),
  952. X            PANEL_VALUE_DISPLAY_LENGTH, 25,
  953. X            PANEL_LABEL_STRING,    "Dump to file:",
  954. X            0);
  955. X    window_fit(dump_panel);
  956. X    window_fit(dump_frame);
  957. X}
  958. X
  959. Xvoid options_init()
  960. X{
  961. X    register Pixrect *pr;
  962. X
  963. X    options_frame = window_create(frame, FRAME,
  964. X            FRAME_DONE_PROC,    options_done,
  965. X            0);
  966. X    options_panel = window_create(options_frame, PANEL, 0);
  967. X
  968. X    pr = panel_button_image(options_panel, "Done", 0, (Pixfont *) 0);
  969. X    (void) panel_create_item(options_panel, PANEL_BUTTON,
  970. X            PANEL_LABEL_IMAGE,    pr,
  971. X            PANEL_NOTIFY_PROC,    options_done,
  972. X            0);
  973. X    pr = panel_button_image(options_panel, "Rotate", 0, (Pixfont*) 0);
  974. X    (void) panel_create_item(options_panel, PANEL_BUTTON,
  975. X            PANEL_NOTIFY_PROC,    turn,
  976. X            PANEL_LABEL_IMAGE,    pr,
  977. X            0);
  978. X    pr = panel_button_image(options_panel, "X Mirror", 0, (Pixfont*) 0);
  979. X    (void) panel_create_item(options_panel, PANEL_BUTTON,
  980. X            PANEL_NOTIFY_PROC,    mirrorx,
  981. X            PANEL_LABEL_IMAGE,    pr,
  982. X            0);
  983. X    pr = panel_button_image(options_panel, "Y Mirror", 0, (Pixfont*) 0);
  984. X    (void) panel_create_item(options_panel, PANEL_BUTTON,
  985. X            PANEL_NOTIFY_PROC,    mirrory,
  986. X            PANEL_LABEL_IMAGE,    pr,
  987. X            0);
  988. X    toggle_item = panel_create_item(options_panel, PANEL_TOGGLE,
  989. X            PANEL_LAYOUT,        PANEL_HORIZONTAL,
  990. X            PANEL_CHOICE_STRINGS,    "Label",
  991. X                        "Square",
  992. X                        "Reverse",
  993. X                        (char *) 0,
  994. X            PANEL_TOGGLE_VALUE,    LABEL, make_label,
  995. X            PANEL_TOGGLE_VALUE,    SQUARE, square,
  996. X            PANEL_TOGGLE_VALUE,    REVERSE, reverse,
  997. X            PANEL_NOTIFY_PROC,    toggle_proc,
  998. X            0);
  999. X    font_item = panel_create_item(options_panel, PANEL_TEXT,
  1000. X            PANEL_VALUE_DISPLAY_LENGTH, 51,
  1001. X            PANEL_VALUE_STORED_LENGTH, MAX_NAME_LENGTH,
  1002. X            PANEL_LABEL_STRING,    "Font name:",
  1003. X            PANEL_VALUE,        font_name,
  1004. X            0);
  1005. X    hor_size_item = panel_create_item(options_panel, PANEL_SLIDER,
  1006. X            PANEL_LABEL_STRING,    "Horizontal size: ",
  1007. X            PANEL_VALUE,        hor_size,
  1008. X            PANEL_MIN_VALUE,    64,
  1009. X            PANEL_MAX_VALUE,    2048,
  1010. X            PANEL_SLIDER_WIDTH,    200,
  1011. X            0);
  1012. X    ver_size_item = panel_create_item(options_panel, PANEL_SLIDER,
  1013. X            PANEL_LABEL_STRING,    "Vertical size:   ",
  1014. X            PANEL_VALUE,        ver_size,
  1015. X            PANEL_MIN_VALUE,    64,
  1016. X            PANEL_MAX_VALUE,    2048,
  1017. X            PANEL_SLIDER_WIDTH,    200,
  1018. X            0);
  1019. X    window_fit(options_panel);
  1020. X    window_fit(options_frame);
  1021. X    if (square) {
  1022. X        panel_set(ver_size_item,
  1023. X            PANEL_SHOW_ITEM,    FALSE,
  1024. X            0);
  1025. X        panel_set(hor_size_item,
  1026. X            PANEL_LABEL_STRING,    "Canvas size:     ",
  1027. X            0);
  1028. X    }
  1029. X}
  1030. X
  1031. Xvoid panel_init()
  1032. X{
  1033. X    register Pixrect *pr;
  1034. X
  1035. X    panel = window_create(frame, PANEL, 0);
  1036. X    pr = panel_button_image(panel, "Next Page", 0, (Pixfont *) 0);
  1037. X    next_page_item = panel_create_item(panel, PANEL_BUTTON,
  1038. X            PANEL_NOTIFY_PROC,    nextpage,
  1039. X            PANEL_LABEL_IMAGE,    pr,
  1040. X            0);
  1041. X    pr = panel_button_image(panel, "Redraw", 0, (Pixfont *) 0);
  1042. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1043. X            PANEL_NOTIFY_PROC,    redraw,
  1044. X            PANEL_LABEL_IMAGE,    pr,
  1045. X            0);
  1046. X    pr = panel_button_image(panel, "Zoom", 0, (Pixfont *) 0);
  1047. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1048. X            PANEL_NOTIFY_PROC,    zoom,
  1049. X            PANEL_LABEL_IMAGE,    pr,
  1050. X            0);
  1051. X    pr = panel_button_image(panel, "Options", 0, (Pixfont *) 0);
  1052. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1053. X            PANEL_NOTIFY_PROC,    options,
  1054. X            PANEL_LABEL_IMAGE,    pr,
  1055. X            0);
  1056. X    pr = panel_button_image(panel, "Dump", 0, (Pixfont *) 0);
  1057. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1058. X            PANEL_NOTIFY_PROC,    dump,
  1059. X            PANEL_LABEL_IMAGE,    pr,
  1060. X            0);
  1061. X    pr = panel_button_image(panel, "Fit Screen", 0, (Pixfont *) 0);
  1062. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1063. X            PANEL_NOTIFY_PROC,    fit_screen,
  1064. X            PANEL_LABEL_IMAGE,    pr,
  1065. X            0);
  1066. X    pr = panel_button_image(panel, "Quit", 0, (Pixfont *) 0);
  1067. X    (void) panel_create_item(panel, PANEL_BUTTON,
  1068. X            PANEL_NOTIFY_PROC,    quit,
  1069. X            PANEL_LABEL_IMAGE,    pr,
  1070. X            0);
  1071. X    window_fit_height(panel);
  1072. X}
  1073. X
  1074. Xcanvas_init()
  1075. X{
  1076. X    canvas = window_create(frame, CANVAS,
  1077. X            CANVAS_AUTO_SHRINK,    FALSE,
  1078. X            CANVAS_WIDTH,        hor_size,
  1079. X            CANVAS_HEIGHT,        ver_size,
  1080. X            CANVAS_RETAINED,    TRUE,
  1081. X            WIN_VERTICAL_SCROLLBAR,    scrollbar_create(0),
  1082. X            WIN_HORIZONTAL_SCROLLBAR, scrollbar_create(0),
  1083. X            0);
  1084. X    pw = canvas_pixwin(canvas);
  1085. X}
  1086. X
  1087. Xmain(argc, argv)
  1088. Xchar **argv;
  1089. X{
  1090. X    initplot();
  1091. X
  1092. X    hor_size = ver_size = INIT_CANVAS_SIZE;
  1093. X    frame = window_create(NULL, FRAME,
  1094. X            FRAME_LABEL,        "Sunplot",
  1095. X            FRAME_SUBWINDOWS_ADJUSTABLE, FALSE,
  1096. X            FRAME_ICON, icon_create(ICON_IMAGE, &sunplot_icon, 0),
  1097. X            FRAME_ARGC_PTR_ARGV,    &argc, argv,
  1098. X            0);
  1099. X    while (argc > 1 && argv[1][0] == '-') {
  1100. X        switch (argv[1][1]) {
  1101. X        case 'c':
  1102. X            if (argv[1][2])
  1103. X                hor_size = atoi(&argv[1][2]);
  1104. X            else if (argc > 2) {
  1105. X                hor_size = atoi(argv[2]);
  1106. X                argv[1] = argv[0];
  1107. X                argv++;
  1108. X                argc--;
  1109. X            }
  1110. X            if (hor_size < 64)
  1111. X                hor_size = 64;
  1112. X            ver_size = hor_size;
  1113. X            square = TRUE;
  1114. X            break;
  1115. X        case 'h':
  1116. X            if (argv[1][2])
  1117. X                hor_size = atoi(&argv[1][2]);
  1118. X            else if (argc > 2) {
  1119. X                hor_size = atoi(argv[2]);
  1120. X                argv[1] = argv[0];
  1121. X                argv++;
  1122. X                argc--;
  1123. X            }
  1124. X            if (hor_size < 64)
  1125. X                hor_size = 64;
  1126. X            square = FALSE;
  1127. X            break;
  1128. X        case 'v':
  1129. X            if (argv[1][2])
  1130. X                ver_size = atoi(&argv[1][2]);
  1131. X            else if (argc > 2) {
  1132. X                ver_size = atoi(argv[2]);
  1133. X                argv[1] = argv[0];
  1134. X                argv++;
  1135. X                argc--;
  1136. X            }
  1137. X            if (ver_size < 64)
  1138. X                ver_size = 64;
  1139. X            square = FALSE;
  1140. X            break;
  1141. X        case 'l':
  1142. X            make_label = !make_label;
  1143. X            break;
  1144. X        case 's':
  1145. X            square = !square;
  1146. X            break;
  1147. X        case 'r':
  1148. X            turn();
  1149. X            break;
  1150. X        case 'x':
  1151. X            mirrorx();
  1152. X            break;
  1153. X        case 'y':
  1154. X            mirrory();
  1155. X            break;
  1156. X        case 'f':
  1157. X            if (argv[1][2])
  1158. X                strcpy(font_name, &argv[1][2]);
  1159. X            else if (argc > 2) {
  1160. X                strcpy(font_name, argv[2]);
  1161. X                argv[1] = argv[0];
  1162. X                argv++;
  1163. X                argc--;
  1164. X            }
  1165. X            break;
  1166. X        }
  1167. X        argc--;
  1168. X        argv[1] = argv[0];
  1169. X        argv++;
  1170. X    }
  1171. X    dump_init();
  1172. X    options_init();
  1173. X    panel_init();
  1174. X    canvas_init();
  1175. X    if (font_name[0]) {
  1176. X        register char *f = font_name;
  1177. X
  1178. X        if (*f != '/') {
  1179. X            f = malloc(strlen(font_dir)+strlen(font_name)+1);
  1180. X            strcpy(f, font_dir);
  1181. X            strcat(f, font_name);
  1182. X        }
  1183. X        font = pf_open(f);
  1184. X        if (f != font_name)
  1185. X            free(f);
  1186. X    }
  1187. X    if (font == 0) {
  1188. X        font = pf_default();
  1189. X        font_name[0] = 0;
  1190. X    }
  1191. X
  1192. X    fit_screen();
  1193. X
  1194. X    notify_set_input_func(me, input_reader, fileno(stdin));
  1195. X
  1196. X    window_main_loop(frame);
  1197. X
  1198. X    exit(0);
  1199. X}
  1200. + END-OF-FILE sunplot.c
  1201. chmod 'u=rw,g=r,o=r' 'sunplot.c'
  1202. set `wc -c 'sunplot.c'`
  1203. count=$1
  1204. case $count in
  1205. 19634)    :;;
  1206. *)    echo 'Bad character count in ''sunplot.c' >&2
  1207.         echo 'Count should be 19634' >&2
  1208. esac
  1209. echo Extracting 'sunplot.icon'
  1210. sed 's/^X//' > 'sunplot.icon' << '+ END-OF-FILE ''sunplot.icon'
  1211. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1212. X */
  1213. X    0x0000,0x0000,0x0000,0x0400,0x0000,0x0000,0x0000,0x0400,
  1214. X    0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,0x0800,
  1215. X    0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x7FF0,0x1000,
  1216. X    0x0000,0x0007,0x800F,0x1000,0x0000,0x0038,0x0000,0xE000,
  1217. X    0x0000,0x00C0,0x0000,0x3800,0x2000,0x0300,0x0000,0x4600,
  1218. X    0x1800,0x0400,0x0000,0x4100,0x07FF,0x0800,0x0000,0x8080,
  1219. X    0x03FF,0xFFFC,0x0000,0x8060,0x01C1,0xFFFF,0xFFF0,0x8010,
  1220. X    0x00E0,0x8037,0xFFFF,0xF008,0x0071,0x0030,0x001F,0xFE04,
  1221. X    0x003A,0x0030,0x0002,0x0002,0x001E,0x0060,0x0002,0x0002,
  1222. X    0x000F,0x0060,0x0002,0x0001,0x000F,0x8060,0x0004,0x0000,
  1223. X    0x0011,0xC0C0,0x0004,0x0000,0x0010,0xE0C0,0x0008,0x0000,
  1224. X    0x0020,0x7180,0x0008,0x0000,0x0020,0x3B80,0x0008,0x0000,
  1225. X    0x0040,0x1F00,0x0010,0x0000,0x0040,0x0E00,0x0010,0x0000,
  1226. X    0x0040,0x1F80,0x0020,0x0000,0x0080,0x3BC0,0x0020,0x0000,
  1227. X    0x0080,0x70E0,0x0040,0x0000,0x0081,0xE070,0x0040,0x0000,
  1228. X    0x0081,0xC038,0x0040,0x0000,0x0100,0x001C,0x0080,0x0000,
  1229. X    0x0100,0x000E,0x0080,0x0000,0x0100,0x0007,0x0100,0x0000,
  1230. X    0x0100,0x0003,0x8100,0x0000,0x0100,0x0001,0xE100,0x0000,
  1231. X    0x0100,0x0000,0xF200,0x0000,0x0100,0x0000,0x3A00,0x0000,
  1232. X    0x0100,0x0000,0x1C00,0x0000,0x0100,0x0000,0x0E00,0x0000,
  1233. X    0x0100,0x0000,0x0F00,0x0000,0x0100,0x0000,0x0B80,0x0000,
  1234. X    0x0080,0x0000,0x0980,0x0000,0x0080,0x0000,0x1040,0x0000,
  1235. X    0x0080,0x0000,0x1020,0x0000,0x0080,0x0000,0x2000,0x0000,
  1236. X    0x0040,0x0000,0x2000,0x0000,0x0040,0x0000,0x2000,0x0000,
  1237. X    0x0FFF,0xFFFF,0xFFFF,0xFFE0,0x0924,0x9249,0x2492,0x4920,
  1238. X    0x0924,0x9249,0x2492,0x4920,0x0924,0x9249,0x2492,0x4920,
  1239. X    0x0800,0x0000,0x0000,0x0020,0x0800,0x0000,0x0000,0x0020,
  1240. X    0x0800,0x0000,0x0000,0x0021,0x0800,0x0000,0x0000,0x0022,
  1241. X    0x0800,0x0000,0x0000,0x0022,0x0800,0x0000,0x0000,0x0024,
  1242. X    0x0FFF,0xFFFF,0xFFFF,0xFFE8,0x0000,0x4004,0x0000,0x0010,
  1243. X    0x0000,0x3008,0x0000,0x0060,0x0000,0x0808,0x0000,0x0080,
  1244. X    0x0000,0x0410,0x0000,0x0100,0x0000,0x0310,0x0000,0x0600
  1245. + END-OF-FILE sunplot.icon
  1246. chmod 'u=rw,g=r,o=r' 'sunplot.icon'
  1247. set `wc -c 'sunplot.icon'`
  1248. count=$1
  1249. case $count in
  1250. 1933)    :;;
  1251. *)    echo 'Bad character count in ''sunplot.icon' >&2
  1252.         echo 'Count should be 1933' >&2
  1253. esac
  1254. exit 0
  1255. -- 
  1256. Sjoerd Mullender
  1257. sjoerd@cs.vu.nl
  1258.