home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / inne / gs300ini / gs_statd.ps < prev    next >
Encoding:
Text File  |  1994-08-02  |  8.4 KB  |  222 lines

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