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