diff options
author | Nancy Durgin <nancy.durgin@artifex.com> | 2019-02-19 14:56:31 -0800 |
---|---|---|
committer | Nancy Durgin <nancy.durgin@artifex.com> | 2019-02-20 13:55:27 -0800 |
commit | 9a6d754d60409d4ff3832d83801b1d3f96303932 (patch) | |
tree | 4fbaec0c043da35d06d00c7c9ba11b4f09bfc88b /Resource/Init/gs_setpd.ps | |
parent | 214fdd5625c81afa4e2c206eb3e54f1f0435580f (diff) | |
download | ghostpdl-9a6d754d60409d4ff3832d83801b1d3f96303932.tar.gz |
Make it possible to .bind showpage and copypage
A bunch of operators were being redefined later in other code, so that
binding showpage and copypage picked up the wrong versions. I think
historically this was due to the way level2/level3 support was
implemented. Since we no longer support level1 postscript, we can
clean some of this up.
The cleanup involves moving some operators from other files into
gs_init.ps and also removing duplicate (level1) definitions when applicable.
- Move 'initgraphics' operator definition from gs_cspace.ps
- Move .currentnumcopies, .beginpage, .endpage from gs_setpd.ps
- Move 'copypage' definition down near showpage, so code is in right places
There are no changes to the code within the moved functions, other than to
make them .bind executeonly.
Diffstat (limited to 'Resource/Init/gs_setpd.ps')
-rw-r--r-- | Resource/Init/gs_setpd.ps | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/Resource/Init/gs_setpd.ps b/Resource/Init/gs_setpd.ps index 53f9d6b41..c6da8bbb8 100644 --- a/Resource/Init/gs_setpd.ps +++ b/Resource/Init/gs_setpd.ps @@ -18,45 +18,8 @@ languagelevel 1 .setlanguagelevel level2dict begin - % ---------------- Redefinitions ---------------- % -% Redefine .beginpage and .endpage so that they call BeginPage and -% EndPage respectively if appropriate. - -% We have to guard against the BeginPage procedure not popping its operand. -% This is really stupid, but the Genoa CET does it. -/.beginpage { % - .beginpage - - .currentshowpagecount { - .currentpagedevice pop - dup //null ne { /BeginPage .knownget } { pop //false } ifelse { - % Stack: ... pagecount proc - count 2 .execn - % Stack: ... ..???.. oldcount - count 1 add exch sub { pop } repeat - } { - pop - } ifelse - } if -} bind odef - -% Guard similarly against EndPage not popping its operand. -/.endpage { % <reason> .endpage <print_bool> - .currentshowpagecount { - 1 index .currentpagedevice pop - dup //null ne { /EndPage .knownget } { pop //false } ifelse { - % Stack: ... reason pagecount reason proc - count 2 .execn - % Stack: ... ..???.. print oldcount - count 2 add exch sub { exch pop } repeat - } { - pop pop 2 ne - } ifelse - } { - 2 ne - } ifelse -} bind odef - % Define interpreter callouts for handling gstate-saving operators, % to make sure that they create a page device dictionary for use by % the corresponding gstate-restoring operator. @@ -394,19 +357,6 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if { .uninstallpagedevice setgstate //.installpagedevice exec } bind def -% Redefine .currentnumcopies so it consults the NumCopies device parameter. -/.numcopiesdict mark - /NumCopies dup -.dicttomark readonly def - -/.currentnumcopies - { currentdevice //.numcopiesdict .getdeviceparams - dup type /integertype eq - { exch pop exch pop } - { cleartomark #copies } - ifelse - } bind odef - % Redefine .currentpagedevice and .setpagedevice so they convert between % null and a fixed empty directionary. /.nullpagedevice 0 dict readonly def |