HPLjetIIPrinterStream.st
author Claus Gittinger <cg@exept.de>
Tue, 25 Jun 2019 14:28:51 +0200
changeset 5050 44fa8672d102
parent 4538 6f8d97524948
child 5175 75c026242bf0
permissions -rw-r--r--
#DOCUMENTATION by cg class: SharedQueue comment/format in: #next #nextWithTimeout:
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) 1988 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
"
4196
bb2ff928a16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    13
4196
bb2ff928a16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
    14
"{ NameSpace: Smalltalk }"
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    15
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    16
PrinterStream subclass:#HPLjetIIPrinterStream
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    17
	instanceVariableNames:''
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    18
	classVariableNames:''
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    19
	poolDictionaries:''
1649
5b56cd237a28 category change
fm
parents: 1317
diff changeset
    20
	category:'Interface-Printing'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    21
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    22
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    23
!HPLjetIIPrinterStream class methodsFor:'documentation'!
31
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    24
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    25
copyright
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    26
"
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    27
 COPYRIGHT (c) 1988 by Claus Gittinger
84
claus
parents: 36
diff changeset
    28
	      All Rights Reserved
31
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    29
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    30
 This software is furnished under a license and may be used
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    31
 only in accordance with the terms of that license and with the
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    33
 be provided or otherwise made available to, or used by, any
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    34
 other person.  No title to or ownership of the software is
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    35
 hereby transferred.
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    36
"
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    37
!
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    38
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    39
documentation
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    40
"
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    41
    This class defines protocol for simple text prinitng on an HP Laserjet 2/3
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    42
    (and compatible) printer. 
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    43
    It does not support multiple fonts, but knows how to print bold, italic etc.
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    44
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    45
    Graphics printing is not supported - you need a postscriptprinter for this.
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    46
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    47
    Notice: 
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    48
        This class only defines some minimum protocol for printing on
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    49
        HP-LJ - you really should use a PostscriptPrinter ...
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    50
        ... however, if you own a LJ, here is some class to start with.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    51
        It may need to be enhanced at some places (for example: provide more
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    52
        fonts/emphasis's, better international character translation,
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    53
        image printing etc.)
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    54
4196
bb2ff928a16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
    55
    [Disclaimer:]    
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    56
        This class is not officially supported - take it or leave it.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    57
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    58
    [author:]
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    59
        Claus Gittinger
31
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    60
"
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    61
! !
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    62
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    63
!HPLjetIIPrinterStream class methodsFor:'initialization'!
441
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    64
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    65
initialize
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    66
    DefaultCommands := #('lpr' 
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    67
                         'lpr -P<your-printer>' 
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    68
                         'cat | rsh <printHost> lpr -h' 
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    69
                        ).
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    70
    super initialize
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    71
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    72
    "
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    73
     self initialize
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    74
    "
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    75
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    76
! !
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
    77
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    78
!HPLjetIIPrinterStream class methodsFor:'queries'!
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    79
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    80
printerTypeName
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    81
    "return a descriptive name"
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    82
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
    83
    ^ 'hp laserjet III compatible printer'
31
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    84
! !
e223f3cf2995 *** empty log message ***
claus
parents: 9
diff changeset
    85
4538
6f8d97524948 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4196
diff changeset
    86
!HPLjetIIPrinterStream methodsFor:'access-writing'!
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    87
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    88
cr
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    89
    "send a carriage-return (newLine) to the printer.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    90
     We have to output cr-nl here"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    91
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    92
    super nextPutUntranslated:(Character value:13).
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    93
    super nextPutUntranslated:(Character value:10).
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
    94
    self spaces:self class leftMargin
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    95
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
    96
    "Modified: 1.6.1996 / 00:13:42 / cg"
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    97
!
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    98
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
    99
nextPut:aCharacter
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   100
    stream nextPut:aCharacter
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   101
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   102
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   103
!HPLjetIIPrinterStream methodsFor:'emphasis change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   104
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   105
bold
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   106
    "switch to bold emphasis"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   107
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   108
    "send <ESC>(s0S<ESC>(s3B"
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   109
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   110
    super escapeAll:'(s0S'.
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   111
    super escapeAll:'(s3B'
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   112
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   113
    "Modified: 18.5.1996 / 09:10:39 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   114
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   115
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   116
italic
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   117
    "switch to italic/oblique emphasis"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   118
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   119
    super escapeAll:'(s1S'.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   120
    super escapeAll:'(s0B'
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   121
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   122
    "Modified: 18.5.1996 / 09:10:44 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   123
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   124
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   125
normal
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   126
    "switch to normal/roman emphasis"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   127
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   128
    super escapeAll:'(s0S'.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   129
    super escapeAll:'(s0B'
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   130
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   131
    "Modified: 18.5.1996 / 09:10:48 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   132
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   133
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   134
!HPLjetIIPrinterStream methodsFor:'font change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   135
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   136
courier
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   137
    "switch to courier font"
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   138
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   139
    super escapeAll:'(s3T'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   140
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   141
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   142
helvetica
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   143
    "switch to helvetica font"
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   144
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   145
    super escapeAll:'(s4T'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   146
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   147
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   148
times
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   149
    "switch to times font"
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   150
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   151
    super escapeAll:'(s5T'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   152
! !
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   153
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   154
!HPLjetIIPrinterStream class methodsFor:'documentation'!
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   155
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   156
version
4196
bb2ff928a16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   157
    ^ '$Header$'
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   158
! !
1317
890b41076c7c changed inheritance;
Claus Gittinger <cg@exept.de>
parents: 441
diff changeset
   159
4196
bb2ff928a16d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   160
441
dbbbefa3beae no a2ps in command-list
dq
parents: 370
diff changeset
   161
HPLjetIIPrinterStream initialize!