home *** CD-ROM | disk | FTP | other *** search
/ OneVision 3.03 / OneVision3.03.iso / Apps / OneVision.app / TMSPrintingPackage.1Vsys / WSBugFix.ps < prev   
Encoding:
Text File  |  1996-11-12  |  3.1 KB  |  101 lines

  1. %!
  2. %%Title: (WSBugFix)
  3. %%Version: 1.1 
  4. %%Copyright: ((C) OneVision GmbH, Regensburg All Rights Reserved)
  5.  
  6. systemdict /nextimage known
  7. {    currentpacking true setpacking
  8.     /hardbind where
  9.     {pop}
  10.     {    /isarray {type dup /arraytype eq exch /packedarraytype eq or} bind def
  11.         /hardbind
  12.         {    dup xcheck exch mark exch
  13.             {    dup type /marktype eq
  14.                 {pop {mark} aload pop}
  15.                 {    dup xcheck
  16.                     {    dup type /nametype eq
  17.                         {dup where {exch get dup xcheck {dup isarray {{exec} aload pop} if} if} if}
  18.                         {dup isarray {hardbind} if}
  19.                         ifelse
  20.                     } if
  21.                 }
  22.                 ifelse
  23.             } forall
  24.             counttomark packedarray exch pop exch {cvx} if
  25.         } bind def
  26.     } ifelse
  27. %% there is a bug in the windowserver. It does not return the
  28. %% current pattern when the underlying colorspace is separation or indexed
  29.     /_CurPatGstate 3 dict def
  30.     _CurPatGstate begin
  31.     /gsavelevel 0 def
  32.     /stack 10 array def
  33.     end
  34.     /currentcolor
  35.     {    currentcolor
  36.         currentcolorspace 0 get /Pattern eq
  37.         {    dup type /dicttype ne 1 index type /nulltype ne and
  38.             {_CurPatGstate /stack get _CurPatGstate /gsavelevel get get}
  39.             if
  40.         } if
  41.     } hardbind def
  42.     /setcolor
  43.     {    currentcolorspace 0 get /Pattern eq
  44.         {dup _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put}
  45.         if
  46.         setcolor
  47.     } hardbind def
  48.     /setpattern
  49.     {    currentcolorspace 0 get /Pattern ne {[/Pattern currentcolorspace] setcolorspace} if
  50.         setcolor
  51.     } hardbind def
  52.     /gsave
  53.     {    gsave
  54.         _CurPatGstate /stack get _CurPatGstate /gsavelevel get get
  55.         _CurPatGstate /gsavelevel 2 copy get 1 add put
  56.         _CurPatGstate /stack get length _CurPatGstate /gsavelevel get le
  57.         {    _CurPatGstate /stack get dup length 10 add array
  58.             _CurPatGstate /stack 2 index put copy pop
  59.             _CurPatGstate /stack get dup length 10 sub
  60.             10 {2 copy null put 1 add} repeat pop pop
  61.         } if
  62.         _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put
  63.     } hardbind def
  64.     /grestore
  65.     {    _CurPatGstate /gsavelevel 2 copy get dup 0 gt {1 sub} if put
  66.         grestore
  67.     } hardbind def
  68. %% second bug in the windowserver: nulldevice causes windowserver death
  69. %% when the current colorspace is a noncolored pattern
  70.     /nulldevice
  71.     {    matrix currentmatrix 0 0 0 0 Nonretained window dup windowdeviceround termwindow setmatrix
  72.     } hardbind def
  73. %% third bug in the windowserver: CCITTFax filters don't work and SubFileDecode has a limit of 65535
  74.     /repairfilterbugsdict 2 dict def
  75.     repairfilterbugsdict begin
  76.     revision 125 lt {/CCITTFaxDecode {pop pop pop [500 string] cvx 0 () /SubFileDecode} hardbind def} if
  77.     /SubFileDecode
  78.     {    2 index 65535 gt
  79.         {    4 2 roll
  80.             3 dict begin /datalenstr 20 string def /bufstr 500 string def
  81.             /datalenstr load cvs pop /inputfile exch dup type /filetype ne {0 () /SubFileDecode filter} if def
  82.             [    currentdict end
  83.                 {    begin
  84.                     /bufstr load /datalenstr load cvi
  85.                     dup 2 index length lt {0 exch getinterval 0} {1 index length sub} ifelse
  86.                     /datalenstr load 0 1 2 index length 1 sub {0 3 copy put pop pop} for cvs pop
  87.                     dup length 0 gt {/inputfile load exch readstring pop} if
  88.                     end
  89.                 } /exec cvx
  90.             ] cvx 0 4 -2 roll
  91.         } if
  92.     } hardbind def
  93.     end
  94.     /filter
  95.     {    repairfilterbugsdict 1 index known
  96.         {repairfilterbugsdict 1 index get exec} if
  97.         filter
  98.     } hardbind def
  99.     setpacking
  100. } if
  101.