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

  1. /* GNUPLOT - dxy.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.  *  Roland DXY800A plotter 
  21.  *
  22.  * AUTHORS
  23.  *  Martin Yii, eln557h@monu3.OZ
  24.  *  Further modified Jan 1990 by Russell Lang, rjl@monu1.cc.monash.oz
  25.  * 
  26.  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  27.  * 
  28.  */
  29.  
  30. #define DXY_XMAX 2470
  31. #define DXY_YMAX 1700
  32.  
  33. #define DXY_XLAST (DXY_XMAX - 1)
  34. #define DXY_YLAST (DXY_XMAX - 1)
  35.  
  36. #define DXY_VCHAR    (56)    /* double actual height of characters */
  37. #define DXY_HCHAR    (28)    /* actual width including spacing */
  38. #define DXY_VTIC    (28)        
  39. #define DXY_HTIC    (28)        
  40.  
  41. int dxy_angle = 0;
  42.  
  43. DXY_init()
  44. {
  45. /*
  46.     No initialisation sequences for DXY 800A
  47. */
  48. }
  49.  
  50.  
  51. DXY_graphics()
  52. {
  53.     /* HOME, Character size 3 */
  54.     fprintf(outfile,"H\nS3\n");
  55. }
  56.  
  57.  
  58. DXY_text()
  59. {
  60. /*
  61.     No sequences needed
  62. */
  63. }
  64.  
  65.  
  66. DXY_linetype(linetype)
  67. int linetype;
  68. {
  69.     /* select pen */
  70.     fprintf(outfile,"J%d\n",(linetype+2)%8+1);
  71.     switch(linetype) {
  72.        case -1 :  /* use dotted line for axis */
  73.                fprintf(outfile,"L1\nB50\n");
  74.             break;
  75.        default :  /* use solid line for all others */
  76.             fprintf(outfile,"L0\n");
  77.                 break;
  78.        }
  79. }
  80.  
  81.  
  82. DXY_move(x,y)
  83. int x,y;
  84. {
  85.     fprintf(outfile,"M%d,%d\n",x,y);
  86. }
  87.  
  88.  
  89. DXY_vector(x,y)
  90. int x,y;
  91. {
  92.     fprintf(outfile,"D%d,%d\n",x,y);
  93. }
  94.  
  95.  
  96. DXY_put_text(x,y,str)
  97. int x, y;
  98. char *str;
  99. {
  100.     if (dxy_angle == 1 ) 
  101.         /* vertical */
  102.         DXY_move(x + DXY_VCHAR/4,y);
  103.     else
  104.         /* horiz */
  105.         DXY_move(x,y - DXY_VCHAR/4);
  106.     fprintf(outfile,"P%s\n",str);
  107. }
  108.  
  109.  
  110. int DXY_text_angle(ang)
  111. int ang;
  112. {
  113.     dxy_angle = ang;
  114.     fprintf(outfile,"Q%d\n",ang);
  115.     return TRUE;
  116. }
  117.  
  118.  
  119. DXY_reset()
  120. {
  121.     /* Home pen */
  122.     fprintf(outfile,"H\n");
  123. }
  124.  
  125.