home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 334_03 / v384.trm < prev    next >
Text File  |  1991-02-05  |  3KB  |  126 lines

  1. /* GNUPLOT - v384.trm */
  2. /*
  3.  * Copyright (C) 1990   
  4.  *
  5.  * Permission to use, copy, and distribute this software and its
  6.  * documentation for any purpose with or without fee is hereby granted, 
  7.  * provided that the above copyright notice appear in all copies and 
  8.  * that both that copyright notice and this permission notice appear 
  9.  * in supporting documentation.
  10.  *
  11.  * Permission to modify the software is granted, but not the right to
  12.  * distribute the modified code.  Modifications are to be distributed 
  13.  * as patches to released version.
  14.  *  
  15.  * This software  is provided "as is" without express or implied warranty.
  16.  * 
  17.  * This file is included by ../term.c.
  18.  *
  19.  * This terminal driver supports:
  20.  *  Vectrix 384 - works with tandy color printer as well
  21.  *
  22.  * AUTHORS
  23.  *   roland@moncskermit.OZ (Roland Yap) 
  24.  * 
  25.  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  26.  * 
  27.  */
  28.  
  29. /*
  30.  *    Vectrix 384 driver - works with tandy color printer as well
  31.  *  in reverse printing 8 color mode.
  32.  *  This doesn't work on Vectrix 128 because it redefines the
  33.  *  color table. It can be hacked to work on the 128 by changing
  34.  *  the colours but then it will probably not print best. The color
  35.  *  table is purposely designed so that it will print well
  36.  *
  37.  */
  38.  
  39. #define V384_XMAX 630
  40. #define V384_YMAX 480
  41.  
  42. #define V384_XLAST (V384_XMAX - 1)
  43. #define V384_YLAST (V384_YMAX - 1)
  44.  
  45. #define V384_VCHAR    12
  46. #define V384_HCHAR    7
  47. #define V384_VTIC    8
  48. #define V384_HTIC    7
  49.  
  50.  
  51. V384_init()
  52. {
  53.     fprintf(outfile,"%c%c  G0   \n",27,18);
  54.     fprintf(outfile,"Q 0 8\n");
  55.     fprintf(outfile,"0 0 0\n");
  56.     fprintf(outfile,"255 0 0\n");
  57.     fprintf(outfile,"0 255 0\n");
  58.     fprintf(outfile,"0 0 255\n");
  59.     fprintf(outfile,"0 255 255\n");
  60.     fprintf(outfile,"255 0 255\n");
  61.     fprintf(outfile,"255 255 0\n");
  62.     fprintf(outfile,"255 255 255\n");
  63. }
  64.  
  65.  
  66. V384_graphics()
  67. {
  68.     fprintf(outfile,"%c%c E0 RE N 65535\n",27,18);
  69. }
  70.  
  71.  
  72. V384_text()
  73. {
  74.     fprintf(outfile,"%c%c\n",27,17);
  75. }
  76.  
  77.  
  78. V384_linetype(linetype)
  79. int linetype;
  80. {
  81. static int color[]= {
  82.         1 /* red */,
  83.         2 /* green */,
  84.         3 /* blue */,
  85.         4 /* cyan */,
  86.         5 /* magenta */,
  87.         6 /* yellow */, /* not a good color so not in use at the moment */
  88.         7 /* white */
  89.     };
  90.         
  91.     if (linetype < 0)
  92.         linetype=6;
  93.     else
  94.         linetype %= 5;
  95.     fprintf(outfile,"C %d\n",color[linetype]);
  96. }
  97.  
  98.  
  99. V384_move(x,y)
  100. unsigned int x,y;
  101. {
  102.     fprintf(outfile,"M %d %d\n",x+20,y);
  103. }
  104.  
  105.  
  106. V384_vector(x,y)
  107. unsigned int x,y;
  108. {
  109.     fprintf(outfile,"L %d %d\n",x+20,y);
  110. }
  111.  
  112.  
  113. V384_put_text (x, y, str)
  114. unsigned int x, y;
  115. char str[];
  116. {
  117.     V384_move (x, y + V384_VCHAR/2);
  118.     fprintf (outfile, "$%s\n", str);
  119. }
  120.  
  121.  
  122. V384_reset()
  123. {
  124. }
  125.  
  126.