home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GSPMSRC / SRC / GS_STATD.PS < prev    next >
Text File  |  1993-12-16  |  8KB  |  202 lines

  1. %    Copyright (C) 1989-1993 Aladdin Enterprises.  All rights reserved.
  2. %
  3. % This file is part of Ghostscript.
  4. %
  5. % Ghostscript is distributed in the hope that it will be useful, but
  6. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. % to anyone for the consequences of using it or for whether it serves any
  8. % particular purpose or works at all, unless he says so in writing.  Refer
  9. % to the Ghostscript General Public License for full details.
  10. %
  11. % Everyone is granted permission to copy, modify and redistribute
  12. % Ghostscript, but only under the conditions described in the Ghostscript
  13. % General Public License.  A copy of this license is supposed to have been
  14. % given to you along with Ghostscript so you can know your rights and
  15. % responsibilities.  It should be in a file named COPYING.  Among other
  16. % things, the copyright notice and this notice must be preserved on all
  17. % copies.
  18.  
  19. % This file provides statusdict, serverdict, and assorted LaserWriter
  20. % operators, mostly for the benefit of poorly designed PostScript programs
  21. % that 'know' they are running on a LaserWriter.
  22.  
  23. systemdict begin
  24.  
  25.  /statusdict 80 dict def
  26.  /serverdict 4 dict def
  27.  
  28. % Define various paper formats.
  29. % Only letter, note, and legal are defined in the Adobe manual.
  30. % These procedures are also accessed as data structures during initialization,
  31. % so the page dimensions must be the first two elements of the procedure.
  32.  
  33.  /letter {612 792 //statusdict begin .setpagesize end} bind def
  34.  /note {540 720 //statusdict begin .setpagesize end} bind def
  35.  /legal {612 1008 //statusdict begin .setpagesize end} bind def
  36.  /a0 {2380 3368 //statusdict begin .setpagesize end} bind def  % ISO standard
  37.  /a1 {1684 2380 //statusdict begin .setpagesize end} bind def  % ISO standard
  38.  /a2 {1190 1684 //statusdict begin .setpagesize end} bind def  % ISO standard
  39.  /a3 {842 1190 //statusdict begin .setpagesize end} bind def  % ISO standard
  40.  /a4 {595 842 //statusdict begin .setpagesize end} bind def  % ISO standard
  41.  /a5 {421 595 //statusdict begin .setpagesize end} bind def  % ISO standard
  42.  /a6 {297 421 //statusdict begin .setpagesize end} bind def  % ISO standard
  43.  /a7 {210 297 //statusdict begin .setpagesize end} bind def  % ISO standard
  44.  /a8 {148 210 //statusdict begin .setpagesize end} bind def  % ISO standard
  45.  /a9 {105 148 //statusdict begin .setpagesize end} bind def  % ISO standard
  46.  /a10 {74 105 //statusdict begin .setpagesize end} bind def  % ISO standard
  47.  /b0 {2836 4008 //statusdict begin .setpagesize end} bind def  % ISO standard
  48.  /b1 {2004 2836 //statusdict begin .setpagesize end} bind def  % ISO standard
  49.  /b2 {1418 2004 //statusdict begin .setpagesize end} bind def  % ISO standard
  50.  /b3 {1002 1418 //statusdict begin .setpagesize end} bind def  % ISO standard
  51.  /b4 {709 1002 //statusdict begin .setpagesize end} bind def  % ISO standard
  52.  /b5 {501 709 //statusdict begin .setpagesize end} bind def  % ISO standard
  53.  /archE {2592 3456 //statusdict begin .setpagesize end} bind def % U.S. CAD std
  54.  /archD {1728 2592 //statusdict begin .setpagesize end} bind def % U.S. CAD std
  55.  /archC {1296 1728 //statusdict begin .setpagesize end} bind def % U.S. CAD std
  56.  /archB {864 1296 //statusdict begin .setpagesize end} bind def  % U.S. CAD std
  57.  /archA {648 864 //statusdict begin .setpagesize end} bind def  % U.S. CAD std
  58.  /flsa {612 936 //statusdict begin .setpagesize end} bind def  % U.S. foolscap
  59.  /flse {612 936 //statusdict begin .setpagesize end} bind def  % European foolscap
  60.  /halfletter {396 612 //statusdict begin .setpagesize end} bind def
  61.  /11x17 {792 1224 //statusdict begin .setpagesize end} bind def  % 11x17 portrait
  62.  /ledger {1224 792 //statusdict begin .setpagesize end} bind def  % 11x17 landscape
  63.  
  64. end
  65.  
  66. statusdict begin
  67.  
  68. % Define the pagetype values for the known page formats.
  69. % The values for all but letter and note are arbitrary.
  70. /.pagetypenames
  71.  { /letter /note /legal 
  72.    /a0 /a1 /a2 /a3 /a4 /a5 /a6 /a7 /a8 /a9 /a10
  73.    /b0 /b1 /b2 /b3 /b4 /b5 /archE /archD /archC /archB /archA
  74.    /flsa /flse /halfletter /11x17 /ledger
  75.  } cvlit readonly def
  76.  
  77. %%%%%% The following items were suggested by a user as useful.
  78.  
  79. % Permanent definitions
  80.  
  81. /ramsize         4194304 def
  82. /hardwareiomode        0 def
  83.     /sethardwareiomode     {pop} bind def
  84. /softwareiomode        0 def
  85.     /setsoftwareiomode     {pop} bind def
  86. /dosysstart        false def
  87.     /setdosysstart         {pop} bind def
  88. /allowjobreset      true def
  89.     /setallowjobreset      {pop} bind def
  90. /defaultpaperfamily    0 def
  91.     /setdefaultpaperfamily {pop} bind def
  92. /defaultpapertray      0 def
  93.     /setdefaultpapertray   {pop} bind def
  94. /defaulttrayswitch false def
  95.     /setdefaulttrayswitch  {pop} bind def
  96.  
  97. % Tray and format selection
  98.  
  99.  /11x17tray {} bind def
  100.  /a3tray {} bind def
  101.  /a4tray {} bind def
  102.  /a5tray {} bind def
  103.  /a6tray {} bind def
  104.  /b4tray {} bind def
  105.  /flsatray {} bind def
  106.  /flsetray {} bind def
  107.  /halflettertray {} bind def
  108.  /legaltray {} bind def
  109.  /lettertray {} bind def
  110.  
  111. % Per-job parameters
  112.  
  113. /paperfamily 0 def    % 0 is US, 1 is European
  114. /papertray 1 def
  115.     /setpapertray {statusdict exch /papertray exch put} bind def 
  116. /trayswitch false def    % paperout feeds from another tray
  117. /papersize {/letter true} bind def    % <name of paper size>, <short-edge-first-p>
  118. /appletalktype (LaserWriter) def
  119.  
  120. %%%%%% The following items are defined in the PostScript Language
  121. %%%%%% Reference Manual, First Edition.
  122.  
  123.  /checkpassword {statusdict begin .password eq end} bind def
  124.  /defaulttimeouts {statusdict begin .timeouts aload pop end} bind def
  125. %/dostartpage
  126.  /eescratch {pop 0} bind def
  127.  /idlefonts {statusdict begin mark .idlefonts aload pop end} bind def
  128.  /jobname () def
  129. %/jobtimeout
  130.  /manualfeed false def
  131.  /manualfeedtimeout 60 def
  132.  /margins {statusdict begin .topmargin .leftmargin end} bind def
  133.  /pagecount {4711} bind def
  134.  /pagestackorder {false} bind def
  135. %/pagetype
  136.  /prefeed false def
  137.  /printererror {pop pop} bind def
  138.  /printername {statusdict begin .printername exch copy end} bind def
  139.  /processcolors /processcolors load def        % defined in systemdict
  140.  /product product def        % product is defined in systemdict
  141.  /revision revision def        % revision is defined in systemdict
  142.  /sccbatch {pop 9600 0} bind def
  143.  /sccinteractive {pop 9600 0} bind def
  144.  /setdefaulttimeouts {statusdict begin .timeouts astore pop end} bind def
  145.  /setdostartpage {statusdict exch /dostartpage exch put} bind def
  146.  /setduplexmode {pop} bind def
  147.  /seteescratch {pop pop} bind def
  148.  /setidlefonts {] statusdict exch /.idlefonts exch put} bind def
  149.  /setjobtimeout {statusdict exch /jobtimeout exch put} bind def
  150.  /setmargins
  151.   {statusdict begin /.leftmargin exch def /.topmargin exch def end} bind def
  152.  /setpagetype
  153.   { statusdict begin
  154.       dup .pagetypenames exch get systemdict exch get exec
  155.       /pagetype exch def
  156.     end
  157.   } bind def
  158.  /setpassword
  159.   {exch checkpassword
  160.     {statusdict exch /.password exch put true}
  161.     {pop false}
  162.    ifelse} bind def
  163.  /setprintername
  164.   {dup length string copy statusdict exch /printername exch put} bind def
  165.  /setsccbatch {pop pop pop} bind def
  166.  /setsccinteractive {pop pop pop} bind def
  167.  /waittimeout 300 def
  168.  
  169. /.setpagesize
  170.  { mark /HWSize [
  171.      4 index 4 index matrix defaultmatrix dtransform
  172.      abs ceiling cvi exch abs ceiling cvi exch
  173.    ] currentdevice putdeviceprops pop pop pop
  174.    initmatrix initclip erasepage
  175.  } bind def
  176. /.password 0 def
  177. /.timeouts [0 60 30] def
  178. true setdostartpage
  179. mark setidlefonts
  180. 0 setjobtimeout
  181. 0 0 setmargins
  182. 0 setpagetype
  183. product setprintername
  184.  
  185. end    % statusdict
  186.  
  187. % The following contents of serverdict are a complete guess,
  188. % based on some observed LaserWriter boilerplate.
  189.  
  190. serverdict begin
  191.  
  192.  /execjob { } bind def
  193. % The Red Book implies that something like the following is
  194. % an appropriate definition of exitserver.
  195.  /exitserver { clear stop } bind def
  196. % However, this interacts badly with our standard error handler,
  197. % so we override it with the following less appropriate definition.
  198.  /exitserver { 0 ne { clear cleardictstack } if } bind def
  199.  /setrealdevice { } bind def
  200.  
  201. end    % serverdict
  202.