home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / vplot / part10 < prev    next >
Encoding:
Internet Message Format  |  1988-03-28  |  56.5 KB

  1. Subject:  v14i015:  Device-independant graphics system, with drivers
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Joe Dellinger <joe@hanauma.STANFORD.EDU>
  7. Posting-number: Volume 14, Issue 15
  8. Archive-name: vplot/part10
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 10 (of 24)."
  17. # Wrapped by rsalz@fig.bbn.com on Fri Mar 25 11:47:10 1988
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'Envision_device/envilib/envireset.c' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'Envision_device/envilib/envireset.c'\"
  21. else
  22. echo shar: Extracting \"'Envision_device/envilib/envireset.c'\" \(2788 characters\)
  23. sed "s/^X//" >'Envision_device/envilib/envireset.c' <<'END_OF_FILE'
  24. X/*
  25. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  26. X * University. Official permission to use this software is included in
  27. X * the documentation. It authorizes you to use this file for any
  28. X * non-commercial purpose, provided that this copyright notice is not
  29. X * removed and that any modifications made to this file are commented
  30. X * and dated in the style of my example below.
  31. X */
  32. X
  33. X/*
  34. X *
  35. X *  source file:   ./filters/envilib/envireset.c
  36. X *
  37. X * Joe Dellinger (SEP), June 11 1987
  38. X *    Inserted this sample edit history entry.
  39. X *    Please log any further modifications made to this file:
  40. X */
  41. X
  42. X#include <stdio.h>
  43. X#include "../include/extern.h"
  44. X#include "envi.h"
  45. X
  46. envireset ()
  47. X{
  48. extern FILE    *pltout;
  49. extern int      dev_xmax, dev_ymax, dev_xmin, dev_ymin;
  50. X
  51. X/*
  52. X * physical device size
  53. X */
  54. X    dev_xmax = 639;
  55. X    dev_xmin = 0;
  56. X    dev_ymin = 0;
  57. X    pixels_per_inch = 67.;
  58. X    aspect_ratio = 1.;
  59. X    num_col = 8;
  60. X
  61. X    /*
  62. X     * Reset the terminal. On the Envision, it is a pain To do this without
  63. X     * logging the person out! (Escape C) 
  64. X     */
  65. X    putc (ESC, pltout);
  66. X    fprintf (pltout, "OR1");
  67. X    /* Select decimal mode. Slower, but I'm lazy */
  68. X    /*
  69. X     * Almost all actual drawing is done in tek mode, and that is in binary,
  70. X     * and optimized. So don't get too upset about this inefficiency. 
  71. X     */
  72. X    putc (ESC, pltout);
  73. X    fprintf (pltout, "G0");    /* Turn off Graphics Cursor */
  74. X    putc (ESC, pltout);
  75. X    fprintf (pltout, "T0");    /* Turn off dotted lines */
  76. X    putc (ESC, pltout);
  77. X    fprintf (pltout, "L0");    /* Select Drawing Logic mode 0 */
  78. X    putc (ESC, pltout);
  79. X    fprintf (pltout, "OW%d,%d,%d,%d,", dev_xmin * 4, dev_ymin * 4,
  80. X         (dev_xmax + 1) * 4, (dev_ymax + 1) * 4);
  81. X    /*
  82. X     * This really sets the window to xmin =0, ymin=0, xmax= xmax, ymax=ymax
  83. X     * . (Note these were set by termfirst) This is chosen so that 1 pixel
  84. X     * equals 1 unit. For some reason, whenever we are in Tektronix emulation
  85. X     * mode, the window is 1/4'd ! So we have to multiply by 4 to start with!
  86. X     * Strange, huh? The "+1" was added to get around an apparent slight
  87. X     * envision bug. (Lost top row of pixels) 
  88. X     */
  89. X    putc (ESC, pltout);
  90. X    fprintf (pltout, "J7");    /* Enable all Color planes */
  91. X    putc (ESC, pltout);
  92. X    fprintf (pltout, "C7");    /* Set drawing color to white */
  93. X    putc (ESC, pltout);
  94. X    fprintf (pltout, "B0");    /* Set background color to black */
  95. X
  96. X    /* Turn all the guns on all the way */
  97. X    fprintf (pltout, "%cQ0000%cQ1?00%cQ20?0%cQ3??0%cQ400?%cQ5?0?%cQ60??%cQ7???"
  98. X         ,ESC, ESC, ESC, ESC, ESC, ESC, ESC, ESC);
  99. X    fprintf (pltout, "%cRR1", ESC);    /* Turn the graphics plane on */
  100. X    fprintf (pltout, "%cOH0", ESC);    /* Set polygon fill style */
  101. X    envisetpan ();        /* Set Graph and Pan mode, turn off soft keys */
  102. X}
  103. END_OF_FILE
  104. if test 2788 -ne `wc -c <'Envision_device/envilib/envireset.c'`; then
  105.     echo shar: \"'Envision_device/envilib/envireset.c'\" unpacked with wrong size!
  106. fi
  107. # end of 'Envision_device/envilib/envireset.c'
  108. fi
  109. if test -f 'Envision_device/envilib/enviset.c' -a "${1}" != "-c" ; then 
  110.   echo shar: Will not clobber existing file \"'Envision_device/envilib/enviset.c'\"
  111. else
  112. echo shar: Extracting \"'Envision_device/envilib/enviset.c'\" \(2719 characters\)
  113. sed "s/^X//" >'Envision_device/envilib/enviset.c' <<'END_OF_FILE'
  114. X/*
  115. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  116. X * University. Official permission to use this software is included in
  117. X * the documentation. It authorizes you to use this file for any
  118. X * non-commercial purpose, provided that this copyright notice is not
  119. X * removed and that any modifications made to this file are commented
  120. X * and dated in the style of my example below.
  121. X */
  122. X
  123. X/*
  124. X *
  125. X *  source file:   ./filters/envilib/enviset.c
  126. X *
  127. X * Joe Dellinger (SEP), June 11 1987
  128. X *    Inserted this sample edit history entry.
  129. X *    Please log any further modifications made to this file:
  130. X */
  131. X
  132. X#include    <stdio.h>
  133. X#include    "../include/err.h"
  134. X#include    "../include/extern.h"
  135. X#include    "envi.h"
  136. X
  137. X/*
  138. X *  Please note that this routine is NEVER CALLED by screenpen or any of
  139. X * the device independent routines! They don't even know what a mode is.
  140. X * This routine is only called by device dependent routines in this library.
  141. X * Making one routine responsible for keeping track of the terminal's mode
  142. X * saves a lot of trouble. The envision is a simple case, with only 2 modes
  143. X * it can be in.
  144. X */
  145. X
  146. envisetmode (mode)    /* Get the terminal into the required mode */
  147. X    int             mode;
  148. X{
  149. static int      current_mode = REG;
  150. X    switch (mode)
  151. X    {
  152. X    case MOV:
  153. X    if (current_mode == MOV)
  154. X        return;
  155. X    else
  156. X    if (current_mode == TEK)
  157. X        putc (US, pltout);
  158. X    putc (FS, pltout);
  159. X    current_mode = MOV;
  160. X    lost = 1;
  161. X    return;
  162. X
  163. X    case TEK:
  164. X    if (current_mode == TEK)
  165. X        return;
  166. X    else
  167. X    if (current_mode == MOV)
  168. X        putc (US, pltout);
  169. X    putc (GS, pltout);
  170. X    current_mode = TEK;
  171. X    lost = 1;
  172. X    break;
  173. X
  174. X    case REG:
  175. X    if (current_mode == REG)
  176. X        return;
  177. X    /*
  178. X     * Envision Documentation says you also need an ESC at this point,
  179. X     * but tek's don't use it, and it seems to work. 
  180. X     */
  181. X    putc (US, pltout);
  182. X    current_mode = REG;
  183. X    lost = 1;        /* vector is warned */
  184. X    break;
  185. X
  186. X    default:
  187. X    ERR (FATAL, name, "setmode: I've never heard of that mode before!");
  188. X    break;
  189. X    }
  190. X}
  191. X
  192. envipanon ()
  193. X{
  194. X    if (version > 215)
  195. X    fprintf (pltout, "%cRP1", ESC);
  196. X}
  197. X
  198. envipanoff ()
  199. X{
  200. X    if (version > 215)
  201. X    fprintf (pltout, "%cRP0", ESC);
  202. X}
  203. X
  204. envisetpan ()
  205. X{
  206. X    envisoftkeyoff ();
  207. X    fprintf (pltout, "%cRG1", ESC);
  208. X    if (version > 215)
  209. X    fprintf (pltout, "%cRP1", ESC);
  210. X}
  211. X
  212. enviresetpan ()
  213. X{
  214. X    envisoftkeyon ();
  215. X    fprintf (pltout, "%cRG0", ESC);
  216. X    if (version > 215)
  217. X    fprintf (pltout, "%cRP0", ESC);
  218. X}
  219. X
  220. enviresetcolors ()
  221. X{
  222. X    fprintf (pltout, "%cQ ", ESC);
  223. X}
  224. X
  225. envinograph ()
  226. X{
  227. X    fprintf (pltout, "%cRR0", ESC);
  228. X}
  229. X
  230. envicursoron ()
  231. X{
  232. X    fprintf (pltout, "%cG1", ESC);
  233. X}
  234. X
  235. envicursoroff ()
  236. X{
  237. X    fprintf (pltout, "%cG0", ESC);
  238. X}
  239. X
  240. envisoftkeyon ()
  241. X{
  242. X    fprintf (pltout, "%c>", ESC);
  243. X}
  244. X
  245. envisoftkeyoff ()
  246. X{
  247. X    fprintf (pltout, "%c=", ESC);
  248. X}
  249. END_OF_FILE
  250. if test 2719 -ne `wc -c <'Envision_device/envilib/enviset.c'`; then
  251.     echo shar: \"'Envision_device/envilib/enviset.c'\" unpacked with wrong size!
  252. fi
  253. # end of 'Envision_device/envilib/enviset.c'
  254. fi
  255. if test -f 'Imagen_device/imaglib/imagerase.c' -a "${1}" != "-c" ; then 
  256.   echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagerase.c'\"
  257. else
  258. echo shar: Extracting \"'Imagen_device/imaglib/imagerase.c'\" \(2646 characters\)
  259. sed "s/^X//" >'Imagen_device/imaglib/imagerase.c' <<'END_OF_FILE'
  260. X/*
  261. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  262. X * University. Official permission to use this software is included in
  263. X * the documentation. It authorizes you to use this file for any
  264. X * non-commercial purpose, provided that this copyright notice is not
  265. X * removed and that any modifications made to this file are commented
  266. X * and dated in the style of my example below.
  267. X */
  268. X
  269. X/*
  270. X *
  271. X *  source file:   ./filters/imaglib/imagerase.c
  272. X *
  273. X * Joe Dellinger (SEP), June 11 1987
  274. X *    Inserted this sample edit history entry.
  275. X *    Please log any further modifications made to this file:
  276. X */
  277. X
  278. X/*
  279. X * Erase the graphics area (ie issue an ENDPAGE after cleanup)
  280. X */
  281. X#include <stdio.h>
  282. X#include "imagen.h"
  283. X#include "../include/enum.h"
  284. X#include "../include/erasecom.h"
  285. X#include "../include/extern.h"
  286. X
  287. X#define BOX_HEIGHT 60
  288. X#define BOX_Y_POS  75
  289. X#define CHAR_WIDTH  30
  290. X#define INCHES_FROM_LEFT  .7
  291. X
  292. imagerase (command)
  293. X    int             command;
  294. X{
  295. register int    i, ii;
  296. static int      page_count = 1;
  297. char            full_label[100];
  298. int             box_length, box_start;
  299. X
  300. X    switch (command)
  301. X    {
  302. X    case ERASE_MIDDLE:
  303. X    case ERASE_END:
  304. X    endpath (DRAW_PATH, imag_curcolor);
  305. X
  306. X    /*
  307. X     * Put on label, if desired 
  308. X     */
  309. X    if (label[0] != '\0')
  310. X    {
  311. X        if (page_count == 1 && command == ERASE_END)
  312. X        {
  313. X        sprintf (full_label, "%s", label);
  314. X        }
  315. X        else
  316. X        {
  317. X        sprintf (full_label, "%s : Page %d.", label, page_count);
  318. X        }
  319. X        for (i = 0; i < 60 && full_label[i] != '\0'; i++);
  320. X        box_length = (i + 1) * CHAR_WIDTH;
  321. X        box_start = dev_xmax - INCHES_FROM_LEFT * 300 - box_length;
  322. X        dev.plot (box_start, BOX_Y_POS, 0);
  323. X        dev.plot (box_start, BOX_Y_POS + BOX_HEIGHT, 1);
  324. X        dev.plot (box_start + box_length, BOX_Y_POS + BOX_HEIGHT, 1);
  325. X        dev.plot (box_start + box_length, BOX_Y_POS, 1);
  326. X        endpath (FILL_PATH, WHITE);
  327. X        fprintf (pltout, "%c%c", SET_ADV_DIRS, '\002');
  328. X        fprintf (pltout, "%c%c", SET_FAMILY, '\002');
  329. X        fprintf (pltout, "%c%c%c",
  330. X             SET_SP, hib (CHAR_WIDTH), lob (CHAR_WIDTH));
  331. X        fprintf (pltout, "%c", SET_ABS_V);
  332. X        fprintf (pltout, "%c%c", hib (box_start + CHAR_WIDTH / 2),
  333. X             lob (box_start + CHAR_WIDTH / 2));
  334. X        fprintf (pltout, "%c", SET_ABS_H);
  335. X        fprintf (pltout, "%c%c", hib (BOX_Y_POS + CHAR_WIDTH / 2),
  336. X             lob (BOX_Y_POS + CHAR_WIDTH / 2));
  337. X        for (ii = 0; ii < i; ii++)
  338. X        {
  339. X        if (full_label[ii] != ' ')
  340. X        {
  341. X            fprintf (pltout, "%c", full_label[ii]);
  342. X        }
  343. X        else
  344. X        {
  345. X            fprintf (pltout, "%c", SP);
  346. X        }
  347. X        }
  348. X    }
  349. X    if (!stripped)
  350. X    {
  351. X        fprintf (pltout, "%c", ENDPAGE);
  352. X    }
  353. X    page_count++;
  354. X    break;
  355. X    case ERASE_START:
  356. X    default:
  357. X    break;
  358. X    }
  359. X}
  360. END_OF_FILE
  361. if test 2646 -ne `wc -c <'Imagen_device/imaglib/imagerase.c'`; then
  362.     echo shar: \"'Imagen_device/imaglib/imagerase.c'\" unpacked with wrong size!
  363. fi
  364. # end of 'Imagen_device/imaglib/imagerase.c'
  365. fi
  366. if test -f 'Imagen_device/imaglib/imagreset.c' -a "${1}" != "-c" ; then 
  367.   echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagreset.c'\"
  368. else
  369. echo shar: Extracting \"'Imagen_device/imaglib/imagreset.c'\" \(2619 characters\)
  370. sed "s/^X//" >'Imagen_device/imaglib/imagreset.c' <<'END_OF_FILE'
  371. X/*
  372. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  373. X * University. Official permission to use this software is included in
  374. X * the documentation. It authorizes you to use this file for any
  375. X * non-commercial purpose, provided that this copyright notice is not
  376. X * removed and that any modifications made to this file are commented
  377. X * and dated in the style of my example below.
  378. X */
  379. X
  380. X/*
  381. X *
  382. X *  source file:   ./filters/imaglib/imagreset.c
  383. X *
  384. X * Joe Dellinger (SEP), June 11 1987
  385. X *    Inserted this sample edit history entry.
  386. X *    Please log any further modifications made to this file:
  387. X * Stewart A. Levin (SEP), July 2, 1987
  388. X *    Support command line ncopies= option
  389. X */
  390. X
  391. X#include <stdio.h>
  392. X#include "../include/enum.h"
  393. X#include "../include/extern.h"
  394. X#include "imagen.h"
  395. X
  396. imagreset ()
  397. X{
  398. X    /*
  399. X     * Make sure that the imagen knows this is in impress language! 
  400. X     */
  401. X    if (stripped == NO)
  402. X    {
  403. X    prepend (pltout);    /* puts in ipr's document control strings */
  404. X    fprintf (pltout, "@document(language ImPRESS, ");
  405. X    if (brute_force)
  406. X        fprintf (pltout, "prerasterization on, ");
  407. X    if (holdreason[0] != '\0')
  408. X        fprintf (pltout, "hold \"%s; 'rj' to proceed\", ",
  409. X             holdreason);
  410. X    fprintf (pltout, "copies %d, ", ncopies_document);
  411. X    fprintf (pltout, "jobheader off)");
  412. X    }
  413. X    if (label[0] != '\0')
  414. X    {
  415. X    fprintf (pltout, "%c%c%c%c%s%c", CREATE_FAMILY_TABLE,
  416. X         '\002', '\001', '\000', "COUR12", '\0');
  417. X    }
  418. X    if (tex == YES)
  419. X    {
  420. X    fprintf (pltout, "%c%c%c", SET_PUSH_MASK, '\001', '\377');
  421. X    fprintf (pltout, "%c", PUSH);
  422. X    fprintf (pltout, "%c%c", SET_HV_SYSTEM, '\143');
  423. X    }
  424. X}
  425. X
  426. X
  427. X#include <pwd.h>
  428. static
  429. prepend (newfile)
  430. X    FILE           *newfile;
  431. X{
  432. X    /*
  433. X     * Stolen from ipr to set up document control 
  434. X     */
  435. X
  436. char            SYSIDENT[256];
  437. register char  *sp, *dp;
  438. long            spooltime;
  439. struct passwd  *pw, *getpwuid ();
  440. long            time ();/* Date/time-getting support */
  441. char           *ctime ();
  442. char            now[32];
  443. X
  444. X    /* Add a document header to this file */
  445. X    time (&spooltime);
  446. X    sp = ctime (&spooltime);
  447. X    dp = now;
  448. X    while (*sp && *sp != '\n')
  449. X    *dp++ = *sp++;
  450. X    *dp = '\0';
  451. X    fprintf (newfile, "@document(");
  452. X    pw = getpwuid (getuid ());
  453. X    gethostname (SYSIDENT, sizeof (SYSIDENT));
  454. X    if (pw != 0)
  455. X    {
  456. X    fprintf (newfile, "owner \"%s", pw->pw_name);
  457. X    if (pw->pw_gecos != 0 && pw->pw_gecos[0] != '\0')
  458. X        fprintf (newfile, " (%s)", pw->pw_gecos);
  459. X    fprintf (newfile, "\", site \"%s\"", SYSIDENT);
  460. X    }
  461. X    else
  462. X    fprintf (newfile, "site \"%s\"", SYSIDENT);
  463. X    fprintf (newfile, ", spooldate \"%s\"", now);
  464. X    fprintf (newfile, ")");
  465. X
  466. X}
  467. END_OF_FILE
  468. if test 2619 -ne `wc -c <'Imagen_device/imaglib/imagreset.c'`; then
  469.     echo shar: \"'Imagen_device/imaglib/imagreset.c'\" unpacked with wrong size!
  470. fi
  471. # end of 'Imagen_device/imaglib/imagreset.c'
  472. fi
  473. if test -f 'Masscomp_device/gpslib/gpsopen.c' -a "${1}" != "-c" ; then 
  474.   echo shar: Will not clobber existing file \"'Masscomp_device/gpslib/gpsopen.c'\"
  475. else
  476. echo shar: Extracting \"'Masscomp_device/gpslib/gpsopen.c'\" \(2798 characters\)
  477. sed "s/^X//" >'Masscomp_device/gpslib/gpsopen.c' <<'END_OF_FILE'
  478. X/*
  479. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  480. X * University. Official permission to use this software is included in
  481. X * the documentation. It authorizes you to use this file for any
  482. X * non-commercial purpose, provided that this copyright notice is not
  483. X * removed and that any modifications made to this file are commented
  484. X * and dated in the style of my example below.
  485. X */
  486. X
  487. X/*
  488. X *
  489. X *  source file:   ./filters/gpslib/gpsopen.c
  490. X *
  491. X * Stew Levin (SEP), July 3 1987
  492. X *    Copied from raslib and modified for gps (Masscomp color, I hope)
  493. X */
  494. X
  495. X#include <stdio.h>
  496. X#include "../include/enum.h"
  497. X#include "../include/extern.h"
  498. X#include "../include/err.h"
  499. X#include "../include/vplot.h"
  500. X#include <strings.h>
  501. X#ifdef SEP
  502. X#include <ctype.h>
  503. X#endif
  504. X#define DEFAULT_OUT    isatty(fileno(pltout))
  505. X#include "gpspen.h"
  506. X
  507. char           *image;
  508. extern float    aspect_ratio;
  509. extern float    pixels_per_inch;
  510. int             color_mult;
  511. X
  512. extern int      num_col;
  513. X
  514. gpsopen ()
  515. X{
  516. extern char   **xargv;
  517. extern FILE    *pltout;
  518. X#ifdef SEP
  519. extern int      headfd;
  520. char            headname[30], fname[80];
  521. char            path[50];
  522. char           *front, *tail, *ptr;
  523. X#endif
  524. char            newpath[60];
  525. char            plpipe[60];
  526. X
  527. X/*
  528. X * physical device parameters
  529. X */
  530. X
  531. X/*
  532. X * device capabilities
  533. X */
  534. X    need_end_erase = YES;
  535. X    buffer_output = YES;
  536. X    smart_clip = NO;
  537. X
  538. X    color_mult = 1;
  539. X    getpar ("colormult", "d", &color_mult);
  540. X    num_col = NCOLOR / color_mult;
  541. X
  542. X    dev_xmin = -6554;        /* from default window 13 */
  543. X    dev_ymin = -6554;
  544. X    dev_xmax = 6553;
  545. X    dev_ymax = 6553;
  546. X    aspect_ratio = 1.;
  547. X    pixels_per_inch = RPERIN;    /* good enough */
  548. X    getpar ("aspect", "f", &aspect_ratio);
  549. X    getpar ("ppi", "d", &pixels_per_inch);
  550. X    allowecho = YES;
  551. X
  552. X    if (DEFAULT_OUT)
  553. X    {
  554. X#ifdef SEP
  555. X    datapath (path);
  556. X/* Code stolen from output.c to get a reasonable raster file name. */
  557. X    if (0 < findnm (headfd, headname, sizeof (headname)))
  558. X    {
  559. X        /* modify slightly */
  560. X        strcpy (fname, "");
  561. X        front = rindex (headname, '/');
  562. X        if (front == ((char *) NULL))
  563. X        front = headname;
  564. X        else
  565. X        front++;
  566. X        if ((*front) == 'H')
  567. X        strcat (fname, ++front);
  568. X        else
  569. X        {
  570. X        tail = rindex (front, '.');
  571. X        if (tail == ((char *) NULL))
  572. X            strcat (fname, front);
  573. X        else
  574. X        {
  575. X            for (ptr = tail + 1; *ptr; ptr++)
  576. X            if (!isupper (*ptr))
  577. X                break;
  578. X            if (!(*ptr))/* drop suffix if all caps */
  579. X            *tail = '\0';
  580. X            (void) strcat (fname, front);
  581. X        }
  582. X        }
  583. X        (void) strcat (fname, ".p");
  584. X    }
  585. X    else
  586. X    {
  587. X        strcpy (fname, "gps.p");
  588. X    }
  589. X
  590. X    sprintf (newpath, "%s%s", path, fname);
  591. X    Puthead ("\tin=%s\n", newpath);
  592. X#else
  593. X    sprintf (newpath, "%s", "gps.p");
  594. X#endif
  595. X    plpipe[0] = '\0';
  596. X    }
  597. X    else
  598. X    {
  599. X    newpath[0] = '\0';
  600. X    strcpy (plpipe, "cat");
  601. X    }
  602. X    new_plot (newpath, plpipe);
  603. X}
  604. END_OF_FILE
  605. if test 2798 -ne `wc -c <'Masscomp_device/gpslib/gpsopen.c'`; then
  606.     echo shar: \"'Masscomp_device/gpslib/gpsopen.c'\" unpacked with wrong size!
  607. fi
  608. # end of 'Masscomp_device/gpslib/gpsopen.c'
  609. fi
  610. if test -f 'Printronix_device/lprlib/lprerase.c' -a "${1}" != "-c" ; then 
  611.   echo shar: Will not clobber existing file \"'Printronix_device/lprlib/lprerase.c'\"
  612. else
  613. echo shar: Extracting \"'Printronix_device/lprlib/lprerase.c'\" \(2952 characters\)
  614. sed "s/^X//" >'Printronix_device/lprlib/lprerase.c' <<'END_OF_FILE'
  615. X/*
  616. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  617. X * University. Official permission to use this software is included in
  618. X * the documentation. It authorizes you to use this file for any
  619. X * non-commercial purpose, provided that this copyright notice is not
  620. X * removed and that any modifications made to this file are commented
  621. X * and dated in the style of my example below.
  622. X */
  623. X
  624. X/*
  625. X *
  626. X *  source file:   ./filters/lprlib/lprerase.c
  627. X *
  628. X * Joe Dellinger (SEP), June 11 1987
  629. X *    Inserted this sample edit history entry.
  630. X *    Please log any further modifications made to this file:
  631. X */
  632. X
  633. X/*
  634. X * Erase the graphics area (ie output raster image and clear memory)
  635. X */
  636. X#include <stdio.h>
  637. X#include "lprpen.h"
  638. X#include "../include/enum.h"
  639. X#include "../include/erasecom.h"
  640. X#include "../include/extern.h"
  641. X
  642. lprerase (command)
  643. X    int             command;
  644. X{
  645. X    switch (command)
  646. X    {
  647. X    case ERASE_MIDDLE:
  648. X    case ERASE_END:
  649. X    cat ();
  650. X    zap (mem, xlimit);
  651. X    case ERASE_START:
  652. X    default:
  653. X    break;
  654. X    }
  655. X}
  656. X
  657. X
  658. X#define M    0100    /* mask bit for printronix */
  659. char            rev[] =    /* bit reverse table for Printronix format */
  660. X{
  661. X (000 | M), (040 | M), (020 | M), (060 | M), (010 | M), (050 | M), (030 | M), (070 | M),
  662. X (004 | M), (044 | M), (024 | M), (064 | M), (014 | M), (054 | M), (034 | M), (074 | M),
  663. X (002 | M), (042 | M), (022 | M), (062 | M), (012 | M), (052 | M), (032 | M), (072 | M),
  664. X (006 | M), (046 | M), (026 | M), (066 | M), (016 | M), (056 | M), (036 | M), (076 | M),
  665. X (001 | M), (041 | M), (021 | M), (061 | M), (011 | M), (051 | M), (031 | M), (071 | M),
  666. X (005 | M), (045 | M), (025 | M), (065 | M), (015 | M), (055 | M), (035 | M), (075 | M),
  667. X (003 | M), (043 | M), (023 | M), (063 | M), (013 | M), (053 | M), (033 | M), (073 | M),
  668. X (007 | M), (047 | M), (027 | M), (067 | M), (017 | M), (057 | M), (037 | M), (077 | M)
  669. X};
  670. X#define PUT(x)    putc(prev[x], pltout)
  671. X
  672. cat ()
  673. X{
  674. register short *p1, *p2;
  675. register char  *prev;
  676. register int    len;
  677. int             x, xmax, count, addr;
  678. X
  679. X    prev = rev;
  680. X
  681. X    for (p2 = &mem[xlimit * NYW - 1]; p2 >= mem && *p2 == 0; p2--);
  682. X    xmax = (p2 - mem) / NYW + 1;
  683. X    for (x = 0; x < xmax; x++)
  684. X    {
  685. X    p1 = mem + x * NYW;
  686. X    p2 = p1 + (NYW - 1);
  687. X    while (p2 >= p1 && *p2 == 0)
  688. X        p2--;
  689. X    if (*p2 == 0)
  690. X        len = 0;
  691. X    else
  692. X        len = (16 * (p2 - p1 + 1) + 5) / 6;
  693. X    if (len > 132)
  694. X        len = 132;
  695. X    putc (05, pltout);
  696. X    while (len > 0)
  697. X    {
  698. X        PUT ((p1[0] >> 10) & 077);
  699. X        PUT ((p1[0] >> 4) & 077);
  700. X        PUT ((p1[0] << 2) & 074 | (p1[1] >> 14) & 03);
  701. X        PUT ((p1[1] >> 8) & 077);
  702. X
  703. X        if (len == 4)
  704. X        break;
  705. X        PUT ((p1[1] >> 2) & 077);
  706. X        PUT ((p1[1] << 4) & 060 | (p1[2] >> 12) & 017);
  707. X        PUT ((p1[2] >> 6) & 077);
  708. X        PUT ((p1[2]) & 077);
  709. X        p1 += 3;
  710. X        len -= 8;
  711. X    }
  712. X    putc ('\n', pltout);
  713. X    }
  714. X    putc ('\f', pltout);
  715. X    return;
  716. X}
  717. X
  718. zap (addr, nx)        /* zero memory */
  719. X    register int   *addr, nx;
  720. X{
  721. register int    count;
  722. X    count = nx * NYW / 2;
  723. X    while (count--)
  724. X    *addr++ = 0;
  725. X}
  726. END_OF_FILE
  727. if test 2952 -ne `wc -c <'Printronix_device/lprlib/lprerase.c'`; then
  728.     echo shar: \"'Printronix_device/lprlib/lprerase.c'\" unpacked with wrong size!
  729. fi
  730. # end of 'Printronix_device/lprlib/lprerase.c'
  731. fi
  732. if test -f 'RasterTek_device/rteklib/rtekopen.c' -a "${1}" != "-c" ; then 
  733.   echo shar: Will not clobber existing file \"'RasterTek_device/rteklib/rtekopen.c'\"
  734. else
  735. echo shar: Extracting \"'RasterTek_device/rteklib/rtekopen.c'\" \(2973 characters\)
  736. sed "s/^X//" >'RasterTek_device/rteklib/rtekopen.c' <<'END_OF_FILE'
  737. X/*
  738. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  739. X * University. Official permission to use this software is included in
  740. X * the documentation. It authorizes you to use this file for any
  741. X * non-commercial purpose, provided that this copyright notice is not
  742. X * removed and that any modifications made to this file are commented
  743. X * and dated in the style of my example below.
  744. X */
  745. X
  746. X/*
  747. X *
  748. X *  source file:   ./filters/rteklib/rtekopen.c
  749. X *
  750. X * Joe Dellinger (SEP), June 11 1987
  751. X *    Inserted this sample edit history entry.
  752. X *    Please log any further modifications made to this file:
  753. X * Joe Dellinger Feb 12 1988
  754. X *    Initial color should be white not blue!
  755. X * Joe Dellinger Mar 3 1988
  756. X *    Get device file name in /dev out of include file.
  757. X */
  758. X
  759. X#include "rtekpen.h"
  760. X#ifdef SEP
  761. X#define    GETPAR fetch
  762. X#else
  763. X#define    GETPAR getpar
  764. X#endif
  765. X
  766. X#include "../include/attrcom.h"
  767. X#include "../include/params.h"
  768. X
  769. FILE           *rtekfd = NULL;
  770. char            devname[] = RTEKDEV;
  771. extern int      allowecho;
  772. X
  773. rtekopen ()
  774. X{
  775. int             bufsize;
  776. char            block[10], *buffer;
  777. X
  778. X    dev_xmax = 635;
  779. X    dev_ymax = 507;
  780. X    dev_xmin = -635;
  781. X    dev_ymin = -507;
  782. X    pixels_per_inch = 100.;
  783. X    aspect_ratio = 1.;
  784. X
  785. X    /* device capabilities */
  786. X    need_end_erase = YES;
  787. X    buffer_output = NO;
  788. X    smart_clip = YES;
  789. X    num_col = 256;
  790. X
  791. X    /* make pen leave our echoing alone */
  792. X    allowecho = YES;
  793. X
  794. X    /* fast device, so default a nice font */
  795. X    txfont = DEFAULT_HARDCOPY_FONT;
  796. X    txprec = DEFAULT_HARDCOPY_PREC;
  797. X
  798. X    /* open dma channel to Raster Tech */
  799. X    rtekfd = fopen (devname, "w");
  800. X    if (rtekfd == NULL)
  801. X    ERR (FATAL, name, "can't open Raster Tech\n");
  802. X
  803. X    /* setup buffer */
  804. X    GETPAR ("block", "s", block);
  805. X    switch (block[0])
  806. X    {
  807. X    case 'l':
  808. X    case 'b':
  809. X    case 'h':
  810. X    bufsize = 100000;
  811. X    break;
  812. X    case 's':
  813. X    bufsize = 16;
  814. X    break;
  815. X    case 'm':
  816. X    default:
  817. X    bufsize = 512;
  818. X    break;
  819. X    }
  820. X    bufsize &= ~1;        /* make sure it is even */
  821. X    buffer = (char *) malloc (bufsize);
  822. X    setbuffer (rtekfd, buffer, bufsize);
  823. X
  824. X    /* set graphics mode, undo any Movie remnants */
  825. X
  826. X    CHKLEN (26);
  827. X    byte (GRAPHICS);        /* cmdlen = 26 */
  828. X    byte (NOP);
  829. X    byte (RDMODE);
  830. X    byte (1);
  831. X    byte (MODDIS);
  832. X    byte (2);
  833. X    byte (NOP);
  834. X    byte (ZOOM);
  835. X    byte (1);
  836. X    byte (SCRORG);
  837. X    word (0);
  838. X    word (0);
  839. X    byte (WINDOW);
  840. X    word (dev_xmin);
  841. X    word (dev_ymin);
  842. X    word (dev_xmax);
  843. X    word (dev_ymax);
  844. X    byte (WMSK16);
  845. X    word (65535);
  846. X
  847. X    /* initialize color */
  848. X    rtekattributes (SET_COLOR_TABLE, 0, 0, 0, 0);
  849. X    rtekattributes (SET_COLOR_TABLE, 1, 0, 0, 255);
  850. X    rtekattributes (SET_COLOR_TABLE, 2, 255, 0, 0);
  851. X    rtekattributes (SET_COLOR_TABLE, 3, 255, 0, 255);
  852. X    rtekattributes (SET_COLOR_TABLE, 4, 0, 255, 0);
  853. X    rtekattributes (SET_COLOR_TABLE, 5, 0, 255, 255);
  854. X    rtekattributes (SET_COLOR_TABLE, 6, 255, 255, 0);
  855. X    rtekattributes (SET_COLOR_TABLE, 7, 255, 255, 255);
  856. X    rtekattributes (SET_COLOR, 7, 0, 0, 0);
  857. X}
  858. END_OF_FILE
  859. if test 2973 -ne `wc -c <'RasterTek_device/rteklib/rtekopen.c'`; then
  860.     echo shar: \"'RasterTek_device/rteklib/rtekopen.c'\" unpacked with wrong size!
  861. fi
  862. # end of 'RasterTek_device/rteklib/rtekopen.c'
  863. fi
  864. if test -f 'Virtual_device/raslib/rasvector.c' -a "${1}" != "-c" ; then 
  865.   echo shar: Will not clobber existing file \"'Virtual_device/raslib/rasvector.c'\"
  866. else
  867. echo shar: Extracting \"'Virtual_device/raslib/rasvector.c'\" \(2575 characters\)
  868. sed "s/^X//" >'Virtual_device/raslib/rasvector.c' <<'END_OF_FILE'
  869. X/*
  870. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  871. X * University. Official permission to use this software is included in
  872. X * the documentation. It authorizes you to use this file for any
  873. X * non-commercial purpose, provided that this copyright notice is not
  874. X * removed and that any modifications made to this file are commented
  875. X * and dated in the style of my example below.
  876. X */
  877. X
  878. X/*
  879. X *
  880. X *  source file:   ./filters/raslib/rasvector.c
  881. X *
  882. X * Joe Dellinger (SEP), June 11 1987
  883. X *    Inserted this sample edit history entry.
  884. X *    Please log any further modifications made to this file:
  885. X */
  886. X
  887. X#include <stdio.h>
  888. X#include <math.h>
  889. X#include "../include/extern.h"
  890. X#include "raspen.h"
  891. X
  892. X/*
  893. X * This code originally written by Jeff Thorson ("apenh"),
  894. X * stolen by Joe Dellinger and somewhat modified for vplot standardization.
  895. X */
  896. X
  897. X#ifdef OR
  898. X#define WRITEIT(A,B) Image (A, B) |= rascolor
  899. X#define RASVECTOR rasvector2
  900. X#else
  901. X#define WRITEIT(A,B) Image (A, B) = rascolor
  902. X#define RASVECTOR rasvector
  903. X#endif
  904. X
  905. RASVECTOR (x1, y1, x2, y2, nfat, dashon)
  906. X    int             x1, y1, x2, y2;
  907. X    int             nfat, dashon;
  908. X{
  909. int             test, tmp, x, y;
  910. double          slope, fx, fx3, fy, fy3;
  911. X
  912. X/*
  913. X * Vector rasterizes the line defined by the endpoints (x1,y1) and (x2,y2).
  914. X * If 'nfat' is nonzero then draw parallel lines to fatten the line, by
  915. X * recursive calls to vector.
  916. X */
  917. X
  918. X    if (nfat < 0)
  919. X    return;
  920. X
  921. X    if (dashon)
  922. X    {
  923. X    dashvec (x1, y1, x2, y2, nfat, dashon);
  924. X    return;
  925. X    }
  926. X
  927. X    if (nfat)
  928. X    {
  929. X    if (clip (&x1, &y1, &x2, &y2))
  930. X        return;
  931. X
  932. X    fatvec (x1, y1, x2, y2, nfat, dashon);
  933. X    return;
  934. X    }
  935. X
  936. X    if (clip (&x1, &y1, &x2, &y2))
  937. X    return;
  938. X
  939. X/* Beware checks out of bounds, since the coordinate system may have rotated */
  940. X
  941. X    test = (abs (x2 - x1) >= abs (y2 - y1));
  942. X
  943. X    if (test)
  944. X    {
  945. X    if (x1 == x2)
  946. X    {
  947. X        /* Just a point */
  948. X        WRITEIT (x1, y1);
  949. X        return;
  950. X    }
  951. X    else
  952. X    if (x1 > x2)
  953. X    {
  954. X        tmp = x1;
  955. X        x1 = x2;
  956. X        x2 = tmp;
  957. X        tmp = y1;
  958. X        y1 = y2;
  959. X        y2 = tmp;
  960. X    }
  961. X    slope = (double) (y2 - y1) / (double) (x2 - x1);
  962. X    fy3 = y1;
  963. X
  964. X    for (x = x1, fy = fy3; x < x2; x++, fy += slope)
  965. X    {
  966. X        y = fy + .5;    /* OK rounding, since always positive */
  967. X        WRITEIT (x, y);
  968. X    }
  969. X    WRITEIT (x2, y2);
  970. X    return;
  971. X    }
  972. X    else
  973. X    {
  974. X    /* y1 can't equal y2 here */
  975. X    if (y1 > y2)
  976. X    {
  977. X        tmp = x1;
  978. X        x1 = x2;
  979. X        x2 = tmp;
  980. X        tmp = y1;
  981. X        y1 = y2;
  982. X        y2 = tmp;
  983. X    }
  984. X    slope = (double) (x2 - x1) / (double) (y2 - y1);
  985. X    fx3 = x1;
  986. X
  987. X    for (y = y1, fx = fx3; y < y2; y++, fx += slope)
  988. X    {
  989. X        x = fx + .5;
  990. X        WRITEIT (x, y);
  991. X    }
  992. X    WRITEIT (x2, y2);
  993. X    return;
  994. X    }
  995. X}
  996. END_OF_FILE
  997. if test 2575 -ne `wc -c <'Virtual_device/raslib/rasvector.c'`; then
  998.     echo shar: \"'Virtual_device/raslib/rasvector.c'\" unpacked with wrong size!
  999. fi
  1000. # end of 'Virtual_device/raslib/rasvector.c'
  1001. fi
  1002. if test -f 'Vplot_Kernel/Hershey/hertogrid.c' -a "${1}" != "-c" ; then 
  1003.   echo shar: Will not clobber existing file \"'Vplot_Kernel/Hershey/hertogrid.c'\"
  1004. else
  1005. echo shar: Extracting \"'Vplot_Kernel/Hershey/hertogrid.c'\" \(2586 characters\)
  1006. sed "s/^X//" >'Vplot_Kernel/Hershey/hertogrid.c' <<'END_OF_FILE'
  1007. X/*
  1008. X *
  1009. X *  source file:   ./Hershey/hertogrid.c
  1010. X *
  1011. X * Joe Dellinger (SEP), June 11 1987
  1012. X *    Inserted this sample edit history entry.
  1013. X *    Please log any further modifications made to this file:
  1014. X */
  1015. X
  1016. X/*
  1017. X * This program allows you to scan the glyphs in the Hershey character sets,
  1018. X * and tells you the Hershey glyph number of each.
  1019. X * This allows you to construct appropriate .hmp files for a new font you are
  1020. X * putting together.
  1021. X * .hmp files have already been created for all the occidental files, but nothing
  1022. X * has been done with the oriental ones. Anyone out there in Japan want to do this?
  1023. X *
  1024. X * This program is used by:
  1025. X * cat hershey.oc? | hertogrid | plas | pen_filter
  1026. X *
  1027. X * As a start to anyone out there that wants to do Japanese,
  1028. X * Hirigana runs from 6000 to 6079, and
  1029. X * Katakana runs from 6100 to 6179.
  1030. X *
  1031. X * (What do you get with glyphs 1056 and then 5055?)
  1032. X *
  1033. X * Joe Dellinger,
  1034. X * Stanford University Dept of Geophysics
  1035. X */
  1036. X#include <stdio.h>
  1037. X/*
  1038. X * scanint: a function to scan an integer, using n characters of
  1039. X *          the input file, ignoring newlines. (scanf won't work
  1040. X *          because it also ignores blanks)
  1041. X */
  1042. int
  1043. scanint (n)
  1044. X    int             n;
  1045. X{
  1046. char            buf[20];
  1047. int             i, c;
  1048. X
  1049. X    for (i = 0; i < n; i++)
  1050. X    {
  1051. X    while ((c = getchar ()) == '\n');    /* discard spare newlines */
  1052. X    if (c == EOF)
  1053. X        return (-1);
  1054. X    buf[i] = c;
  1055. X    }
  1056. X
  1057. X    buf[i] = 0;
  1058. X    return (atoi (buf));
  1059. X}
  1060. X
  1061. int             rows = 10, cols = 10, scale = 11, maxpage = 10;
  1062. main ()
  1063. X{
  1064. int             ich, nch, i, x, y, k, kn, xx, yy;
  1065. int             line[2][1000];
  1066. int             move, ipnt;
  1067. X
  1068. X    printf ("S r\nJ 2 5\n");
  1069. X    for (k = 0, kn = rows * cols * maxpage; k < kn; k++)
  1070. X    {
  1071. X    if ((ich = scanint (5)) < 1)
  1072. X    {
  1073. X        exit (0);
  1074. X    }
  1075. X    nch = scanint (3);
  1076. X
  1077. X    for (i = 0; i < nch; i++)
  1078. X    {
  1079. X        if ((i == 32) || (i == 68) || (i == 104) || (i == 140))
  1080. X        getchar ();    /* skip newlines */
  1081. X        line[0][i] = getchar ();
  1082. X        line[1][i] = getchar ();
  1083. X    }
  1084. X    getchar ();
  1085. X
  1086. X/*             .. left and right widths */
  1087. X
  1088. X    if (k % (rows * cols) == 0 && k > 0)
  1089. X        printf ("e\n");
  1090. X    xx = (k % rows) * 40 + 20;
  1091. X    yy = (k % (rows * cols)) / rows * 47 + 25;
  1092. X
  1093. X    printf ("m %d %d\n", scale * xx, scale * (yy - 15));
  1094. X    printf ("T 2 0\n");
  1095. X    printf ("%d\n", ich);
  1096. X
  1097. X    move = 1;
  1098. X    for (ipnt = 1; ipnt < nch; ipnt++)
  1099. X    {
  1100. X        if (line[0][ipnt] == ' ')
  1101. X        {
  1102. X        move = 1;
  1103. X        }
  1104. X        else
  1105. X        {
  1106. X        x = (int) line[0][ipnt] - (int) 'R' + xx;
  1107. X        y = yy - (int) line[1][ipnt] + (int) 'R';
  1108. X        if (move)
  1109. X            printf ("m ");
  1110. X        else
  1111. X            printf ("d ");
  1112. X        move = 0;
  1113. X        printf ("%d %d\n", scale * x, scale * y);
  1114. X        }
  1115. X    }
  1116. X    }
  1117. X}
  1118. END_OF_FILE
  1119. if test 2586 -ne `wc -c <'Vplot_Kernel/Hershey/hertogrid.c'`; then
  1120.     echo shar: \"'Vplot_Kernel/Hershey/hertogrid.c'\" unpacked with wrong size!
  1121. fi
  1122. # end of 'Vplot_Kernel/Hershey/hertogrid.c'
  1123. fi
  1124. if test -f 'Vplot_Kernel/README' -a "${1}" != "-c" ; then 
  1125.   echo shar: Will not clobber existing file \"'Vplot_Kernel/README'\"
  1126. else
  1127. echo shar: Extracting \"'Vplot_Kernel/README'\" \(2565 characters\)
  1128. sed "s/^X//" >'Vplot_Kernel/README' <<'END_OF_FILE'
  1129. Read all the other README files which are in most directories
  1130. before attempting "make install".
  1131. X
  1132. You may also want to look at all the stuff in the directory ./Documentation.
  1133. In particular, you should read the copyright notice in vplot.mn.
  1134. X
  1135. Here are the files you should have:
  1136. X
  1137. Documentation - just what it says
  1138. X
  1139. Hershey - stuff for converting the Hershey fonts as distributed to something
  1140. X      Vplot can use.
  1141. X
  1142. Hershey_Fonts - the actual Hershey Fonts themselves. These are NOT themselves
  1143. X        part of Vplot, but this directory may be included as a
  1144. X        convenience. If you don't have this directory, you'll have
  1145. X        to track down your own copy of the Hershey Fonts. Vplot is
  1146. X        useable without them, but you'll only have 1 boring font.
  1147. X
  1148. Makefile - just spawns off all the other makefiles in the subdirectories.
  1149. X
  1150. README - this file
  1151. X
  1152. filters - the source for the vplot filters.
  1153. X
  1154. lvplot - the source for the lvplot library.
  1155. X
  1156. util - the source for some vplot utility programs.
  1157. X
  1158. X- Joe Dellinger
  1159. X
  1160. X##########################################################################
  1161. X
  1162. Notes for the "long" version of the distribution:
  1163. X
  1164. I have tried to make the "makefile" in this directory such that
  1165. X"make install" will do EVERYTHING.
  1166. X
  1167. Remember, you WILL have to get ALL the site-dependent parameters,
  1168. include files, makefile defines, etc, etc, all set FIRST.
  1169. X(For the most part, this just means doing the stuff in the README
  1170. file in "filters". The make install should probably handle everything
  1171. else.)
  1172. X
  1173. After you THINK you've got that all right, if you're brave, you can
  1174. try running this make. It worked on our system, at least...
  1175. X
  1176. X##########################################################################
  1177. X
  1178. Notes for the "short" version (if you don't have the Hershey_Fonts directory,
  1179. you've got the short version):
  1180. X
  1181. You will be missing some "demo" files in ./filters/Tests, no big deal.
  1182. X
  1183. You will either have to get a copy of the Hershey fonts OR edit
  1184. X./filters/include/font_definitions.h before any of the pen filters
  1185. will compile.
  1186. X
  1187. The device-dependent code for various filters will be distributed
  1188. separately. Simply get the appropriate device-dependent library,
  1189. stick it in ./filters, re-run MakeMake, do make, and you should
  1190. be in business. Here are the various devices so far (some of them
  1191. may not be distributed for a while if I think there's a chance of
  1192. getting them improved first):
  1193. X
  1194. Masscomp (gps),
  1195. Sun (2: suntools + NeWS),
  1196. XX,
  1197. Virtual (2: Generic Raster + Vplot "Editor"),
  1198. Tek (2: 401X and 410X),
  1199. Envision (Lear Siegler),
  1200. Regis,
  1201. Imagen,
  1202. PostScript,
  1203. RasterTek
  1204. HPGL
  1205. X
  1206. X- Joe Dellinger
  1207. END_OF_FILE
  1208. if test 2565 -ne `wc -c <'Vplot_Kernel/README'`; then
  1209.     echo shar: \"'Vplot_Kernel/README'\" unpacked with wrong size!
  1210. fi
  1211. # end of 'Vplot_Kernel/README'
  1212. fi
  1213. if test -f 'Vplot_Kernel/filters/Tests/TEST_clipping' -a "${1}" != "-c" ; then 
  1214.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/TEST_clipping'\"
  1215. else
  1216. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/TEST_clipping'\" \(2854 characters\)
  1217. sed "s/^X//" >'Vplot_Kernel/filters/Tests/TEST_clipping' <<'END_OF_FILE'
  1218. X#plas: Vplot units used in this file
  1219. e
  1220. S s
  1221. w -32760 -32760 32760 32760
  1222. F 0 0 0
  1223. J 0 0
  1224. s 0
  1225. f 0
  1226. c 7
  1227. m 0 0
  1228. d 8191 0
  1229. d 8191 6144
  1230. d 0 6144
  1231. d 0 0
  1232. z
  1233. Test of polygon clipping.
  1234. z
  1235. X
  1236. z
  1237. First a complicated polygon is drawn in cyan.
  1238. z
  1239. Then various clipping windows are turned on,
  1240. z
  1241. and the polygon is drawn again in yellow, blue, red, and green.
  1242. z
  1243. X
  1244. z
  1245. Each clipping window is outlined in white.
  1246. z
  1247. Each polygon should just cover its white window outline,
  1248. z
  1249. without extending outside.
  1250. z
  1251. X
  1252. d 8191 0
  1253. d 8191 6144
  1254. d 0 6144
  1255. d 0 0
  1256. F 0 0 0
  1257. J 0 0
  1258. s 0
  1259. f 0
  1260. f 1
  1261. m 499 499
  1262. d 0 4999
  1263. f 0
  1264. f 1
  1265. m 999 1399
  1266. d 499 499
  1267. f 0
  1268. f 1
  1269. m 4999 499
  1270. d 999 1399
  1271. f 0
  1272. f 1
  1273. m 3999 499
  1274. d 4999 499
  1275. f 0
  1276. f 1
  1277. m 2499 3999
  1278. d 3999 499
  1279. f 0
  1280. f 1
  1281. m 4500 1500
  1282. d 2499 3999
  1283. f 0
  1284. f 1
  1285. m 2250 2250
  1286. d 4500 1500
  1287. f 0
  1288. f 1
  1289. m 999 999
  1290. d 2250 2250
  1291. f 0
  1292. f 1
  1293. m 4999 0
  1294. d 999 999
  1295. f 0
  1296. f 1
  1297. m 0 4999
  1298. d 4999 0
  1299. f 0
  1300. c 5
  1301. a 10
  1302. X-1 1 1
  1303. X498 498
  1304. X998 1399
  1305. X4999 498
  1306. X3998 498
  1307. X2498 3998
  1308. X4500 1500
  1309. X2250 2250
  1310. X998 998
  1311. X4999 0
  1312. X0 4999
  1313. c 7
  1314. w 499 499 1249 32760
  1315. m 499 499
  1316. d 1249 499
  1317. d 1249 6144
  1318. d 499 6144
  1319. d 499 499
  1320. f 1
  1321. c 6
  1322. m 499 499
  1323. d 0 4999
  1324. f 0
  1325. f 1
  1326. m 999 1399
  1327. d 499 499
  1328. f 0
  1329. f 1
  1330. m 4999 499
  1331. d 999 1399
  1332. f 0
  1333. f 1
  1334. m 3999 499
  1335. d 4999 499
  1336. f 0
  1337. f 1
  1338. m 2499 3999
  1339. d 3999 499
  1340. f 0
  1341. f 1
  1342. m 4500 1500
  1343. d 2499 3999
  1344. f 0
  1345. f 1
  1346. m 2250 2250
  1347. d 4500 1500
  1348. f 0
  1349. f 1
  1350. m 999 999
  1351. d 2250 2250
  1352. f 0
  1353. f 1
  1354. m 4999 0
  1355. d 999 999
  1356. f 0
  1357. f 1
  1358. m 0 4999
  1359. d 4999 0
  1360. f 0
  1361. a 10
  1362. X-1 1 3
  1363. X498 498
  1364. X998 1399
  1365. X4999 498
  1366. X3998 498
  1367. X2498 3998
  1368. X4500 1500
  1369. X2250 2250
  1370. X998 998
  1371. X4999 0
  1372. X0 4999
  1373. w 1999 1999 2499 2499
  1374. c 7
  1375. m 1999 1999
  1376. d 2499 1999
  1377. d 2499 2499
  1378. d 1999 2499
  1379. d 1999 1999
  1380. c 6
  1381. f 1
  1382. c 1
  1383. m 499 499
  1384. d 0 4999
  1385. f 0
  1386. f 1
  1387. m 999 1399
  1388. d 499 499
  1389. f 0
  1390. f 1
  1391. m 4999 499
  1392. d 999 1399
  1393. f 0
  1394. f 1
  1395. m 3999 499
  1396. d 4999 499
  1397. f 0
  1398. f 1
  1399. m 2499 3999
  1400. d 3999 499
  1401. f 0
  1402. f 1
  1403. m 4500 1500
  1404. d 2499 3999
  1405. f 0
  1406. f 1
  1407. m 2250 2250
  1408. d 4500 1500
  1409. f 0
  1410. f 1
  1411. m 999 999
  1412. d 2250 2250
  1413. f 0
  1414. f 1
  1415. m 4999 0
  1416. d 999 999
  1417. f 0
  1418. f 1
  1419. m 0 4999
  1420. d 4999 0
  1421. f 0
  1422. a 10
  1423. X-1 4 1
  1424. X498 498
  1425. X998 1399
  1426. X4999 498
  1427. X3998 498
  1428. X2498 3998
  1429. X4500 1500
  1430. X2250 2250
  1431. X998 998
  1432. X4999 0
  1433. X0 4999
  1434. w 750 999 4999 1249
  1435. c 7
  1436. m 750 999
  1437. d 4999 999
  1438. d 4999 1249
  1439. d 750 1249
  1440. d 750 999
  1441. c 1
  1442. f 1
  1443. c 4
  1444. m 499 499
  1445. d 0 4999
  1446. f 0
  1447. f 1
  1448. m 999 1399
  1449. d 499 499
  1450. f 0
  1451. f 1
  1452. m 4999 499
  1453. d 999 1399
  1454. f 0
  1455. f 1
  1456. m 3999 499
  1457. d 4999 499
  1458. f 0
  1459. f 1
  1460. m 2499 3999
  1461. d 3999 499
  1462. f 0
  1463. f 1
  1464. m 4500 1500
  1465. d 2499 3999
  1466. f 0
  1467. f 1
  1468. m 2250 2250
  1469. d 4500 1500
  1470. f 0
  1471. f 1
  1472. m 999 999
  1473. d 2250 2250
  1474. f 0
  1475. f 1
  1476. m 4999 0
  1477. d 999 999
  1478. f 0
  1479. f 1
  1480. m 0 4999
  1481. d 4999 0
  1482. f 0
  1483. a 10
  1484. X-1 3 3
  1485. X498 498
  1486. X998 1399
  1487. X4999 498
  1488. X3998 498
  1489. X2498 3998
  1490. X4500 1500
  1491. X2250 2250
  1492. X998 998
  1493. X4999 0
  1494. X0 4999
  1495. w 2750 1350 3999 2100
  1496. c 7
  1497. m 2750 1350
  1498. d 3999 1350
  1499. d 3999 2100
  1500. d 2750 2100
  1501. d 2750 1350
  1502. c 4
  1503. f 1
  1504. c 2
  1505. m 499 499
  1506. d 0 4999
  1507. f 0
  1508. f 1
  1509. m 999 1399
  1510. d 499 499
  1511. f 0
  1512. f 1
  1513. m 4999 499
  1514. d 999 1399
  1515. f 0
  1516. f 1
  1517. m 3999 499
  1518. d 4999 499
  1519. f 0
  1520. f 1
  1521. m 2499 3999
  1522. d 3999 499
  1523. f 0
  1524. f 1
  1525. m 4500 1500
  1526. d 2499 3999
  1527. f 0
  1528. f 1
  1529. m 2250 2250
  1530. d 4500 1500
  1531. f 0
  1532. f 1
  1533. m 999 999
  1534. d 2250 2250
  1535. f 0
  1536. f 1
  1537. m 4999 0
  1538. d 999 999
  1539. f 0
  1540. f 1
  1541. m 0 4999
  1542. d 4999 0
  1543. f 0
  1544. a 10
  1545. X-1 8 2
  1546. X498 498
  1547. X998 1399
  1548. X4999 498
  1549. X3998 498
  1550. X2498 3998
  1551. X4500 1500
  1552. X2250 2250
  1553. X998 998
  1554. X4999 0
  1555. X0 4999
  1556. END_OF_FILE
  1557. if test 2854 -ne `wc -c <'Vplot_Kernel/filters/Tests/TEST_clipping'`; then
  1558.     echo shar: \"'Vplot_Kernel/filters/Tests/TEST_clipping'\" unpacked with wrong size!
  1559. fi
  1560. # end of 'Vplot_Kernel/filters/Tests/TEST_clipping'
  1561. fi
  1562. if test -f 'Vplot_Kernel/filters/Tests/TEST_colors' -a "${1}" != "-c" ; then 
  1563.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/TEST_colors'\"
  1564. else
  1565. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/TEST_colors'\" \(2555 characters\)
  1566. sed "s/^X//" >'Vplot_Kernel/filters/Tests/TEST_colors' <<'END_OF_FILE'
  1567. X#plas: Vplot units used in this file
  1568. e
  1569. S s
  1570. w -32760 -32760 32760 32760
  1571. F 0 0 0
  1572. J 0 0
  1573. s 0
  1574. w -32760 -32760 8190 32760
  1575. f 0
  1576. c 7
  1577. z
  1578. Test of colors and polygon fill densities.
  1579. z
  1580. X
  1581. c 0
  1582. f 1
  1583. m 0 0
  1584. d 0 499
  1585. f 0
  1586. f 1
  1587. m 7000 0
  1588. d 0 0
  1589. f 0
  1590. f 1
  1591. m 7000 499
  1592. d 7000 0
  1593. f 0
  1594. f 1
  1595. m 0 499
  1596. d 7000 499
  1597. f 0
  1598. c 1
  1599. f 1
  1600. m 0 499
  1601. d 0 999
  1602. f 0
  1603. f 1
  1604. m 7000 499
  1605. d 0 499
  1606. f 0
  1607. f 1
  1608. m 7000 999
  1609. d 7000 499
  1610. f 0
  1611. f 1
  1612. m 0 999
  1613. d 7000 999
  1614. f 0
  1615. a 4
  1616. X-1 7 7
  1617. X0 499
  1618. X7000 499
  1619. X7000 999
  1620. X0 999
  1621. c 2
  1622. f 1
  1623. m 0 999
  1624. d 0 1500
  1625. f 0
  1626. f 1
  1627. m 7000 999
  1628. d 0 999
  1629. f 0
  1630. f 1
  1631. m 7000 1500
  1632. d 7000 999
  1633. f 0
  1634. f 1
  1635. m 0 1500
  1636. d 7000 1500
  1637. f 0
  1638. a 4
  1639. X-1 6 6
  1640. X0 999
  1641. X7000 999
  1642. X7000 1500
  1643. X0 1500
  1644. c 3
  1645. f 1
  1646. m 0 1500
  1647. d 0 1999
  1648. f 0
  1649. f 1
  1650. m 7000 1500
  1651. d 0 1500
  1652. f 0
  1653. f 1
  1654. m 7000 1999
  1655. d 7000 1500
  1656. f 0
  1657. f 1
  1658. m 0 1999
  1659. d 7000 1999
  1660. f 0
  1661. a 4
  1662. X-1 5 5
  1663. X0 1500
  1664. X7000 1500
  1665. X7000 1999
  1666. X0 1999
  1667. c 4
  1668. f 1
  1669. m 0 1999
  1670. d 0 2499
  1671. f 0
  1672. f 1
  1673. m 7000 1999
  1674. d 0 1999
  1675. f 0
  1676. f 1
  1677. m 7000 2499
  1678. d 7000 1999
  1679. f 0
  1680. f 1
  1681. m 0 2499
  1682. d 7000 2499
  1683. f 0
  1684. a 4
  1685. X-1 4 4
  1686. X0 1999
  1687. X7000 1999
  1688. X7000 2499
  1689. X0 2499
  1690. c 5
  1691. f 1
  1692. m 0 2499
  1693. d 0 3000
  1694. f 0
  1695. f 1
  1696. m 7000 2499
  1697. d 0 2499
  1698. f 0
  1699. f 1
  1700. m 7000 3000
  1701. d 7000 2499
  1702. f 0
  1703. f 1
  1704. m 0 3000
  1705. d 7000 3000
  1706. f 0
  1707. a 4
  1708. X-1 3 3
  1709. X0 2499
  1710. X7000 2499
  1711. X7000 3000
  1712. X0 3000
  1713. c 6
  1714. f 1
  1715. m 0 3000
  1716. d 0 3500
  1717. f 0
  1718. f 1
  1719. m 7000 3000
  1720. d 0 3000
  1721. f 0
  1722. f 1
  1723. m 7000 3500
  1724. d 7000 3000
  1725. f 0
  1726. f 1
  1727. m 0 3500
  1728. d 7000 3500
  1729. f 0
  1730. a 4
  1731. X-1 2 2
  1732. X0 3000
  1733. X7000 3000
  1734. X7000 3500
  1735. X0 3500
  1736. c 7
  1737. f 1
  1738. m 0 3500
  1739. d 0 3999
  1740. f 0
  1741. f 1
  1742. m 7000 3500
  1743. d 0 3500
  1744. f 0
  1745. f 1
  1746. m 7000 3999
  1747. d 7000 3500
  1748. f 0
  1749. f 1
  1750. m 0 3999
  1751. d 7000 3999
  1752. f 0
  1753. a 4
  1754. X-1 1 1
  1755. X0 3500
  1756. X7000 3500
  1757. X7000 3999
  1758. X0 3999
  1759. f 20
  1760. c 0
  1761. m 3500 0
  1762. d 3500 3999
  1763. F 1 -1 3
  1764. J 2 3
  1765. f 5
  1766. c 7
  1767. m 3500 249
  1768. T 10 0
  1769. Black
  1770. m 3881 249
  1771. m 3500 750
  1772. T 10 0
  1773. Blue
  1774. m 3804 750
  1775. m 3500 1249
  1776. T 10 0
  1777. Red
  1778. m 3766 1249
  1779. m 3500 1750
  1780. T 10 0
  1781. Magenta
  1782. m 4091 1750
  1783. m 3500 2250
  1784. T 10 0
  1785. Green
  1786. m 3907 2250
  1787. m 3500 2750
  1788. T 10 0
  1789. Cyan
  1790. m 3842 2750
  1791. m 3500 3249
  1792. T 10 0
  1793. Yellow
  1794. m 3928 3249
  1795. m 3500 3750
  1796. T 10 0
  1797. White
  1798. m 3873 3750
  1799. z
  1800. On a color device colors of bars should match with their labels.
  1801. z
  1802. If not, then the default colors for the device are wrong.
  1803. z
  1804. Monochrome devices should display a grey scale, with the background color
  1805. z
  1806. at the bottom and the opposite of it at the top.
  1807. z
  1808. The vertical stripe should be drawn in the background color.
  1809. f 4
  1810. c 1
  1811. m 0 4250
  1812. d 7000 4250
  1813. f 2
  1814. c 7
  1815. m 1999 4250
  1816. T 10 0
  1817. Box A
  1818. m 2407 4250
  1819. F -1 -1 1
  1820. m 4999 4250
  1821. T 10 0
  1822. Box B
  1823. m 5420 4250
  1824. z
  1825. X
  1826. z
  1827. Box A and Box B at the top should both look exactly the same,
  1828. z
  1829. except that the blue line should disappear behind Box A and not Box B.
  1830. z
  1831. If any of the boxes are shaded with something besides the background color
  1832. z
  1833. X(possibly making it so you can't read the text except in Box B)
  1834. z
  1835. then your device driver does not do proper fill for color 0. (serious bug)
  1836. END_OF_FILE
  1837. if test 2555 -ne `wc -c <'Vplot_Kernel/filters/Tests/TEST_colors'`; then
  1838.     echo shar: \"'Vplot_Kernel/filters/Tests/TEST_colors'\" unpacked with wrong size!
  1839. fi
  1840. # end of 'Vplot_Kernel/filters/Tests/TEST_colors'
  1841. fi
  1842. if test -f 'Vplot_Kernel/filters/include/extern.h' -a "${1}" != "-c" ; then 
  1843.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/extern.h'\"
  1844. else
  1845. echo shar: Extracting \"'Vplot_Kernel/filters/include/extern.h'\" \(2630 characters\)
  1846. sed "s/^X//" >'Vplot_Kernel/filters/include/extern.h' <<'END_OF_FILE'
  1847. X/*
  1848. X * defines structures referred to herein
  1849. X */
  1850. X#include "../include/device.h"
  1851. X
  1852. X/*
  1853. X * external variables (quite a few of them)
  1854. X */
  1855. X
  1856. X/*
  1857. X * these must be DECLARED in dev.conf
  1858. X */
  1859. extern char *documentation[];
  1860. extern int doclength;
  1861. extern char name[];
  1862. X
  1863. X/*
  1864. X * these MUST be initialized in either dev.open or dev.reset
  1865. X * (Not setting them will cause a fatal error.)
  1866. X */
  1867. extern int dev_xmax, dev_ymax, dev_xmin, dev_ymin;
  1868. extern float pixels_per_inch;
  1869. extern float aspect_ratio;
  1870. extern int num_col;
  1871. X
  1872. X/*
  1873. X * options and variables that may also need to be reset in dev.open
  1874. X * They can't be reset in dev.reset, because the user may override
  1875. X * the values set by the device. (Except that mono will not be reset
  1876. X * to NO if the device says it is YES.)
  1877. X */
  1878. extern int mono, invras;
  1879. extern float fatmult;
  1880. extern float patternmult;
  1881. extern int shade;
  1882. extern int wantras;
  1883. extern int rotate;
  1884. extern float  hshift, vshift;
  1885. extern int dither;
  1886. extern int endpause;
  1887. extern int txfont,txprec,txovly;
  1888. extern float pixc, greyc;
  1889. X
  1890. X/*
  1891. X * these can also be set in dev.open or dev.reset if dovplot gets them wrong,
  1892. X * but can usually be left at their default values.
  1893. X *
  1894. X * allowecho must only be reset in dev.open because the user can override
  1895. X * from the command line to force it to be YES. (But user can't force it NO.)
  1896. X */
  1897. extern int allowecho;
  1898. extern int need_end_erase;
  1899. extern int buffer_output;
  1900. extern int smart_clip;
  1901. extern int smart_raster;
  1902. X
  1903. X/*
  1904. X * This might also need to be set if you needed to force allowecho.
  1905. X */
  1906. extern int (*message)();
  1907. X
  1908. X/*
  1909. X * These variables may be useful for referring to in dev.open,
  1910. X * so that similar devices can be merged under one pen filter.
  1911. X */
  1912. extern char wstype[];
  1913. extern char callname[];
  1914. X
  1915. X/*
  1916. X * Usual place to read from and place to send the plot to.
  1917. X * The device can use these if they are appropriate, or reject
  1918. X * these and handle things on its own instead.
  1919. X */
  1920. extern FILE *pltin;
  1921. extern FILE *pltout;
  1922. X
  1923. X/*
  1924. X * device structure stuff.
  1925. X */
  1926. extern struct device dev;
  1927. extern int (*message)();
  1928. X
  1929. X/*
  1930. X * options
  1931. X */
  1932. extern int epause;
  1933. extern int size;
  1934. extern int echo;
  1935. extern int  xorig, yorig;
  1936. extern int overlay;
  1937. extern float  xscale, yscale, txscale, mkscale, dashscale;
  1938. extern float  hdevscale, vdevscale;
  1939. X
  1940. X/*
  1941. X * variables
  1942. X */
  1943. extern int xold,yold;
  1944. extern int xnew,ynew;
  1945. extern int xwmin,xwmax,ywmin,ywmax;
  1946. extern int xorigin,yorigin;
  1947. extern int fat,fatbase,dashon;
  1948. extern int afat;
  1949. extern int ipat;
  1950. extern struct pat pat[];
  1951. extern struct txalign txalign;
  1952. extern float mxx, mxy, myx, myy;
  1953. extern float dashes[];
  1954. extern float dashpos, dashsum;
  1955. extern char pltname[];
  1956. extern char group_name[];
  1957. extern int group_number;
  1958. END_OF_FILE
  1959. if test 2630 -ne `wc -c <'Vplot_Kernel/filters/include/extern.h'`; then
  1960.     echo shar: \"'Vplot_Kernel/filters/include/extern.h'\" unpacked with wrong size!
  1961. fi
  1962. # end of 'Vplot_Kernel/filters/include/extern.h'
  1963. fi
  1964. if test -f 'Vplot_Kernel/filters/include/font_definitions.h' -a "${1}" != "-c" ; then 
  1965.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/font_definitions.h'\"
  1966. else
  1967. echo shar: Extracting \"'Vplot_Kernel/filters/include/font_definitions.h'\" \(2498 characters\)
  1968. sed "s/^X//" >'Vplot_Kernel/filters/include/font_definitions.h' <<'END_OF_FILE'
  1969. X/*
  1970. X * NUM_FONTS is the total number of fonts.
  1971. X * Font 0 should be the good old pen font.
  1972. X * The Marker routine assumes that fonts 15 and 16
  1973. X * are math and misc fonts.
  1974. X * Other than that, I suppose you can reorder them as you like
  1975. X * but probably it's a good idea to leave the first 17 fonts just
  1976. X * like I've got them here.
  1977. X *
  1978. X * Additional device-independent fonts can be added quite easily.
  1979. X * Fonts 100 and up are reserved for hardware device-dependent fonts,
  1980. X * however!
  1981. X *
  1982. X * - Joe Dellinger
  1983. X */
  1984. X#define NUM_FONTS    17
  1985. X
  1986. X
  1987. X/*
  1988. X * Here are the fonts that we want included at compile time into gentext.c.
  1989. X * All other fonts will be loaded at runtime on demand.
  1990. X */
  1991. X#include "../include/vplotfonts/pen.include"
  1992. X#include "../include/vplotfonts/romans.include"
  1993. X#include "../include/vplotfonts/romanc.include"
  1994. X
  1995. X
  1996. X#define    BOTTOM    0
  1997. X#define    BASE    1
  1998. X#define    HALF    2
  1999. X#define    CAP    3
  2000. X#define    TOP    4
  2001. X#define    LETTER    5
  2002. X#define    LINE    6
  2003. X#define    SPACE    7
  2004. X#define    START    8
  2005. X#define    END    9
  2006. X
  2007. X#define NOT_LOADED 0,0,0,0,0,0,0
  2008. X
  2009. typedef struct {
  2010. X    int load;
  2011. X    char name[10];
  2012. X    short *dim;
  2013. X    int   *saddr;
  2014. X    short *swidthl;
  2015. X    short *swidthr;
  2016. X    short *symbol;
  2017. X    unsigned short *svec;
  2018. X    int *lig;
  2019. X} GLYPH;
  2020. X
  2021. X/*
  2022. X * Here are two examples of fonts loaded at compile time.
  2023. X * You have to specify all the entries in the GLYPH structure.
  2024. X * The "1" in the first slot specifies that this font is already loaded.
  2025. X */
  2026. GLYPH font[NUMGENFONT] = {
  2027. X
  2028. X{1, "pen", pen_dim, pen_addr, pen_widthl, pen_widthr, pen_symbol, pen_vec, pen_lig},
  2029. X
  2030. X
  2031. X{1, "romans", romans_dim, romans_addr, romans_widthl, romans_widthr, romans_symbol, romans_vec, romans_lig},
  2032. X
  2033. X/*
  2034. X * Here's an example of a font loaded at run time.
  2035. X * You put in ZERO for the first entry in the GLYPH structure.
  2036. X * This specifies that this font is not loaded.
  2037. X * You still put the font name in the second slot as for a loaded font.
  2038. X * All the rest of the slots should have zeroes put in them
  2039. X * to make the compiler happy.
  2040. X * The define NOT_LOADED puts in the correct number of zeroes for you.
  2041. X */
  2042. X{0, "romand", NOT_LOADED},
  2043. X
  2044. X{1, "romanc", romanc_dim, romanc_addr, romanc_widthl, romanc_widthr, romanc_symbol, romanc_vec, romanc_lig},
  2045. X
  2046. X{0, "romant", NOT_LOADED},
  2047. X
  2048. X{0, "italicc", NOT_LOADED},
  2049. X
  2050. X{0, "italict", NOT_LOADED},
  2051. X
  2052. X{0, "scripts", NOT_LOADED},
  2053. X
  2054. X{0, "scriptc", NOT_LOADED},
  2055. X
  2056. X{0, "greeks", NOT_LOADED},
  2057. X
  2058. X{0, "greekc", NOT_LOADED},
  2059. X
  2060. X{0, "cyrilc", NOT_LOADED},
  2061. X
  2062. X{0, "gothgbt", NOT_LOADED},
  2063. X
  2064. X{0, "gothgrt", NOT_LOADED},
  2065. X
  2066. X{0, "gothitt", NOT_LOADED},
  2067. X
  2068. X{0, "math", NOT_LOADED},
  2069. X
  2070. X{0, "misc", NOT_LOADED},
  2071. X
  2072. X};
  2073. END_OF_FILE
  2074. if test 2498 -ne `wc -c <'Vplot_Kernel/filters/include/font_definitions.h'`; then
  2075.     echo shar: \"'Vplot_Kernel/filters/include/font_definitions.h'\" unpacked with wrong size!
  2076. fi
  2077. # end of 'Vplot_Kernel/filters/include/font_definitions.h'
  2078. fi
  2079. if test -f 'Vplot_Kernel/filters/include/mesgcom.h' -a "${1}" != "-c" ; then 
  2080.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/mesgcom.h'\"
  2081. else
  2082. echo shar: Extracting \"'Vplot_Kernel/filters/include/mesgcom.h'\" \(2737 characters\)
  2083. sed "s/^X//" >'Vplot_Kernel/filters/include/mesgcom.h' <<'END_OF_FILE'
  2084. X/*
  2085. X * commands for device's message routine
  2086. X */
  2087. X#define MESG_HOME            0
  2088. X#define MESG_OFF             1
  2089. X#define MESG_ON             2
  2090. X#define MESG_ERASE            3
  2091. X#define MESG_HIGHLIGHT_ON        4
  2092. X#define MESG_HIGHLIGHT_OFF         5
  2093. X#define MESG_READY             6
  2094. X#define MESG_DONE            7
  2095. X#define MESG_TEXT            8
  2096. X#define MESG_MESSAGE            9
  2097. X
  2098. X/*
  2099. X *  MESG_HOME: home the cursor. This does not have to be the terminal's
  2100. X *    "home" position. Anyplace likely to be out of the way of the graph
  2101. X *    will do.  Leave room for the prompt's text which will surely follow
  2102. X *    immediately on this command's heels. If you handle all prompting
  2103. X *    yourself, ignore this command.
  2104. X *
  2105. X *  MESG_OFF: turn the message (text screen) off, leaving the text intact
  2106. X *    but invisible. If this is not possible, this should be interpreted
  2107. X *    as an erase. If the text and graphics screen are completely
  2108. X *    separate, ignore this command.
  2109. X *
  2110. X *  MESG_ON: turn the message (text screen) back on again if you turned it off.
  2111. X *    If you erased it, this may not be possible. If so, just forget about it.
  2112. X *
  2113. X *  MESG_ERASE: erase the text screen. Do this even if you know how to just
  2114. X *    make the text invisible; we want to use the text screen for
  2115. X *    prompting and need to leave it on. If you handle all prompting
  2116. X *    yourself, ignore this command.
  2117. X *
  2118. X *  MESG_HIGHLIGHT_ON: after "READY", means that the following message is
  2119. X *    a prompt generated by the vplot device-independent code. Normally
  2120. X *    you will want to indicate to the user that this text is a prompt by
  2121. X *    going into some sort of "highlighted" text mode. Some devices may
  2122. X *    want to handle prompting by themselves in dev.interact in a
  2123. X *    device-dependent way, however, and they can take this as a signal
  2124. X *    to ignore the following text.
  2125. X *
  2126. X *  MESG_HIGHLIGHT_OFF: get out of "prompt mode".
  2127. X *
  2128. X *  MESG_READY: get ready to print a message.
  2129. X *
  2130. X *  MESG_DONE: we're through printing the message.
  2131. X *
  2132. X *  MESG_TEXT: print out the given text.
  2133. X *
  2134. X *  MESG_MESSAGE: after "READY", means that the following message is
  2135. X *    from the "VP_MESSAGE" vplot command, and so might want to be
  2136. X *    treated differently from other messages such as errors or prompts.
  2137. X */
  2138. X
  2139. X/*
  2140. X * The modes MESG_READY, MESG_TEXT, MESG_HIGHLIGHT_OFF,
  2141. X * MESG_HIGHLIGHT_ON, MESG_DONE, and MESG_MESSAGE can only occur
  2142. X * in the following orders:
  2143. X *
  2144. X * READY, [MESSAGE optionally], TEXT, DONE
  2145. X *
  2146. X * For a prompt:
  2147. X * READY, HIGHLIGHT_ON, TEXT, DONE, dev.interact,
  2148. X * HIGHLIGHT_OFF, [READY, TEXT (carriage return - line feed),] DONE
  2149. X *
  2150. X * The other modes can occur at any time in any order!
  2151. X */
  2152. X
  2153. X#define CRLF            "\015\012"
  2154. X
  2155. X/*
  2156. X * Use CRLF instead of \n when you are putting a newline on the end of
  2157. X * a message, since the output may be (probably is, in fact) in raw mode.
  2158. X * Note that "error" puts this on FOR you.
  2159. X */
  2160. X
  2161. END_OF_FILE
  2162. if test 2737 -ne `wc -c <'Vplot_Kernel/filters/include/mesgcom.h'`; then
  2163.     echo shar: \"'Vplot_Kernel/filters/include/mesgcom.h'\" unpacked with wrong size!
  2164. fi
  2165. # end of 'Vplot_Kernel/filters/include/mesgcom.h'
  2166. fi
  2167. if test -f 'Vplot_Kernel/filters/include/vplot.h' -a "${1}" != "-c" ; then 
  2168.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/vplot.h'\"
  2169. else
  2170. echo shar: Extracting \"'Vplot_Kernel/filters/include/vplot.h'\" \(2561 characters\)
  2171. sed "s/^X//" >'Vplot_Kernel/filters/include/vplot.h' <<'END_OF_FILE'
  2172. X/*
  2173. X * Weird backwards-compatible units
  2174. X */
  2175. X#define RPERIN         600.    /* vplot units per inch */
  2176. X#define HATCHPERIN    100.    /* Hatch units per inch */
  2177. X#define TXPERIN     33.    /* Text units per inch */
  2178. X#define FATPERIN    200.    /* Fatness units per inch */
  2179. X/*
  2180. X * Height in inches of "standard" device, standard style
  2181. X */
  2182. X#define STANDARD_HEIGHT 10.24
  2183. X/*
  2184. X * Height in inches of "standard" device, rotated style
  2185. X */
  2186. X#define ROTATED_HEIGHT     7.5
  2187. X/*
  2188. X * Aspect ratio of the default window (height/width)
  2189. X */
  2190. X#define SCREEN_RATIO 0.75
  2191. X#define VP_MAX 54.6        /* absolute maximum x or y coordinate in inches */
  2192. X
  2193. X/*
  2194. X * text alignment enumerations
  2195. X */
  2196. X/* horizontal */
  2197. X#define    TH_NORMAL    0
  2198. X#define    TH_LEFT        1
  2199. X#define    TH_CENTER    2
  2200. X#define    TH_RIGHT    3
  2201. X#define TH_SYMBOL    4
  2202. X
  2203. X/* vertical */
  2204. X#define    TV_NORMAL    0
  2205. X#define TV_BOTTOM    1
  2206. X#define TV_BASE        2
  2207. X#define TV_HALF        3
  2208. X#define TV_CAP        4
  2209. X#define TV_TOP        5
  2210. X#define TV_SYMBOL    6
  2211. X
  2212. struct txalign {
  2213. X    int hor;
  2214. X    int ver;
  2215. X};
  2216. X
  2217. X/*
  2218. X * text precision enumerations
  2219. X */
  2220. X#define STRING    0
  2221. X#define CHAR    1
  2222. X#define STROKE    2
  2223. X/* leave it what it already was */
  2224. X#define NO_CHANGE -1
  2225. X
  2226. X/*
  2227. X * text overlay enumerations
  2228. X */
  2229. X#define OVLY_NORMAL    0
  2230. X#define OVLY_BOX    1
  2231. X#define OVLY_SHADE    2
  2232. X#define OVLY_SHADE_BOX    3
  2233. X
  2234. X/*
  2235. X * colors
  2236. X */
  2237. X#define BLACK    0
  2238. X#define BLUE     1
  2239. X#define RED      2
  2240. X#define PURPLE   3
  2241. X#define GREEN    4
  2242. X#define CYAN     5
  2243. X#define YELLOW   6
  2244. X#define WHITE    7
  2245. X
  2246. X/*
  2247. X * Coordinate Origin
  2248. X */
  2249. X#define STANDARD    0
  2250. X#define ROTATED        1
  2251. X#define ABSOLUTE     3
  2252. X
  2253. X/*
  2254. X * Fonts
  2255. X */
  2256. X
  2257. X#define PEN        0
  2258. X#define ROMANS        1
  2259. X#define ROMAND        2
  2260. X#define ROMANC        3
  2261. X#define ROMANT        4
  2262. X#define ITALICC        5
  2263. X#define ITALICT        6
  2264. X#define SCRIPTS        7
  2265. X#define SCRIPTC        8
  2266. X#define GREEKS        9
  2267. X#define GREEKC        10
  2268. X#define CYRILC        11
  2269. X#define GOTHGBT        12
  2270. X#define GOTHGRT        13
  2271. X#define GOTHITT        14
  2272. X#define MATH        15
  2273. X#define MISC        16
  2274. X
  2275. X/*
  2276. X * vplot metafile op-codes
  2277. X */
  2278. X
  2279. X#define VP_SETSTYLE        'S'
  2280. X
  2281. X#define VP_MOVE            'm'
  2282. X#define VP_DRAW            'd'
  2283. X#define VP_PLINE            'L'
  2284. X#define VP_PMARK           'M'
  2285. X#define VP_TEXT            'T'
  2286. X#define VP_GTEXT        'G'
  2287. X#define VP_AREA            'A'
  2288. X#define VP_OLDAREA        'a'
  2289. X#define VP_BYTE_RASTER        'R'
  2290. X#define VP_BIT_RASTER        'r'
  2291. X
  2292. X#define VP_ERASE        'e'
  2293. X#define VP_BREAK        'b'
  2294. X#define VP_PURGE        'p'
  2295. X#define VP_NOOP            'n'
  2296. X
  2297. X#define VP_ORIGIN        'o'
  2298. X#define VP_WINDOW        'w'
  2299. X
  2300. X#define VP_FAT            'f'
  2301. X#define VP_SETDASH        's'
  2302. X#define VP_COLOR        'c'
  2303. X#define VP_SET_COLOR_TABLE    'C'
  2304. X#define VP_TXALIGN        'J'
  2305. X#define VP_TXFONTPREC        'F'
  2306. X#define VP_PATLOAD        'l'
  2307. X#define VP_OVERLAY        'v'
  2308. X
  2309. X#define VP_MESSAGE        'z'
  2310. X#define VP_BEGIN_GROUP        '['
  2311. X#define VP_END_GROUP        ']'
  2312. X
  2313. X/* Hopefully now dead primitives */
  2314. X#define VP_OLDTEXT        't'
  2315. END_OF_FILE
  2316. if test 2561 -ne `wc -c <'Vplot_Kernel/filters/include/vplot.h'`; then
  2317.     echo shar: \"'Vplot_Kernel/filters/include/vplot.h'\" unpacked with wrong size!
  2318. fi
  2319. # end of 'Vplot_Kernel/filters/include/vplot.h'
  2320. fi
  2321. if test -f 'Vplot_Kernel/filters/utilities/dashvec.c' -a "${1}" != "-c" ; then 
  2322.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/utilities/dashvec.c'\"
  2323. else
  2324. echo shar: Extracting \"'Vplot_Kernel/filters/utilities/dashvec.c'\" \(2919 characters\)
  2325. sed "s/^X//" >'Vplot_Kernel/filters/utilities/dashvec.c' <<'END_OF_FILE'
  2326. X/*
  2327. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  2328. X * University. Official permission to use this software is included in
  2329. X * the documentation. It authorizes you to use this file for any
  2330. X * non-commercial purpose, provided that this copyright notice is not
  2331. X * removed and that any modifications made to this file are commented
  2332. X * and dated in the style of my example below.
  2333. X */
  2334. X
  2335. X/*
  2336. X *
  2337. X *  source file:   ./filters/utilities/dashvec.c
  2338. X *
  2339. X * Joe Dellinger (SEP), June 11 1987
  2340. X *    Inserted this sample edit history entry.
  2341. X *    Please log any further modifications made to this file:
  2342. X * Joe Dellinger Mar 2 1987
  2343. X *    Simplify a few expressions that made the IBM RT's barf.
  2344. X */
  2345. X
  2346. X/*
  2347. X * Utility routine to make dashed lines.
  2348. X * Should ONLY be called if dashon > 0
  2349. X */
  2350. X
  2351. X#include <stdio.h>
  2352. X#include <math.h>
  2353. X#include "../include/extern.h"
  2354. X#include "../include/round.h"
  2355. X
  2356. X/*
  2357. X * dash1, gap1, dash2, gap2
  2358. X * in inches.
  2359. X */
  2360. X
  2361. dashvec (x1, y1, x2, y2, nfat, dashon)
  2362. X    int             x1, y1, x2, y2;
  2363. X    int             nfat, dashon;
  2364. X{
  2365. double          dash_ahead, dash_behind, dashdist, dist, sine, cosine;
  2366. double          deltax, deltay, lambda1, lambda2;
  2367. int             i, nextdash;
  2368. double          dashmod ();
  2369. int             xv1, xv2, yv1, yv2;
  2370. X
  2371. X/*
  2372. X * If not a dashed line, should never have even been called.
  2373. X * Can't dash a single point!
  2374. X */
  2375. X    if (!dashon || (x1 == x2 && y1 == y2))
  2376. X    return;
  2377. X
  2378. X/*
  2379. X * find current position in dashes
  2380. X */
  2381. X    dashpos = (float) dashmod ((double) dashpos, (double) dashsum);
  2382. X    dash_behind = dashpos;
  2383. X
  2384. X    i = 0;
  2385. X    dash_ahead = 0.;
  2386. X    while (dash_ahead < dash_behind)
  2387. X    {
  2388. X    dash_ahead += dashes[i];
  2389. X    i++;
  2390. X    }
  2391. X    nextdash = i - 1;
  2392. X/*
  2393. X * compute distances, properly scaled
  2394. X */
  2395. X    deltax = x2 - x1;
  2396. X    deltay = y2 - y1;
  2397. X    lambda1 = 1. / pixels_per_inch;
  2398. X    lambda2 = aspect_ratio / pixels_per_inch;
  2399. X    dist = sqrt (lambda1 * lambda1 * deltax * deltax + lambda2 * lambda2 * deltay * deltay);
  2400. X    sine = deltay / dist;
  2401. X    cosine = deltax / dist;
  2402. X
  2403. X/*
  2404. X * draw the dashed line
  2405. X */
  2406. X    for (dashdist = 0.;
  2407. X     dash_ahead - dashpos < dist;
  2408. X     dashdist += dash_ahead - dash_behind,
  2409. X     dash_behind = dash_ahead,
  2410. X     nextdash++,
  2411. X     dash_ahead += dashes[nextdash % (dashon * 2)])
  2412. X    {
  2413. X    if (nextdash % 2 == 0)
  2414. X    {
  2415. X        xv1 = ROUND (x1 + cosine * (dashdist));
  2416. X        yv1 = ROUND (y1 + sine * (dashdist));
  2417. X        xv2 = ROUND (x1 + cosine * (dashdist + (dash_ahead - dash_behind)));
  2418. X        yv2 = ROUND (y1 + sine * (dashdist + (dash_ahead - dash_behind)));
  2419. X
  2420. X        dev.vector (xv1, yv1, xv2, yv2, nfat, 0);
  2421. X    }
  2422. X    }
  2423. X
  2424. X    if (nextdash % 2 == 0)
  2425. X    {
  2426. X    xv1 = ROUND (x1 + cosine * (dashdist));
  2427. X    yv1 = ROUND (y1 + sine * (dashdist));
  2428. X
  2429. X    dev.vector (xv1, yv1, x2, y2, nfat, 0);
  2430. X    }
  2431. X
  2432. X/*
  2433. X * Increment to new position in dash pattern.
  2434. X */
  2435. X    dashpos += dashmod (dist, (double) dashsum);
  2436. X}
  2437. X
  2438. X/*
  2439. X * mod subroutine
  2440. X */
  2441. double
  2442. dashmod (a, b)
  2443. X    double          a, b;
  2444. X{
  2445. X    return (a - floor (a / b) * b);
  2446. X}
  2447. END_OF_FILE
  2448. if test 2919 -ne `wc -c <'Vplot_Kernel/filters/utilities/dashvec.c'`; then
  2449.     echo shar: \"'Vplot_Kernel/filters/utilities/dashvec.c'\" unpacked with wrong size!
  2450. fi
  2451. # end of 'Vplot_Kernel/filters/utilities/dashvec.c'
  2452. fi
  2453. echo shar: End of archive 10 \(of 24\).
  2454. cp /dev/null ark10isdone
  2455. MISSING=""
  2456. 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 ; do
  2457.     if test ! -f ark${I}isdone ; then
  2458.     MISSING="${MISSING} ${I}"
  2459.     fi
  2460. done
  2461. if test "${MISSING}" = "" ; then
  2462.     echo You have unpacked all 24 archives.
  2463.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2464. else
  2465.     echo You still need to unpack the following archives:
  2466.     echo "        " ${MISSING}
  2467. fi
  2468. ##  End of shell archive.
  2469. exit 0
  2470.