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