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

  1. /* GNUPLOT - hp26.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.  *  HP2623A 
  21.  *
  22.  * AUTHORS
  23.  *   hplvlch!ch (Chuck Heller) 
  24.  * 
  25.  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  26.  * 
  27.  */
  28.  
  29.  
  30. #define HP26_XMAX 512
  31. #define HP26_YMAX 390
  32.  
  33. #define HP26_XLAST (HP26_XMAX - 1)
  34. #define HP26_YLAST (HP26_XMAX - 1)
  35.  
  36. /* Assume a character size of 1, or a 7 x 10 grid. */
  37. #define HP26_VCHAR    10
  38. #define HP26_HCHAR    7
  39. #define HP26_VTIC    (HP26_YMAX/70)        
  40. #define HP26_HTIC    (HP26_XMAX/75)        
  41.  
  42. HP26_init()
  43. {
  44.     /*    The HP2623A needs no initialization. */
  45. }
  46.  
  47.  
  48. HP26_graphics()
  49. {
  50.     /*    Clear and enable the display */
  51.  
  52.     fputs("\033*daZ\033*dcZ",outfile);
  53. }
  54.  
  55.  
  56. HP26_text()
  57. {
  58.     fputs("\033*dT",outfile);    /* back to text mode */
  59. }
  60.  
  61.  
  62. HP26_linetype(linetype)
  63. int linetype;
  64. {
  65. #define    SOLID    1
  66. #define LINE4    4
  67. #define LINE5    5
  68. #define LINE6    6
  69. #define LINE8    8
  70. #define    DOTS    7
  71. #define LINE9    9
  72. #define LINE10    10
  73.  
  74. static int map[2+9] = {    SOLID,    /* border */
  75.                         SOLID,    /* axes */
  76.                         DOTS,    /* plot 0 */
  77.                         LINE4,    /* plot 1 */
  78.                         LINE5,    /* plot 2 */
  79.                         LINE6,    /* plot 3 */
  80.                         LINE8,    /* plot 4 */
  81.                         LINE9,    /* plot 5 */
  82.                         LINE10,    /* plot 6 */
  83.                         SOLID,    /* plot 7 */
  84.                         SOLID    /* plot 8 */ };
  85.  
  86.     if (linetype >= 9)
  87.         linetype %= 9;
  88.     fprintf(outfile,"\033*m%dB",map[linetype + 2]);
  89. }
  90.  
  91.  
  92. HP26_move(x,y)
  93. int x,y;
  94. {
  95.     fprintf(outfile,"\033*pa%d,%dZ",x,y);
  96. }
  97.  
  98.  
  99. HP26_vector(x,y)
  100. int x,y;
  101. {
  102.     fprintf(outfile,"\033*pb%d,%dZ",x,y);
  103. }
  104.  
  105.  
  106. HP26_put_text(x,y,str)
  107. int x, y;
  108. char *str;
  109. {
  110.     HP26_move(x,y - HP26_VCHAR/2);
  111.     fputs("\033*dS",outfile);
  112.     fprintf(outfile,"\033*m3Q\033*l%s\n",str);
  113.     fputs("\033*dT",outfile);
  114. }
  115.  
  116.  
  117.  
  118. HP26_reset()
  119. {
  120. }
  121.  
  122.