author | Stefan Vogel <sv@exept.de> |
Thu, 12 Sep 1996 10:42:23 +0200 | |
changeset 443 | 2c85dbf33207 |
parent 442 | dcc6bcb69eba |
child 456 | 37b86d48d290 |
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:[ |
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 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
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 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
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 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
366 |
topMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
367 |
"return the topMargin (in inches). Here, no margin is supported, |
378 | 368 |
but its redefined in some printer classes" |
369 |
||
370 |
^ 0 |
|
371 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
372 |
"Created: 5.9.1996 / 21:40:13 / cg" |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
373 |
! ! |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
374 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
375 |
!PrinterStream class methodsFor:'queries'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
376 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
377 |
printerTypeName |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
378 |
"return a descriptive name" |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
379 |
|
442 | 380 |
^ 'dumb printer (or print filter)' |
235 | 381 |
|
382 |
"Modified: 18.4.1996 / 20:04:12 / cg" |
|
139 | 383 |
! |
384 |
||
383 | 385 |
supportsColor |
386 |
"return true if this is a color printer" |
|
387 |
||
388 |
^ false |
|
389 |
||
390 |
"Created: 3.6.1996 / 18:00:36 / cg" |
|
391 |
! |
|
392 |
||
378 | 393 |
supportsMargins |
383 | 394 |
"return true if this printer supports margin settings (in inches) |
395 |
if not, it supports at least a leftMargin to be specified in columns." |
|
378 | 396 |
|
397 |
^ false |
|
398 |
||
399 |
"Created: 3.6.1996 / 10:47:54 / cg" |
|
383 | 400 |
"Modified: 3.6.1996 / 18:24:20 / cg" |
378 | 401 |
! |
402 |
||
368
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
403 |
supportsPageSizes |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
404 |
"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
|
405 |
|
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
406 |
^ false |
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 |
"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
|
409 |
! |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
410 |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
411 |
supportsPostscript |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
412 |
"return true if this is a postscript printer" |
139 | 413 |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
414 |
^ false |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
415 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
416 |
"Created: 10.2.1996 / 16:23:07 / cg" |
126 | 417 |
! ! |
0 | 418 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
419 |
!PrinterStream methodsFor:'access writing'! |
126 | 420 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
421 |
next:count put:aCharacter |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
422 |
"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
|
423 |
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
|
424 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
425 |
count timesRepeat:[ |
370 | 426 |
self nextPut:aCharacter |
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
427 |
] |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
428 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
429 |
"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
|
430 |
"Modified: 10.4.1996 / 13:09:06 / cg" |
126 | 431 |
! |
432 |
||
433 |
nextPutAll:aCollection |
|
348 | 434 |
"send some characters to the printer - translate as needed. |
435 |
The argument, aCollection can be a Text (i.e. include emphasis)" |
|
126 | 436 |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
437 |
|lastE| |
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
438 |
|
348 | 439 |
aCollection hasChangeOfEmphasis ifTrue:[ |
392 | 440 |
aCollection keysAndValuesDo:[:idx :aChar | |
441 |
|e| |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
442 |
|
392 | 443 |
e := aCollection emphasisAt:idx. |
444 |
(idx == 1 |
|
445 |
or:[lastE ~~ e]) ifTrue:[ |
|
446 |
self emphasis:e. |
|
447 |
lastE := e. |
|
448 |
]. |
|
449 |
self nextPut:aChar. |
|
450 |
]. |
|
451 |
self emphasis:nil. |
|
348 | 452 |
] ifFalse:[ |
392 | 453 |
aCollection do:[:aChar | |
454 |
self nextPut:aChar |
|
455 |
] |
|
126 | 456 |
] |
348 | 457 |
|
381
9afd4993bc24
avoid #emphasis: messages if there is no change
Claus Gittinger <cg@exept.de>
parents:
379
diff
changeset
|
458 |
"Modified: 3.6.1996 / 17:12:31 / cg" |
126 | 459 |
! |
460 |
||
461 |
nextPutAllUntranslated:aCollection |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
462 |
"send some raw characters to the printer - even if not in native mode" |
126 | 463 |
|
464 |
super nextPutAll:aCollection |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
465 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
466 |
"Modified: 10.4.1996 / 13:08:35 / cg" |
126 | 467 |
! |
468 |
||
469 |
nextPutUntranslated:aCharacter |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
470 |
"send a raw character to the printer - even if not in native mode" |
126 | 471 |
|
472 |
super nextPut:aCharacter |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
473 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
474 |
"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
|
475 |
! ! |
0 | 476 |
|
348 | 477 |
!PrinterStream methodsFor:'emphasis change'! |
478 |
||
479 |
bold |
|
480 |
"set emphasis to bold |
|
481 |
- ignore here, since this class does not know anything about the printer" |
|
482 |
||
483 |
^ self |
|
484 |
||
485 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
486 |
! |
|
487 |
||
488 |
boldItalic |
|
489 |
"set emphasis to boldItalic |
|
490 |
- ignore here, since this class does not know anything about the printer" |
|
491 |
||
492 |
^ self |
|
493 |
||
494 |
"Created: 14.5.1996 / 18:53:43 / cg" |
|
495 |
"Modified: 18.5.1996 / 08:55:14 / cg" |
|
496 |
! |
|
497 |
||
498 |
emphasis:anEmphasis |
|
499 |
"change the emphasis" |
|
500 |
||
392 | 501 |
|b i| |
502 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
503 |
(Text emphasis:anEmphasis includes:#underline) ifTrue:[ |
392 | 504 |
underline ifFalse:[ |
505 |
self underline |
|
506 |
] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
507 |
] ifFalse:[ |
392 | 508 |
underline ifTrue:[ |
509 |
self noUnderline |
|
510 |
] |
|
348 | 511 |
]. |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
512 |
|
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:#strikeout) ifTrue:[ |
392 | 514 |
strikeout ifFalse:[ |
515 |
self strikeout |
|
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 |
strikeout ifTrue:[ |
519 |
self noStrikeout |
|
520 |
] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
521 |
]. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
522 |
|
392 | 523 |
b := (Text emphasis:anEmphasis includes:#bold). |
524 |
i := (Text emphasis:anEmphasis includes:#italic). |
|
525 |
||
526 |
b ifTrue:[ |
|
527 |
i ifTrue:[ |
|
528 |
^ self boldItalic |
|
529 |
] ifFalse:[ |
|
530 |
^ self bold |
|
531 |
] |
|
532 |
] ifFalse:[ |
|
533 |
i ifTrue:[ |
|
534 |
^ self italic |
|
535 |
] |
|
349 | 536 |
]. |
348 | 537 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
538 |
^ self normal |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
539 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
540 |
"Modified: 8.6.1996 / 08:15:00 / cg" |
348 | 541 |
! |
542 |
||
543 |
italic |
|
544 |
"set emphasis to italic |
|
545 |
- ignore here, since this class does not know anything about the printer" |
|
546 |
||
547 |
^ self |
|
548 |
||
549 |
"Modified: 18.5.1996 / 08:55:18 / cg" |
|
550 |
! |
|
551 |
||
392 | 552 |
noStrikeout |
553 |
"set emphasis to no strikeout |
|
554 |
- ignore here, since this class does not know anything about the printer" |
|
555 |
||
556 |
^ self |
|
557 |
||
558 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
559 |
"Created: 8.6.1996 / 08:15:20 / cg" |
|
560 |
! |
|
561 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
562 |
noUnderline |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
563 |
"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
|
564 |
- 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
|
565 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
566 |
^ self |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
567 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
568 |
"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
|
569 |
"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
|
570 |
! |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
571 |
|
348 | 572 |
normal |
573 |
"set emphasis to normal (non-bold, non-italic) |
|
574 |
- ignore here, since this class does not know anything about the printer" |
|
575 |
||
576 |
^ self |
|
577 |
||
578 |
"Modified: 18.5.1996 / 08:55:21 / cg" |
|
579 |
! |
|
580 |
||
581 |
strikeout |
|
582 |
"set emphasis to strikeout |
|
583 |
- ignore here, since this class does not know anything about the printer" |
|
584 |
||
585 |
^ self |
|
586 |
||
587 |
"Modified: 18.5.1996 / 08:55:10 / cg" |
|
588 |
"Created: 18.5.1996 / 08:56:13 / cg" |
|
589 |
! |
|
590 |
||
591 |
underline |
|
592 |
"set emphasis to underline |
|
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:24 / cg" |
|
599 |
! ! |
|
600 |
||
601 |
!PrinterStream methodsFor:'font change'! |
|
602 |
||
603 |
courier |
|
604 |
"set font to courier |
|
605 |
- ignore here, since this class does not know anything about the printer" |
|
606 |
||
607 |
^ self |
|
608 |
! |
|
609 |
||
610 |
helvetica |
|
611 |
"set font to helvetic |
|
612 |
- ignore here, since this class does not know anything about the printer" |
|
613 |
||
614 |
^ self |
|
615 |
! |
|
616 |
||
617 |
times |
|
618 |
"set font to times |
|
619 |
- ignore here, since this class does not know anything about the printer" |
|
620 |
||
621 |
^ self |
|
622 |
! ! |
|
623 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
624 |
!PrinterStream methodsFor:'helpers writing'! |
6 | 625 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
626 |
escape:aCharacter |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
627 |
"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
|
628 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
629 |
super nextPut:(Character escape); nextPut:aCharacter |
126 | 630 |
! |
631 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
632 |
escapeAll:aString |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
633 |
"since its so common, this method sends escape followed by aString" |
126 | 634 |
|
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
635 |
super nextPut:(Character escape); nextPutAll:aString |
0 | 636 |
! ! |
126 | 637 |
|
367 | 638 |
!PrinterStream methodsFor:'initialization'! |
639 |
||
640 |
initialize |
|
641 |
pageFormat := DefaultPageFormat |
|
642 |
||
643 |
"Created: 31.5.1996 / 20:14:36 / cg" |
|
644 |
! ! |
|
645 |
||
126 | 646 |
!PrinterStream methodsFor:'open/close'! |
647 |
||
160 | 648 |
basicClose |
649 |
super close |
|
650 |
! |
|
651 |
||
126 | 652 |
close |
653 |
self endPrint. |
|
654 |
super close |
|
655 |
! |
|
656 |
||
657 |
endPrint |
|
658 |
^ self |
|
659 |
! |
|
660 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
661 |
setNative |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
662 |
native := true |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
663 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
664 |
"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
|
665 |
! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
666 |
|
362 | 667 |
setNative:aBoolean |
668 |
native := aBoolean |
|
669 |
||
670 |
"Created: 30.5.1996 / 17:49:09 / cg" |
|
671 |
! |
|
672 |
||
126 | 673 |
startPrint |
370 | 674 |
super writingTo:(self class printCommand). |
675 |
||
676 |
"Modified: 1.6.1996 / 00:13:23 / cg" |
|
126 | 677 |
! ! |
678 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
679 |
!PrinterStream methodsFor:'queries'! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
680 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
681 |
bottomMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
682 |
^ self class bottomMargin |
383 | 683 |
|
684 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
685 |
"Created: 5.9.1996 / 21:37:26 / cg" |
383 | 686 |
! |
687 |
||
379 | 688 |
isPrinterStream |
689 |
"return true, if this is a printerStream. |
|
690 |
Always true here." |
|
691 |
||
692 |
^ true |
|
693 |
||
694 |
"Created: 3.6.1996 / 12:06:21 / cg" |
|
695 |
! |
|
696 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
697 |
leftMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
698 |
^ self class leftMargin |
383 | 699 |
|
700 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
701 |
"Created: 5.9.1996 / 21:38:23 / cg" |
383 | 702 |
! |
703 |
||
221
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
704 |
lineLength |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
705 |
"the printer pages width (in characters)" |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
706 |
|
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
707 |
^ 80 |
383 | 708 |
! |
709 |
||
710 |
pageFormat |
|
711 |
^ self class pageFormat |
|
712 |
||
713 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
714 |
! |
|
715 |
||
437 | 716 |
rightMargin |
717 |
^ self class rightMargin |
|
718 |
||
719 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
720 |
"Created: 5.9.1996 / 21:38:23 / cg" |
|
721 |
! |
|
722 |
||
383 | 723 |
supportsColor |
724 |
"return true if this is a color printer" |
|
725 |
||
726 |
^ self class supportsColor |
|
727 |
||
728 |
"Created: 3.6.1996 / 18:00:27 / cg" |
|
729 |
! |
|
730 |
||
731 |
supportsMargins |
|
732 |
"return true if this printer supports margin settings (in inches) |
|
733 |
if not, it supports at least a leftMargin to be specified in columns." |
|
734 |
||
735 |
^ self class supportsMargins |
|
736 |
||
737 |
"Created: 3.6.1996 / 17:59:35 / cg" |
|
738 |
"Modified: 3.6.1996 / 18:24:04 / cg" |
|
739 |
! |
|
740 |
||
741 |
supportsPostscript |
|
742 |
"return true if this is a postscript printer" |
|
743 |
||
744 |
^ self class supportsPostscript |
|
745 |
||
746 |
"Created: 3.6.1996 / 17:59:58 / cg" |
|
747 |
! |
|
748 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
749 |
topMargin |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
750 |
^ self class topMargin |
383 | 751 |
|
752 |
"Modified: 3.6.1996 / 10:27:45 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
753 |
"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
|
754 |
! ! |
7bc2c2d89ede
added native setting (suppress trailer in PS-subclass)
Claus Gittinger <cg@exept.de>
parents:
211
diff
changeset
|
755 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
756 |
!PrinterStream class methodsFor:'documentation'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
757 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
758 |
version |
443
2c85dbf33207
Fix documentation (mostly typos).
Stefan Vogel <sv@exept.de>
parents:
442
diff
changeset
|
759 |
^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.44 1996-09-12 08:42:23 stefan Exp $' |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
760 |
! ! |
126 | 761 |
PrinterStream initialize! |