author | Claus Gittinger <cg@exept.de> |
Thu, 05 Sep 1996 22:32:47 +0200 | |
changeset 436 | 3ad1e8473117 |
parent 435 | 78c5425445da |
child 437 | 59142d78f87d |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
84 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
PipeStream subclass:#PrinterStream |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
14 |
instanceVariableNames:'native pageFormat underline strikeout' |
370 | 15 |
classVariableNames:'' |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
16 |
poolDictionaries:'' |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
17 |
category:'Streams-External' |
0 | 18 |
! |
19 |
||
436 | 20 |
PrinterStream class instanceVariableNames:'PrintCommand DefaultCommands PageFormat DefaultPageFormats Landscape' |
373 | 21 |
|
22 |
" |
|
23 |
The following class instance variables are inherited by this class: |
|
24 |
||
25 |
PipeStream - |
|
26 |
NonPositionableExternalStream - |
|
27 |
ExternalStream - |
|
28 |
ReadWriteStream - |
|
29 |
WriteStream - |
|
30 |
PositionableStream - |
|
31 |
PeekableStream - |
|
32 |
Stream - |
|
33 |
Object - |
|
34 |
" |
|
370 | 35 |
! |
36 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
37 |
!PrinterStream class methodsFor:'documentation'! |
31 | 38 |
|
39 |
copyright |
|
40 |
" |
|
41 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
84 | 42 |
All Rights Reserved |
0 | 43 |
|
31 | 44 |
This software is furnished under a license and may be used |
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
! |
|
0 | 52 |
|
31 | 53 |
documentation |
54 |
" |
|
55 |
a stream for printing; this (concrete or abstract) class can handle only |
|
348 | 56 |
very dumb printers. |
57 |
No attributes (italic, bold etc) and no multiple fonts are supported |
|
58 |
- just plain single font text printing. |
|
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
59 |
|
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
60 |
More intelligence is added by subclasses (see PostscriptPrinterStream among others.) |
211 | 61 |
|
62 |
These classes do not support graphics printing - they are only for |
|
63 |
text; although some limited font functionality (such as bold or italic printing) |
|
64 |
may be supported by some subclasses. |
|
65 |
||
348 | 66 |
|
67 |
[usage:] |
|
68 |
||
211 | 69 |
The concrete printer class is bound to the global variable Printer, |
235 | 70 |
which is either set to PrinterStream (for dumb printers) or to one of |
211 | 71 |
the subclasses (PostscriptPrinterStream etc.). |
72 |
||
73 |
To print: |
|
74 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
75 |
|p| |
211 | 76 |
|
370 | 77 |
p := Printer new. |
78 |
p notNil ifTrue:[ |
|
79 |
p nextPutAll:'hello world'; cr. |
|
80 |
p nextPutAll:' ...'; cr. |
|
81 |
p close |
|
82 |
]. |
|
211 | 83 |
|
84 |
See users of the Printer global variable for more examples. |
|
259 | 85 |
|
348 | 86 |
[class variables:] |
370 | 87 |
PrintCommand <String> the operatingSystem command for printing. |
88 |
Usually something like 'lp' or 'lpr' |
|
348 | 89 |
|
259 | 90 |
[author:] |
370 | 91 |
Claus Gittinger |
31 | 92 |
" |
93 |
! ! |
|
0 | 94 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
95 |
!PrinterStream class methodsFor:'initialization'! |
0 | 96 |
|
97 |
initialize |
|
98 |
"this is usually redefined by the startup-file" |
|
99 |
||
370 | 100 |
DefaultCommands isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
101 |
DefaultCommands := #('lpr' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
102 |
'lpr -P<your-printer>' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
103 |
'cat | rsh <printHost> lpr -h' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
104 |
'cat >xxx ; ghostview xxx' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
105 |
'cat > printfile' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
106 |
'a2ps' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
107 |
'a2ps | rsh <printHost> lpr -h' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
108 |
'a2ps > printfile' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
109 |
). |
370 | 110 |
]. |
111 |
||
10 | 112 |
PrintCommand isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
113 |
OperatingSystem isBSDlike ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
114 |
PrintCommand := 'lpr' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
115 |
] ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
116 |
PrintCommand := 'lp' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
117 |
] |
0 | 118 |
]. |
367 | 119 |
|
120 |
DefaultPageFormats isNil ifTrue:[ |
|
121 |
"/ UnitConverter must support all of them. |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
122 |
self defaultPageFormats:#( |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
123 |
'letter' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
124 |
'legal' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
125 |
'ledger' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
126 |
'a3' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
127 |
'a4' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
128 |
'a5' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
129 |
'a6' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
130 |
'b5' |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
131 |
). |
367 | 132 |
]. |
133 |
||
134 |
Landscape isNil ifTrue:[ |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
135 |
Landscape := false |
367 | 136 |
]. |
137 |
||
138 |
PageFormat isNil ifTrue:[ |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
139 |
Language == #us ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
140 |
PageFormat := #letter |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
141 |
] ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
142 |
PageFormat := #a4 |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
143 |
] |
0 | 144 |
] |
367 | 145 |
|
146 |
" |
|
386 | 147 |
DefaultPageFormats := nil. |
367 | 148 |
PrinterStream initialize |
149 |
" |
|
370 | 150 |
|
386 | 151 |
"Modified: 4.6.1996 / 17:16:32 / cg" |
373 | 152 |
! |
153 |
||
154 |
reInitPage |
|
155 |
"nothing done here" |
|
156 |
||
157 |
"Created: 1.6.1996 / 00:49:40 / cg" |
|
2 | 158 |
! ! |
159 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
160 |
!PrinterStream class methodsFor:'instance creation'! |
0 | 161 |
|
162 |
new |
|
163 |
"return a new stream for printing" |
|
164 |
||
367 | 165 |
^ self basicNew initialize startPrint |
160 | 166 |
! |
167 |
||
168 |
newNative |
|
169 |
"return a new stream for untranslated printing |
|
170 |
(i.e. text should be sent via nextPutUntranslated in the printers |
|
171 |
native format)" |
|
172 |
||
367 | 173 |
^ self basicNew initialize setNative; writingTo:(self printCommand) |
0 | 174 |
! ! |
175 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
176 |
!PrinterStream class methodsFor:'accessing - defaults'! |
0 | 177 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
178 |
bottomMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
179 |
"return the bottomMargin (in inches). Here, no margin is supported, |
378 | 180 |
but its redefined in some printer classes" |
181 |
||
182 |
^ 0 |
|
183 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
184 |
"Created: 5.9.1996 / 21:37:49 / cg" |
378 | 185 |
! |
186 |
||
247
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
187 |
defaultCommands |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
188 |
"return a list presented as possible commands for printed |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
189 |
(in the launchers printer configuration). |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
190 |
This list can be set from the startup script with: |
371 | 191 |
PrinterStream defaultCommands:#( ... )" |
247
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
192 |
|
370 | 193 |
DefaultCommands isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
194 |
self == PrinterStream ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
195 |
^ self superclass defaultCommands |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
196 |
] |
370 | 197 |
]. |
247
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
198 |
^ DefaultCommands |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
199 |
|
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
200 |
"Created: 23.4.1996 / 18:25:18 / cg" |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
201 |
! |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
202 |
|
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
203 |
defaultCommands:collectionOfCommandStrings |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
204 |
"set the list which will be presented as possible commands for printing. |
367 | 205 |
(shown in in the launchers printer configuration). |
247
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
206 |
This can be done from the startup script with: |
370 | 207 |
PrinterStream defaultCommands:#( ... )" |
247
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
208 |
|
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
209 |
DefaultCommands := collectionOfCommandStrings |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
210 |
|
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
211 |
"Created: 23.4.1996 / 18:26:06 / cg" |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
212 |
! |
d1e5c0187e59
keep defaultCommands in a classVar
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
213 |
|
367 | 214 |
defaultPageFormats |
215 |
"return a list of supported pae formats. |
|
216 |
This list can be set from the startup script with: |
|
371 | 217 |
PrinterStream defaultPageFormats:#..." |
367 | 218 |
|
370 | 219 |
DefaultPageFormats isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
220 |
self == PrinterStream ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
221 |
^ self superclass defaultPageFormats |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
222 |
] |
370 | 223 |
]. |
367 | 224 |
^ DefaultPageFormats |
225 |
||
226 |
"Created: 23.4.1996 / 18:25:18 / cg" |
|
227 |
! |
|
228 |
||
229 |
defaultPageFormats:aList |
|
230 |
"set the list of supported pae formats. |
|
231 |
(shown in in the launchers printer configuration). |
|
232 |
This list can be set from the startup script with: |
|
370 | 233 |
PrinterStream defaultPageFormats:#..." |
367 | 234 |
|
235 |
DefaultPageFormats := aList. |
|
236 |
||
237 |
"/ validate the list |
|
238 |
aList do:[:name | |
|
370 | 239 |
|unit ok| |
367 | 240 |
|
370 | 241 |
ok := true. |
242 |
#('W' 'H' 'lW' 'lH') do:[:what | |
|
243 |
unit := (name , what) asSymbolIfInterned. |
|
244 |
(unit isNil |
|
245 |
or:[(UnitConverter convert:1 from:unit to:#millimeter) isNil]) ifTrue:[ |
|
246 |
ok := false |
|
247 |
] |
|
248 |
]. |
|
249 |
ok ifFalse:[ |
|
250 |
('PRINTER: UnitConverter has no size-info for ''' , name , '''-format') errorPrintCR |
|
251 |
] |
|
367 | 252 |
]. |
253 |
||
254 |
" |
|
255 |
PrinterStream |
|
370 | 256 |
defaultPageFormats:#( |
257 |
'letter' |
|
258 |
'a4' |
|
259 |
'a5' |
|
260 |
'a6' |
|
261 |
) |
|
367 | 262 |
" |
263 |
||
264 |
"Created: 23.4.1996 / 18:25:18 / cg" |
|
265 |
! |
|
266 |
||
267 |
landscape |
|
268 |
"return the landscape setting" |
|
269 |
||
370 | 270 |
Landscape isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
271 |
self == PrinterStream ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
272 |
^ self superclass landscape |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
273 |
] |
370 | 274 |
]. |
367 | 275 |
^ Landscape |
276 |
! |
|
277 |
||
278 |
landscape:aBoolean |
|
279 |
"set/clear landscape printing" |
|
280 |
||
373 | 281 |
Landscape := aBoolean. |
282 |
self reInitPage. |
|
283 |
||
284 |
"Modified: 1.6.1996 / 00:49:22 / cg" |
|
367 | 285 |
! |
286 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
287 |
leftMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
288 |
"return the leftMargin (in inches). Here, no margin is supported, |
378 | 289 |
but its redefined in some printer classes" |
290 |
||
291 |
^ 0 |
|
292 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
293 |
"Created: 5.9.1996 / 21:37:49 / cg" |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
294 |
"Modified: 5.9.1996 / 21:39:55 / cg" |
0 | 295 |
! |
296 |
||
367 | 297 |
pageFormat |
298 |
"return a symbol describing the default page format. |
|
299 |
This list can be set from the startup script with: |
|
371 | 300 |
PrinterStream defaultPageFormat:#... |
367 | 301 |
or via the launchers settings menu." |
302 |
||
370 | 303 |
PageFormat isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
304 |
self == PrinterStream ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
305 |
^ self superclass pageFormat |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
306 |
] |
370 | 307 |
]. |
367 | 308 |
^ PageFormat |
309 |
||
310 |
"Created: 23.4.1996 / 18:25:18 / cg" |
|
311 |
! |
|
312 |
||
313 |
pageFormat:aSymbol |
|
314 |
"set the the default page format to be aSymbol. |
|
315 |
Valid symbols are #letter, #a4, #a5 etc. |
|
316 |
The UnitConverter must contain width/height information on |
|
317 |
that symbol, in order for printing to be correct. |
|
318 |
||
319 |
This list can be set from the startup script with: |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
320 |
PrinterStream defaultPageFormat:#... |
367 | 321 |
or via the launchers settings menu." |
322 |
||
373 | 323 |
PageFormat := aSymbol. |
324 |
self reInitPage. |
|
367 | 325 |
|
326 |
"Created: 23.4.1996 / 18:25:18 / cg" |
|
373 | 327 |
"Modified: 1.6.1996 / 00:49:06 / cg" |
367 | 328 |
! |
329 |
||
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
330 |
printCommand |
367 | 331 |
"return the command used for printing (usually 'lp' or 'lpr'). |
332 |
This is either set from the startup file, or via the launchers |
|
333 |
settings menu." |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
334 |
|
370 | 335 |
PrintCommand isNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
336 |
self == PrinterStream ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
337 |
^ self superclass printCommand |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
338 |
] |
370 | 339 |
]. |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
340 |
^ PrintCommand |
348 | 341 |
|
342 |
"Modified: 18.5.1996 / 09:12:35 / cg" |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
343 |
! |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
344 |
|
126 | 345 |
printCommand:aString |
367 | 346 |
"set the command for printing (usually 'lp' or 'lpr'). |
347 |
This is either set from the startup file, or via the launchers |
|
348 |
settings menu." |
|
126 | 349 |
|
350 |
PrintCommand := aString |
|
139 | 351 |
|
352 |
" |
|
353 |
PrinterStream printCommand:'lpr' |
|
354 |
PrinterStream printCommand:'lpr -h' |
|
355 |
PrinterStream printCommand:'rsh ibm lpr -h' |
|
356 |
PrinterStream printCommand:'gs -sDEVICE=djet500 -sOutputFile=/tmp/stx.ps -sPAPERSIZE=a4 -q -; cat /tmp/stx.ps | rsh ibm lpr -h' |
|
357 |
" |
|
348 | 358 |
|
359 |
"Modified: 18.5.1996 / 09:12:48 / cg" |
|
378 | 360 |
! |
361 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
362 |
topMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
363 |
"return the topMargin (in inches). Here, no margin is supported, |
378 | 364 |
but its redefined in some printer classes" |
365 |
||
366 |
^ 0 |
|
367 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
368 |
"Created: 5.9.1996 / 21:40:13 / cg" |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
369 |
! ! |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
370 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
371 |
!PrinterStream class methodsFor:'queries'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
372 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
373 |
printerTypeName |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
374 |
"return a descriptive name" |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
375 |
|
235 | 376 |
^ 'dumb printer' |
377 |
||
378 |
"Modified: 18.4.1996 / 20:04:12 / cg" |
|
139 | 379 |
! |
380 |
||
383 | 381 |
supportsColor |
382 |
"return true if this is a color printer" |
|
383 |
||
384 |
^ false |
|
385 |
||
386 |
"Created: 3.6.1996 / 18:00:36 / cg" |
|
387 |
! |
|
388 |
||
378 | 389 |
supportsMargins |
383 | 390 |
"return true if this printer supports margin settings (in inches) |
391 |
if not, it supports at least a leftMargin to be specified in columns." |
|
378 | 392 |
|
393 |
^ false |
|
394 |
||
395 |
"Created: 3.6.1996 / 10:47:54 / cg" |
|
383 | 396 |
"Modified: 3.6.1996 / 18:24:20 / cg" |
378 | 397 |
! |
398 |
||
368
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
399 |
supportsPageSizes |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
400 |
"return true if this printer supports different page sizes" |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
401 |
|
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
402 |
^ false |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
403 |
|
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
404 |
"Created: 31.5.1996 / 22:35:26 / cg" |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
405 |
! |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
406 |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
407 |
supportsPostscript |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
408 |
"return true if this is a postscript printer" |
139 | 409 |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
410 |
^ false |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
411 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
412 |
"Created: 10.2.1996 / 16:23:07 / cg" |
126 | 413 |
! ! |
0 | 414 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
415 |
!PrinterStream methodsFor:'access writing'! |
126 | 416 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
417 |
next:count put:aCharacter |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
418 |
"send some character multiple times to the printer - translate as needed. |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
419 |
Redefined to allow individual character translation in subclasses" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
420 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
421 |
count timesRepeat:[ |
370 | 422 |
self nextPut:aCharacter |
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
423 |
] |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
424 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
425 |
"Created: 10.4.1996 / 13:08:13 / cg" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
426 |
"Modified: 10.4.1996 / 13:09:06 / cg" |
126 | 427 |
! |
428 |
||
429 |
nextPutAll:aCollection |
|
348 | 430 |
"send some characters to the printer - translate as needed. |
431 |
The argument, aCollection can be a Text (i.e. include emphasis)" |
|
126 | 432 |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
433 |
|lastE| |
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
434 |
|
348 | 435 |
aCollection hasChangeOfEmphasis ifTrue:[ |
392 | 436 |
aCollection keysAndValuesDo:[:idx :aChar | |
437 |
|e| |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
438 |
|
392 | 439 |
e := aCollection emphasisAt:idx. |
440 |
(idx == 1 |
|
441 |
or:[lastE ~~ e]) ifTrue:[ |
|
442 |
self emphasis:e. |
|
443 |
lastE := e. |
|
444 |
]. |
|
445 |
self nextPut:aChar. |
|
446 |
]. |
|
447 |
self emphasis:nil. |
|
348 | 448 |
] ifFalse:[ |
392 | 449 |
aCollection do:[:aChar | |
450 |
self nextPut:aChar |
|
451 |
] |
|
126 | 452 |
] |
348 | 453 |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
454 |
"Modified: 3.6.1996 / 17:12:31 / cg" |
126 | 455 |
! |
456 |
||
457 |
nextPutAllUntranslated:aCollection |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
458 |
"send some raw characters to the printer - even if not in native mode" |
126 | 459 |
|
460 |
super nextPutAll:aCollection |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
461 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
462 |
"Modified: 10.4.1996 / 13:08:35 / cg" |
126 | 463 |
! |
464 |
||
465 |
nextPutUntranslated:aCharacter |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
466 |
"send a raw character to the printer - even if not in native mode" |
126 | 467 |
|
468 |
super nextPut:aCharacter |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
469 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
470 |
"Modified: 10.4.1996 / 13:08:28 / cg" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
471 |
! ! |
0 | 472 |
|
348 | 473 |
!PrinterStream methodsFor:'emphasis change'! |
474 |
||
475 |
bold |
|
476 |
"set emphasis to bold |
|
477 |
- ignore here, since this class does not know anything about the printer" |
|
478 |
||
479 |
^ self |
|
480 |
||
481 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
482 |
! |
|
483 |
||
484 |
boldItalic |
|
485 |
"set emphasis to boldItalic |
|
486 |
- ignore here, since this class does not know anything about the printer" |
|
487 |
||
488 |
^ self |
|
489 |
||
490 |
"Created: 14.5.1996 / 18:53:43 / cg" |
|
491 |
"Modified: 18.5.1996 / 08:55:14 / cg" |
|
492 |
! |
|
493 |
||
494 |
emphasis:anEmphasis |
|
495 |
"change the emphasis" |
|
496 |
||
392 | 497 |
|b i| |
498 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
499 |
(Text emphasis:anEmphasis includes:#underline) ifTrue:[ |
392 | 500 |
underline ifFalse:[ |
501 |
self underline |
|
502 |
] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
503 |
] ifFalse:[ |
392 | 504 |
underline ifTrue:[ |
505 |
self noUnderline |
|
506 |
] |
|
348 | 507 |
]. |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
508 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
509 |
(Text emphasis:anEmphasis includes:#strikeout) ifTrue:[ |
392 | 510 |
strikeout ifFalse:[ |
511 |
self strikeout |
|
512 |
] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
513 |
] ifFalse:[ |
392 | 514 |
strikeout ifTrue:[ |
515 |
self noStrikeout |
|
516 |
] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
517 |
]. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
518 |
|
392 | 519 |
b := (Text emphasis:anEmphasis includes:#bold). |
520 |
i := (Text emphasis:anEmphasis includes:#italic). |
|
521 |
||
522 |
b ifTrue:[ |
|
523 |
i ifTrue:[ |
|
524 |
^ self boldItalic |
|
525 |
] ifFalse:[ |
|
526 |
^ self bold |
|
527 |
] |
|
528 |
] ifFalse:[ |
|
529 |
i ifTrue:[ |
|
530 |
^ self italic |
|
531 |
] |
|
349 | 532 |
]. |
348 | 533 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
534 |
^ self normal |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
535 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
536 |
"Modified: 8.6.1996 / 08:15:00 / cg" |
348 | 537 |
! |
538 |
||
539 |
italic |
|
540 |
"set emphasis to italic |
|
541 |
- ignore here, since this class does not know anything about the printer" |
|
542 |
||
543 |
^ self |
|
544 |
||
545 |
"Modified: 18.5.1996 / 08:55:18 / cg" |
|
546 |
! |
|
547 |
||
392 | 548 |
noStrikeout |
549 |
"set emphasis to no strikeout |
|
550 |
- ignore here, since this class does not know anything about the printer" |
|
551 |
||
552 |
^ self |
|
553 |
||
554 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
555 |
"Created: 8.6.1996 / 08:15:20 / cg" |
|
556 |
! |
|
557 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
558 |
noUnderline |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
559 |
"set emphasis to no underline |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
560 |
- ignore here, since this class does not know anything about the printer" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
561 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
562 |
^ self |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
563 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
564 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
565 |
"Created: 8.6.1996 / 08:15:12 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
566 |
! |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
567 |
|
348 | 568 |
normal |
569 |
"set emphasis to normal (non-bold, non-italic) |
|
570 |
- ignore here, since this class does not know anything about the printer" |
|
571 |
||
572 |
^ self |
|
573 |
||
574 |
"Modified: 18.5.1996 / 08:55:21 / cg" |
|
575 |
! |
|
576 |
||
577 |
strikeout |
|
578 |
"set emphasis to strikeout |
|
579 |
- ignore here, since this class does not know anything about the printer" |
|
580 |
||
581 |
^ self |
|
582 |
||
583 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
584 |
"Created: 18.5.1996 / 08:56:13 / cg" |
|
585 |
! |
|
586 |
||
587 |
underline |
|
588 |
"set emphasis to underline |
|
589 |
- ignore here, since this class does not know anything about the printer" |
|
590 |
||
591 |
^ self |
|
592 |
||
593 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
594 |
"Created: 18.5.1996 / 08:56:24 / cg" |
|
595 |
! ! |
|
596 |
||
597 |
!PrinterStream methodsFor:'font change'! |
|
598 |
||
599 |
courier |
|
600 |
"set font to courier |
|
601 |
- ignore here, since this class does not know anything about the printer" |
|
602 |
||
603 |
^ self |
|
604 |
! |
|
605 |
||
606 |
helvetica |
|
607 |
"set font to helvetic |
|
608 |
- ignore here, since this class does not know anything about the printer" |
|
609 |
||
610 |
^ self |
|
611 |
! |
|
612 |
||
613 |
times |
|
614 |
"set font to times |
|
615 |
- ignore here, since this class does not know anything about the printer" |
|
616 |
||
617 |
^ self |
|
618 |
! ! |
|
619 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
620 |
!PrinterStream methodsFor:'helpers writing'! |
6 | 621 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
622 |
escape:aCharacter |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
623 |
"since its so common, this method sends escape followed by aCharacter" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
624 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
625 |
super nextPut:(Character escape); nextPut:aCharacter |
126 | 626 |
! |
627 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
628 |
escapeAll:aString |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
629 |
"since its so common, this method sends escape followed by aString" |
126 | 630 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
631 |
super nextPut:(Character escape); nextPutAll:aString |
0 | 632 |
! ! |
126 | 633 |
|
367 | 634 |
!PrinterStream methodsFor:'initialization'! |
635 |
||
636 |
initialize |
|
637 |
pageFormat := DefaultPageFormat |
|
638 |
||
639 |
"Created: 31.5.1996 / 20:14:36 / cg" |
|
640 |
! ! |
|
641 |
||
126 | 642 |
!PrinterStream methodsFor:'open/close'! |
643 |
||
160 | 644 |
basicClose |
645 |
super close |
|
646 |
! |
|
647 |
||
126 | 648 |
close |
649 |
self endPrint. |
|
650 |
super close |
|
651 |
! |
|
652 |
||
653 |
endPrint |
|
654 |
^ self |
|
655 |
! |
|
656 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
657 |
setNative |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
658 |
native := true |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
659 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
660 |
"Created: 10.4.1996 / 13:05:01 / cg" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
661 |
! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
662 |
|
362 | 663 |
setNative:aBoolean |
664 |
native := aBoolean |
|
665 |
||
666 |
"Created: 30.5.1996 / 17:49:09 / cg" |
|
667 |
! |
|
668 |
||
126 | 669 |
startPrint |
370 | 670 |
super writingTo:(self class printCommand). |
671 |
||
672 |
"Modified: 1.6.1996 / 00:13:23 / cg" |
|
126 | 673 |
! ! |
674 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
675 |
!PrinterStream methodsFor:'queries'! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
676 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
677 |
bottomMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
678 |
^ self class bottomMargin |
383 | 679 |
|
680 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
681 |
"Created: 5.9.1996 / 21:37:26 / cg" |
383 | 682 |
! |
683 |
||
379 | 684 |
isPrinterStream |
685 |
"return true, if this is a printerStream. |
|
686 |
Always true here." |
|
687 |
||
688 |
^ true |
|
689 |
||
690 |
"Created: 3.6.1996 / 12:06:21 / cg" |
|
691 |
! |
|
692 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
693 |
leftMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
694 |
^ self class leftMargin |
383 | 695 |
|
696 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
697 |
"Created: 5.9.1996 / 21:38:23 / cg" |
383 | 698 |
! |
699 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
700 |
lineLength |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
701 |
"the printer pages width (in characters)" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
702 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
703 |
^ 80 |
383 | 704 |
! |
705 |
||
706 |
pageFormat |
|
707 |
^ self class pageFormat |
|
708 |
||
709 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
710 |
! |
|
711 |
||
712 |
supportsColor |
|
713 |
"return true if this is a color printer" |
|
714 |
||
715 |
^ self class supportsColor |
|
716 |
||
717 |
"Created: 3.6.1996 / 18:00:27 / cg" |
|
718 |
! |
|
719 |
||
720 |
supportsMargins |
|
721 |
"return true if this printer supports margin settings (in inches) |
|
722 |
if not, it supports at least a leftMargin to be specified in columns." |
|
723 |
||
724 |
^ self class supportsMargins |
|
725 |
||
726 |
"Created: 3.6.1996 / 17:59:35 / cg" |
|
727 |
"Modified: 3.6.1996 / 18:24:04 / cg" |
|
728 |
! |
|
729 |
||
730 |
supportsPostscript |
|
731 |
"return true if this is a postscript printer" |
|
732 |
||
733 |
^ self class supportsPostscript |
|
734 |
||
735 |
"Created: 3.6.1996 / 17:59:58 / cg" |
|
736 |
! |
|
737 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
738 |
topMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
739 |
^ self class topMargin |
383 | 740 |
|
741 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
742 |
"Created: 5.9.1996 / 21:40:32 / cg" |
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
743 |
! ! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
744 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
745 |
!PrinterStream class methodsFor:'documentation'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
746 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
747 |
version |
436 | 748 |
^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.41 1996-09-05 20:32:24 cg Exp $' |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
749 |
! ! |
126 | 750 |
PrinterStream initialize! |