home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume24 / gnuplot3 / part19 < prev    next >
Text File  |  1991-10-27  |  49KB  |  1,729 lines

  1. Newsgroups: comp.sources.misc
  2. From: gershon%gr@cs.utah.edu (Elber Gershon)
  3. Subject:  v24i041:  gnuplot3 - interactive function plotting utility, Part19/26
  4. Message-ID: <1991Oct28.002356.12670@sparky.imd.sterling.com>
  5. X-Md4-Signature: be5330d9be4344824f9193dd4c28c6ed
  6. Date: Mon, 28 Oct 1991 00:23:56 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
  10. Posting-number: Volume 24, Issue 41
  11. Archive-name: gnuplot3/part19
  12. Environment: UNIX, MS-DOS, VMS
  13. Supersedes: gnuplot2: Volume 11, Issue 65-79
  14.  
  15. #!/bin/sh
  16. # this is Part.19 (part 19 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file gnuplot/term/unixplot.trm continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 19; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping gnuplot/term/unixplot.trm'
  34. else
  35. echo 'x - continuing file gnuplot/term/unixplot.trm'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/term/unixplot.trm' &&
  37. {
  38. static char *lt[2+5] = {"solid", "longdashed", "solid", "dotted","shortdashed",
  39. X    "dotdashed", "longdashed"};
  40. X
  41. X    if (linetype >= 5)
  42. X        linetype %= 5;
  43. X    linemod(lt[linetype+2]);
  44. }
  45. X
  46. X
  47. UP_move(x,y)
  48. unsigned int x,y;
  49. {
  50. X    move(x,y);
  51. }
  52. X
  53. X
  54. UP_vector(x,y)
  55. unsigned int x,y;
  56. {
  57. X    cont(x,y);
  58. }
  59. X
  60. X
  61. UP_put_text(x,y,str)
  62. unsigned int x,y;
  63. char str[];
  64. {
  65. X    UP_move(x+UP_HCHAR/2,y+UP_VCHAR/5);
  66. X    label(str);
  67. }
  68. X
  69. UP_reset()
  70. {
  71. X    closepl();
  72. }
  73. X
  74. SHAR_EOF
  75. echo 'File gnuplot/term/unixplot.trm is complete' &&
  76. chmod 0666 gnuplot/term/unixplot.trm ||
  77. echo 'restore of gnuplot/term/unixplot.trm failed'
  78. Wc_c="`wc -c < 'gnuplot/term/unixplot.trm'`"
  79. test 1929 -eq "$Wc_c" ||
  80.     echo 'gnuplot/term/unixplot.trm: original size 1929, current size' "$Wc_c"
  81. rm -f _shar_wnt_.tmp
  82. fi
  83. # ============= gnuplot/term/v384.trm ==============
  84. if test -f 'gnuplot/term/v384.trm' -a X"$1" != X"-c"; then
  85.     echo 'x - skipping gnuplot/term/v384.trm (File already exists)'
  86.     rm -f _shar_wnt_.tmp
  87. else
  88. > _shar_wnt_.tmp
  89. echo 'x - extracting gnuplot/term/v384.trm (Text)'
  90. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/v384.trm' &&
  91. /* GNUPLOT - v384.trm */
  92. /*
  93. X * Copyright (C) 1990   
  94. X *
  95. X * Permission to use, copy, and distribute this software and its
  96. X * documentation for any purpose with or without fee is hereby granted, 
  97. X * provided that the above copyright notice appear in all copies and 
  98. X * that both that copyright notice and this permission notice appear 
  99. X * in supporting documentation.
  100. X *
  101. X * Permission to modify the software is granted, but not the right to
  102. X * distribute the modified code.  Modifications are to be distributed 
  103. X * as patches to released version.
  104. X *  
  105. X * This software  is provided "as is" without express or implied warranty.
  106. X * 
  107. X * This file is included by ../term.c.
  108. X *
  109. X * This terminal driver supports:
  110. X *  Vectrix 384 - works with tandy color printer as well
  111. X *
  112. X * AUTHORS
  113. X *   roland@moncskermit.OZ (Roland Yap) 
  114. X * 
  115. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  116. X * 
  117. X */
  118. X
  119. /*
  120. X *    Vectrix 384 driver - works with tandy color printer as well
  121. X *  in reverse printing 8 color mode.
  122. X *  This doesn't work on Vectrix 128 because it redefines the
  123. X *  color table. It can be hacked to work on the 128 by changing
  124. X *  the colours but then it will probably not print best. The color
  125. X *  table is purposely designed so that it will print well
  126. X *
  127. X */
  128. X
  129. #define V384_XMAX 630
  130. #define V384_YMAX 480
  131. X
  132. #define V384_XLAST (V384_XMAX - 1)
  133. #define V384_YLAST (V384_YMAX - 1)
  134. X
  135. #define V384_VCHAR    12
  136. #define V384_HCHAR    7
  137. #define V384_VTIC    8
  138. #define V384_HTIC    7
  139. X
  140. X
  141. V384_init()
  142. {
  143. X    fprintf(outfile,"%c%c  G0   \n",27,18);
  144. X    fprintf(outfile,"Q 0 8\n");
  145. X    fprintf(outfile,"0 0 0\n");
  146. X    fprintf(outfile,"255 0 0\n");
  147. X    fprintf(outfile,"0 255 0\n");
  148. X    fprintf(outfile,"0 0 255\n");
  149. X    fprintf(outfile,"0 255 255\n");
  150. X    fprintf(outfile,"255 0 255\n");
  151. X    fprintf(outfile,"255 255 0\n");
  152. X    fprintf(outfile,"255 255 255\n");
  153. }
  154. X
  155. X
  156. V384_graphics()
  157. {
  158. X    fprintf(outfile,"%c%c E0 RE N 65535\n",27,18);
  159. }
  160. X
  161. X
  162. V384_text()
  163. {
  164. X    fprintf(outfile,"%c%c\n",27,17);
  165. }
  166. X
  167. X
  168. V384_linetype(linetype)
  169. int linetype;
  170. {
  171. static int color[]= {
  172. X        1 /* red */,
  173. X        2 /* green */,
  174. X        3 /* blue */,
  175. X        4 /* cyan */,
  176. X        5 /* magenta */,
  177. X        6 /* yellow */, /* not a good color so not in use at the moment */
  178. X        7 /* white */
  179. X    };
  180. X        
  181. X    if (linetype < 0)
  182. X        linetype=6;
  183. X    else
  184. X        linetype %= 5;
  185. X    fprintf(outfile,"C %d\n",color[linetype]);
  186. }
  187. X
  188. X
  189. V384_move(x,y)
  190. unsigned int x,y;
  191. {
  192. X    fprintf(outfile,"M %d %d\n",x+20,y);
  193. }
  194. X
  195. X
  196. V384_vector(x,y)
  197. unsigned int x,y;
  198. {
  199. X    fprintf(outfile,"L %d %d\n",x+20,y);
  200. }
  201. X
  202. X
  203. V384_put_text (x, y, str)
  204. unsigned int x, y;
  205. char str[];
  206. {
  207. X    V384_move (x, y + V384_VCHAR/2);
  208. X    fprintf (outfile, "$%s\n", str);
  209. }
  210. X
  211. X
  212. V384_reset()
  213. {
  214. }
  215. X
  216. SHAR_EOF
  217. chmod 0666 gnuplot/term/v384.trm ||
  218. echo 'restore of gnuplot/term/v384.trm failed'
  219. Wc_c="`wc -c < 'gnuplot/term/v384.trm'`"
  220. test 2579 -eq "$Wc_c" ||
  221.     echo 'gnuplot/term/v384.trm: original size 2579, current size' "$Wc_c"
  222. rm -f _shar_wnt_.tmp
  223. fi
  224. # ============= gnuplot/term/vws.trm ==============
  225. if test -f 'gnuplot/term/vws.trm' -a X"$1" != X"-c"; then
  226.     echo 'x - skipping gnuplot/term/vws.trm (File already exists)'
  227.     rm -f _shar_wnt_.tmp
  228. else
  229. > _shar_wnt_.tmp
  230. echo 'x - extracting gnuplot/term/vws.trm (Text)'
  231. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/vws.trm' &&
  232. /* GNUPLOT - vws.trm */
  233. /*
  234. X * Copyright (C) 1990
  235. X *
  236. X * Permission to use, copy, and distribute this software and its
  237. X * documentation for any purpose with or without fee is hereby granted,
  238. X * provided that the above copyright notice appear in all copies and
  239. X * that both that copyright notice and this permission notice appear
  240. X * in supporting documentation.
  241. X *
  242. X * Permission to modify the software is granted, but not the right to
  243. X * distribute the modified code.  Modifications are to be distributed
  244. X * as patches to released version.
  245. X *
  246. X * This software  is provided "as is" without express or implied warranty.
  247. X *
  248. X * This file is included by ../term.c.
  249. X *
  250. X * This terminal driver supports:
  251. X *   IRIS terminals
  252. X *
  253. X * AUTHORS
  254. X *   Walter Speth
  255. X *           BITNET: SPETH@DBNPIB5
  256. X *
  257. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  258. X *
  259. X */
  260. #define VWS_XMAX   1024
  261. #define VWS_YMAX   780
  262. #define VWS_VCHAR  25
  263. #define VWS_HCHAR  15
  264. #define VWS_VTIC   10
  265. #define VWS_HTIC   10
  266. #include stdio
  267. /*
  268. #include math
  269. #include ssdef
  270. */
  271. #include descrip
  272. #include <uisentry.h>
  273. #include <uisusrdef.h>
  274. #define DEFAULT_ATTR 0
  275. #define OVER_ATTR 1
  276. #define ERAS_ATTR 2
  277. #define BIS_ATTR 3
  278. #define COLOR_ATTR 4
  279. #define TEXT_ATTR 5
  280. #define LINE_ATTR 6
  281. #define BACK_ATTR 7
  282. float current_x, current_y;
  283. int vd_id, wd_id;
  284. int vcm_id;
  285. static $DESCRIPTOR(ws_devname, "SYS$WORKSTATION");
  286. static $DESCRIPTOR(vd_title, "gnuplot");
  287. static float x0, y0, xsiz, ysiz,
  288. X             wc_xmin_new, wc_ymin_new, wc_xmax_new, wc_ymax_new,
  289. X             wc_xmin, wc_ymin, wc_xmax, wc_ymax,
  290. X             vd_width, vd_height;
  291. VWS_resize_ast()
  292. { uis$resize_window(&vd_id, &wd_id, &x0, &y0, &xsiz, &ysiz,
  293. X                     &wc_xmin, &wc_ymin, &wc_xmax, &wc_ymax);
  294. X  replotrequest();
  295. }
  296. /****************************************************************************/
  297. VWS_init()
  298. {
  299. X  int i;
  300. X  int cattr;
  301. X  $DESCRIPTOR(a_font,"DTABER0003WK00PG0001UZZZZ02A000");
  302. X  vd_width  = 14;
  303. X  vd_height = 10; /* aspect sqrt(2) as DIN A paper */
  304. X  wc_xmin = 0.0;
  305. X  wc_ymin = 0.0;
  306. X  wc_xmax = (float) VWS_XMAX;
  307. X  wc_ymax = (float) VWS_YMAX;
  308. X  vcm_id = uis$create_color_map(&8);
  309. X  vd_id = uis$create_display(&wc_xmin, &wc_ymin, &wc_xmax, &wc_ymax,
  310. X                             &vd_width, &vd_height, &vcm_id);
  311. X  uis$set_color(&vd_id, &0, &.5, &.5, &.5);
  312. X  uis$set_color(&vd_id, &1, &0.0, &0.0, &0.0);
  313. X  uis$set_color(&vd_id, &2, &0.0, &0.0, &0.0);
  314. X  uis$set_color(&vd_id, &3, &0.0, &0.0, &0.0);
  315. X  uis$set_color(&vd_id, &4, &0.0, &0.0, &0.0);
  316. X  uis$set_color(&vd_id, &5, &0.0, &0.0, &0.0);
  317. X  uis$set_color(&vd_id, &6, &0.0, &0.0, &0.0);
  318. X  uis$set_color(&vd_id, &7, &0.0, &0.0, &0.0);
  319. /*
  320. X  uis$set_color(&vd_id, &2, &.2, &.2, &.2);
  321. X  uis$set_color(&vd_id, &3, &.3, &.3, &.3);
  322. X  uis$set_color(&vd_id, &4, &.4, &.4, &.4);
  323. X  uis$set_color(&vd_id, &5, &.5, &.5, &.5);
  324. X  uis$set_color(&vd_id, &6, &.6, &.6, &.6);
  325. X  uis$set_color(&vd_id, &7, &.7, &.7, &.7);
  326. /* perhaps better for color terms (which I do not have)
  327. X  uis$set_color(&vd_id, &0, &0.0, &0.0, &0.0);
  328. X  uis$set_color(&vd_id, &1, &0.9, &0.0, &0.0);
  329. X  uis$set_color(&vd_id, &2, &0.0, &0.9, &0.0);
  330. X  uis$set_color(&vd_id, &3, &0.9, &0.9, &0.0);
  331. X  uis$set_color(&vd_id, &4, &0.0, &0.0, &0.9);
  332. X  uis$set_color(&vd_id, &5, &0.9, &0.0, &0.9);
  333. X  uis$set_color(&vd_id, &6, &0.0, &0.9, &0.9);
  334. X  uis$set_color(&vd_id, &7, &0.9, &0.9, &0.9);
  335. /*
  336. */
  337. X  uis$disable_display_list(&vd_id);
  338. X  wd_id = uis$create_window(&vd_id, &ws_devname, &vd_title,
  339. X                            &wc_xmin, &wc_ymin, &wc_xmax, &wc_ymax,
  340. X                            &vd_width, &vd_height);
  341. X  uis$set_resize_ast(&vd_id, &wd_id, &VWS_resize_ast, &0,
  342. X                     &x0, &y0, &xsiz, &ysiz,
  343. X                     &wc_xmin_new, &wc_ymin_new, &wc_xmax_new, &wc_ymax_new);
  344. X  uis$set_writing_mode(&vd_id, &DEFAULT_ATTR, &OVER_ATTR, &UIS$C_MODE_OVER);
  345. X  uis$set_writing_mode(&vd_id, &DEFAULT_ATTR, &ERAS_ATTR, &UIS$C_MODE_ERAS);
  346. X  uis$set_writing_mode(&vd_id, &DEFAULT_ATTR, &BIS_ATTR, &UIS$C_MODE_BIS);
  347. /*
  348. X  for (i=0; i<8; i++) {
  349. X    cattr = COLOR_ATTR+i;
  350. X    uis$set_writing_index(&vd_id, ©_ATTR, &cattr, &i);
  351. X    }
  352. */
  353. X  uis$set_background_index(&vd_id, &DEFAULT_ATTR, &BACK_ATTR, &0);
  354. X  uis$set_writing_mode(&vd_id, &DEFAULT_ATTR, &TEXT_ATTR, &UIS$C_MODE_OVER);
  355. X  uis$set_font(&vd_id,&TEXT_ATTR,&TEXT_ATTR,&a_font);
  356. X  uis$set_char_size(&vd_id,&TEXT_ATTR,&TEXT_ATTR,&0,
  357. X                    &(float)VWS_HCHAR,&(float)VWS_VCHAR);
  358. X  uis$set_line_style(&vd_id,&LINE_ATTR,&LINE_ATTR,&0xFFFFFFFF);
  359. }
  360. /****************************************************************************/
  361. VWS_reset()
  362. {
  363. X  uis$delete_display(&vd_id);
  364. }
  365. /****************************************************************************/
  366. VWS_scale(xs,ys)
  367. int xs,ys;
  368. {
  369. X        return FALSE;
  370. }
  371. /****************************************************************************/
  372. VWS_graphics()
  373. {
  374. X    uis$erase(&vd_id, &wc_xmin, &wc_ymin, &wc_xmax, &wc_ymax);
  375. }
  376. /****************************************************************************/
  377. VWS_text()
  378. {
  379. }
  380. /****************************************************************************/
  381. VWS_move(x,y)
  382. int x,y;
  383. {
  384. X  current_x= (float)(x);
  385. X  current_y= (float)(y);
  386. }
  387. /****************************************************************************/
  388. VWS_vector(x,y)
  389. int x,y;
  390. { int col;
  391. X  float fx,fy;
  392. X  fx=(float) x;
  393. X  fy=(float) y;
  394. X      uis$line(&vd_id, &LINE_ATTR,
  395. X               ¤t_x, ¤t_y, &fx, &fy);
  396. X      VWS_move (x,y);
  397. }
  398. /****************************************************************************/
  399. VWS_linetype(lt)
  400. int lt;
  401. {
  402. long int lstyle[9]={    0xffffffff,
  403. X                        0Xff00ff00,
  404. X                        0xffffff00,
  405. X                        0xffff0000,
  406. X                        0xf0f0f0f0,
  407. X                        0Xfff0fff0,
  408. X                        0xf000f000,
  409. X                        0xa5a5a5af,
  410. X                        0xf00f00f0 };
  411. X  switch(lt) {
  412. case -1: uis$set_line_style(&vd_id,&LINE_ATTR,&LINE_ATTR,&0xFFFFFFFF);
  413. X         uis$set_line_width(&vd_id,&LINE_ATTR,&LINE_ATTR,&1.5);
  414. X         break;
  415. case -2: uis$set_line_style(&vd_id,&LINE_ATTR,&LINE_ATTR,&0xFFFFFFFF);
  416. X         uis$set_line_width(&vd_id,&LINE_ATTR,&LINE_ATTR,&2.0);
  417. X         break;
  418. /*
  419. default:  uis$set_line_style(&vd_id,&LINE_ATTR,&LINE_ATTR,&lstyle[lt % 8]);
  420. X          makes part of curve disappear on my workstation
  421. */
  422. default:  uis$set_line_style(&vd_id,&LINE_ATTR,&LINE_ATTR,&0xFFFFFFFF);
  423. X         uis$set_line_width(&vd_id,&LINE_ATTR,&LINE_ATTR,&1.0);
  424. }
  425. }
  426. /****************************************************************************/
  427. static int justify_mode =CENTRE,up;;
  428. VWS_put_text(x,y,str)
  429. int x,y; char* str;
  430. {
  431. X  float fx,fy, thih, twid;
  432. /* uis$text parameter is descriptor string not character string */
  433. X  struct dsc$descriptor_s textline = {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,""};
  434. X  textline.dsc$a_pointer = str;
  435. X  textline.dsc$w_length = strlen(textline.dsc$a_pointer);
  436. X  uis$measure_text(&vd_id,&TEXT_ATTR,&textline,&twid,&thih);
  437. X  fx=(float)x;
  438. X  fy=(float)y;
  439. X  switch (justify_mode) {
  440. X  case LEFT : fy+=thih/2.;
  441. X              break;
  442. X  case RIGHT : fy+=thih/2.;
  443. X               fx-=twid;
  444. X              break;
  445. X  case CENTRE : fy+=thih/2.;
  446. X               fx-=twid/2;
  447. X              break;
  448. X  };
  449. X  uis$text(&vd_id,&TEXT_ATTR,&textline,&fx,&fy);
  450. X     /* write to Example Viewport window */
  451. }
  452. /****************************************************************************/
  453. VWS_text_angle(ang)
  454. int ang;
  455. {
  456. X  float degrees;
  457. X  degrees=90.*(up=ang);
  458. X  uis$set_text_slope (&vd_id, &TEXT_ATTR, &TEXT_ATTR, °rees);
  459. return TRUE;
  460. }
  461. /****************************************************************************/
  462. VWS_justify_text(mode)
  463. int mode;
  464. { justify_mode=mode;
  465. return TRUE;
  466. }
  467. /****************************************************************************/
  468. VWS_point(x,y,point)
  469. int x,y,point;
  470. {
  471. do_point(x,y,point);
  472. }
  473. /****************************************************************************/
  474. VWS_arrow(sx,sy,ex,ey)
  475. int sx,sy,ex,ey;
  476. {
  477. do_arrow(sx,sy,ex,ey);
  478. }
  479. SHAR_EOF
  480. chmod 0644 gnuplot/term/vws.trm ||
  481. echo 'restore of gnuplot/term/vws.trm failed'
  482. Wc_c="`wc -c < 'gnuplot/term/vws.trm'`"
  483. test 8014 -eq "$Wc_c" ||
  484.     echo 'gnuplot/term/vws.trm: original size 8014, current size' "$Wc_c"
  485. rm -f _shar_wnt_.tmp
  486. fi
  487. # ============= gnuplot/term/x11.trm ==============
  488. if test -f 'gnuplot/term/x11.trm' -a X"$1" != X"-c"; then
  489.     echo 'x - skipping gnuplot/term/x11.trm (File already exists)'
  490.     rm -f _shar_wnt_.tmp
  491. else
  492. > _shar_wnt_.tmp
  493. echo 'x - extracting gnuplot/term/x11.trm (Text)'
  494. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/x11.trm' &&
  495. /*
  496. X *    x11.trm  --- inboard terminal driver for X11
  497. X */
  498. X
  499. #define X11_XMAX 4096
  500. #define X11_YMAX 4096
  501. X
  502. /* approximations for typical font/screen sizes */
  503. #define X11_VCHAR (X11_YMAX/25) 
  504. #define X11_HCHAR (X11_XMAX/100) 
  505. #define X11_VTIC (X11_YMAX/100)
  506. #define X11_HTIC (X11_XMAX/150)
  507. X
  508. #define X11_nopts 22
  509. char X11_opts[X11_nopts][20] = {
  510. X   "-iconic", "-rv", "-reverse", "+rv", "-synchronous", 
  511. X   "-display", "-geometry", "-bg", "-background", "-bd", "-bordercolor", "-bw",
  512. X   "-borderwidth", "-fg", "-foreground", "-fn", "-font", "-name", 
  513. X   "-selectionTimeout", "-title", "-xnllanguage", "-xrm" 
  514. X   };
  515. int X11_optarg[X11_nopts] = { 
  516. X   0, 0, 0, 0, 0,
  517. X   1, 1, 1, 1, 1, 1, 1,
  518. X   1, 1, 1, 1, 1, 1, 
  519. X   1, 1, 1, 1
  520. X   };
  521. X
  522. FILE *X11_pipe, *popen();
  523. char X11_command[1024]= "gnuplot_x11 -name gnuplot";
  524. X
  525. X
  526. /*   X11_args - scan gnuplot command line for standard X Toolkit options */
  527. X
  528. XX11_args(argc, argv) int argc; char *argv[]; {
  529. X   int nx11 = 0, n;
  530. X
  531. X   while(++argv, --argc > 0) {
  532. X      for (n=0; n<X11_nopts; n++) {
  533. X     if (!strcmp(*argv, X11_opts[n])) {
  534. X        strcat(X11_command, " ");
  535. X        strcat(X11_command, *argv); 
  536. X        if (X11_optarg[n]) {
  537. X           if (--argc <= 0) return(nx11);
  538. X           strcat(X11_command, " \"");
  539. X           strcat(X11_command, *++argv); 
  540. X           strcat(X11_command, "\"");
  541. X           nx11++;
  542. X           }
  543. X        nx11++; break;
  544. X        }
  545. X     }
  546. X      if (n == X11_nopts) break; 
  547. X      }
  548. X   return(nx11);
  549. X   }
  550. X
  551. #ifdef ULTRIX_KLUDGE
  552. #define X11_ULTRIX_KLUDGE fprintf (X11_pipe, "E\n"); fflush (X11_pipe);
  553. #else
  554. #define X11_ULTRIX_KLUDGE 
  555. #endif
  556. X
  557. XX11_init() { X11_pipe = popen(X11_command, "w"); }
  558. X
  559. XX11_reset() { fprintf(X11_pipe, "R\n"); fflush(X11_pipe); pclose(X11_pipe); }
  560. X
  561. XX11_text() { fprintf(X11_pipe, "E\n"); fflush(X11_pipe); X11_ULTRIX_KLUDGE }
  562. X
  563. XX11_graphics() { fprintf(X11_pipe, "G\n"); }
  564. X
  565. XX11_move(x,y) unsigned int x,y; { fprintf(X11_pipe, "M%04d%04d\n", x, y); }
  566. X
  567. XX11_vector(x,y) unsigned int x,y; { fprintf(X11_pipe, "V%04d%04d\n", x, y); }
  568. X
  569. XX11_linetype(lt) int lt; { fprintf(X11_pipe, "L%04d\n", lt); }
  570. X
  571. XX11_put_text(x,y,str) unsigned int x,y; char str[]; {
  572. X   fprintf(X11_pipe, "T%04d%04d%s\n", x, y, str);
  573. X   }
  574. XX11_justify_text(mode) enum JUSTIFY mode; {
  575. X   fprintf(X11_pipe, "J%04d\n", mode);
  576. X   return(TRUE);
  577. X   }
  578. SHAR_EOF
  579. chmod 0644 gnuplot/term/x11.trm ||
  580. echo 'restore of gnuplot/term/x11.trm failed'
  581. Wc_c="`wc -c < 'gnuplot/term/x11.trm'`"
  582. test 2240 -eq "$Wc_c" ||
  583.     echo 'gnuplot/term/x11.trm: original size 2240, current size' "$Wc_c"
  584. rm -f _shar_wnt_.tmp
  585. fi
  586. # ============= gnuplot/term/gpr.trm ==============
  587. if test -f 'gnuplot/term/gpr.trm' -a X"$1" != X"-c"; then
  588.     echo 'x - skipping gnuplot/term/gpr.trm (File already exists)'
  589.     rm -f _shar_wnt_.tmp
  590. else
  591. > _shar_wnt_.tmp
  592. echo 'x - extracting gnuplot/term/gpr.trm (Text)'
  593. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/gpr.trm' &&
  594. /* GNUPLOT - gpr.trm */
  595. /*
  596. X * Copyright (C) 1990   
  597. X *
  598. X * Permission to use, copy, and distribute this software and its
  599. X * documentation for any purpose with or without fee is hereby granted, 
  600. X * provided that the above copyright notice appear in all copies and 
  601. X * that both that copyright notice and this permission notice appear 
  602. X * in supporting documentation.
  603. X *
  604. X * Permission to modify the software is granted, but not the right to
  605. X * distribute the modified code.  Modifications are to be distributed 
  606. X * as patches to released version.
  607. X *  
  608. X * This software  is provided "as is" without express or implied warranty.
  609. X * 
  610. X * This file is included by ../term.c.
  611. X *
  612. X * This terminal driver supports:
  613. X *   APOLLO's GPR windowing system
  614. X *
  615. X * AUTHORS
  616. X *  Michael Aramini
  617. X *  Roque D Oliveira , oliveria@caen.engin.umich.edu
  618. X * 
  619. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  620. X * 
  621. X */
  622. #include <apollo/base.h>
  623. #include <apollo/error.h>
  624. #include <apollo/gpr.h>
  625. #include <apollo/pad.h>
  626. /* landscape window */
  627. /*
  628. #define GPR_XMAX 720
  629. #define GPR_YMAX 450
  630. */
  631. /* portrait window */
  632. #define GPR_XMAX 585
  633. #define GPR_YMAX 735
  634. X
  635. #define GPR_XLAST (GPR_XMAX - 1)
  636. #define GPR_YLAST (GPR_YMAX - 1)
  637. X
  638. #define GPR_VCHAR 19
  639. #define GPR_HCHAR 10
  640. #define GPR_VTIC (GPR_YMAX/80)
  641. #define GPR_HTIC (GPR_XMAX/80)
  642. X
  643. gpr_$direction_t  gpr_path=gpr_$right;
  644. int               gpr_ang=0;            /* text angle, 0=horizontal, 1=vertical */
  645. enum JUSTIFY      gpr_justify=LEFT;     /* text is flush left */
  646. X
  647. static status_$t  status;
  648. unsigned int      DEBUG    = 0;         /* set it to 1 when debugging program */
  649. X
  650. X
  651. static void check(messagex)
  652. char *messagex;
  653. {
  654. X  if (status.all = status_$ok)
  655. X  {
  656. X    error_$print(status);
  657. X    printf("Error occurred while %s.\n", messagex);
  658. X  }
  659. }
  660. X
  661. /* return whether stdout is a DM pad . Called by term.c */
  662. gpr_isa_pad()
  663. {
  664. X    pad_$isa(1, &status);
  665. X    return (status.all == status_$ok);
  666. }
  667. X
  668. X
  669. GPR_init()
  670. {
  671. X  gpr_$offset_t dm_bitmap_size;
  672. X  gpr_$bitmap_desc_t dm_bitmap_desc;
  673. X  pad_$window_desc_t window;
  674. X  short font_id;
  675. X  stream_$id_t stream_id;
  676. X  static gpr_$rgb_plane_t  hi_plane;
  677. X  static gpr_$disp_char_t  display_characteristics;
  678. X  static float             screen_size_r_width,screen_size_r_height ;
  679. X  static short int         disp_len = sizeof(gpr_$disp_char_t);
  680. X  static short int         disp_len_returned;
  681. X
  682. X
  683. X  /* open a pad to do graphics in */
  684. X  window.top    = 0;
  685. X  window.left   = 0;
  686. X  window.width  = GPR_XMAX + 10; /* 10 accounts for width of window border */
  687. X  window.height = GPR_YMAX + 35; /* 35 accounts for height of window border */
  688. X  pad_$create_window("",(short)0,pad_$transcript,(short)1,window,&stream_id,&status);
  689. X  check("pad_$create_window");
  690. X
  691. /*  pad_$set_full_window(stream_id,(short) 1,&window, &status); */
  692. /*  pad_$set_border (stream_id,(short) 1, true, &status); */
  693. X  pad_$set_scale (stream_id,(short) 1,(short) 1, &status);
  694. X  pad_$set_auto_close(stream_id, (short) 1, true, &status );
  695. X
  696. X  gpr_$inq_disp_characteristics(gpr_$direct,stream_id,disp_len,&display_characteristics,&disp_len_returned,&status);
  697. X  check("in gpr_$inq_display_characteristics");
  698. X  screen_size_r_width    = (float) display_characteristics.x_window_size;    /*x_window_size in pixels */
  699. X  screen_size_r_height   = (float) display_characteristics.y_window_size;    /*y_window_size in pixels */
  700. X  hi_plane  = display_characteristics.n_planes - 1;  
  701. X  if(DEBUG) printf("width=%f height=%f \n",screen_size_r_width,screen_size_r_height);
  702. X
  703. X  dm_bitmap_size.x_size = 1280;
  704. X  dm_bitmap_size.y_size = 1024;
  705. X  gpr_$init(gpr_$direct,stream_id,dm_bitmap_size,hi_plane,&dm_bitmap_desc,&status); 
  706. X  check("in gpr_$init");
  707. /*
  708. X  gpr_$set_obscured_opt(gpr_$pop_if_obs, &status); 
  709. X  check("in gpr_$set_obscured_opt");
  710. */
  711. X  gpr_$set_auto_refresh(true, &status); 
  712. X  check("in gpr_$set_auto_refresh");
  713. X
  714. X  /* load a font and make it current */
  715. X  gpr_$load_font_file("f7x13", 5, &font_id, &status);
  716. X  check("in gpr_$load_font_file");
  717. X  gpr_$set_text_font(font_id, &status);
  718. X  check("in gpr_$set_text_font");
  719. X
  720. X  /* set up color values */
  721. X  gpr_$set_draw_value((gpr_$pixel_value_t)7, &status);  /* white */
  722. X  check("in gpr_set_draw_value");
  723. X  gpr_$set_text_background_value((gpr_$pixel_value_t)(-1), &status); /* trans */
  724. X  check("in gpr_$set_text_background_value");
  725. X  gpr_$set_text_value((gpr_$pixel_value_t)7, &status);  /* white */
  726. X  check("in gpr_$set_text_value");
  727. }
  728. X
  729. X
  730. GPR_graphics()
  731. {
  732. X  gpr_$coordinate_t locx,locy,marker_size;
  733. X
  734. X  (void) gpr_$acquire_display(&status);
  735. X  check("in gpr_$acquire display");
  736. X  gpr_$clear((gpr_$pixel_value_t)0, &status);  /* black */
  737. X  check("in gpr_$clear");
  738. X
  739. X  if(DEBUG) 
  740. X   {
  741. X    marker_size = (short) 10;  
  742. X
  743. X    locx = (short) 5;
  744. X    locy = (short) 5;
  745. X    gpr_$set_draw_value((gpr_$pixel_value_t)2, &status);  /* white */
  746. X    gpr_$move( (locx - marker_size/2) ,locy,&status);
  747. X    gpr_$line( (locx + marker_size/2) ,locy,&status);
  748. X    gpr_$move( locx, (locy + marker_size/2),&status);
  749. X    gpr_$line( locx, (locy - marker_size/2),&status);
  750. X    
  751. X    locx = (short) (GPR_XMAX -1 - 5);
  752. X    locy = (short) 5;
  753. X    gpr_$set_draw_value((gpr_$pixel_value_t)3, &status);  /* white */
  754. X    gpr_$move( (locx - marker_size/2) ,locy,&status);
  755. X    gpr_$line( (locx + marker_size/2) ,locy,&status);
  756. X    gpr_$move( locx, (locy + marker_size/2),&status);
  757. X    gpr_$line( locx, (locy - marker_size/2),&status);
  758. X    
  759. X    locx = (short) 5;
  760. X    locy = (short) (GPR_YMAX -1 - 5);
  761. X    gpr_$set_draw_value((gpr_$pixel_value_t)4, &status);  /* white */
  762. X    gpr_$move( (locx - marker_size/2) ,locy,&status);
  763. X    gpr_$line( (locx + marker_size/2) ,locy,&status);
  764. X    gpr_$move( locx, (locy + marker_size/2),&status);
  765. X    gpr_$line( locx, (locy - marker_size/2),&status);
  766. X    
  767. X    locx = (short) (GPR_XMAX -1 - 5);
  768. X    locy = (short) (GPR_YMAX -1 - 5);
  769. X    gpr_$set_draw_value((gpr_$pixel_value_t)5, &status);  /* white */
  770. X    gpr_$move( (locx - marker_size/2) ,locy,&status);
  771. X    gpr_$line( (locx + marker_size/2) ,locy,&status);
  772. X    gpr_$move( locx, (locy + marker_size/2),&status);
  773. X    gpr_$line( locx, (locy - marker_size/2),&status);
  774. X    
  775. X    gpr_$set_draw_value((gpr_$pixel_value_t)7, &status);  /* white */
  776. X    check("in gpr_$set_draw_value");
  777. X   } /* end if(DEBUG) */
  778. X
  779. }
  780. X
  781. X
  782. GPR_text()
  783. {
  784. X  gpr_$release_display(&status);
  785. X  check("gpr_$release_display");
  786. }
  787. X
  788. X
  789. GPRold_linetype(linetype)
  790. int linetype;
  791. {
  792. X  static gpr_$line_pattern_t patterns[2+5] = {
  793. X      { 0xFFFF },   /* solid              1111111111111111 */
  794. X      { 0x3FFF },   /* very long dashed   0011111111111111 */
  795. X      { 0xFFFF },   /* solid              1111111111111111 */
  796. X      { 0x5555 },   /* dotted             0101010101010101 */
  797. X      { 0x3333 },   /* short dashed       0011001100110011 */
  798. X      { 0xB5AD },   /* dot short-dashed   1011010110101101 */
  799. X      { 0x3FFF }    /* very long dashed   0011111111111111 */
  800. X                                             };
  801. X  if (linetype >= 5) linetype %= 5;
  802. X  gpr_$set_line_pattern((short)1, patterns[linetype+2], (short)16, &status);
  803. X  check("in gpr_$set_line_pattern");
  804. }
  805. X
  806. GPR_linetype(linetype)
  807. int linetype;
  808. {
  809. X  static gpr_$line_pattern_t patterns[2+7] = {
  810. X      { 0xFFFF },   /* solid              1111111111111111 */
  811. X      { 0x1111 },   /* long-spaced dotted 0001000100010001 */
  812. X      { 0xFFFF },   /* solid              1111111111111111 */
  813. X      { 0x5555 },   /* dotted             0101010101010101 */
  814. X      { 0x3333 },   /* short  dashed      0011001100110011 */
  815. X      { 0x7777 },   /* medium dashed      0111011101110111 */
  816. X      { 0x3F3F },   /* long   dashed      0011111100111111 */
  817. X      { 0x0F0F },   /* long-spaced dashed 0000111100001111 */
  818. X      { 0x5F5F }    /* dot dashed         0101111101011111 */
  819. X                                             };
  820. X  if (linetype >= 7) linetype %= 7;
  821. X  gpr_$set_line_pattern((short)1, patterns[linetype+2], (short)16, &status);
  822. X  check("in gpr_$set_line_pattern");
  823. X
  824. /*
  825. X  gpr_$set_draw_value((gpr_$pixel_value_t)(linetype + 1), &status);
  826. X  check("in gpr_$set_draw_value");
  827. */
  828. }
  829. X
  830. X
  831. GPR_move(x, y)
  832. unsigned int x, y;
  833. {
  834. X  gpr_$move((short)x, (short)(GPR_YMAX -1 - y), &status);
  835. X  check("in gpr_$move");
  836. }
  837. X
  838. X
  839. GPR_vector(x, y)
  840. unsigned int x, y;
  841. {
  842. X  gpr_$line((short)x, (short)(GPR_YMAX -1 - y), &status);
  843. X  check("in gpr_$line");
  844. }
  845. X
  846. X
  847. GPR_put_text(x,y,str)
  848. unsigned int x,y;        /* reference point of string */
  849. char str[];              /* the text */
  850. {
  851. X  gpr_$coordinate_t xgpr,ygpr;
  852. X  gpr_$offset_t     str_size_in_pixels;
  853. X  short int         str_len;     
  854. X
  855. X  gpr_$coordinate_t locx,locy,marker_size;
  856. X
  857. X  if(DEBUG) 
  858. X   {
  859. X    locx = (short) x;
  860. X    locy = (short) (GPR_YMAX -1 - y);
  861. X    marker_size = (short) 20;  
  862. X    gpr_$set_draw_value((gpr_$pixel_value_t)1, &status);  /* white */
  863. X    gpr_$move( (locx - marker_size/2) ,locy,&status);
  864. X    gpr_$line( (locx + marker_size/2) ,locy,&status);
  865. X    gpr_$move( locx, (locy + marker_size/2),&status);
  866. X    gpr_$line( locx, (locy - marker_size/2),&status);
  867. X    gpr_$set_draw_value((gpr_$pixel_value_t)7, &status);  /* white */
  868. X   }
  869. X
  870. X  xgpr = (short) x;
  871. X  ygpr = (short) (GPR_YMAX -1 - y); 
  872. X  gpr_$set_text_path(gpr_path, &status); 
  873. X  check("gpr_$set_text_path");
  874. X
  875. X  str_len = (short) strlen(str);
  876. X  gpr_$inq_text_extent(str,str_len,&str_size_in_pixels,&status); /* Calculate how much space (in pixels) the string requires */    
  877. X  check("in gpr_$inq_text_extent");
  878. X
  879. X  switch (gpr_justify) 
  880. X   {
  881. X    case LEFT :
  882. X        {
  883. X         switch (gpr_path) 
  884. X          {
  885. X           case gpr_$up :           /* vertical */
  886. X               {
  887. X                if(DEBUG) printf("LEFT and up , str=%s\n",str);
  888. X                break;
  889. X               }
  890. X           case gpr_$right :        /* horizontal */
  891. X               {
  892. X                ygpr = ygpr + str_size_in_pixels.y_size/2;
  893. X                if(DEBUG) printf("LEFT and right, str=%s \n",str);
  894. X                break;
  895. X               }
  896. X          }
  897. X         break;
  898. X        }
  899. X
  900. X    case CENTRE :
  901. X        {  
  902. X         switch (gpr_path) 
  903. X          {
  904. X           case gpr_$up :           /* vertical */
  905. X               {
  906. X                xgpr = xgpr + str_size_in_pixels.x_size/2;
  907. X                ygpr = ygpr + str_size_in_pixels.y_size/2;
  908. X                if(DEBUG) printf("CENTRE and up, str=%s \n",str);
  909. X                break;
  910. X               }
  911. X           case gpr_$right :        /* horizontal */
  912. X               {
  913. X                xgpr = xgpr - str_size_in_pixels.x_size/2;
  914. X                ygpr = ygpr + str_size_in_pixels.y_size/2;
  915. X                if(DEBUG) printf("CENTRE and right, str=%s \n",str);
  916. X                break;
  917. X               }
  918. X          }
  919. X         break;
  920. X        }
  921. X    case RIGHT :
  922. X        {
  923. X         switch (gpr_path) 
  924. X          {
  925. X           case gpr_$up :           /* vertical */
  926. X               {
  927. X                ygpr = ygpr + str_size_in_pixels.y_size;
  928. X                if(DEBUG) printf("RIGHT and up, str=%s \n",str);
  929. X                break;
  930. X               }
  931. X           case gpr_$right :        /* horizontal */
  932. X               {
  933. X                xgpr = xgpr - str_size_in_pixels.x_size;
  934. X                ygpr = ygpr + str_size_in_pixels.y_size/2;
  935. X                if(DEBUG) printf("RIGHT and right, str=%s \n",str);
  936. X                break;
  937. X               }
  938. X          }
  939. X         break;
  940. X        }
  941. X   }
  942. X
  943. X  gpr_$move(xgpr,ygpr,&status);
  944. X  check("in gpr_$move");
  945. X  gpr_$text(str, str_len, &status);
  946. X  check("in gpr_$text");
  947. }
  948. X
  949. int GPR_text_angle(ang)
  950. int ang;
  951. {   
  952. X    if (gpr_ang != ang)
  953. X      {
  954. X        gpr_ang  = ang;
  955. X        gpr_path = (gpr_ang == 1 ? gpr_$up : gpr_$right);
  956. X      }
  957. X    return (TRUE);
  958. }
  959. X
  960. int GPR_justify_text(mode)
  961. enum JUSTIFY mode;
  962. {
  963. X    gpr_justify = mode;
  964. X    return (TRUE);
  965. }
  966. X
  967. GPR_reset()
  968. {
  969. X  gpr_$terminate(false, &status);
  970. X  check("in gpr_$terminate");
  971. }
  972. SHAR_EOF
  973. chmod 0644 gnuplot/term/gpr.trm ||
  974. echo 'restore of gnuplot/term/gpr.trm failed'
  975. Wc_c="`wc -c < 'gnuplot/term/gpr.trm'`"
  976. test 11637 -eq "$Wc_c" ||
  977.     echo 'gnuplot/term/gpr.trm: original size 11637, current size' "$Wc_c"
  978. rm -f _shar_wnt_.tmp
  979. fi
  980. # ============= gnuplot/term/dumb.trm ==============
  981. if test -f 'gnuplot/term/dumb.trm' -a X"$1" != X"-c"; then
  982.     echo 'x - skipping gnuplot/term/dumb.trm (File already exists)'
  983.     rm -f _shar_wnt_.tmp
  984. else
  985. > _shar_wnt_.tmp
  986. echo 'x - extracting gnuplot/term/dumb.trm (Text)'
  987. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/dumb.trm' &&
  988. /* GNUPLOT - dumb.trm */
  989. /*
  990. X * Copyright (C) 1991
  991. X *
  992. X * Permission to use, copy, and distribute this software and its
  993. X * documentation for any purpose with or without fee is hereby granted,
  994. X * provided that the above copyright notice appear in all copies and
  995. X * that both that copyright notice and this permission notice appear
  996. X * in supporting documentation.
  997. X *
  998. X * Permission to modify the software is granted, but not the right to
  999. X * distribute the modified code.  Modifications are to be distributed
  1000. X * as patches to released version.
  1001. X *
  1002. X * This software  is provided "as is" without express or implied warranty.
  1003. X *
  1004. X * This file is included by ../term.c.
  1005. X *
  1006. X * This terminal driver supports:
  1007. X *   DUMB terminals
  1008. X *
  1009. X * AUTHORS
  1010. X *   Francois Pinard, 91-04-03
  1011. X *           INTERNET: pinard@iro.umontreal.ca
  1012. X *
  1013. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1014. X *
  1015. X */
  1016. X
  1017. #define DUMB_AXIS_CONST '\1'
  1018. #define DUMB_BORDER_CONST '\2'
  1019. X
  1020. #define DUMB_XMAX 79
  1021. #define DUMB_YMAX 24
  1022. X
  1023. static char *dumb_matrix = NULL;      /* matrix of characters */
  1024. static char *dumb_priority = NULL;    /* matrix of priority at each position */
  1025. static char dumb_pen;                 /* current character used to draw */
  1026. static int dumb_x;                    /* current X position */
  1027. static int dumb_y;                    /* current Y position */
  1028. static int dumb_xmax = DUMB_XMAX;
  1029. static int dumb_ymax = DUMB_YMAX;
  1030. X
  1031. #define DUMB_PIXEL(x,y) dumb_matrix[dumb_xmax*(y)+(x)]
  1032. X
  1033. X
  1034. dumb_set_pixel(x,y,v,p)
  1035. int x,y,v,p;
  1036. {
  1037. X  if (p > dumb_priority[dumb_xmax*y+x])
  1038. X    {
  1039. X      dumb_matrix[dumb_xmax*y+x] = v;
  1040. X      dumb_priority[dumb_xmax*y+x] = p;
  1041. X    }
  1042. }
  1043. X
  1044. X
  1045. DUMB_options()
  1046. {
  1047. X  int x,y;
  1048. X  struct value a;
  1049. X  extern struct value *const_express();
  1050. X  extern double real();
  1051. X
  1052. X  if (!END_OF_COMMAND) {
  1053. X    x = (int) real(const_express(&a));
  1054. X    if (!END_OF_COMMAND) {
  1055. X      y = (int) real(const_express(&a));
  1056. X      dumb_xmax = term_tbl[term].xmax = x;
  1057. X      dumb_ymax = term_tbl[term].ymax = y;
  1058. X    }
  1059. X  }
  1060. X
  1061. X  sprintf(term_options, "%d %d",dumb_xmax,dumb_ymax);
  1062. }
  1063. X
  1064. X
  1065. DUMB_init()
  1066. {
  1067. X  if (dumb_matrix)
  1068. X    free(dumb_matrix);
  1069. X
  1070. X  dumb_matrix = alloc (dumb_xmax * dumb_ymax * 2, "dumb terminal");
  1071. X
  1072. X  dumb_priority = dumb_matrix + dumb_xmax * dumb_ymax;
  1073. }
  1074. X
  1075. X
  1076. char *
  1077. DUMB_str_state()
  1078. {
  1079. X   static char str[80];
  1080. X
  1081. X   sprintf( str, "%d %d", dumb_xmax, dumb_ymax );
  1082. X
  1083. X   return str;
  1084. }
  1085. X
  1086. X
  1087. DUMB_graphics ()
  1088. {
  1089. X  int i;
  1090. X  char *pm = dumb_matrix, *pp = dumb_priority;
  1091. X
  1092. X  for ( i = dumb_xmax * dumb_ymax; i > 0; i-- ) {
  1093. X    *pm++ = ' ';
  1094. X    *pp++ = 0;
  1095. X  }
  1096. }
  1097. X
  1098. X
  1099. DUMB_text ()
  1100. {
  1101. X  int x, y, l;
  1102. X
  1103. X  putc ('\f', outfile);
  1104. X  for (y = dumb_ymax - 1; y >= 0; y--)
  1105. X    {
  1106. X      for (l = dumb_xmax; l > 0 && DUMB_PIXEL (l - 1, y) == ' '; l--)
  1107. X       ;
  1108. X      for (x = 0; x < l; x++)
  1109. X       putc (DUMB_PIXEL (x, y), outfile);
  1110. X      if (y > 0)
  1111. X       putc ('\n', outfile);
  1112. X    }
  1113. X  fflush (outfile);
  1114. }
  1115. X
  1116. X
  1117. DUMB_reset()
  1118. {
  1119. X  free (dumb_matrix);
  1120. X  dumb_matrix = NULL;
  1121. }
  1122. X
  1123. X
  1124. DUMB_linetype(linetype)
  1125. int linetype;
  1126. {
  1127. X  static char pen_type[7] = {'*', '#', '$', '%', '@', '&', '='};
  1128. X
  1129. X  if (linetype == -2)
  1130. X    dumb_pen = DUMB_BORDER_CONST;
  1131. X  else if (linetype == -1)
  1132. X    dumb_pen = DUMB_AXIS_CONST;
  1133. X  else
  1134. X    {
  1135. X      linetype = linetype % 7;
  1136. X      dumb_pen = pen_type[linetype];
  1137. X    }
  1138. }
  1139. X
  1140. X
  1141. DUMB_move(x, y)
  1142. int x, y;
  1143. {
  1144. X  dumb_x = x;
  1145. X  dumb_y = y;
  1146. }
  1147. X
  1148. X
  1149. DUMB_point(x,y,point)
  1150. int x,y,point;
  1151. {
  1152. X  dumb_set_pixel (x, y, point == -1 ? '.' : point % 26 + 'A', 4);
  1153. }
  1154. X
  1155. X
  1156. DUMB_vector(x,y)
  1157. int x,y;
  1158. {
  1159. X  char pen, pen1;
  1160. X  int priority;
  1161. X  int delta;
  1162. X
  1163. X  if (abs (y - dumb_y) > abs (x - dumb_x))
  1164. X    {
  1165. X      switch (dumb_pen)
  1166. X       {
  1167. X       case DUMB_AXIS_CONST:
  1168. X         pen = ':';
  1169. X         pen1 = '+';
  1170. X         priority = 1;
  1171. X         break;
  1172. X
  1173. X       case DUMB_BORDER_CONST:
  1174. X         pen = '|';
  1175. X         pen1 = '+';
  1176. X         priority = 2;
  1177. X         break;
  1178. X
  1179. X       default:
  1180. X         pen = dumb_pen;
  1181. X         pen1 = dumb_pen;
  1182. X         priority = 3;
  1183. X         break;
  1184. X       }
  1185. X      dumb_set_pixel (dumb_x, dumb_y, pen1, priority);
  1186. X      for (delta = 1; delta < abs (y - dumb_y); delta++)
  1187. X       dumb_set_pixel (dumb_x
  1188. X                       + (int) ((double) (x - dumb_x) * delta / abs(y - dumb_y)
  1189. X                                + 0.5),
  1190. X                       dumb_y + delta * sign (y - dumb_y),
  1191. X                       pen, priority);
  1192. X      dumb_set_pixel (x, y, pen1, priority);
  1193. X    }
  1194. X  else if (abs (x - dumb_x) > abs (y - dumb_y))
  1195. X    {
  1196. X      switch (dumb_pen)
  1197. X       {
  1198. X       case DUMB_AXIS_CONST:
  1199. X         pen = '.';
  1200. X         pen1 = '+';
  1201. X         priority = 1;
  1202. X         break;
  1203. X
  1204. X       case DUMB_BORDER_CONST:
  1205. X         pen = '-';
  1206. X         pen1 = '+';
  1207. X         priority = 2;
  1208. X         break;
  1209. X
  1210. X       default:
  1211. X         pen = dumb_pen;
  1212. X         pen1 = dumb_pen;
  1213. X         priority = 3;
  1214. X         break;
  1215. X       }
  1216. X      dumb_set_pixel (dumb_x, dumb_y, pen1, priority);
  1217. X      for (delta = 1; delta < abs (x - dumb_x); delta++)
  1218. X       dumb_set_pixel (dumb_x + delta * sign (x - dumb_x),
  1219. X                       dumb_y +
  1220. X                       (int) ((double) (y - dumb_y) * delta / abs(x - dumb_x)
  1221. X                              + 0.5),
  1222. X                       pen, priority);
  1223. X      dumb_set_pixel (x, y, pen1, priority);
  1224. X    }
  1225. X  else
  1226. X    {
  1227. X      switch (dumb_pen)
  1228. X       {
  1229. X       case DUMB_AXIS_CONST:    /* zero length axis */
  1230. X         pen = '+';
  1231. X         priority = 1;
  1232. X         break;
  1233. X
  1234. X       case DUMB_BORDER_CONST:    /* zero length border */
  1235. X         pen = '+';
  1236. X         priority = 2;
  1237. X         break;
  1238. X
  1239. X       default:
  1240. X         pen = dumb_pen;
  1241. X         priority = 3;
  1242. X         break;
  1243. X       }
  1244. X      for (delta = 0; delta <= abs (x - dumb_x); delta++)
  1245. X    dumb_set_pixel (dumb_x + delta * sign (x - dumb_x),
  1246. X            dumb_y + delta * sign (y - dumb_y),
  1247. X            pen, priority);
  1248. X    }
  1249. X  dumb_x = x;
  1250. X  dumb_y = y;
  1251. }
  1252. X
  1253. X
  1254. DUMB_put_text(x,y,str)
  1255. int x, y;
  1256. char *str;
  1257. {
  1258. X  int length;
  1259. X  int delta;
  1260. X
  1261. X  length = strlen(str);
  1262. X  if (x + length > dumb_xmax)
  1263. X    x = max (0, dumb_xmax - length);
  1264. X
  1265. X  for (; x < dumb_xmax && *str; x++, str++)
  1266. X    dumb_set_pixel (x, y, *str, 5);
  1267. }
  1268. X
  1269. X
  1270. DUMB_arrow (sx,sy,ex,ey)
  1271. int sx,sy,ex,ey;
  1272. {
  1273. X  char saved_pen;
  1274. X  char saved_x;
  1275. X  char saved_y;
  1276. X
  1277. X  saved_pen = dumb_pen;
  1278. X  saved_x = dumb_x;
  1279. X  saved_y = dumb_y;
  1280. X
  1281. X  dumb_pen = '>';
  1282. X  dumb_x = sx;
  1283. X  dumb_y = sy;
  1284. X  DUMB_vector (ex,ey);
  1285. X
  1286. X  dumb_pen = saved_pen;
  1287. X  dumb_x = saved_x;
  1288. X  dumb_y = saved_y;
  1289. }
  1290. SHAR_EOF
  1291. chmod 0644 gnuplot/term/dumb.trm ||
  1292. echo 'restore of gnuplot/term/dumb.trm failed'
  1293. Wc_c="`wc -c < 'gnuplot/term/dumb.trm'`"
  1294. test 6235 -eq "$Wc_c" ||
  1295.     echo 'gnuplot/term/dumb.trm: original size 6235, current size' "$Wc_c"
  1296. rm -f _shar_wnt_.tmp
  1297. fi
  1298. # ============= gnuplot/term/amiga.trm ==============
  1299. if test -f 'gnuplot/term/amiga.trm' -a X"$1" != X"-c"; then
  1300.     echo 'x - skipping gnuplot/term/amiga.trm (File already exists)'
  1301.     rm -f _shar_wnt_.tmp
  1302. else
  1303. > _shar_wnt_.tmp
  1304. echo 'x - extracting gnuplot/term/amiga.trm (Text)'
  1305. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/amiga.trm' &&
  1306. /* GNUPLOT - amiga.trm */
  1307. /*
  1308. X * Copyright (C) 1991
  1309. X *
  1310. X * Permission to use, copy, and distribute this software and its
  1311. X * documentation for any purpose with or without fee is hereby granted, 
  1312. X * provided that the above copyright notice appear in all copies and 
  1313. X * that both that copyright notice and this permission notice appear 
  1314. X * in supporting documentation.
  1315. X *
  1316. X * Permission to modify the software is granted, but not the right to
  1317. X * distribute the modified code.  Modifications are to be distributed 
  1318. X * as patches to released version.
  1319. X *  
  1320. X * This software  is provided "as is" without express or implied warranty.
  1321. X * 
  1322. X * This file is included by ../term.c.
  1323. X *
  1324. X * This terminal driver supports:
  1325. X *   Amiga Custom Screen
  1326. X *
  1327. X * AUTHORS
  1328. X *   Carsten Steger
  1329. X * 
  1330. X *   Pat R. Empleo      Slightly modified for Aztec C v5.2a (beta); sort of
  1331. X *   08/27/91           supports overscan; for large WB 2.0 virtual screens,
  1332. X *                      we limit the plot size so we don't have to scroll
  1333. X *                      around (not fun).
  1334. X *
  1335. X *   Carsten Steger     Modified to support Kickstart 2.0.
  1336. X *   09/11/91           Opens a text overscan screen when used with WB 2.0.
  1337. X *                      Discerns between NTSC and PAL Amigas when used with
  1338. X *                      WB 1.3 and lower.
  1339. X *
  1340. X *   Pat R. Empleo      Defined some 2.0 stuff in order to get Aztec C to
  1341. X *   09/20/91           work with Carsten's new code (see above).  When
  1342. X *                      KS/WB 2.0 support gets implemented in Aztec C, this
  1343. X *                      kludge will get deleted! 
  1344. X *                      (Aztec C release 5.2 beta)
  1345. X *
  1346. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1347. X * 
  1348. X */
  1349. X
  1350. #ifdef AMIGA_AC_5
  1351. #include <intuition/intuitionbase.h>
  1352. #include <intuition/screens.h>
  1353. #include <graphics/text.h>
  1354. #include <graphics/gfxbase.h>
  1355. X
  1356. #define OSCAN_TEXT     (1)                   /*                            */
  1357. #define SA_Dummy       (TAG_USER + 32)       /* This stuff is temporary    */
  1358. #define SA_Overscan    (SA_Dummy + 0x0014)   /* until Aztec C implements   */
  1359. #define STDSCREENWIDTH -1                    /* KS/WB 2.0 support.         */
  1360. #define TAG_DONE       (0L)                  /*                            */
  1361. #define TAG_USER       (1L<<31)              /*                            */
  1362. X                                             /*                            */
  1363. typedef ULONG Tag;                           /*                            */
  1364. X                                             /*                            */
  1365. struct TagItem                               /*                            */
  1366. X   {                                         /*                            */
  1367. X   Tag   ti_Tag;                             /*                            */
  1368. X   ULONG ti_Data;                            /*                            */
  1369. X   };                                        /*                            */
  1370. X
  1371. #else
  1372. /* You will have to use the Kickstart 2.0 header files for this to compile */
  1373. #include <exec/types.h>
  1374. #include <intuition/intuitionbase.h>
  1375. #include <graphics/gfxbase.h>
  1376. #include <proto/intuition.h>
  1377. #include <proto/graphics.h>
  1378. #include <proto/exec.h>
  1379. #include <proto/diskfont.h>
  1380. #endif
  1381. X
  1382. extern char *getenv(),*strchr();
  1383. X
  1384. #define AMIGA_XMAX 640
  1385. #define AMIGA_YMAX 512
  1386. X
  1387. #define AMIGA_VCHAR (12)
  1388. #define AMIGA_HCHAR (8)
  1389. #define AMIGA_VTIC (AMIGA_YMAX/80)
  1390. #define AMIGA_HTIC (AMIGA_XMAX/80)
  1391. /* The origin is in the upper left hand corner, so we have to translate */
  1392. /* and flip the coordinates: */
  1393. #define AMIGA_VTF(y) (AMIGA_ymax-1-(y))
  1394. X
  1395. X
  1396. struct IntuitionBase *IntuitionBase;
  1397. struct GfxBase *GfxBase;
  1398. struct Library *DiskfontBase;
  1399. static struct TextAttr AMIGA_Font = {
  1400. X  "topaz.font",TOPAZ_EIGHTY,FS_NORMAL,FPF_ROMFONT
  1401. };
  1402. static struct TextFont *AMIGA_TextFont;
  1403. static struct NewScreen AMIGA_NewScreen = {
  1404. X  0,0,AMIGA_XMAX,AMIGA_YMAX,4,15,0,HIRES|LACE,
  1405. X  CUSTOMSCREEN|SCREENBEHIND|SCREENQUIET,NULL,NULL,NULL,NULL
  1406. };
  1407. static struct Screen *AMIGA_Screen;
  1408. static UWORD AMIGA_Colors [] = {
  1409. X  0x000,0xfff,0xbbb,0x0f0,0xf00,0x00f,0x3ca,0xf0f,
  1410. X  0x94d,0x0ff,0x82f,0xff0,0x0af,0xc5e,0xfa2,0xf44
  1411. };
  1412. static int AMIGA_slinetype;
  1413. static enum JUSTIFY AMIGA_justify = LEFT;
  1414. static unsigned int AMIGA_ymax,AMIGA_xmax; 
  1415. static WORD AMIGA_cwd,AMIGA_cht,AMIGA_bsl,AMIGA_vadj;
  1416. static struct TagItem AMIGA_ScrTagList[] = {
  1417. X  {SA_Overscan,OSCAN_TEXT},{TAG_DONE,0}
  1418. };
  1419. X
  1420. X
  1421. AMIGA_reset()
  1422. {
  1423. X  if (AMIGA_TextFont != NULL) CloseFont(AMIGA_TextFont);
  1424. X  if (DiskfontBase != NULL) CloseLibrary(DiskfontBase);
  1425. X  if (AMIGA_Screen != NULL) CloseScreen(AMIGA_Screen);
  1426. X  if (IntuitionBase != NULL) CloseLibrary(IntuitionBase);
  1427. X  if (GfxBase != NULL) CloseLibrary(GfxBase);
  1428. X  AMIGA_TextFont = NULL;
  1429. X  DiskfontBase = NULL;
  1430. X  AMIGA_Screen = NULL;
  1431. X  IntuitionBase = NULL;
  1432. X  GfxBase = NULL;
  1433. }
  1434. X
  1435. X
  1436. AMIGA_init()
  1437. {
  1438. X  static char fontname[80],*gnufont,*search;
  1439. X  static int fsize;
  1440. X  static char *test_str =
  1441. X    " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
  1442. X  static WORD test_len,test_pxl;
  1443. X
  1444. X
  1445. #ifdef AMIGA_LC_5_1
  1446. X  /* Install exit trap in case of abnormal termination (see below). */
  1447. X  int AMIGA_exit();
  1448. X  if (!onexit(&AMIGA_exit)) {
  1449. X    fprintf(stderr,"Couldn't set exit trap\n");
  1450. X    exit(20);
  1451. X  }
  1452. #endif
  1453. X  GfxBase = OpenLibrary("graphics.library",0);
  1454. X  if (GfxBase == NULL) {
  1455. X    fprintf(stderr,"No Graphics-Library\n");
  1456. X    AMIGA_reset();
  1457. X    exit(20);
  1458. X  }
  1459. X  IntuitionBase = OpenLibrary("intuition.library",0);
  1460. X  if (IntuitionBase == NULL) {
  1461. X    fprintf(stderr,"No Intuition-Library\n");
  1462. X    AMIGA_reset();
  1463. X    exit(20);
  1464. X  }
  1465. X  if (IntuitionBase->LibNode.lib_Version <= 34) {
  1466. X    /* We compute the vertical resolution for those poor NTSC-souls   :-)   */
  1467. X    if (GfxBase->DisplayFlags && PAL) AMIGA_ymax = 512;
  1468. X    else AMIGA_ymax = 400;
  1469. X    AMIGA_xmax = 640;
  1470. X    AMIGA_NewScreen.Width = AMIGA_xmax;
  1471. X    AMIGA_NewScreen.Height = AMIGA_ymax;
  1472. X    AMIGA_Screen = OpenScreen(&AMIGA_NewScreen);
  1473. X    if (AMIGA_Screen == NULL) {
  1474. X      fprintf(stderr,"No Screen\n");
  1475. X      AMIGA_reset();
  1476. X      exit(20);
  1477. X    }
  1478. X  } else {
  1479. X    /* Kickstart 2.0 support */
  1480. X    AMIGA_NewScreen.Width = STDSCREENWIDTH;
  1481. X    AMIGA_NewScreen.Height = STDSCREENHEIGHT;
  1482. X    /* I had to set TopEdge equal to 1 with my (probably outdated) software */
  1483. X    /* version of Kickstart 2.0 in order for the last line to be displayed */
  1484. X    /* correctly. Remove the next two lines and check if it still works */
  1485. X    /* with newer ROM-versions of Kickstart 2.0 */
  1486. #ifdef AMIGA_LC_5_1
  1487. X    AMIGA_NewScreen.TopEdge = 1;
  1488. X    AMIGA_NewScreen.LeftEdge = 0;
  1489. #endif
  1490. X    AMIGA_Screen = OpenScreenTagList(&AMIGA_NewScreen,AMIGA_ScrTagList);
  1491. X    if (AMIGA_Screen == NULL) {
  1492. X      fprintf(stderr,"No Screen\n");
  1493. X      AMIGA_reset();
  1494. X      exit(20);
  1495. X    }
  1496. X    AMIGA_xmax = AMIGA_Screen->Width;
  1497. X    AMIGA_ymax = AMIGA_Screen->Height;
  1498. X  }
  1499. X  term_tbl[term].xmax = AMIGA_xmax;
  1500. X  term_tbl[term].ymax = AMIGA_ymax;
  1501. X  gnufont = getenv("GNUFONT");
  1502. X  if (gnufont != NULL ) {
  1503. X    search = strchr(gnufont,'/');
  1504. X    if (search != NULL) {
  1505. X      *search++ = '\0';
  1506. X      strncpy(fontname,gnufont,74);
  1507. X      strcat(fontname,".font");
  1508. X      sscanf(search,"%d",&fsize);
  1509. X      /* Avoid opening "diskfont.library" if a built-in font is desired */
  1510. X      if ((strcmp("topaz.font",fontname) == 0) &&
  1511. X        ((fsize == TOPAZ_EIGHTY) || (fsize == TOPAZ_SIXTY))) {
  1512. X        AMIGA_Font.ta_Name = fontname;
  1513. X        AMIGA_Font.ta_YSize = fsize;
  1514. X        AMIGA_Font.ta_Style = FS_NORMAL;
  1515. X        AMIGA_Font.ta_Flags = FPF_ROMFONT;
  1516. X        AMIGA_TextFont = OpenFont(&AMIGA_Font);
  1517. X        if (AMIGA_TextFont != NULL) 
  1518. X          SetFont(&AMIGA_Screen->RastPort,AMIGA_TextFont);
  1519. X      } else {
  1520. X        DiskfontBase = OpenLibrary("diskfont.library",0);
  1521. X        if (DiskfontBase != NULL) {
  1522. X          AMIGA_Font.ta_Name = fontname;
  1523. X          AMIGA_Font.ta_YSize = fsize;
  1524. X          AMIGA_Font.ta_Style = FS_NORMAL;
  1525. X          AMIGA_Font.ta_Flags = FPF_ROMFONT|FPF_DISKFONT;
  1526. X          AMIGA_TextFont = OpenDiskFont(&AMIGA_Font);
  1527. X          if (AMIGA_TextFont != NULL)
  1528. X            SetFont(&AMIGA_Screen->RastPort,AMIGA_TextFont);
  1529. X        }
  1530. X      }
  1531. X    }
  1532. X  }
  1533. X  /* Width of characters: This works better for proportional fonts than */
  1534. X  /* AMIGA_Screen->RastPort.TxWidth + AMIGA_Screen->RastPort.TxSpacing */
  1535. X  test_len = strlen(test_str);
  1536. X  test_pxl = TextLength(&AMIGA_Screen->RastPort,test_str,test_len);
  1537. X  AMIGA_cwd = test_pxl / test_len;
  1538. X  AMIGA_cht = AMIGA_Screen->RastPort.TxHeight; /* Height of characters */
  1539. X  AMIGA_bsl = AMIGA_Screen->RastPort.TxBaseline; /* Reference line */
  1540. X  /* Amount by which characters have to be shifted upwards to be */
  1541. X  /* vertically justified: */
  1542. X  AMIGA_vadj = AMIGA_bsl / 2;
  1543. X  term_tbl[term].v_char = AMIGA_cht + 4; /* So lines won't be too close */
  1544. X  term_tbl[term].h_char = AMIGA_cwd;
  1545. X  LoadRGB4(&AMIGA_Screen->ViewPort,AMIGA_Colors,16);
  1546. X  RemakeDisplay();
  1547. X  AMIGA_slinetype = 1;
  1548. X  SetAPen(&AMIGA_Screen->RastPort,AMIGA_slinetype);
  1549. X  SetDrMd(&AMIGA_Screen->RastPort,JAM1);
  1550. }
  1551. X
  1552. X
  1553. AMIGA_text()
  1554. {
  1555. X  char c;
  1556. X
  1557. X  c = getc(stdin); /* This is extremely ugly... Yuk !!!!   >:-(   */
  1558. X  ungetc(c,stdin); /* Maybe someone else will find a better solution */
  1559. X  ScreenToBack(AMIGA_Screen);
  1560. }
  1561. X
  1562. X
  1563. AMIGA_graphics()
  1564. {
  1565. X  SetRast(&AMIGA_Screen->RastPort,0);
  1566. X  SetAPen(&AMIGA_Screen->RastPort,AMIGA_slinetype);
  1567. X  ScreenToFront(AMIGA_Screen);
  1568. }
  1569. X
  1570. X
  1571. AMIGA_move(x,y)
  1572. unsigned int x,y;
  1573. {
  1574. X  if ((x>=AMIGA_xmax) || (y>=AMIGA_ymax)) return;
  1575. X  Move(&AMIGA_Screen->RastPort,x,AMIGA_VTF(y));
  1576. }
  1577. X
  1578. X
  1579. AMIGA_vector(x,y)
  1580. unsigned int x,y;
  1581. {
  1582. X  if ((x>=AMIGA_xmax) || (y>=AMIGA_ymax)) return;
  1583. X  Draw(&AMIGA_Screen->RastPort,x,AMIGA_VTF(y));
  1584. }
  1585. X
  1586. X
  1587. AMIGA_linetype(linetype)
  1588. int linetype;
  1589. {
  1590. X  if (linetype >= 13) linetype %= 13;
  1591. X  AMIGA_slinetype = linetype+3;
  1592. X  SetAPen(&AMIGA_Screen->RastPort,AMIGA_slinetype);
  1593. }
  1594. X
  1595. X
  1596. AMIGA_put_text(x,y,str)
  1597. unsigned int x,y;
  1598. char *str;
  1599. {
  1600. X  LONG len,tx_len;
  1601. X  WORD xmin,xmax,ymin,ymax;
  1602. X
  1603. X  len = strlen(str);
  1604. X  tx_len = TextLength(&AMIGA_Screen->RastPort,str,len);
  1605. X  switch (AMIGA_justify) {
  1606. X    case LEFT:
  1607. X      xmin = x;
  1608. X      xmax = x + tx_len;
  1609. X      break;
  1610. X    case CENTRE:
  1611. X      xmin = x - tx_len / 2;
  1612. X      xmax = x + tx_len - tx_len / 2; /* aviod roundoff errors ! */
  1613. X      break;
  1614. X    case RIGHT:
  1615. X      xmin = x - tx_len;
  1616. X      xmax = x;
  1617. X      break;
  1618. X  }
  1619. X  ymin = AMIGA_VTF(y) - AMIGA_vadj;
  1620. X  ymax = ymin + AMIGA_cht;
  1621. X  /* Check if character-string lies completely within the screen: */
  1622. X  if ((xmax >= AMIGA_xmax) || (ymin < 0) || (ymax >= AMIGA_ymax)) return;
  1623. X  Move(&AMIGA_Screen->RastPort,xmin,ymin+AMIGA_bsl);
  1624. X  Text(&AMIGA_Screen->RastPort,str,len);
  1625. }
  1626. X
  1627. X
  1628. int AMIGA_justify_text(mode)
  1629. enum JUSTIFY mode;
  1630. {
  1631. X  AMIGA_justify = mode;
  1632. X  return TRUE;
  1633. }
  1634. X
  1635. X
  1636. /* This function is mainly included if the program terminates abnormally */
  1637. /* and the screen and libraries are still open. It closes down all opened */
  1638. /* libraries and screens. This happens e.g. when loading "bivariat.demo" */
  1639. /* and the stack is smaller than 70000 bytes. */
  1640. #ifdef AMIGA_LC_5_1
  1641. int AMIGA_exit(rc)
  1642. int rc;
  1643. {
  1644. X  AMIGA_reset();
  1645. X  return rc;
  1646. }
  1647. #endif
  1648. SHAR_EOF
  1649. chmod 0644 gnuplot/term/amiga.trm ||
  1650. echo 'restore of gnuplot/term/amiga.trm failed'
  1651. Wc_c="`wc -c < 'gnuplot/term/amiga.trm'`"
  1652. test 10991 -eq "$Wc_c" ||
  1653.     echo 'gnuplot/term/amiga.trm: original size 10991, current size' "$Wc_c"
  1654. rm -f _shar_wnt_.tmp
  1655. fi
  1656. # ============= gnuplot/term/apollo.trm ==============
  1657. if test -f 'gnuplot/term/apollo.trm' -a X"$1" != X"-c"; then
  1658.     echo 'x - skipping gnuplot/term/apollo.trm (File already exists)'
  1659.     rm -f _shar_wnt_.tmp
  1660. else
  1661. > _shar_wnt_.tmp
  1662. echo 'x - extracting gnuplot/term/apollo.trm (Text)'
  1663. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term/apollo.trm' &&
  1664. /* GNUPLOT - apollo.trm */
  1665. /*
  1666. X    Apollo terminal driver for GNUplot.
  1667. X
  1668. X    Open a pad for the graphics, and use GPR routines.  For additional
  1669. X    speed, we do the graphics to a separate bitmap, and the blt the
  1670. X    entire bitmap to the display.  When the user specifies an output
  1671. X    file name, however, we draw directly to the screen, so the graphics
  1672. X    are written to the file correctly.  Thus, the user can save the
  1673. X    graphics in a file, to be viewed later.  If we try the bitmap
  1674. X    trick, it looks funny.
  1675. SHAR_EOF
  1676. true || echo 'restore of gnuplot/term/apollo.trm failed'
  1677. fi
  1678. echo 'End of  part 19'
  1679. echo 'File gnuplot/term/apollo.trm is continued in part 20'
  1680. echo 20 > _shar_seq_.tmp
  1681. exit 0
  1682.  
  1683. exit 0 # Just in case...
  1684. -- 
  1685. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1686. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1687. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1688. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1689.