home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume11 / gnuplot2 / part09 < prev    next >
Encoding:
Text File  |  1990-03-25  |  55.3 KB  |  2,339 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Pixar -- Marin County, California
  3. subject: v11i074: Gnuplot 2.0 - 9 of 14
  4. From: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 11, Issue 74
  8. Submitted-by: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
  9. Archive-name: gnuplot2/part09
  10.  
  11. This is gnuplot.sh09
  12.  
  13. --- CUT HERE ---
  14. #! /bin/sh
  15. echo x - term/aed.trm
  16. sed 's/^X//' >term/aed.trm <<'*-*-END-of-term/aed.trm-*-*'
  17. X/* GNUPLOT - aed.trm */
  18. X/*
  19. X * Copyright (C) 1990
  20. X *
  21. X * Permission to use, copy, and distribute this software and its
  22. X * documentation for any purpose with or without fee is hereby granted, 
  23. X * provided that the above copyright notice appear in all copies and 
  24. X * that both that copyright notice and this permission notice appear 
  25. X * in supporting documentation.
  26. X *
  27. X * Permission to modify the software is granted, but not the right to
  28. X * distribute the modified code.  Modifications are to be distributed 
  29. X * as patches to released version.
  30. X *  
  31. X * This software  is provided "as is" without express or implied warranty.
  32. X * 
  33. X * This file is included by ../term.c.
  34. X *
  35. X * This terminal driver supports:
  36. X *   AED terminals
  37. X *
  38. X * AUTHORS
  39. X *     Colin Kelley, Thomas Williams, Russell Lang
  40. X *
  41. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  42. X * 
  43. X */
  44. X
  45. X#define AED_XMAX 768
  46. X#define AED_YMAX 575
  47. X
  48. X#define AED_XLAST (AED_XMAX - 1)
  49. X#define AED_YLAST (AED_YMAX - 1)
  50. X
  51. X#define AED_VCHAR    13
  52. X#define AED_HCHAR    8
  53. X#define AED_VTIC    8
  54. X#define AED_HTIC    7
  55. X
  56. X/* slightly different for AED 512 */
  57. X#define AED5_XMAX 512
  58. X#define AED5_XLAST (AED5_XMAX - 1)
  59. X
  60. XAED_init()
  61. X{
  62. X    fprintf(outfile,
  63. X    "\033SEN3DDDN.SEC.7.SCT.0.1.80.80.90.SBC.0.AAV2.MOV.0.9.CHR.0.FFD");
  64. X/*   2            3     4                5     7    6       1
  65. X    1. Clear Screen
  66. X    2. Set Encoding
  67. X    3. Set Default Color
  68. X    4. Set Backround Color Table Entry
  69. X    5. Set Backround Color
  70. X    6. Move to Bottom Lefthand Corner
  71. X    7. Anti-Alias Vectors
  72. X*/
  73. X}
  74. X
  75. X
  76. XAED_graphics()
  77. X{
  78. X    fprintf(outfile,"\033FFD\033");
  79. X}
  80. X
  81. X
  82. XAED_text()
  83. X{
  84. X    fprintf(outfile,"\033MOV.0.9.SEC.7.XXX");
  85. X}
  86. X
  87. X
  88. X
  89. XAED_linetype(linetype)
  90. Xint linetype;
  91. X{
  92. Xstatic int color[2+9] = { 7, 1, 6, 2, 3, 5, 1, 6, 2, 3, 5 };
  93. Xstatic int type[2+9] = { 85, 85, 255, 255, 255, 255, 255, 85, 85, 85, 85 };
  94. X
  95. X    if (linetype >= 10)
  96. X        linetype %= 10;
  97. X    fprintf(outfile,"\033SLS%d.255.",type[linetype+2]);
  98. X    fprintf(outfile,"\033SEC%d.",color[linetype+2]);
  99. X}
  100. X
  101. X
  102. X
  103. XAED_move(x,y)
  104. Xint x,y;
  105. X{
  106. X    fprintf(outfile,"\033MOV%d.%d.",x,y);
  107. X}
  108. X
  109. X
  110. XAED_vector(x,y)
  111. Xint x,y;
  112. X{
  113. X    fprintf(outfile,"\033DVA%d.%d.",x,y);
  114. X}
  115. X
  116. X
  117. XAED_put_text(x,y,str)
  118. Xint x,y;
  119. Xchar str[];
  120. X{
  121. X    AED_move(x,y - AED_VCHAR/2 + 2);
  122. X    fprintf(outfile,"\033XXX%s\033",str);
  123. X}
  124. X
  125. X
  126. X#define hxt (AED_HTIC/2)
  127. X#define hyt (AED_VTIC/2)
  128. X
  129. XAED_reset()
  130. X{
  131. X    fprintf(outfile,"\033SCT0.1.0.0.0.SBC.0.FFD");
  132. X}
  133. X
  134. *-*-END-of-term/aed.trm-*-*
  135. echo x - term/dxy.trm
  136. sed 's/^X//' >term/dxy.trm <<'*-*-END-of-term/dxy.trm-*-*'
  137. X/* GNUPLOT - dxy.trm */
  138. X/*
  139. X * Copyright (C) 1990   
  140. X *
  141. X * Permission to use, copy, and distribute this software and its
  142. X * documentation for any purpose with or without fee is hereby granted, 
  143. X * provided that the above copyright notice appear in all copies and 
  144. X * that both that copyright notice and this permission notice appear 
  145. X * in supporting documentation.
  146. X *
  147. X * Permission to modify the software is granted, but not the right to
  148. X * distribute the modified code.  Modifications are to be distributed 
  149. X * as patches to released version.
  150. X *  
  151. X * This software  is provided "as is" without express or implied warranty.
  152. X * 
  153. X * This file is included by ../term.c.
  154. X *
  155. X * This terminal driver supports:
  156. X *  Roland DXY800A plotter 
  157. X *
  158. X * AUTHORS
  159. X *  Martin Yii, eln557h@monu3.OZ
  160. X *  Further modified Jan 1990 by Russell Lang, rjl@monu1.cc.monash.oz
  161. X * 
  162. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  163. X * 
  164. X */
  165. X
  166. X#define DXY_XMAX 2470
  167. X#define DXY_YMAX 1700
  168. X
  169. X#define DXY_XLAST (DXY_XMAX - 1)
  170. X#define DXY_YLAST (DXY_XMAX - 1)
  171. X
  172. X#define DXY_VCHAR    (56)    /* double actual height of characters */
  173. X#define DXY_HCHAR    (28)    /* actual width including spacing */
  174. X#define DXY_VTIC    (28)        
  175. X#define DXY_HTIC    (28)        
  176. X
  177. Xint dxy_angle = 0;
  178. X
  179. XDXY_init()
  180. X{
  181. X/*
  182. X    No initialisation sequences for DXY 800A
  183. X*/
  184. X}
  185. X
  186. X
  187. XDXY_graphics()
  188. X{
  189. X    /* HOME, Character size 3 */
  190. X    fprintf(outfile,"H\nS3\n");
  191. X}
  192. X
  193. X
  194. XDXY_text()
  195. X{
  196. X/*
  197. X    No sequences needed
  198. X*/
  199. X}
  200. X
  201. X
  202. XDXY_linetype(linetype)
  203. Xint linetype;
  204. X{
  205. X    /* select pen */
  206. X    fprintf(outfile,"J%d\n",(linetype+2)%8+1);
  207. X    switch(linetype) {
  208. X       case -1 :  /* use dotted line for axis */
  209. X               fprintf(outfile,"L1\nB50\n");
  210. X            break;
  211. X       default :  /* use solid line for all others */
  212. X            fprintf(outfile,"L0\n");
  213. X                break;
  214. X       }
  215. X}
  216. X
  217. X
  218. XDXY_move(x,y)
  219. Xint x,y;
  220. X{
  221. X    fprintf(outfile,"M%d,%d\n",x,y);
  222. X}
  223. X
  224. X
  225. XDXY_vector(x,y)
  226. Xint x,y;
  227. X{
  228. X    fprintf(outfile,"D%d,%d\n",x,y);
  229. X}
  230. X
  231. X
  232. XDXY_put_text(x,y,str)
  233. Xint x, y;
  234. Xchar *str;
  235. X{
  236. X    if (dxy_angle == 1 ) 
  237. X        /* vertical */
  238. X        DXY_move(x + DXY_VCHAR/4,y);
  239. X    else
  240. X        /* horiz */
  241. X        DXY_move(x,y - DXY_VCHAR/4);
  242. X    fprintf(outfile,"P%s\n",str);
  243. X}
  244. X
  245. X
  246. Xint DXY_text_angle(ang)
  247. Xint ang;
  248. X{
  249. X    dxy_angle = ang;
  250. X    fprintf(outfile,"Q%d\n",ang);
  251. X    return TRUE;
  252. X}
  253. X
  254. X
  255. XDXY_reset()
  256. X{
  257. X    /* Home pen */
  258. X    fprintf(outfile,"H\n");
  259. X}
  260. X
  261. *-*-END-of-term/dxy.trm-*-*
  262. echo x - term/epson.trm
  263. sed 's/^X//' >term/epson.trm <<'*-*-END-of-term/epson.trm-*-*'
  264. X/* GNUPLOT - epson.trm */
  265. X/*
  266. X * Copyright (C) 1990   
  267. X *
  268. X * Permission to use, copy, and distribute this software and its
  269. X * documentation for any purpose with or without fee is hereby granted, 
  270. X * provided that the above copyright notice appear in all copies and 
  271. X * that both that copyright notice and this permission notice appear 
  272. X * in supporting documentation.
  273. X *
  274. X * Permission to modify the software is granted, but not the right to
  275. X * distribute the modified code.  Modifications are to be distributed 
  276. X * as patches to released version.
  277. X *  
  278. X * This software  is provided "as is" without express or implied warranty.
  279. X * 
  280. X * This file is included by ../term.c.
  281. X *
  282. X *  This file contains generic bit map graphics drivers,
  283. X *  and epson_lx800, nec_cp6c, nec_cp6d, nec_cp6b, and proprinter
  284. X *
  285. X * AUTHORS
  286. X *  Russell Lang
  287. X *
  288. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  289. X * 
  290. X */
  291. X
  292. X/* The following epson lx800 driver uses generic bit mapped graphics
  293. X   routines to build up a bit map in memory. */
  294. X/* by Russell Lang, eln272v@monu1.cc.monash.oz */
  295. X/* On PC, print using 'copy file /b lpt1:', do NOT use 'print' */
  296. X/* EPSON_init changes outfile to binary mode on PC's */
  297. X
  298. X#ifdef EPSON
  299. X
  300. Xunsigned int bm_planes = 1;    /* number of bit planes ( must be < sizeof(int) )*/
  301. Xunsigned int bm_psize;        /* plane size */
  302. Xunsigned int bm_bpi;        /* bits (pixels) per int */
  303. Xunsigned int bm_ipc;        /* int per column */
  304. Xunsigned int bm_xmax;         /* pixels  */
  305. Xunsigned int bm_ymax;        /* pixels (must be multiple of bits per int)
  306. X                                and (must be multiple of 8) */
  307. Xunsigned int *bm_array;        /* pointer to bit map array of unsigned int */
  308. Xchar *bm_free;
  309. Xunsigned int bm_value = 1;    /* this can be used for colour if bm_planes>1 */
  310. Xunsigned int bm_line_mask = 0xffff;    /* 16 bit mask for dotted lines */
  311. Xstatic unsigned int bm_pattern[] = {0xffff, 0x1111,
  312. X    0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
  313. Xint bm_mask_count = 0;
  314. Xunsigned int bm_lastx, bm_lasty;    /* last pixel set - used by bm_line */
  315. X
  316. X
  317. X#define EPSONXMAX    512 
  318. X#define EPSONYMAX    384
  319. X
  320. X#define EPSONXLAST (EPSONXMAX - 1)
  321. X#define EPSONYLAST (EPSONYMAX - 1)
  322. X
  323. X#define EPSONVCHAR        11      
  324. X#define EPSONHCHAR        7        
  325. X#define EPSONVTIC        6
  326. X#define EPSONHTIC        6
  327. X
  328. Xunsigned int epson_x=0, epson_y=0;
  329. Xint epson_angle=0;
  330. X
  331. XEPSONinit()
  332. X{
  333. Xchar filename[MAX_ID_LEN+1];
  334. X    bm_xmax=EPSONXMAX;
  335. X    bm_ymax=EPSONYMAX;
  336. X    bm_planes=1;        /* one plane */
  337. X    bm_value=1;
  338. X    bm_setup();
  339. X    /* output for EPSON must be binary to stop non Unix computers
  340. X        changing \n to \r\n. 
  341. X        At present we only do this for PC's. 
  342. X        (Ultrix generates a run time error on the "wb" mode).
  343. X        if the output is not STDOUT, then the following code 
  344. X        reopens outfile with binary mode. */
  345. X#ifdef PC
  346. X    if (strcmp(outstr,"STDOUT")) {
  347. X        (void) fclose(outfile);
  348. X        (void) strcpy(filename,outstr+1);    /* remove quotes */
  349. X        filename[strlen(filename)-1] = '\0';
  350. X        if ( (outfile = fopen(filename,"wb")) == (FILE *)NULL ) {
  351. X            if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
  352. X                os_error("cannot reopen file with binary type; output unknown",
  353. X                    NO_CARET);
  354. X            } 
  355. X            else {
  356. X    os_error("cannot reopen file with binary type; output reset to ascii", 
  357. X                    NO_CARET);
  358. X            }
  359. X        }
  360. X    }
  361. X#endif
  362. X}
  363. X
  364. X
  365. XEPSONgraphics()
  366. X{
  367. Xunsigned int plane=0;
  368. Xunsigned int fill=0;
  369. X    bm_cls(plane,fill);
  370. X    epson_x=0;
  371. X    epson_y=0;
  372. X    epson_angle=0;
  373. X}
  374. X
  375. X
  376. XEPSONtext()
  377. X{
  378. X    epson_dump();
  379. X}
  380. X
  381. X
  382. XEPSONlinetype(linetype)
  383. Xint linetype;
  384. X{
  385. X    if (linetype>=7)
  386. X        linetype %= 7;
  387. X    bm_line_mask = bm_pattern[linetype+2];
  388. X    bm_mask_count=0;
  389. X}
  390. X
  391. X
  392. XEPSONmove(x,y)
  393. Xunsigned int x,y;
  394. X{
  395. X    epson_x=x;
  396. X    epson_y=y;
  397. X}
  398. X
  399. X
  400. XEPSONvector(x,y)
  401. Xunsigned int x,y;
  402. X{
  403. X    bm_line(epson_x,x,epson_y,y);
  404. X    epson_x=x;
  405. X    epson_y=y;
  406. X}
  407. X
  408. X
  409. XEPSONput_text(x,y,str)
  410. Xunsigned int x, y;
  411. Xchar *str;
  412. X{
  413. X    if (epson_angle == 1)
  414. X        x += EPSONVCHAR/2;
  415. X    else
  416. X        y -= EPSONVCHAR/2;
  417. X   switch (epson_angle) {
  418. X      case 0:
  419. X         for (; *str; ++str, x += EPSONHCHAR)
  420. X            bm_putc (x, y, *str, epson_angle);
  421. X                    break;
  422. X      case 1:
  423. X         for (; *str; ++str, y += EPSONHCHAR)
  424. X            bm_putc (x, y, *str, epson_angle);
  425. X                    break;
  426. X    }
  427. X}
  428. X
  429. X
  430. Xint EPSON_text_angle(ang)
  431. Xint ang;
  432. X{
  433. X    epson_angle=ang;
  434. X    return TRUE;
  435. X}
  436. X
  437. X    
  438. XEPSONreset()
  439. X{
  440. X    bm_release();
  441. X}
  442. X
  443. X
  444. X/* and now the generic bit map graphics routines */
  445. Xbm_setup()
  446. X{
  447. X    bm_bpi = sizeof(unsigned int)*8;    /* bits (pixels) per int */
  448. X    bm_ipc = bm_ymax/bm_bpi;             /* int per column */
  449. X    bm_psize= bm_ipc * bm_xmax;         /* plane size */
  450. X    bm_free = alloc((unsigned int) 
  451. X                (sizeof(unsigned int) * bm_psize * bm_planes),
  452. X                 "screen bit map");
  453. X    bm_array = (unsigned int *) bm_free;
  454. X}
  455. X
  456. Xbm_release()
  457. X{
  458. X    (void) free(bm_free);
  459. X}
  460. X
  461. Xbm_cls(plane,fill) 
  462. Xunsigned int plane, fill;
  463. X{
  464. Xunsigned int i, offset;
  465. X    offset= plane * bm_psize;
  466. X    for (i=0;i<bm_psize;i++)
  467. X        bm_array[offset+i]=fill;
  468. X    bm_lastx=0;
  469. X    bm_lasty=0;
  470. X    bm_mask_count=0;
  471. X    bm_line_mask=0xffff;
  472. X}
  473. X
  474. Xbm_setpixel(x,y,value)
  475. Xunsigned int x,y,value;
  476. X{
  477. Xint i,shift,plane;
  478. X    i = x * bm_ipc  + y/bm_bpi;
  479. X    shift = y % bm_bpi;
  480. X    for (plane=0; plane<bm_planes; plane++) {
  481. X        bm_array[plane*bm_psize+i] = (bm_array[plane*bm_psize+i] & ~(1<<shift) )
  482. X                            | (((value>>plane)&1)<<shift);
  483. X    }
  484. X}
  485. Xbm_setmaskpixel(x,y,value)
  486. Xunsigned int x,y,value;
  487. X{
  488. X    /* dotted line generator */
  489. X    if ((bm_line_mask>>bm_mask_count)&(unsigned int)(1)) {
  490. X        bm_setpixel(x,y,value);
  491. X    }
  492. X    bm_mask_count= (bm_mask_count+1) % 16;
  493. X    bm_lastx= x;  /* last pixel set with mask */
  494. X    bm_lasty= y;
  495. X}
  496. X
  497. X
  498. X/* NOT USED
  499. Xunsigned int bm_getpixel(x,y)
  500. Xunsigned int x,y;
  501. X{
  502. Xint i,shift,plane;
  503. Xunsigned int value=0;
  504. X    i = x * bm_ipc  + y/bm_bpi;
  505. X    shift = y % bm_bpi;
  506. X    for (plane=bm_planes-1; plane>=0; plane--) {
  507. X        value<<=1;
  508. X        value = value | ((bm_array[plane*bm_psize+i]>>shift) & 1);
  509. X    }
  510. X    return value;
  511. X}
  512. X */
  513. X
  514. X
  515. Xbm_line(x1,x2,y1,y2)
  516. Xunsigned int x1,x2,y1,y2;
  517. X{
  518. Xint runcount;
  519. Xint dx,dy;
  520. Xint xinc,yinc;
  521. Xunsigned int xplot,yplot;
  522. X
  523. X    runcount=0;
  524. X    dx = abs((int)(x1)-(int)(x2));
  525. X    if (x2>x1)  xinc=  1;
  526. X    if (x2==x1) xinc=  0;
  527. X    if (x2<x1)  xinc= -1;
  528. X    dy = abs((int)(y1)-(int)(y2));
  529. X    if (y2>y1)  yinc=  1;
  530. X    if (y2==y1) yinc=  0;
  531. X    if (y2<y1)  yinc= -1;
  532. X    xplot=x1;
  533. X    yplot=y1;
  534. X    if (dx>dy) {
  535. X        /* iterate x */
  536. X        if ( (bm_line_mask==0xffff) ||
  537. X            ((xplot!=bm_lastx) && (yplot!=bm_lasty)) )
  538. X            bm_setmaskpixel(xplot,yplot,bm_value);
  539. X        while (xplot!=x2) { 
  540. X            xplot+=xinc;
  541. X            runcount+=dy;
  542. X            if (runcount>=(dx-runcount)) {
  543. X                yplot+=yinc;
  544. X                runcount-=dx;
  545. X            }
  546. X            bm_setmaskpixel(xplot,yplot,bm_value);
  547. X        } 
  548. X    } else {
  549. X        /* iterate y */
  550. X        if ( (bm_line_mask==0xffff) ||
  551. X            ((xplot!=bm_lastx) && (yplot!=bm_lasty)) )
  552. X            bm_setmaskpixel(xplot,yplot,bm_value);
  553. X        while (yplot!=y2) {
  554. X            yplot+=yinc;
  555. X            runcount+=dx;
  556. X            if (runcount>=(dy-runcount)) {
  557. X                xplot+=xinc;
  558. X                runcount-=dy;
  559. X            }
  560. X            bm_setmaskpixel(xplot,yplot,bm_value);
  561. X        } 
  562. X    }
  563. X}
  564. X
  565. Xbm_putc(x,y,c,angle)
  566. Xunsigned int x,y;
  567. Xint angle;
  568. Xchar c;
  569. X{
  570. Xint i,j,k;
  571. Xchar fc;
  572. Xunsigned int pixelon;
  573. X    i = (int)(c) - ' ';
  574. X    for (j=0; j<9; j++) {
  575. X        fc = font5x7[i][j];
  576. X        for (k=0; k<5; k++) {
  577. X            pixelon = (((unsigned int)(fc)) >> k & 1);
  578. X            if (pixelon) {
  579. X                switch(angle) {
  580. X                    case 0 : bm_setpixel(x+k+1,y+j,bm_value);
  581. X                            break;
  582. X                    case 1 : bm_setpixel(x-j,y+k+1,bm_value);
  583. X                            break;
  584. X                }
  585. X            }
  586. X        }
  587. X    }
  588. X}
  589. X
  590. X
  591. X/* output file must be binary mode for epson_dump */
  592. Xepson_dump()
  593. X{
  594. Xunsigned int x;
  595. Xint j,k;
  596. Xint num_bits = (sizeof(unsigned int)-1)*8;
  597. X#ifdef PC
  598. X    fprintf(stderr,"Dumping EPSON graphics (24kbytes)\n");
  599. X#endif
  600. X    fprintf(outfile,"\033A\010"); /* set line spacing to 8/72" = 8 dots */
  601. X    for (j=bm_ipc-1;j>=0;j--) {
  602. X        for (k=num_bits;k>=0;k-=8) {
  603. X            /* select plotter graphics mode (square pixels) */
  604. X            fprintf(outfile,"\r\n\033*\005");
  605. X            (void) fputc((char)(bm_xmax%256),outfile);
  606. X            (void) fputc((char)(bm_xmax/256),outfile);
  607. X            for (x=0; x<bm_xmax; x++) {
  608. X                (void) fputc( (char)((bm_array[x*bm_ipc+j] >>k) &0xff), outfile );
  609. X            }
  610. X        }
  611. X    }
  612. X    fprintf(outfile,"\033A\014\r\n");  /* setline spacing to 12/72" */
  613. X#ifdef PC
  614. X    fprintf(stderr,"Print using: COPY /B\n");
  615. X#endif
  616. X}
  617. X
  618. X
  619. X#endif /* EPSON */
  620. X
  621. X
  622. X#ifdef PROPRINTER
  623. X
  624. X/* This is an output routine for the IBM Proprinter. Author Maurice Castro */
  625. X/* This driver is based on the Epson driver by Russell Lang */
  626. X
  627. X/* EPSON must be defined */
  628. X
  629. X
  630. XPROPRINTERtext()
  631. X{
  632. X    proprinter_dump();
  633. X}
  634. X
  635. X
  636. X/* output file must be binary mode for proprinter_dump */
  637. Xproprinter_dump()
  638. X{
  639. Xunsigned int x;
  640. Xint j,k;
  641. Xint num_bits = (sizeof(unsigned int)-1)*8;
  642. X#ifdef PC
  643. X    fprintf(stderr,"Dumping PROPRINTER graphics (24kbytes)\n");
  644. X#endif
  645. X    for (j=bm_ipc-1;j>=0;j--) {
  646. X        for (k=num_bits;k>=0;k-=8) {
  647. X            /* select plotter graphics mode (square pixels) */
  648. X            fprintf(outfile,"\033\0112\030");
  649. X            fprintf(outfile,"\r\033*\005");
  650. X            (void) fputc((char)(bm_xmax%256),outfile);
  651. X            (void) fputc((char)(bm_xmax/256),outfile);
  652. X            for (x=0; x<bm_xmax; x++) {                         
  653. X                (void) fputc( (char)((bm_array[x*bm_ipc+j] >>k) &0xff), outfile ); 
  654. X            }  
  655. X        }
  656. X    }
  657. X#ifdef PC
  658. X    fprintf(stderr,"Print using: COPY /B\n");
  659. X#endif
  660. X}
  661. X
  662. X
  663. X#endif /* PROPRINTER */
  664. X
  665. X/* The following NEC CP6 Pinwriter driver uses generic bit mapped graphics
  666. X   routines to build up a bit map in memory. */
  667. X/* by Russell Lang, eln272v@monu1.cc.monash.oz */
  668. X/* On PC, print using 'copy file /b lpt1:', do NOT use 'print' */
  669. X/* NECinit changes outfile to binary mode for PC's */
  670. X
  671. X/* Add a Monochrome NEC printer (for faster speed and line types) jdc */
  672. X
  673. X#ifdef NEC
  674. X/* EPSON must be defined */
  675. X
  676. X#define NECXMAX    400 
  677. X#define NECYMAX    320
  678. X
  679. X#define NECXLAST (NECXMAX - 1)
  680. X#define NECYLAST (NECYMAX - 1)
  681. X
  682. X#define NECVCHAR        11      
  683. X#define NECHCHAR        7        
  684. X#define NECVTIC        6
  685. X#define NECHTIC        6
  686. X
  687. X/* plane 0=black, 1=cyan(blue), 2=magenta(red), 3=yellow */
  688. Xstatic unsigned int neccolor[] = {1,8,4,2,10,12,6,14};
  689. Xstatic unsigned int necpcolor[]= {0,2,1,4};
  690. Xunsigned int nec_x=0, nec_y=0;
  691. Xint nec_angle=0;
  692. X
  693. XNECMinit()
  694. X/* Monochrome only NEC CP6 printer (set term nec_cp6m or nec_cp6d). */
  695. X/* will probably work with NEC P6 printer */
  696. X{
  697. X    bm_planes = 1;            /* One plane only */
  698. X    nec_init();
  699. X}
  700. X
  701. X
  702. XNECCinit()
  703. X/* Color ribbon in NEC CP6 printer (set term nec_cp6c) */
  704. X{
  705. X    bm_planes=4;            /* four planes */
  706. X    nec_init();
  707. X}
  708. X
  709. X
  710. Xnec_init()
  711. X{
  712. Xchar filename[MAX_ID_LEN+1];
  713. X    bm_xmax=NECXMAX;
  714. X    bm_ymax=NECYMAX;
  715. X    bm_value=1;                /* black */
  716. X    bm_line_mask=0xffff;    /* solid lines */
  717. X    bm_setup();
  718. X    /* output for NEC must be binary to stop non Unix computers
  719. X        changing \n to \r\n. 
  720. X        At present we only do this for PC's. 
  721. X        (Ultrix generates a run time error on the "wb" mode).
  722. X        if the output is not STDOUT, then the following code 
  723. X        reopens outfile with binary mode. */
  724. X#ifdef PC
  725. X    if (strcmp(outstr,"STDOUT")) {
  726. X        (void) fclose(outfile);
  727. X        (void) strcpy(filename,outstr+1);    /* remove quotes */
  728. X        filename[strlen(filename)-1] = '\0';
  729. X        if ( (outfile = fopen(filename,"wb")) == (FILE *)NULL) {
  730. X            if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
  731. X                os_error("cannot reopen file with binary type; output unknown",
  732. X                    NO_CARET);
  733. X            } 
  734. X            else {
  735. X    os_error("cannot reopen file with binary type; output reset to ascii", 
  736. X                    NO_CARET);
  737. X            }
  738. X        }
  739. X    }
  740. X#endif
  741. X}
  742. X
  743. X
  744. XNECgraphics()
  745. X{
  746. Xunsigned int plane;
  747. Xunsigned int fill=0;
  748. X    for (plane=0; plane<bm_planes; plane++)
  749. X        bm_cls(plane,fill);
  750. X    nec_x=0;
  751. X    nec_y=0;
  752. X    nec_angle=0;
  753. X}
  754. X
  755. X
  756. XNECdraft_text()
  757. X{
  758. X    nec_draft_dump();
  759. X}
  760. X
  761. XNECtext()
  762. X{
  763. X    nec_dump();
  764. X}
  765. X
  766. X
  767. XNECMlinetype(linetype)
  768. Xint linetype;
  769. X{
  770. X    if (linetype>=7)
  771. X        linetype %= 7;
  772. X    bm_line_mask = bm_pattern[linetype+2];
  773. X    bm_mask_count=0;
  774. X}
  775. X
  776. X
  777. XNECClinetype(linetype)
  778. Xint linetype;
  779. X{
  780. X    if (linetype>=6)
  781. X        linetype %= 6;
  782. X    bm_value=neccolor[linetype+2];
  783. X}
  784. X
  785. X
  786. XNECmove(x,y)
  787. Xunsigned int x,y;
  788. X{
  789. X    nec_x=x;
  790. X    nec_y=y;
  791. X}
  792. X
  793. X
  794. XNECvector(x,y)
  795. Xunsigned int x,y;
  796. X{
  797. X    bm_line(nec_x,x,nec_y,y);
  798. X    nec_x=x;
  799. X    nec_y=y;
  800. X}
  801. X
  802. X
  803. XNECput_text(x,y,str)
  804. Xunsigned int x, y;
  805. Xchar *str;
  806. X{
  807. X    if (nec_angle == 1)
  808. X        x += NECVCHAR/2;
  809. X    else
  810. X        y -= NECVCHAR/2;
  811. X   switch (nec_angle) {
  812. X      case 0:
  813. X         for (; *str; ++str, x += NECHCHAR)
  814. X            bm_putc (x, y, *str, nec_angle);
  815. X                    break;
  816. X      case 1:
  817. X         for (; *str; ++str, y += NECHCHAR)
  818. X            bm_putc (x, y, *str, nec_angle);
  819. X                    break;
  820. X    }
  821. X}
  822. X
  823. X
  824. Xint NEC_text_angle(ang)
  825. Xint ang;
  826. X{
  827. X    nec_angle=ang;
  828. X    return TRUE;
  829. X}
  830. X
  831. X    
  832. XNECreset()
  833. X{
  834. X    bm_release();
  835. X}
  836. X
  837. X
  838. X/* output file must be binary mode for nec_dump */
  839. Xnec_dump()
  840. X{
  841. Xunsigned int x;
  842. Xunsigned int plane,offset;
  843. Xint j,k;
  844. Xint num_bits = (sizeof(unsigned int)-1)*8;
  845. Xunsigned int column8;
  846. Xunsigned long column24;
  847. Xchar column3, column2, column1;
  848. X#ifdef PC
  849. X    if (bm_planes==1)
  850. X        fprintf(stderr,"Dumping NEC CP6 graphics (142kbytes)\n");
  851. X    if (bm_planes==4)
  852. X        fprintf(stderr,"Dumping NEC CP6 graphics (565kbytes)\n");
  853. X#endif
  854. X    fprintf(outfile,"\033A\010"); /* set line spacing to 8/60" = 24 dots */
  855. X    fprintf(outfile,"\033P\033l\005");  /* 10cpi, left margin 5 char */
  856. X    for (j=bm_ipc-1;j>=0;j--) {
  857. X        for (k=num_bits;k>=0;k-=8) {
  858. X            fprintf(outfile,"\n");
  859. X            for (plane=0; plane<bm_planes; plane++) {
  860. X                offset=plane*bm_psize;
  861. X                if (bm_planes>1) {
  862. X                    /* select colour for plane */
  863. X                    fprintf(outfile,"\r\033r");
  864. X                    (void) fputc((char)necpcolor[plane],outfile);
  865. X                    fprintf(outfile,"\r");
  866. X                }
  867. X                /* select plotter graphics mode (square pixels) */
  868. X                fprintf(outfile,"\033*\047");
  869. X                (void) fputc((char)(bm_xmax*3%256),outfile);
  870. X                (void) fputc((char)(bm_xmax*3/256),outfile);
  871. X                for (x=0; x<bm_xmax; x++) {
  872. X                    column8= (bm_array[offset+x*bm_ipc+j] >>k) &0xff; 
  873. X                    column24=0;
  874. X                    if (column8&0x01) column24|=(long)0x000007;
  875. X                    if (column8&0x02) column24|=(long)0x000038;
  876. X                    if (column8&0x04) column24|=(long)0x0001c0;
  877. X                    if (column8&0x08) column24|=(long)0x000e00;
  878. X                    if (column8&0x10) column24|=(long)0x007000;
  879. X                    if (column8&0x20) column24|=(long)0x038000;
  880. X                    if (column8&0x40) column24|=(long)0x1c0000;
  881. X                    if (column8&0x80) column24|=(long)0xe00000;
  882. X                    column1 = (char) ( column24      & (long)0xff);
  883. X                    column2 = (char) ((column24>>8)  & (long)0xff);
  884. X                    column3 = (char) ((column24>>16) & (long)0xff);
  885. X                    (void) fputc(column3,outfile);
  886. X                    (void) fputc(column2,outfile);
  887. X                    (void) fputc(column1,outfile);
  888. X                    (void) fputc(column3,outfile);
  889. X                    (void) fputc(column2,outfile);
  890. X                    (void) fputc(column1,outfile);
  891. X                    (void) fputc(column3,outfile);
  892. X                    (void) fputc(column2,outfile);
  893. X                    (void) fputc(column1,outfile);
  894. X                }
  895. X            }
  896. X        }
  897. X    }
  898. X    fprintf(outfile,"\r\033l");
  899. X    (void) fputc('\0',outfile);                /* set left margin to 0 */
  900. X    if (bm_planes > 1) {
  901. X        fprintf(outfile,"\033r");
  902. X        (void) fputc('\0',outfile);                /* set color to black */
  903. X    }
  904. X    fprintf(outfile,"\033A\012\r\n");    /* setline spacing to 10/60" */
  905. X#ifdef PC
  906. X    fprintf(stderr,"Print using: COPY /B\n");
  907. X#endif
  908. X}
  909. X
  910. X/* output file must be binary mode for nec_dump */
  911. Xnec_draft_dump()
  912. X{
  913. Xunsigned int x;
  914. Xunsigned int plane,offset;
  915. Xint j,k;
  916. Xint num_bits = (sizeof(unsigned int)-1)*8;
  917. X#ifdef PC
  918. X    if (bm_planes==1)
  919. X        fprintf(stderr,"Dumping NEC CP6 graphics (17kbytes)\n");
  920. X#endif
  921. X    fprintf(outfile,"\033A\010"); /* set line spacing to 8/60" = 8 dots */
  922. X    fprintf(outfile,"\033P\033l\005\r");  /* 10cpi, left margin 5 char */
  923. X    for (j=bm_ipc-1;j>=0;j--) {
  924. X        for (k=num_bits;k>=0;k-=8) {
  925. X            fprintf(outfile,"\n");
  926. X            for (plane=0; plane<bm_planes; plane++) {
  927. X                offset=plane*bm_psize;
  928. X                if (bm_planes>1) {
  929. X                    /* select colour for plane */
  930. X                    fprintf(outfile,"\r\033r");
  931. X                    (void) fputc((char)necpcolor[plane],outfile);
  932. X                    fprintf(outfile,"\r");
  933. X                }
  934. X                /* select plotter graphics mode (square pixels) */
  935. X                fprintf(outfile,"\033*");
  936. X                (void) fputc('\0',outfile);
  937. X                (void) fputc((char)(bm_xmax%256),outfile);
  938. X                (void) fputc((char)(bm_xmax/256),outfile);
  939. X                for (x=0; x<bm_xmax; x++) {
  940. X                    (void) fputc( (char)((bm_array[offset+x*bm_ipc+j] >>k) 
  941. X                                    &0xff), outfile);
  942. X                }
  943. X            }
  944. X        }
  945. X    }
  946. X    fprintf(outfile,"\r\033l");
  947. X    (void) fputc('\0',outfile);                /* set left margin to 0 */
  948. X    if (bm_planes > 1) {
  949. X        fprintf(outfile,"\033r");
  950. X        (void) fputc('\0',outfile);                /* set color to black */
  951. X    }
  952. X    fprintf(outfile,"\033A\012\r\n");    /* setline spacing to 10/60" */
  953. X#ifdef PC
  954. X    fprintf(stderr,"Print using: COPY /B\n");
  955. X#endif
  956. X}
  957. X
  958. X#endif /* NEC */
  959. X
  960. *-*-END-of-term/epson.trm-*-*
  961. echo x - term/font5x7.trm
  962. sed 's/^X//' >term/font5x7.trm <<'*-*-END-of-term/font5x7.trm-*-*'
  963. X/* GNUPLOT - font5x7.trm */
  964. X/*
  965. X * Copyright (C) 1990   
  966. X *
  967. X * Permission to use, copy, and distribute this software and its
  968. X * documentation for any purpose with or without fee is hereby granted, 
  969. X * provided that the above copyright notice appear in all copies and 
  970. X * that both that copyright notice and this permission notice appear 
  971. X * in supporting documentation.
  972. X *
  973. X * Permission to modify the software is granted, but not the right to
  974. X * distribute the modified code.  Modifications are to be distributed 
  975. X * as patches to released version.
  976. X *  
  977. X * This software  is provided "as is" without express or implied warranty.
  978. X * 
  979. X * This file is included by ../term.c.
  980. X *
  981. X *  This file includes font information, and is included for the 
  982. X *  epson driver, and when on a PC and not using TURBO C.
  983. X *
  984. X * AUTHORS
  985. X *  Russell Lang
  986. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  987. X * 
  988. X */
  989. X
  990. X/* 5x7 font, bottom row first, left pixel in lsb */
  991. Xstatic char font5x7[96][9] = {
  992. X    /* */    {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
  993. X    /*!*/    {0x00,0x00,0x04,0x00,0x04,0x04,0x04,0x04,0x04},
  994. X    /*"*/    {0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x0A,0x0A},
  995. X    /*#*/    {0x00,0x00,0x0A,0x0A,0x1F,0x0A,0x1F,0x0A,0x0A},
  996. X    /*$*/    {0x00,0x00,0x04,0x0F,0x14,0x0E,0x05,0x1E,0x04},
  997. X    /*%*/    {0x00,0x00,0x18,0x19,0x02,0x04,0x08,0x13,0x03},
  998. X    /*&*/    {0x00,0x00,0x16,0x09,0x15,0x02,0x05,0x05,0x02},
  999. X    /*'*/    {0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x06,0x06},
  1000. X    /*(*/    {0x00,0x00,0x08,0x04,0x02,0x02,0x02,0x04,0x08},
  1001. X    /*)*/    {0x00,0x00,0x02,0x04,0x08,0x08,0x08,0x04,0x02},
  1002. X    /***/    {0x00,0x00,0x04,0x15,0x0E,0x1F,0x0E,0x15,0x04},
  1003. X    /*+*/    {0x00,0x00,0x00,0x04,0x04,0x1F,0x04,0x04,0x00},
  1004. X    /*,*/    {0x00,0x01,0x02,0x06,0x06,0x00,0x00,0x00,0x00},
  1005. X    /*-*/    {0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00},
  1006. X    /*.*/    {0x00,0x00,0x06,0x06,0x00,0x00,0x00,0x00,0x00},
  1007. X    /*/*/    {0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00},
  1008. X    /*0*/    {0x00,0x00,0x0E,0x11,0x13,0x15,0x19,0x11,0x0E},
  1009. X    /*1*/    {0x00,0x00,0x0E,0x04,0x04,0x04,0x04,0x06,0x04},
  1010. X    /*2*/    {0x00,0x00,0x1F,0x01,0x01,0x0E,0x10,0x11,0x0E},
  1011. X    /*3*/    {0x00,0x00,0x0E,0x11,0x10,0x0C,0x10,0x11,0x0E},
  1012. X    /*4*/    {0x00,0x00,0x08,0x08,0x1F,0x09,0x0A,0x0C,0x08},
  1013. X    /*5*/    {0x00,0x00,0x0E,0x11,0x10,0x10,0x0E,0x01,0x1F},
  1014. X    /*6*/    {0x00,0x00,0x0E,0x11,0x11,0x0F,0x01,0x02,0x0C},
  1015. X    /*7*/    {0x00,0x00,0x01,0x01,0x02,0x04,0x08,0x10,0x1F},
  1016. X    /*8*/    {0x00,0x00,0x0E,0x11,0x11,0x0E,0x11,0x11,0x0E},
  1017. X    /*9*/    {0x00,0x00,0x06,0x08,0x10,0x1E,0x11,0x11,0x0E},
  1018. X    /*:*/    {0x00,0x00,0x00,0x06,0x06,0x00,0x06,0x06,0x00},
  1019. X    /*;*/    {0x00,0x01,0x02,0x06,0x06,0x00,0x06,0x06,0x00},
  1020. X    /*<*/    {0x00,0x00,0x08,0x04,0x02,0x01,0x02,0x04,0x08},
  1021. X    /*=*/    {0x00,0x00,0x00,0x00,0x1F,0x00,0x1F,0x00,0x00},
  1022. X    /*>*/    {0x00,0x00,0x02,0x04,0x08,0x10,0x08,0x04,0x02},
  1023. X    /*?*/    {0x00,0x00,0x04,0x00,0x04,0x08,0x10,0x11,0x0E},
  1024. X    /*@*/    {0x00,0x00,0x0E,0x15,0x15,0x16,0x10,0x11,0x0E},
  1025. X    /*A*/    {0x00,0x00,0x11,0x11,0x1F,0x11,0x11,0x0A,0x04},
  1026. X    /*B*/    {0x00,0x00,0x0F,0x12,0x12,0x0E,0x12,0x12,0x0F},
  1027. X    /*C*/    {0x00,0x00,0x0E,0x11,0x01,0x01,0x01,0x11,0x0E},
  1028. X    /*D*/    {0x00,0x00,0x0F,0x12,0x12,0x12,0x12,0x12,0x0F},
  1029. X    /*E*/    {0x00,0x00,0x1F,0x01,0x01,0x07,0x01,0x01,0x1F},
  1030. X    /*F*/    {0x00,0x00,0x01,0x01,0x01,0x07,0x01,0x01,0x1F},
  1031. X    /*G*/    {0x00,0x00,0x1E,0x11,0x11,0x19,0x01,0x01,0x1E},
  1032. X    /*H*/    {0x00,0x00,0x11,0x11,0x11,0x1F,0x11,0x11,0x11},
  1033. X    /*I*/    {0x00,0x00,0x0E,0x04,0x04,0x04,0x04,0x04,0x0E},
  1034. X    /*J*/    {0x00,0x00,0x0E,0x11,0x10,0x10,0x10,0x10,0x10},
  1035. X    /*K*/    {0x00,0x00,0x11,0x09,0x05,0x03,0x05,0x09,0x11},
  1036. X    /*L*/    {0x00,0x00,0x1F,0x01,0x01,0x01,0x01,0x01,0x01},
  1037. X    /*M*/    {0x00,0x00,0x11,0x11,0x11,0x15,0x15,0x1B,0x11},
  1038. X    /*N*/    {0x00,0x00,0x11,0x11,0x11,0x19,0x15,0x13,0x11},
  1039. X    /*O*/    {0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x0E},
  1040. X    /*P*/    {0x00,0x00,0x01,0x01,0x01,0x0F,0x11,0x11,0x0F},
  1041. X    /*Q*/    {0x00,0x00,0x16,0x09,0x15,0x11,0x11,0x11,0x0E},
  1042. X    /*R*/    {0x00,0x00,0x11,0x09,0x05,0x0F,0x11,0x11,0x0F},
  1043. X    /*S*/    {0x00,0x00,0x0E,0x11,0x10,0x0E,0x01,0x11,0x0E},
  1044. X    /*T*/    {0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x1F},
  1045. X    /*U*/    {0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11},
  1046. X    /*V*/    {0x00,0x00,0x04,0x04,0x0A,0x0A,0x11,0x11,0x11},
  1047. X    /*W*/    {0x00,0x00,0x11,0x1B,0x15,0x11,0x11,0x11,0x11},
  1048. X    /*X*/    {0x00,0x00,0x11,0x11,0x0A,0x04,0x0A,0x11,0x11},
  1049. X    /*Y*/    {0x00,0x00,0x04,0x04,0x04,0x04,0x0A,0x11,0x11},
  1050. X    /*Z*/    {0x00,0x00,0x1F,0x01,0x02,0x04,0x08,0x10,0x1F},
  1051. X    /*[*/    {0x00,0x00,0x0E,0x02,0x02,0x02,0x02,0x02,0x0E},
  1052. X    /*\*/    {0x00,0x00,0x00,0x10,0x08,0x04,0x02,0x01,0x00},
  1053. X    /*]*/    {0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x0E},
  1054. X    /*^*/    {0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x0A,0x04},
  1055. X    /*_*/    {0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00},
  1056. X    /*`*/    {0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x0C,0x0C},
  1057. X    /*a*/    {0x00,0x00,0x1E,0x11,0x1E,0x10,0x0E,0x00,0x00},
  1058. X    /*b*/    {0x00,0x00,0x0D,0x13,0x11,0x13,0x0D,0x01,0x01},
  1059. X    /*c*/    {0x00,0x00,0x0E,0x11,0x01,0x11,0x0E,0x00,0x00},
  1060. X    /*d*/    {0x00,0x00,0x16,0x19,0x11,0x19,0x16,0x10,0x10},
  1061. X    /*e*/    {0x00,0x00,0x0E,0x01,0x1F,0x11,0x0E,0x00,0x00},
  1062. X    /*f*/    {0x00,0x00,0x04,0x04,0x04,0x0E,0x04,0x14,0x08},
  1063. X    /*g*/    {0x0E,0x11,0x10,0x16,0x19,0x19,0x16,0x00,0x00},
  1064. X    /*h*/    {0x00,0x00,0x11,0x11,0x11,0x13,0x0D,0x01,0x01},
  1065. X    /*i*/    {0x00,0x00,0x0E,0x04,0x04,0x04,0x06,0x00,0x04},
  1066. X    /*j*/    {0x0E,0x11,0x10,0x10,0x10,0x10,0x00,0x10,0x00},
  1067. X    /*k*/    {0x00,0x00,0x09,0x05,0x03,0x05,0x09,0x01,0x01},
  1068. X    /*l*/    {0x00,0x00,0x0E,0x04,0x04,0x04,0x04,0x04,0x06},
  1069. X    /*m*/    {0x00,0x00,0x15,0x15,0x15,0x15,0x0B,0x00,0x00},
  1070. X    /*n*/    {0x00,0x00,0x11,0x11,0x11,0x13,0x0D,0x00,0x00},
  1071. X    /*o*/    {0x00,0x00,0x0E,0x11,0x11,0x11,0x0E,0x00,0x00},
  1072. X    /*p*/    {0x01,0x01,0x0D,0x13,0x11,0x13,0x0D,0x00,0x00},
  1073. X    /*q*/    {0x10,0x10,0x16,0x19,0x11,0x19,0x16,0x00,0x00},
  1074. X    /*r*/    {0x00,0x00,0x01,0x01,0x01,0x13,0x0D,0x00,0x00},
  1075. X    /*s*/    {0x00,0x00,0x0F,0x10,0x0E,0x01,0x1E,0x00,0x00},
  1076. X    /*t*/    {0x00,0x00,0x08,0x14,0x04,0x04,0x1F,0x04,0x04},
  1077. X    /*u*/    {0x00,0x00,0x16,0x19,0x11,0x11,0x11,0x00,0x00},
  1078. X    /*v*/    {0x00,0x00,0x04,0x0A,0x11,0x11,0x11,0x00,0x00},
  1079. X    /*w*/    {0x00,0x00,0x0A,0x15,0x15,0x11,0x11,0x00,0x00},
  1080. X    /*x*/    {0x00,0x00,0x11,0x0A,0x04,0x0A,0x11,0x00,0x00},
  1081. X    /*y*/    {0x0E,0x11,0x10,0x1E,0x11,0x11,0x11,0x00,0x00},
  1082. X    /*z*/    {0x00,0x00,0x1F,0x02,0x04,0x08,0x1F,0x00,0x00},
  1083. X    /*{*/    {0x00,0x00,0x08,0x04,0x04,0x02,0x04,0x04,0x08},
  1084. X    /*|*/    {0x00,0x00,0x04,0x04,0x04,0x00,0x04,0x04,0x04},
  1085. X    /*}*/    {0x00,0x00,0x02,0x04,0x04,0x08,0x04,0x04,0x02},
  1086. X    /*~*/    {0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x15,0x02},
  1087. X    /*DEL*/    {0x00,0x00,0x0A,0x15,0x0A,0x15,0x0A,0x15,0x0A}
  1088. X};
  1089. *-*-END-of-term/font5x7.trm-*-*
  1090. echo x - term/hp26.trm
  1091. sed 's/^X//' >term/hp26.trm <<'*-*-END-of-term/hp26.trm-*-*'
  1092. X/* GNUPLOT - hp26.trm */
  1093. X/*
  1094. X * Copyright (C) 1990   
  1095. X *
  1096. X * Permission to use, copy, and distribute this software and its
  1097. X * documentation for any purpose with or without fee is hereby granted, 
  1098. X * provided that the above copyright notice appear in all copies and 
  1099. X * that both that copyright notice and this permission notice appear 
  1100. X * in supporting documentation.
  1101. X *
  1102. X * Permission to modify the software is granted, but not the right to
  1103. X * distribute the modified code.  Modifications are to be distributed 
  1104. X * as patches to released version.
  1105. X *  
  1106. X * This software  is provided "as is" without express or implied warranty.
  1107. X * 
  1108. X * This file is included by ../term.c.
  1109. X *
  1110. X * This terminal driver supports:
  1111. X *  HP2623A 
  1112. X *
  1113. X * AUTHORS
  1114. X *   hplvlch!ch (Chuck Heller) 
  1115. X * 
  1116. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1117. X * 
  1118. X */
  1119. X
  1120. X
  1121. X#define HP26_XMAX 512
  1122. X#define HP26_YMAX 390
  1123. X
  1124. X#define HP26_XLAST (HP26_XMAX - 1)
  1125. X#define HP26_YLAST (HP26_XMAX - 1)
  1126. X
  1127. X/* Assume a character size of 1, or a 7 x 10 grid. */
  1128. X#define HP26_VCHAR    10
  1129. X#define HP26_HCHAR    7
  1130. X#define HP26_VTIC    (HP26_YMAX/70)        
  1131. X#define HP26_HTIC    (HP26_XMAX/75)        
  1132. X
  1133. XHP26_init()
  1134. X{
  1135. X    /*    The HP2623A needs no initialization. */
  1136. X}
  1137. X
  1138. X
  1139. XHP26_graphics()
  1140. X{
  1141. X    /*    Clear and enable the display */
  1142. X
  1143. X    fputs("\033*daZ\033*dcZ",outfile);
  1144. X}
  1145. X
  1146. X
  1147. XHP26_text()
  1148. X{
  1149. X    fputs("\033*dT",outfile);    /* back to text mode */
  1150. X}
  1151. X
  1152. X
  1153. XHP26_linetype(linetype)
  1154. Xint linetype;
  1155. X{
  1156. X#define    SOLID    1
  1157. X#define LINE4    4
  1158. X#define LINE5    5
  1159. X#define LINE6    6
  1160. X#define LINE8    8
  1161. X#define    DOTS    7
  1162. X#define LINE9    9
  1163. X#define LINE10    10
  1164. X
  1165. Xstatic int map[2+9] = {    SOLID,    /* border */
  1166. X                        SOLID,    /* axes */
  1167. X                        DOTS,    /* plot 0 */
  1168. X                        LINE4,    /* plot 1 */
  1169. X                        LINE5,    /* plot 2 */
  1170. X                        LINE6,    /* plot 3 */
  1171. X                        LINE8,    /* plot 4 */
  1172. X                        LINE9,    /* plot 5 */
  1173. X                        LINE10,    /* plot 6 */
  1174. X                        SOLID,    /* plot 7 */
  1175. X                        SOLID    /* plot 8 */ };
  1176. X
  1177. X    if (linetype >= 9)
  1178. X        linetype %= 9;
  1179. X    fprintf(outfile,"\033*m%dB",map[linetype + 2]);
  1180. X}
  1181. X
  1182. X
  1183. XHP26_move(x,y)
  1184. Xint x,y;
  1185. X{
  1186. X    fprintf(outfile,"\033*pa%d,%dZ",x,y);
  1187. X}
  1188. X
  1189. X
  1190. XHP26_vector(x,y)
  1191. Xint x,y;
  1192. X{
  1193. X    fprintf(outfile,"\033*pb%d,%dZ",x,y);
  1194. X}
  1195. X
  1196. X
  1197. XHP26_put_text(x,y,str)
  1198. Xint x, y;
  1199. Xchar *str;
  1200. X{
  1201. X    HP26_move(x,y - HP26_VCHAR/2);
  1202. X    fputs("\033*dS",outfile);
  1203. X    fprintf(outfile,"\033*m3Q\033*l%s\n",str);
  1204. X    fputs("\033*dT",outfile);
  1205. X}
  1206. X
  1207. X
  1208. X
  1209. XHP26_reset()
  1210. X{
  1211. X}
  1212. X
  1213. *-*-END-of-term/hp26.trm-*-*
  1214. echo x - term/hp2648.trm
  1215. sed 's/^X//' >term/hp2648.trm <<'*-*-END-of-term/hp2648.trm-*-*'
  1216. X/* GNUPLOT -  hp2648.trm */
  1217. X/*
  1218. X * Copyright (C) 1990   
  1219. X *
  1220. X * Permission to use, copy, and distribute this software and its
  1221. X * documentation for any purpose with or without fee is hereby granted, 
  1222. X * provided that the above copyright notice appear in all copies and 
  1223. X * that both that copyright notice and this permission notice appear 
  1224. X * in supporting documentation.
  1225. X *
  1226. X * Permission to modify the software is granted, but not the right to
  1227. X * distribute the modified code.  Modifications are to be distributed 
  1228. X * as patches to released version.
  1229. X *  
  1230. X * This software  is provided "as is" without express or implied warranty.
  1231. X * 
  1232. X * This file is included by ../term.c.
  1233. X *
  1234. X * This terminal driver supports:
  1235. X *  HP2648 and HP2647
  1236. X *
  1237. X * AUTHORS
  1238. X *  Russell Lang
  1239. X * 
  1240. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1241. X * 
  1242. X */
  1243. X
  1244. X#define HP2648XMAX 720             
  1245. X#define HP2648YMAX 360
  1246. X
  1247. X#define HP2648XLAST (HP2648XMAX - 1)
  1248. X#define HP2648YLAST (HP2648YMAX - 1)
  1249. X
  1250. X#define HP2648VCHAR        12      
  1251. X#define HP2648HCHAR        7        
  1252. X#define HP2648VTIC        8
  1253. X#define HP2648HTIC        8
  1254. X
  1255. X
  1256. XHP2648init()
  1257. X{
  1258. X    fprintf(outfile,"\033*m1m1n136,1cZ");
  1259. X/*                   1     2 3     4
  1260. X    1. mode
  1261. X    2. textsize=1
  1262. X    3. textangle=1
  1263. X        4. define line type 2 to be *   *   *   * etc.
  1264. X*/
  1265. X}
  1266. X
  1267. X
  1268. XHP2648graphics()
  1269. X{
  1270. X    fprintf(outfile,"\033*dacZ");
  1271. X/*                   1     23
  1272. X    1. mode
  1273. X    2. clear grahics screen
  1274. X    3. graphics video on
  1275. X*/
  1276. X}
  1277. X
  1278. X
  1279. XHP2648text()
  1280. X{
  1281. X}
  1282. X
  1283. X
  1284. XHP2648linetype(linetype)
  1285. Xint linetype;
  1286. X{
  1287. X    static int hpline[] = {1,7,1,4,5,6,8,9,10,7,2};
  1288. X    fprintf(outfile,"\033*m%dbZ",hpline[(linetype+2)%11]);
  1289. X}
  1290. X
  1291. X
  1292. XHP2648move(x,y)
  1293. Xint x,y;
  1294. X{
  1295. X    fprintf(outfile,"\033*paf%d,%dZ",x,y);
  1296. X    /*               1     23     4
  1297. X    1    plot mode
  1298. X    2    "pen up"
  1299. X    3    goto absolute x,y
  1300. X    4    end command
  1301. X    */
  1302. X}
  1303. X
  1304. X
  1305. XHP2648vector(x,y)
  1306. Xint x,y;
  1307. X{
  1308. X    fprintf(outfile,"\033*pbf%d,%dZ",x,y);
  1309. X    /*                     1 
  1310. X    1    "pen down"
  1311. X    */
  1312. X}
  1313. X
  1314. X
  1315. XHP2648put_text(x,y,str)
  1316. Xint x, y;
  1317. Xchar *str;
  1318. X{
  1319. X    HP2648move(x,y-HP2648VCHAR/2 + 1);
  1320. X    fprintf(outfile,"\033*l%s\n",str);
  1321. X}
  1322. X
  1323. X
  1324. Xint HP2648_text_angle(ang)
  1325. Xint ang;
  1326. X{
  1327. X    fprintf(outfile,"\033*m%dnZ\n",ang+1);
  1328. X    return TRUE;
  1329. X}
  1330. X    
  1331. XHP2648reset()
  1332. X{
  1333. X}
  1334. X
  1335. *-*-END-of-term/hp2648.trm-*-*
  1336. echo x - term/hpgl.trm
  1337. sed 's/^X//' >term/hpgl.trm <<'*-*-END-of-term/hpgl.trm-*-*'
  1338. X/* GNUPLOT - hpgl.trm */
  1339. X/*
  1340. X * Copyright (C) 1990   
  1341. X *
  1342. X * Permission to use, copy, and distribute this software and its
  1343. X * documentation for any purpose with or without fee is hereby granted, 
  1344. X * provided that the above copyright notice appear in all copies and 
  1345. X * that both that copyright notice and this permission notice appear 
  1346. X * in supporting documentation.
  1347. X *
  1348. X * Permission to modify the software is granted, but not the right to
  1349. X * distribute the modified code.  Modifications are to be distributed 
  1350. X * as patches to released version.
  1351. X *  
  1352. X * This software  is provided "as is" without express or implied warranty.
  1353. X * 
  1354. X * This file is included by ../term.c.
  1355. X *
  1356. X * This terminal driver supports:
  1357. X *  hpgl, hp7580b
  1358. X *
  1359. X * AUTHORS
  1360. X *  Colin Kelley, Thomas Williams, Russell Lang
  1361. X * 
  1362. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1363. X * 
  1364. X */
  1365. X
  1366. X#define HPGL_XMAX 15200
  1367. X#define HPGL_YMAX 10000
  1368. X
  1369. X#define HPGL_XLAST (HPGL_XMAX - 1)
  1370. X#define HPGL_YLAST (HPGL_XMAX - 1)
  1371. X
  1372. X/* HPGL_VCHAR, HPGL_HCHAR  are not used */
  1373. X#define HPGL_VCHAR    (int)(HPGL_YMAX*0.032+0.5) /* 3.2% */
  1374. X#define HPGL_HCHAR    (int)(HPGL_XMAX*0.012+0.5) /* 1.2% */
  1375. X#define HPGL_VTIC    (HPGL_YMAX/70)        
  1376. X#define HPGL_HTIC    (HPGL_YMAX/70)        
  1377. X
  1378. Xint HPGL_ang = 0;
  1379. X
  1380. XHPGL_init()
  1381. X{
  1382. X}
  1383. X
  1384. X
  1385. XHPGL_graphics()
  1386. X{
  1387. X    fputs("\033.Y\n",outfile);
  1388. X/*           1
  1389. X    1. enable eavesdropping
  1390. X*/
  1391. X    fprintf(outfile,
  1392. X    "IN;\nSC0,%d,0,%d;\nSR%f,%f;\n",
  1393. X        HPGL_XMAX,HPGL_YMAX,
  1394. X        ((float)(HPGL_HCHAR)*200/3/HPGL_XMAX),
  1395. X        ((float)(HPGL_VCHAR)*100/2/HPGL_YMAX) );
  1396. X/*     1    2             3 
  1397. X    1. reset to power-up defaults
  1398. X    2. set SCaling
  1399. X    3. set character size
  1400. X*/
  1401. X    HPGL_ang = 0;
  1402. X}
  1403. X
  1404. X
  1405. XHPGL_text()
  1406. X{
  1407. X    fputs("PU;\nSP0;\n\033.Z\0",outfile);
  1408. X/*           1    2     3
  1409. X    1. pen up
  1410. X    2. park pen
  1411. X    3. disable eavesdropping
  1412. X*/
  1413. X}
  1414. X
  1415. X
  1416. XHPGL_linetype(linetype)
  1417. Xint linetype;
  1418. X{
  1419. X/* allow for 6 pens */
  1420. X    fprintf(outfile,"PU;\nSP%d;\n",(linetype+2)%6+1); 
  1421. X}
  1422. X
  1423. X
  1424. XHP75_linetype(linetype)
  1425. Xint linetype;
  1426. X{
  1427. X/* allow for 4 pens */
  1428. X    fprintf(outfile,"PU;\nSP%d;\n",(linetype+2)%4+1); 
  1429. X}
  1430. X
  1431. X
  1432. X/* some early HPGL plotters (e.g. HP7220C) require the
  1433. X * Pen Up/Down and Pen (move) Absolute commands to be separate
  1434. X */
  1435. XHPGL_move(x,y)
  1436. Xint x,y;
  1437. X{
  1438. X    fprintf(outfile,"PU;PA%d,%d;\n",x,y);
  1439. X}
  1440. X
  1441. X
  1442. XHPGL_vector(x,y)
  1443. Xint x,y;
  1444. X{
  1445. X    fprintf(outfile,"PD;PA%d,%d;\n",x,y);
  1446. X}
  1447. X
  1448. X
  1449. XHPGL_put_text(x,y,str)
  1450. Xint x, y;
  1451. Xchar *str;
  1452. X{
  1453. X    if (HPGL_ang == 1)
  1454. X        HPGL_move(x + HPGL_VCHAR/4,y);
  1455. X    else
  1456. X        HPGL_move(x,y - HPGL_VCHAR/4);
  1457. X    fprintf(outfile,"LB%s\003\n",str);
  1458. X}
  1459. X
  1460. X
  1461. Xint HPGL_text_angle(ang)
  1462. Xint ang;
  1463. X{
  1464. X    HPGL_ang = ang;
  1465. X    if (ang == 1)
  1466. X        /* vertical */
  1467. X        fprintf(outfile,"DI0,1;\n");
  1468. X    else
  1469. X        /* horizontal */
  1470. X        fprintf(outfile,"DI1,0;\n");
  1471. X    return TRUE;
  1472. X}
  1473. X
  1474. X
  1475. XHPGL_reset()
  1476. X{
  1477. X}
  1478. X
  1479. *-*-END-of-term/hpgl.trm-*-*
  1480. echo x - term/hpljet.trm
  1481. sed 's/^X//' >term/hpljet.trm <<'*-*-END-of-term/hpljet.trm-*-*'
  1482. X/* GNUPLOT - hpljet.trm */
  1483. X/*
  1484. X * Copyright (C) 1990   
  1485. X *
  1486. X * Permission to use, copy, and distribute this software and its
  1487. X * documentation for any purpose with or without fee is hereby granted, 
  1488. X * provided that the above copyright notice appear in all copies and 
  1489. X * that both that copyright notice and this permission notice appear 
  1490. X * in supporting documentation.
  1491. X *
  1492. X * Permission to modify the software is granted, but not the right to
  1493. X * distribute the modified code.  Modifications are to be distributed 
  1494. X * as patches to released version.
  1495. X *  
  1496. X * This software  is provided "as is" without express or implied warranty.
  1497. X * 
  1498. X * This file is included by ../term.c.
  1499. X *
  1500. X * This terminal driver supports:
  1501. X *  Hewlett-Packard Laserjet
  1502. X *
  1503. X * AUTHORS
  1504. X *  Jyrki Yli-Nokari (jty@intrin.UUCP)
  1505. X *
  1506. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1507. X * 
  1508. X */
  1509. X
  1510. X/*
  1511. X** Hewlett-Packard Laserjet
  1512. X** Driver written and copyrighted 1987 by
  1513. X** Jyrki Yli-Nokari (jty@intrin.UUCP)
  1514. X** Intrinsic, Ltd.
  1515. X** 
  1516. X** You may use this code for anything you like as long as
  1517. X** you are not selling it and the credit is given and
  1518. X** this message retained.
  1519. X*/
  1520. X
  1521. X/*
  1522. X** The driver consists of two parts: general raster plotting routines
  1523. X** (#ifdef RASTER) and the laserjet driver using them (#ifdef HPLJET).
  1524. X**
  1525. X** The laserjet driver contains actually three different "terminal types":
  1526. X** laserjet1, laserjet2 and laserjet3. The difference between them is the size
  1527. X** of the picture; "laserjet3" being the biggest.
  1528. X*/
  1529. X
  1530. X
  1531. X#ifdef HPLJET
  1532. X#define RASTER
  1533. X#endif /* HPLJET */
  1534. X
  1535. X#ifdef RASTER
  1536. X/*
  1537. X** General raster plotting routines.
  1538. X** Raster routines written and copyrighted 1987 by
  1539. X** Jyrki Yli-Nokari (jty@intrin.UUCP)
  1540. X** Intrinsic, Ltd.
  1541. X** 
  1542. X** You may use this code for anything you like as long as
  1543. X** you are not selling it and the credit is given and
  1544. X** this message retained.
  1545. X**
  1546. X** The plotting area is defined as a huge raster.
  1547. X** The raster is stored in a dynamically allocated pixel array r_p
  1548. X**
  1549. X** The raster is allocated (and initialized to zero) with
  1550. X** r_makeraster(xsize, ysize)
  1551. X** and freed with r_freeraster()
  1552. X**
  1553. X** Valid (unsigned) coordinates range from zero to (xsize-1,ysize-1)
  1554. X**
  1555. X** Plotting is done via r_move(x, y) and r_draw(x, y, value) functions,
  1556. X** where the point (x,y) is the target to go from the current point
  1557. X** and value is the value (of type pixel) to be stored in every pixel.
  1558. X**
  1559. X** Internally all plotting goes through r_setpixel(x, y, val).
  1560. X** If you want different plotting styles (like OR, XOR...), use "value"
  1561. X** in r_draw() to mark different styles and change r_setpixel() accordingly.
  1562. X*/
  1563. X
  1564. X#define IN(i,size)    ((unsigned)i < (unsigned)size)
  1565. Xtypedef char pixel;    /* the type of one pixel in raster */
  1566. Xtypedef pixel *raster[];    /* the raster */
  1567. X
  1568. Xstatic raster *r_p;    /* global pointer to raster */
  1569. Xstatic unsigned r_currx, r_curry;    /* the current coordinates */
  1570. Xstatic unsigned r_xsize, r_ysize;    /* the size of the raster */
  1571. X
  1572. X/*
  1573. X** set pixel (x, y, val) to value val (this can be 1/0 or a color number).
  1574. X*/
  1575. Xvoid
  1576. Xr_setpixel(x, y, val)
  1577. Xunsigned x, y;
  1578. Xpixel val;
  1579. X{
  1580. X    if (IN(x, r_xsize) && IN(y, r_ysize)) {
  1581. X        *(((*r_p)[y]) + x) = val;
  1582. X    }
  1583. X#ifdef RASTERDEBUG
  1584. X    else {
  1585. X        fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n", x, y, val);
  1586. X    }
  1587. X#endif
  1588. X}
  1589. X
  1590. X/*
  1591. X** get pixel (x,y) value
  1592. X*/
  1593. Xpixel
  1594. Xr_getpixel(x, y)
  1595. Xunsigned x, y;
  1596. X{
  1597. X    if (IN(x, r_xsize) && IN(y, r_ysize)) {
  1598. X        return *(((*r_p)[y]) + x);
  1599. X    } else {
  1600. X#ifdef RASTERDEBUG
  1601. X        fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n", x, y);
  1602. X#endif
  1603. X        return 0;
  1604. X    }
  1605. X}
  1606. X
  1607. X/*
  1608. X** allocate the raster
  1609. X*/
  1610. Xvoid
  1611. Xr_makeraster(x, y)
  1612. Xunsigned x, y;
  1613. X{
  1614. X    register unsigned j;
  1615. X    
  1616. X    /* allocate row pointers */
  1617. X    r_p = (raster *)alloc(y * sizeof(pixel *), "raster buffer");
  1618. X    bzero(r_p, y * sizeof(pixel *));
  1619. X    for (j = 0; j < y; j++) {
  1620. X        (*r_p)[j] = (pixel *)alloc(x * sizeof(pixel), "raster buffer");
  1621. X        bzero((*r_p)[j], x * sizeof(pixel));
  1622. X    }
  1623. X    r_xsize = x; r_ysize = y;
  1624. X    r_currx = r_curry = 0;
  1625. X}
  1626. X    
  1627. X/*
  1628. X** plot a line from (x0,y0) to (x1,y1) with color val.
  1629. X*/
  1630. Xvoid
  1631. Xr_plot(x0, y0, x1, y1, val)
  1632. Xunsigned x0, y0, x1, y1;
  1633. Xpixel val;
  1634. X{
  1635. X    unsigned hx, hy, i;
  1636. X    int e, dx, dy;
  1637. X
  1638. X    hx = abs((int)(x1 - x0));
  1639. X    hy = abs((int)(y1 - y0));
  1640. X    dx = (x1 > x0) ? 1 : -1;
  1641. X    dy = (y1 > y0) ? 1 : -1;
  1642. X    
  1643. X    if (hx > hy) {
  1644. X        /*
  1645. X        ** loop over x-axis
  1646. X        */
  1647. X        e = hy + hy - hx;
  1648. X        for (i = 0; i <= hx; i++) {
  1649. X            r_setpixel(x0, y0, val);
  1650. X            if (e > 0) {
  1651. X                y0 += dy;
  1652. X                e += hy + hy - hx - hx;
  1653. X            } else {
  1654. X                e += hy + hy;
  1655. X            }
  1656. X            x0 += dx;
  1657. X        }
  1658. X    } else {
  1659. X        /*
  1660. X        ** loop over y-axis
  1661. X        */
  1662. X        e = hx + hx - hy;
  1663. X        for (i = 0; i <= hy; i++) {
  1664. X            r_setpixel(x0, y0, val);
  1665. X            if (e > 0) {
  1666. X                x0 += dx;
  1667. X                e += hx + hx - hy - hy;
  1668. X            } else {
  1669. X                e += hx + hx;
  1670. X            }
  1671. X            y0 += dy;
  1672. X        }
  1673. X    }
  1674. X}
  1675. X
  1676. X/*
  1677. X** move to (x,y)
  1678. X*/
  1679. Xvoid
  1680. Xr_move(x, y)
  1681. Xunsigned x, y;
  1682. X{
  1683. X    r_currx = x;
  1684. X    r_curry = y;
  1685. X}
  1686. X
  1687. X/*
  1688. X** draw to (x,y) with color val
  1689. X** (move pen down)
  1690. X*/
  1691. Xvoid
  1692. Xr_draw(x, y, val)
  1693. Xunsigned x, y;
  1694. Xpixel val;
  1695. X{
  1696. X    r_plot(r_currx, r_curry, x, y, val);
  1697. X    r_currx = x;
  1698. X    r_curry = y;
  1699. X}
  1700. X
  1701. X/*
  1702. X** free the allocated raster
  1703. X*/
  1704. Xvoid
  1705. Xr_freeraster()
  1706. X{
  1707. X    int y;
  1708. X
  1709. X    for (y = 0; y < r_ysize; y++) {
  1710. X        (void) free((char *)(*r_p)[y]);
  1711. X    }
  1712. X    (void) free((char *)r_p);
  1713. X}
  1714. X#endif /* RASTER */
  1715. X
  1716. X
  1717. X
  1718. X/*
  1719. X** NOTE:
  1720. X** When sending the plot to the laserjet there must be absolutely
  1721. X** NO character translation done by the operating system.
  1722. X** Normally, in UNIX, the (operating system) terminal driver
  1723. X** translates newlines to CR/LF pairs. This is called the "cooked mode".
  1724. X** Some operating systems might add CR/LF pairs if they think there
  1725. X** is a too long line. ALL THIS IS STRICTLY PROHIBITED.
  1726. X** ALL DATA TO THE LASERJET MUST BE SENT WHEN THE LINE IS IN RAW MODE.
  1727. X**
  1728. X
  1729. X/*
  1730. X** The laserjet math is a pain since we have to deal with
  1731. X** decipoints (720/inch), dots (300/inch), pixels (100-300/inch),
  1732. X** characters (10/inch horiz., 6/inch vertic.) and the size of
  1733. X** the plottable surface in A4 (about 7.8 inches horizontally).
  1734. X** On top of this we also support different plot sizes!
  1735. X*/
  1736. X
  1737. X#define HPLJET_PIXSIZE    (hpljet_pixel)
  1738. X        /* Laserjet pixel size in laserjet minimum dots */
  1739. X#define HPLJET_PPI (300/HPLJET_PIXSIZE)
  1740. X        /* Laserjet raster scaling factor, Pixels Per Inch */
  1741. X#define HPLJET_WIDTH 5600
  1742. X        /* ~ Number of horizontal decipoints in A4 */
  1743. X#define HPLJET_IN2DP(x) (720*(x))
  1744. X        /* convert INches TO DeciPoints */
  1745. X#define HPLJET_PX2DP(x) (HPLJET_IN2DP(x)/HPLJET_PPI)
  1746. X        /* convert PiXels TO DeciPoints */
  1747. X#define HPLJET_HC2DP(x) (72*(x))
  1748. X        /* convert Horizontal Characters TO DeciPoints */
  1749. X#define HPLJET_VC2DP(x) (120*(x))
  1750. X        /* convert Vertical Characters TO DeciPoints */
  1751. X#define HPLJET_LMARG ((HPLJET_WIDTH - HPLJET_PX2DP(HPLJETXMAX))/2)
  1752. X        /* Picture left margin in decipoints */
  1753. X#define HPLJET_RMARG ((HPLJET_WIDTH + HPLJET_PX2DP(HPLJETXMAX))/2)
  1754. X        /* Picture right margin in decipoints */
  1755. X#define HPLJETXMAX 640
  1756. X        /* Number of pixels in X-axis */
  1757. X#define HPLJETYMAX 640
  1758. X        /* Number of pixels in Y-axis */
  1759. X#define HPLJETXLAST (HPLJETXMAX - 1)
  1760. X        /* Last valid X-pixel value */
  1761. X#define HPLJETYLAST (HPLJETYMAX - 1)
  1762. X        /* Last valid Y-pixel value */
  1763. X
  1764. X#define HPLJETVCHAR    (HPLJET_PPI/6)
  1765. X        /* Vertical pixel size of the character font */
  1766. X#define HPLJETHCHAR    (HPLJET_PPI/10)
  1767. X        /* Horizontal pixel size of the character font */
  1768. X#define HPLJET1VCHAR    (300/6)
  1769. X        /* Vertical pixel size of the character font */
  1770. X#define HPLJET1HCHAR    (300/10)
  1771. X        /* Horizontal pixel size of the character font */
  1772. X#define HPLJET2VCHAR    (150/6)
  1773. X        /* Vertical pixel size of the character font */
  1774. X#define HPLJET2HCHAR    (150/10)
  1775. X        /* Horizontal pixel size of the character font */
  1776. X#define HPLJET3VCHAR    (100/6)
  1777. X        /* Vertical pixel size of the character font */
  1778. X#define HPLJET3HCHAR    (100/10)
  1779. X        /* Horizontal pixel size of the character font */
  1780. X/*
  1781. X** (I guess) VTIC and HTIC are used as
  1782. X** "small units that look like equal length".
  1783. X** They determine (at least) the length of "bars" in axises and
  1784. X** the size of plotting symbols.
  1785. X*/
  1786. X#define HPLJETVTIC        6
  1787. X#define HPLJETHTIC        6
  1788. X
  1789. X/*
  1790. X** We use laserjet1, laserjet2 and laserjet3 for different
  1791. X** pixel sizes of the picture (1 is the smallest).
  1792. X** The size of the text, however, remains the same.
  1793. X** These three terminal types use mostly the same
  1794. X** functions, only the init-function determines the size of the picture.
  1795. X** Also, the h_char and v_char are different, but they are
  1796. X** not used.
  1797. X*/
  1798. X
  1799. X/*
  1800. X** Initialize (once) for graphics
  1801. X*/
  1802. Xstatic int hpljet_pixel = 3;
  1803. X
  1804. XHPLJET1init()
  1805. X{
  1806. X    hpljet_pixel = 1;
  1807. X}
  1808. X
  1809. XHPLJET2init()
  1810. X{
  1811. X    hpljet_pixel = 2;
  1812. X}
  1813. X
  1814. XHPLJET3init()
  1815. X{
  1816. X    hpljet_pixel = 3;
  1817. X}
  1818. X
  1819. XHPLJETmove(x, y)
  1820. X{
  1821. X    r_move((unsigned)x, (unsigned)y);
  1822. X}
  1823. X
  1824. XHPLJETvector(x, y)
  1825. X{
  1826. X    r_draw((unsigned)x, (unsigned)y, (pixel)1);
  1827. X}
  1828. X
  1829. X/*
  1830. X** Enter graphics mode:
  1831. X**    - allocate raster buffer
  1832. X**    - set resolution
  1833. X*/
  1834. XHPLJETgraphics()
  1835. X{
  1836. X    r_makeraster(HPLJETXMAX, HPLJETYMAX);
  1837. X    fprintf(outfile,"\033*t%dR", HPLJET_PPI);
  1838. X/*                                 1
  1839. X**    1. Set resolution pixels/inch
  1840. X*/
  1841. X}
  1842. X
  1843. X/*
  1844. X** (re-)enter text mode,
  1845. X** output raster and deallocate it.
  1846. X*/
  1847. XHPLJETtext()
  1848. X{
  1849. X    int x, y;
  1850. X    unsigned v, i;
  1851. X
  1852. X    fprintf(outfile, "\033&a%dH\033&a%dV", HPLJET_LMARG, HPLJET_VC2DP(2));
  1853. X    fprintf(outfile, "\033*r1A");
  1854. X    for (y = r_ysize-1; y >= 0; y--) {
  1855. X        fprintf(outfile, "\033*b%dW", r_xsize/8);
  1856. X        for (x = 0; x < r_xsize; x += 8) {
  1857. X            v = 0;
  1858. X            for (i = 0; i < 8; i++) {
  1859. X                v = (v << 1) | r_getpixel((unsigned)x + i, (unsigned)y);
  1860. X            }
  1861. X            putc((char)v, outfile);
  1862. X        }
  1863. X    }
  1864. X    r_freeraster();
  1865. X    fprintf(outfile, "\033*rB\f");
  1866. X}
  1867. X
  1868. X/*
  1869. X** Select line type [-2:8]
  1870. X** line types:
  1871. X**    -2 = border line
  1872. X**    -1 = x/y axis line
  1873. X**    0-8 = function plot lines.
  1874. X**    Dummy function here.
  1875. X*/
  1876. XHPLJETlinetype(linetype)
  1877. Xint linetype;
  1878. X{
  1879. X}
  1880. X
  1881. X/* put_text was added by Russell Lang, eln272v@monu1.cc.monash.oz
  1882. X * IT IS UNTESTED
  1883. X */
  1884. X/* Put text "str" at pixel position x,y
  1885. X**/
  1886. XHPLJETput_text(x,y,str)
  1887. Xunsigned x,y;
  1888. Xchar str[];
  1889. X{
  1890. X    fprintf(outfile, "\033&a%dH\033&a%dV",
  1891. X            HPLJET_PX2DP(x), HPLJET_PX2DP(y) );
  1892. X    fputs(str, outfile);
  1893. X}
  1894. X    
  1895. X
  1896. X/*
  1897. X** Put text "str" to the lower right corner of the screen.
  1898. X** "row" is the row number [0:1].
  1899. X** Actually in the laserjet, put the text above the upper right corner.
  1900. X*/
  1901. XHPLJETlrput_text(row,str)
  1902. Xunsigned int row;
  1903. Xchar str[];
  1904. X{
  1905. X    
  1906. X    fprintf(outfile, "\033&a%dH\033&a%dV",
  1907. X            HPLJET_RMARG - HPLJET_HC2DP(strlen(str)), HPLJET_VC2DP(row));
  1908. X    fputs(str, outfile);
  1909. X}
  1910. X
  1911. X/*
  1912. X** Put text "str" to the upper left corner of the screen.
  1913. X** "row" is the (serial) number of function to be plotted.
  1914. X** Actually in the laserjet, put the text under the lower left corner.
  1915. X*/
  1916. XHPLJETulput_text(row,str)
  1917. Xunsigned int row;
  1918. Xchar str[];
  1919. X{
  1920. X    fprintf(outfile, "\033&a%dH\033&a%dV",
  1921. X            HPLJET_LMARG,
  1922. X            HPLJET_VC2DP(row+3)+HPLJET_PX2DP(HPLJETYMAX));
  1923. X    fputs(str, outfile);
  1924. X}
  1925. X
  1926. X/*
  1927. X** RETURN to normal mode (exit gnuplot)
  1928. X*/
  1929. XHPLJETreset()
  1930. X{
  1931. X}
  1932. X
  1933. *-*-END-of-term/hpljet.trm-*-*
  1934. echo x - term/iris4d.trm
  1935. sed 's/^X//' >term/iris4d.trm <<'*-*-END-of-term/iris4d.trm-*-*'
  1936. X/* GNUPLOT - iris4d.trm */
  1937. X/*
  1938. X * Copyright (C) 1990   
  1939. X *
  1940. X * Permission to use, copy, and distribute this software and its
  1941. X * documentation for any purpose with or without fee is hereby granted, 
  1942. X * provided that the above copyright notice appear in all copies and 
  1943. X * that both that copyright notice and this permission notice appear 
  1944. X * in supporting documentation.
  1945. X *
  1946. X * Permission to modify the software is granted, but not the right to
  1947. X * distribute the modified code.  Modifications are to be distributed 
  1948. X * as patches to released version.
  1949. X *  
  1950. X * This software  is provided "as is" without express or implied warranty.
  1951. X * 
  1952. X * This file is included by ../term.c.
  1953. X *
  1954. X * This terminal driver supports:
  1955. X *   IRIS terminals
  1956. X *
  1957. X * AUTHORS
  1958. X *   John H. Merritt 
  1959. X *           (Applied Research Corporation) 7/1/89
  1960. X *           INTERNET: merritt@iris613.gsfc.nasa.gov
  1961. X * 
  1962. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1963. X * 
  1964. X */
  1965. X
  1966. X#include <gl.h>
  1967. X#define IRIS4D_XMAX 1024
  1968. X#define IRIS4D_YMAX 1024
  1969. X
  1970. X#define IRIS4D_XLAST (IRIS4D_XMAX - 1)
  1971. X#define IRIS4D_YLAST (IRIS4D_YMAX - 1)
  1972. X
  1973. X#define IRIS4D_VCHAR (IRIS4D_YMAX/30)
  1974. X#define IRIS4D_HCHAR (IRIS4D_XMAX/72)
  1975. X#define IRIS4D_VTIC (IRIS4D_YMAX/80)
  1976. X#define IRIS4D_HTIC (IRIS4D_XMAX/80)
  1977. X
  1978. XIRIS4D_init()
  1979. X{
  1980. X  foreground();
  1981. X  winopen("Gnuplot");
  1982. X  deflinestyle(1, 0x3FFF); /* Long dash */
  1983. X  deflinestyle(2, 0x5555); /* dotted */
  1984. X  deflinestyle(3, 0x3333); /* short dash */
  1985. X  deflinestyle(4, 0xB5AD); /* dotdashed */
  1986. X  return;
  1987. X}
  1988. X
  1989. XIRIS4D_graphics()
  1990. X{
  1991. X  reshapeviewport();
  1992. X  ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
  1993. X  color(WHITE);
  1994. X  clear();
  1995. X  
  1996. X  return;
  1997. X}
  1998. X
  1999. XIRIS4D_text()
  2000. X{
  2001. X  return; /* enter text from another window!!! */
  2002. X}
  2003. X
  2004. XIRIS4D_linetype(linetype)
  2005. Xint linetype;
  2006. X{
  2007. X  static int pen_color[5] = {1, 2, 3, 4, 5};
  2008. X  
  2009. X  linetype = linetype % 5;
  2010. X  color((Colorindex) pen_color[linetype]);
  2011. X  setlinestyle(linetype);
  2012. X  return;
  2013. X}
  2014. X
  2015. XIRIS4D_move(x, y)
  2016. Xunsigned int x, y;
  2017. X{
  2018. X  move2i(x, y);
  2019. X  return;
  2020. X}
  2021. X
  2022. XIRIS4D_cmove(x, y)
  2023. Xunsigned int x, y;
  2024. X{
  2025. X  cmov2i(x, y);
  2026. X  return;
  2027. X}
  2028. X
  2029. XIRIS4D_vector(x, y)
  2030. Xunsigned x, y;
  2031. X{
  2032. X  draw2i(x, y);
  2033. X  return;
  2034. X}
  2035. X
  2036. X
  2037. XIRIS4D_put_text(x,y,str)
  2038. Xint x, y;
  2039. Xchar *str;
  2040. X{
  2041. X  IRIS4D_cmove(x,y - IRIS4D_VCHAR/2);
  2042. X  charstr(str);
  2043. X  return;
  2044. X}
  2045. X
  2046. X
  2047. XIRIS4D_reset()
  2048. X{
  2049. X  return;
  2050. X}
  2051. X
  2052. *-*-END-of-term/iris4d.trm-*-*
  2053. echo x - term/sun.trm
  2054. sed 's/^X//' >term/sun.trm <<'*-*-END-of-term/sun.trm-*-*'
  2055. X/* GNUPLOT - sun.trm */
  2056. X/*
  2057. X * Copyright (C) 1990   
  2058. X *
  2059. X * Permission to use, copy, and distribute this software and its
  2060. X * documentation for any purpose with or without fee is hereby granted, 
  2061. X * provided that the above copyright notice appear in all copies and 
  2062. X * that both that copyright notice and this permission notice appear 
  2063. X * in supporting documentation.
  2064. X *
  2065. X * Permission to modify the software is granted, but not the right to
  2066. X * distribute the modified code.  Modifications are to be distributed 
  2067. X * as patches to released version.
  2068. X *  
  2069. X * This software  is provided "as is" without express or implied warranty.
  2070. X * 
  2071. X * This file is included by ../term.c.
  2072. X *
  2073. X * This terminal driver supports:
  2074. X *   SUNview windowing system
  2075. X *
  2076. X * AUTHORS
  2077. X *  Maurice Castro
  2078. X * 
  2079. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  2080. X * 
  2081. X */
  2082. X
  2083. X#include <suntool/sunview.h>
  2084. X#include <suntool/canvas.h>
  2085. X#include <suntool/scrollbar.h>
  2086. X#include <suntool/panel.h>
  2087. X#include <pixrect/pixrect_hs.h>
  2088. X
  2089. X#define SUN_XMAX 600
  2090. X#define SUN_YMAX 512
  2091. X
  2092. X#define SUN_VCHAR (12)        /* default, will be changed */
  2093. X#define SUN_HCHAR (8)        /* default, will be changed */
  2094. X#define SUN_VTIC (SUN_YMAX/80)
  2095. X#define SUN_HTIC (SUN_XMAX/80)
  2096. X#define MARGIN 5
  2097. X#define MINWIN 128
  2098. X
  2099. Xstatic Frame frame;
  2100. Xstatic Canvas canvas;
  2101. Xstatic Pixwin *pw;
  2102. Xstatic struct pixfont *sun_font = NULL;
  2103. X
  2104. Xstatic enum JUSTIFY sun_justify=LEFT;
  2105. X
  2106. Xstatic Notify_value local_notice_destroy();
  2107. X
  2108. Xextern Notify_error notify_dispatch();
  2109. X  
  2110. X/* dotted line generator */
  2111. Xunsigned int sun_value = 1;    /* this can be used for colour */
  2112. Xunsigned int sun_line_mask = 0xffff;    /* 16 bit mask for dotted lines */
  2113. Xstatic unsigned int sun_pattern[] = {0xffff, 0x1111,
  2114. X    0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
  2115. Xint sun_mask_count = 0;
  2116. Xunsigned int sun_lastx, sun_lasty;    /* last pixel set - used by sun_line */
  2117. X
  2118. X
  2119. XSUN_init()
  2120. X{
  2121. X  struct termentry *t = &term_tbl[term];
  2122. X  struct pr_subregion bound;
  2123. X
  2124. X  frame = window_create(NULL, FRAME, 
  2125. X            FRAME_LABEL,               "Gnuplot",
  2126. X            0);
  2127. X  notify_interpose_destroy_func(frame,local_notice_destroy);
  2128. X  canvas = window_create(frame, CANVAS,
  2129. X            CANVAS_AUTO_EXPAND,        TRUE,
  2130. X            CANVAS_AUTO_SHRINK,        TRUE,
  2131. X            CANVAS_MARGIN,             MARGIN,
  2132. X            0);
  2133. X  notify_do_dispatch();
  2134. X  pw = canvas_pixwin(canvas);
  2135. X  window_set(frame, WIN_SHOW, TRUE, 0);
  2136. X
  2137. X  /* figure out font and rough size */
  2138. X  sun_font = pf_default();
  2139. X  pf_textbound(&bound, 1, sun_font, "M");
  2140. X  t->v_char = bound.size.y;
  2141. X  t->h_char = bound.size.x;
  2142. X
  2143. X  return;
  2144. X}
  2145. X
  2146. XSUN_graphics()
  2147. X{
  2148. X  term_tbl[term].xmax = (int) window_get(canvas,CANVAS_WIDTH);
  2149. X  term_tbl[term].ymax = (int) window_get(canvas,CANVAS_HEIGHT);
  2150. X  pw_writebackground(pw,0,0,term_tbl[term].xmax, term_tbl[term].ymax, PIX_SRC );
  2151. X  notify_dispatch();
  2152. X  /* do not let the user make the window too small */
  2153. X  if ((term_tbl[term].xmax)<MINWIN)
  2154. X  {
  2155. X      window_set(frame,
  2156. X            WIN_WIDTH,                MINWIN+2*MARGIN+24,
  2157. X            0);
  2158. X      notify_dispatch();
  2159. X      SUN_graphics();
  2160. X      }
  2161. X  if ((term_tbl[term].ymax) <MINWIN)
  2162. X  {
  2163. X      window_set(frame,
  2164. X            WIN_HEIGHT,               MINWIN+2*MARGIN+24,
  2165. X            0);
  2166. X      notify_dispatch();
  2167. X      SUN_graphics();
  2168. X      }
  2169. X  notify_dispatch();
  2170. X  return;
  2171. X}
  2172. X
  2173. XSUN_text()
  2174. X{
  2175. X  notify_dispatch();
  2176. X  return; /* enter text from another window!!! */
  2177. X}
  2178. X
  2179. XSUN_linetype(linetype)
  2180. Xint linetype;
  2181. X{
  2182. X    if (linetype>=7)
  2183. X        linetype %= 7;
  2184. X    sun_line_mask = sun_pattern[linetype+2];
  2185. X    sun_mask_count=0;
  2186. X}
  2187. X
  2188. X
  2189. XSUN_move(x, y)
  2190. Xunsigned int x, y;
  2191. X{
  2192. X  sun_lastx = x;
  2193. X  sun_lasty = y;
  2194. X  notify_dispatch();
  2195. X  return;
  2196. X}
  2197. X
  2198. XSUN_vector(x, y)
  2199. Xunsigned int x, y;
  2200. X{
  2201. X  if ( (x>=term_tbl[term].xmax) || (y>=term_tbl[term].ymax) )
  2202. X    return;
  2203. X  sun_line(sun_lastx,x,sun_lasty,y);
  2204. X  canvas_pixwin(canvas);
  2205. X  notify_dispatch();
  2206. X  return;
  2207. X}
  2208. X
  2209. X
  2210. XSUN_put_text(x,y,str)
  2211. Xunsigned int x, y;
  2212. Xchar *str;
  2213. X{
  2214. X  struct pr_subregion bound;
  2215. X
  2216. X  if ( (x>=term_tbl[term].xmax) || (y>=term_tbl[term].ymax) )
  2217. X    return;
  2218. X
  2219. X  pf_textbound(&bound, strlen(str), sun_font, str);
  2220. X  y = term_tbl[term].ymax-1-y + bound.size.y/3; /* vertical centering */
  2221. X
  2222. X  switch(sun_justify) {
  2223. X     case LEFT:   break;
  2224. X     case CENTRE: x -= bound.size.x/2; break;
  2225. X     case RIGHT:  x -= bound.size.x; break;
  2226. X  }
  2227. X  pw_text(pw, x,y, PIX_SRC | PIX_DST, 0, str); 
  2228. X  canvas_pixwin(canvas);
  2229. X  notify_dispatch();
  2230. X  return;
  2231. X}
  2232. X
  2233. Xint SUN_justify_text(mode)
  2234. X    enum JUSTIFY mode;
  2235. X{
  2236. X    sun_justify = mode;
  2237. X    return (TRUE);
  2238. X}
  2239. X  
  2240. X  
  2241. X
  2242. X
  2243. XSUN_reset()
  2244. X{
  2245. X  
  2246. X  term_tbl[term].xmax = SUN_XMAX;
  2247. X  term_tbl[term].ymax = SUN_YMAX;
  2248. X  window_set(frame, WIN_SHOW, FALSE, 0);
  2249. X  return;
  2250. X}
  2251. X
  2252. X
  2253. X
  2254. Xsun_setmaskpixel(x,y,value)
  2255. Xunsigned int x,y,value;
  2256. X{
  2257. X    /* dotted line generator */
  2258. X    if ((sun_line_mask>>sun_mask_count)&(unsigned int)(1)) {
  2259. X        pw_put(pw,x,term_tbl[term].ymax-1-y,sun_value);
  2260. X    }
  2261. X    sun_mask_count= (sun_mask_count+1) % 16;
  2262. X    sun_lastx= x;  /* last pixel set with mask */
  2263. X    sun_lasty= y;
  2264. X}
  2265. X
  2266. X
  2267. X
  2268. X
  2269. Xsun_line(x1,x2,y1,y2)
  2270. Xunsigned int x1,x2,y1,y2;
  2271. X{
  2272. Xint runcount;
  2273. Xint dx,dy;
  2274. Xint xinc,yinc;
  2275. Xunsigned int xplot,yplot;
  2276. X
  2277. X    runcount=0;
  2278. X    dx = abs((int)(x1)-(int)(x2));
  2279. X    if (x2>x1)  xinc=  1;
  2280. X    if (x2==x1) xinc=  0;
  2281. X    if (x2<x1)  xinc= -1;
  2282. X    dy = abs((int)(y1)-(int)(y2));
  2283. X    if (y2>y1)  yinc=  1;
  2284. X    if (y2==y1) yinc=  0;
  2285. X    if (y2<y1)  yinc= -1;
  2286. X    xplot=x1;
  2287. X    yplot=y1;
  2288. X    if (dx>dy) {
  2289. X        /* iterate x */
  2290. X        if ( (sun_line_mask==0xffff) ||
  2291. X            ((xplot!=sun_lastx) && (yplot!=sun_lasty)) )
  2292. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2293. X        while (xplot!=x2) { 
  2294. X            xplot+=xinc;
  2295. X            runcount+=dy;
  2296. X            if (runcount>=(dx-runcount)) {
  2297. X                yplot+=yinc;
  2298. X                runcount-=dx;
  2299. X            }
  2300. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2301. X        } 
  2302. X    } else {
  2303. X        /* iterate y */
  2304. X        if ( (sun_line_mask==0xffff) ||
  2305. X            ((xplot!=sun_lastx) && (yplot!=sun_lasty)) )
  2306. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2307. X        while (yplot!=y2) {
  2308. X            yplot+=yinc;
  2309. X            runcount+=dx;
  2310. X            if (runcount>=(dy-runcount)) {
  2311. X                xplot+=xinc;
  2312. X                runcount-=dy;
  2313. X            }
  2314. X            sun_setmaskpixel(xplot,yplot,sun_value);
  2315. X        } 
  2316. X    }
  2317. X}
  2318. X
  2319. X
  2320. Xstatic Notify_value local_notice_destroy(frame, status)
  2321. X   Frame frame;
  2322. X   Destroy_status status;
  2323. X{
  2324. X   if (status != DESTROY_CHECKING)
  2325. X   {
  2326. X      SUN_reset();
  2327. X      term_init = FALSE;
  2328. X      }
  2329. X   return(NOTIFY_DONE);
  2330. X   }
  2331. X
  2332. *-*-END-of-term/sun.trm-*-*
  2333. exit
  2334.  
  2335.  
  2336.