PSPrStr.st
changeset 378 91abcf70e0c3
parent 375 ab43222a70ce
child 380 fa5adc326473
--- a/PSPrStr.st	Sat Jun 01 15:29:46 1996 +0200
+++ b/PSPrStr.st	Mon Jun 03 12:02:46 1996 +0200
@@ -14,9 +14,9 @@
 	instanceVariableNames:'xPos yPos lineBuffer colNr lineNr fFamily fStyle pageStartAction
 		pageEndAction'
 	classVariableNames:'Prolog Trailer PageProlog PageTrailer FontNames FontHeight
-		FontWidth LeftX TopMargin LeftMargin BottomMargin TopY PageHeight
-		LinesPerPage PhysicalPageHeight Italic Bold Normal BoldItalic
-		Courier Times Helvetica'
+		FontWidth LeftX TopY PageHeight LinesPerPage PhysicalPageHeight
+		Italic Bold Normal BoldItalic Courier Times Helvetica TopInset
+		LeftInset BottomInset'
 	poolDictionaries:''
 	category:'Streams-External'
 !
@@ -293,14 +293,14 @@
         PageFormat := #letter
     ].
 
-    TopMargin isNil ifTrue:[
-        TopMargin := 0.652778.  "/ inches
+    TopInset isNil ifTrue:[
+        TopInset := 0.652778.  "/ inches
     ].
-    BottomMargin isNil ifTrue:[
-        BottomMargin := 1.18056 "/ inches
+    BottomInset isNil ifTrue:[
+        BottomInset := 1.18056 "/ inches
     ].
-    LeftMargin isNil ifTrue:[
-        LeftMargin := 0.625.     "/ inches
+    LeftInset isNil ifTrue:[
+        LeftInset := 0.625.     "/ inches
     ].
 
     "/     +-----------------------------------------------+  PageHeight
@@ -316,7 +316,7 @@
     "/     |                                               |
     "/     (0/0)-------------------------------------------+  0
 
-    LeftX := (UnitConverter convert:LeftMargin from:#inch to:#twip) rounded.
+    LeftX := (UnitConverter convert:LeftInset from:#inch to:#twip) rounded.
 
     PhysicalPageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
     Landscape ifTrue:[
@@ -325,11 +325,11 @@
         PageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
     ].
 
-    TopY := PageHeight - (UnitConverter convert:TopMargin from:#inch to:#twip) rounded.
-    LinesPerPage := TopY - (UnitConverter convert:BottomMargin from:#inch to:#twip) rounded // 200.
+    TopY := PageHeight - (UnitConverter convert:TopInset from:#inch to:#twip) rounded.
+    LinesPerPage := TopY - (UnitConverter convert:BottomInset from:#inch to:#twip) rounded // 200.
 
     "Modified: 30.5.1996 / 17:24:55 / ca"
-    "Modified: 31.5.1996 / 23:33:00 / cg"
+    "Modified: 3.6.1996 / 10:45:34 / cg"
 !
 
 initPageProlog
@@ -487,25 +487,58 @@
 bottomInset
     "return the bottom margin (in inches)"
 
-    ^ BottomMargin
+    ^ BottomInset
 
     "Created: 1.6.1996 / 13:07:43 / cg"
+    "Modified: 3.6.1996 / 10:44:44 / cg"
+!
+
+bottomInset:inches
+    "set the bottom margin (in inches)"
+
+    BottomInset := inches.
+    self reInitPage.
+
+    "Created: 3.6.1996 / 10:46:25 / cg"
+    "Modified: 3.6.1996 / 10:47:16 / cg"
 !
 
 leftInset
     "return the left margin (in inches)"
 
-    ^ TopMargin
+    ^ LeftInset
 
     "Created: 1.6.1996 / 13:07:12 / cg"
+    "Modified: 3.6.1996 / 10:45:11 / cg"
+!
+
+leftInset:inches
+    "set the left margin (in inches)"
+
+    LeftInset := inches.
+    self reInitPage.
+
+    "Created: 3.6.1996 / 10:46:33 / cg"
+    "Modified: 3.6.1996 / 10:47:21 / cg"
 !
 
 topInset
     "return the top margin (in inches)"
 
-    ^ TopMargin
+    ^ TopInset
 
     "Created: 1.6.1996 / 13:07:20 / cg"
+    "Modified: 3.6.1996 / 10:45:17 / cg"
+!
+
+topInset:inches
+    "set the top margin (in inches)"
+
+    TopInset := inches.
+    self reInitPage.
+
+    "Created: 3.6.1996 / 10:46:41 / cg"
+    "Modified: 3.6.1996 / 10:47:26 / cg"
 ! !
 
 !PostscriptPrinterStream class methodsFor:'queries'!
@@ -516,6 +549,14 @@
     ^ 'postscript printer'
 !
 
+supportsMargins
+    "return true if this printer supports margins"
+
+    ^ true
+
+    "Created: 3.6.1996 / 10:48:04 / cg"
+!
+
 supportsPageSizes
     "return true if this printer supports different page sizes"
 
@@ -884,6 +925,6 @@
 !PostscriptPrinterStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Attic/PSPrStr.st,v 1.33 1996-06-01 11:28:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Attic/PSPrStr.st,v 1.34 1996-06-03 10:02:05 cg Exp $'
 ! !
 PostscriptPrinterStream initialize!