home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / GPT34SRC / TERM / EXCL.TRM < prev    next >
Text File  |  1993-05-11  |  6KB  |  204 lines

  1. /*
  2.  * $Id: excl.trm 3.38.2.18 1992/11/23 21:54:22 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* Copyright (c) 1992 by P. Klosowski at NIST.  All Rights Reserved 
  7.  *
  8.  * Permission to use, copy, and distribute this software and its
  9.  * documentation for any purpose with or without fee is hereby granted, 
  10.  * provided that the above copyright notice appear in all copies and 
  11.  * that both that copyright notice and this permission notice appear 
  12.  * in supporting documentation.
  13.  *
  14.  * Permission to modify the software is granted, but not the right to
  15.  * distribute the modified code.  Modifications are to be distributed 
  16.  * as patches to released version.
  17.  *  
  18.  * This software  is provided "as is" without express or implied warranty.
  19.  * 
  20.  * This file is included by ../term.c.
  21.  *
  22.  * 
  23.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  24.  *
  25.  ***     $Id: excl.trm 3.38.2.18 1992/11/23 21:54:22 woo Exp $
  26.      
  27.   NAME
  28.      quic
  29.    PURPOSE
  30.      QUIC driver for GNUPLOT
  31.    NOTES
  32.      
  33.    HISTORY
  34.      przemek - Aug 16, 1992: Created.
  35. ***/
  36. /*
  37. c               *****************************************
  38. c               *****************************************
  39. c               ******                              *****
  40. c               ******   EXCL command definitions   *****
  41. c               ******                              *****
  42. c               *****************************************
  43. c               *****************************************
  44. */
  45.  
  46. /*  Define ansi command headers, NUL character */
  47. #define ESC "\033"
  48. #define GS  "\035"
  49. #define CSI "\033["
  50. #define DCS "\033P"
  51. #define ST  "\033\\"
  52.  
  53. /*
  54. page numbers are given per "Talaris EXCL programmer's reference manual" M292 rev.2
  55. NOTE: EXCL coordinate system places (0,0) at upper left corner of the page
  56.  
  57. c EXCL commands for initialization
  58.  
  59. c     TALAMS: set ANSI                                        (p. 162)
  60. c     TALMOD: set emulation *** EXCL                          (p. 164)
  61. c     TALPGO: set page orient *** landscape                   (p.  81)
  62. c     TALFCTL: set paper format *** 8.5x11                    (p.  85)
  63. c     TALTBM: set top/bot margins  ** in land mode to full pg (p.  73)
  64. c     TALLRM: set left/right margins                          (p.  75)
  65. c     PUM:    set units ** units of measure set by TALPRM     (p.  67)
  66. c     TALASF: Absorb cr/ff/lf/vt   ** ON                      (p. 182)
  67. c     TALPOP: pop controller params                           (p. 168)
  68. c     TALPSH: push controller params                          (p. 167)
  69. c     TALPRM: set units of measure ** to 1/1000 inch          (p.  64)
  70. c     TALGLT: set line type ** solid                          (p. 211)
  71. c     TALORG: set page absolute origin ** (0,0) UL corner     (p.  78) 
  72. c     TALPCW: set page clip window *** for landsc/full page   (p.  84)
  73. c     TALGLP: line: **pen7x7mil*draw*smear*glyph112*font5279* (p. 208)
  74. c     TALGLPE: ending for TALGLP command, forcing DRAW mode
  75. c     TALGBB: bounding box; used only by qdrive               (p. 207)
  76. c     TALFPO: Force page out  ** clear bitmap                 (p.  95)
  77. c     TALGDW: graphical draw to hor,vert ** abs  coords       (p. 212)
  78. c     TALGMV: graphical move to hor,vert ** abs  coords       (p. 213)
  79. */
  80. #define TALAMS  "\033[0*s"
  81. #define TALMOD  "\033[1;0r"
  82. #define TALPGO  "\033[1;0p"
  83. #define TALFCTL "\033[0;3x"
  84. #define TALTBM  "\033[0;8500 v"
  85. #define TALLRM  "\033[0;11000v"
  86. #define PUM     "\033[11h"
  87. #define TALASF  "\033[1 z"
  88. #define TALPOP  "\033[*]"
  89. #define TALPSH  "\033[*["
  90. #define TALPRM  "\033[3y"
  91. #define TALGLT  "\033[%s*t"
  92. #define TALORG  "\033[0;0o"
  93. #define TALCCNT "\033[1;0u"
  94. #define TALPCW  "\033[0;8500;11000;0*c"
  95. #define TALGLP_init  "\033[7;7;8;1;112;5279*w"
  96. #define TALGLP  "\033[%d;%d;8*w"
  97. #define TALFPO  "\033[0*F"
  98. #define TALGDW "\033[0;%d;%d*d"
  99. #define TALGMV "\033[0;%d;%d*m"
  100.  
  101. /*  TALPYL: polyline                                        (p. 222)
  102. **        5;0} list of 16-bit signed integers, encoded, mostly relative
  103. **        5,1} list of ASCII  absolute coords (if w/o +- signs)(e.g. 315:1222;)
  104. */
  105.  
  106. #define TALPYL  "\033P5;1}"
  107.  
  108. #define EXCL_XMAX 9000
  109. #define EXCL_YMAX 6500
  110.  
  111. #define EXCL_XLAST (EXCL_XMAX - 1)
  112. #define EXCL_YLAST (EXCL_YMAX - 1)
  113.  
  114. #define EXCL_VCHAR        120
  115. #define EXCL_HCHAR        70
  116. #define EXCL_VTIC        70
  117. #define EXCL_HTIC        70
  118.  
  119. EXCL_init()
  120. {
  121.   fprintf(outfile,"%s%s%s%s%s%s",
  122.                 TALPSH,TALAMS,TALMOD,TALCCNT,TALFCTL,TALASF);
  123. /*                ^save state   ^setEXCL       ^PaperSize8.5x11       */
  124. /*                       ^setANSI      ^copyCount1     ^absorbCtlChar */
  125.   fprintf(outfile, "%s%s%s%s%s%s",
  126.           PUM,TALPRM,TALPGO,TALPCW,TALORG,TALGLP_init);
  127.   fprintf(outfile,                                            TALGLT,"");
  128. /*                ^setUnits  ^landscape    ^OriginZero        ^SolidLine   */
  129. /*                    ^Units1/1000" ^pageClip     ^SetLine            */
  130. }
  131.  
  132. EXCL_graphics()
  133. {
  134. }
  135.  
  136. EXCL_text()
  137. {
  138.     fprintf(outfile,TALFPO );
  139.     /*              ^pageout  */
  140. }
  141.  
  142.  
  143. EXCL_linetype(linetype)
  144. int linetype;
  145. {
  146. /* excl line widths in mils: 4 is mimimum, but too thin; then 
  147.    7,10,14,17,20,24,27...
  148.    exclpen=MOD(NPEN,8)*7
  149.    CSI  exclpen; exclpen; TALGLPE
  150. */
  151.   static char *type[2+9]={ 
  152.     "", "40;40", "",  "42;42",  "14;21",
  153.     /*   ....   ----  -- -- --   . . .   */
  154.      "",  "49;30",  "14;21",         "",  "49;30",  "14;21"
  155.     /*  same pattern, but thicker..  and thicker       */
  156.     };
  157.   static int width[2+9] = {14, 7,    7, 7, 7, 10, 10, 10, 17, 17, 17};
  158.   if (linetype >= 9)
  159.     linetype %= 9;
  160.   fprintf(outfile,TALGLP,width[linetype+2],width[linetype+2]); 
  161.   /*              ^width in dots */
  162.   fprintf(outfile,TALGLT,type[linetype+2]);
  163.   /*              ^line type     */
  164. }
  165.  
  166.  
  167. EXCL_move(x,y)
  168. int x,y;
  169. {
  170.     fprintf(outfile,TALGMV, 1000 + x, EXCL_YLAST + 1000 - y);
  171. /*                     ^pen up vector*/
  172. }
  173.  
  174.  
  175. EXCL_vector(x2,y2)
  176. int x2,y2;
  177. {
  178.     fprintf(outfile,TALGDW, 1000 + x2, EXCL_YLAST + 1000 - y2);
  179. /*                     ^pen down vector*/
  180. }
  181.  
  182.  
  183. EXCL_put_text(x,y,str)
  184. unsigned int x,y;
  185. char str[];
  186. {
  187. char ch;
  188.     EXCL_move(x,y - EXCL_VCHAR/3);
  189.     ch = *str++;
  190.     while(ch!='\0') {
  191.         putc(ch,outfile);
  192.         ch = *str++;
  193.     }
  194. }
  195.  
  196. EXCL_reset()
  197. {
  198.     fprintf(outfile,"%s%s", TALFPO, TALPOP);
  199.     /*                      ^pageout ^pop  */
  200. }
  201.  
  202.  
  203.  
  204.