checkin from browser
authorClaus Gittinger <cg@exept.de>
Mon, 03 Jun 1996 12:02:46 +0200
changeset 378 91abcf70e0c3
parent 377 3be86dc85537
child 379 ae282a246159
checkin from browser
PSPrStr.st
PostscriptPrinterStream.st
PrinterStream.st
--- 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!
--- a/PostscriptPrinterStream.st	Sat Jun 01 15:29:46 1996 +0200
+++ b/PostscriptPrinterStream.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/PostscriptPrinterStream.st,v 1.33 1996-06-01 11:28:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.34 1996-06-03 10:02:05 cg Exp $'
 ! !
 PostscriptPrinterStream initialize!
--- a/PrinterStream.st	Sat Jun 01 15:29:46 1996 +0200
+++ b/PrinterStream.st	Mon Jun 03 12:02:46 1996 +0200
@@ -178,6 +178,15 @@
 
 !PrinterStream class methodsFor:'accessing - defaults'!
 
+bottomInset
+    "return the bottomInset (in inches). Here, no bottom inset is supported,
+     but its redefined in some printer classes"
+
+    ^ 0
+
+    "Created: 3.6.1996 / 10:43:44 / cg"
+!
+
 defaultCommands
     "return a list presented as possible commands for printed
      (in the launchers printer configuration).
@@ -278,6 +287,15 @@
     "Modified: 1.6.1996 / 00:49:22 / cg"
 !
 
+leftInset
+    "return the leftInset (in inches). Here, no left inset is supported,
+     but its redefined in some printer classes"
+
+    ^ 0
+
+    "Created: 3.6.1996 / 10:43:28 / cg"
+!
+
 leftMargin
     "return the number of blanks for the left margin"
 
@@ -358,6 +376,15 @@
     "
 
     "Modified: 18.5.1996 / 09:12:48 / cg"
+!
+
+topInset
+    "return the topInset (in inches). Here, no top inset is supported,
+     but its redefined in some printer classes"
+
+    ^ 0
+
+    "Created: 3.6.1996 / 10:43:40 / cg"
 ! !
 
 !PrinterStream class methodsFor:'queries'!
@@ -370,6 +397,14 @@
     "Modified: 18.4.1996 / 20:04:12 / cg"
 !
 
+supportsMargins
+    "return true if this printer supports margin settings"
+
+    ^ false
+
+    "Created: 3.6.1996 / 10:47:54 / cg"
+!
+
 supportsPageSizes
     "return true if this printer supports different page sizes"
 
@@ -457,6 +492,14 @@
     "Modified: 10.4.1996 / 13:08:28 / cg"
 ! !
 
+!PrinterStream methodsFor:'accessing'!
+
+pageFormat
+    ^ self class pageFormat
+
+    "Modified: 3.6.1996 / 10:27:45 / cg"
+! !
+
 !PrinterStream methodsFor:'emphasis change'!
 
 bold
@@ -633,6 +676,6 @@
 !PrinterStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.30 1996-05-31 22:49:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.31 1996-06-03 10:02:46 cg Exp $'
 ! !
 PrinterStream initialize!