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