summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2018-08-28 09:55:48 +0100
committerChris Liddell <chris.liddell@artifex.com>2018-08-28 09:55:48 +0100
commit5b5536fa88a9e885032bc0df3852c3439399a5c0 (patch)
treed766e1597c9fbf02178d881c815f10432a790727
parentc9b362ba908ca4b1d7c72663a33229588012d7d9 (diff)
Remove gssetresolution/gsgetresolution
These are non-standard, and never used, so remove them. Also rejig gsgetdeviceprop, rename to .gsgetdeviceprop and undefine it after it's used. For the only other use of gsgetdeviceprop, replace with a special_op call.
-rw-r--r--Resource/Init/gs_init.ps28
-rw-r--r--Resource/Init/gs_setpd.ps4
2 files changed, 12 insertions, 20 deletions
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index 90d68c7ee..aa4aaa630 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -767,23 +767,6 @@ userdict /.currentresourcefile //null put
767 { /run .systemvar exec } .execasresource 767 { /run .systemvar exec } .execasresource
768} bind def 768} bind def
769 769
770% Define procedures for getting and setting the current device resolution.
771
772/gsgetdeviceprop % <device> <propname> gsgetdeviceprop <value>
773 { 2 copy mark exch //null .dicttomark .getdeviceparams
774 dup mark eq % if true, not found
775 { pop dup /undefined signalerror }
776 { 5 1 roll pop pop pop pop }
777 ifelse
778 } bind def
779/gscurrentresolution % - gscurrentresolution <[xres yres]>
780 { currentdevice /HWResolution gsgetdeviceprop
781 } bind def
782/gssetresolution % <[xres yres]> gssetresolution -
783 { 2 array astore mark exch /HWResolution exch
784 currentdevice copydevice putdeviceprops setdevice
785 } bind def
786
787% Define auxiliary procedures needed for the above. 770% Define auxiliary procedures needed for the above.
788/shellarguments % -> shell_arguments true (or) false 771/shellarguments % -> shell_arguments true (or) false
789 { /ARGUMENTS where 772 { /ARGUMENTS where
@@ -1521,6 +1504,14 @@ setpacking
1521 dup 150 lt //systemdict /DITHERPPI known not and 1504 dup 150 lt //systemdict /DITHERPPI known not and
1522} bind def 1505} bind def
1523 1506
1507/.gsgetdeviceprop % <device> <propname> gsgetdeviceprop <value>
1508 { 2 copy mark exch //null .dicttomark .getdeviceparams
1509 dup mark eq % if true, not found
1510 { pop dup /undefined signalerror }
1511 { 5 1 roll pop pop pop pop }
1512 ifelse
1513 } bind def
1514
1524% The following implementation uses LL2 extensions, but only in stopped 1515% The following implementation uses LL2 extensions, but only in stopped
1525% contexts so that with LL1, the .set??reshalftone will be used. 1516% contexts so that with LL1, the .set??reshalftone will be used.
1526% 1517%
@@ -1528,7 +1519,7 @@ setpacking
1528% false 1519% false
1529/.getdefaulthalftone { 1520/.getdefaulthalftone {
1530 % try the device to see if it has a default halftone 1521 % try the device to see if it has a default halftone
1531 { currentdevice /HalftoneDefault gsgetdeviceprop } .internalstopped 1522 { currentdevice /HalftoneDefault //.gsgetdeviceprop exec } .internalstopped
1532 { pop pop //false } % no device property 1523 { pop pop //false } % no device property
1533 { dup type /dicttype eq { //true } { pop //false } ifelse } 1524 { dup type /dicttype eq { //true } { pop //false } ifelse }
1534 ifelse 1525 ifelse
@@ -1541,6 +1532,7 @@ setpacking
1541 } 1532 }
1542 if 1533 if
1543} bind def 1534} bind def
1535currentdict /.gsgetdeviceprop .forceundef
1544 1536
1545/.setdefaulthalftone { 1537/.setdefaulthalftone {
1546 .getdefaulthalftone 1538 .getdefaulthalftone
diff --git a/Resource/Init/gs_setpd.ps b/Resource/Init/gs_setpd.ps
index 0fc72300f..4cdfdc0e1 100644
--- a/Resource/Init/gs_setpd.ps
+++ b/Resource/Init/gs_setpd.ps
@@ -204,8 +204,8 @@ level2dict begin
204 mark 204 mark
205 % First put the device's default page size in slot 0 205 % First put the device's default page size in slot 0
206 % This satifies those that have devices built with a4 as the default 206 % This satifies those that have devices built with a4 as the default
207 0 mark /PageSize currentdevice /PageSize gsgetdeviceprop .dicttomark 207 0 mark /PageSize /GetDeviceParam .special_op
208 208 not {/setpagedevice .systemvar /configurationerror signalerror} if .dicttomark
209 % Only populate the other entries if we aren't FIXEDMEDIA 209 % Only populate the other entries if we aren't FIXEDMEDIA
210 FIXEDMEDIA not { 210 FIXEDMEDIA not {
211 statusdict /.pagetypenames get { 211 statusdict /.pagetypenames get {