|
Class: PrinterContext
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--PrinterContext
- Package:
- stx:libview2
- Category:
- Interface-Printing
- Version:
- rev:
1.29
date: 2023/12/08 13:19:55
- user: cg
- file: PrinterContext.st directory: libview2
- module: stx stc-classLibrary: libview2
I am the mediator between the smalltalk printing protocol
(which is the same as the graphics drawing protocol) and the
windows printer.
When you open a printer, you will typically talk to me, and I will
forward the graphics commands to my printer.
copyrightCOPYRIGHT (c) 2006 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
default
-
Answer the default Printer, or nil if none.
Usage example(s):
-
defaultMargins
-
Private - answer aPoint containing the default horizontal and vertical
margins for a page (units in inches).
-
defaultPrinterName
-
Answer the name of the default printer, or nil if none.
Usage example(s):
PrinterContext defaultPrinterName
|
-
getPrinterInformation: printerNameString
-
Answer the printer information for the printer named printerNameString. If no name is specified,
answer the information for the default printer.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
named: aName
-
Answer a new instance of Printer which represents
the printer named aName as specified in the host
Control Panel.
-
printerNames
-
Answer a collection of all known printer names.
instance creation
-
fromPrinterInfo: aPrinterInfo
-
** This method must be redefined in concrete classes (subclassResponsibility) **
abort handling
-
abortPrintJob
-
Abort the current print job.
-
aborted
-
Answer whether the user aborted from PrintAbortDialog.
accessing
-
container
-
-
getCharHeight
-
Private - answer the height of the font selected in the receiver's
device context.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
horizontalPixelsPerMeter
-
Answer horizontal pixels per meter on the screen.
-
name
-
Answer the receiver's name from the current printerInfo.
-
name: aName
-
Set the receiver's printer name to aName.
-
numberOfColorBitsPerPixel
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
physicalOffsetX
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
physicalOffsetY
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
pixelsPerInchOfScreenHeight
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
pixelsPerInchOfScreenWidth
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
printerHeightArea
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
printerInfo
-
-
printerInfo: aPrinterInfo
-
-
printerInfoWithName: aName
-
-
printerPhysicalHeight
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
printerPhysicalWidth
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
printerUserFriendlyName
-
Answer the receiver's name from the current printerInfo.
-
printerWidthArea
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
setPrinterFont: aFont
-
-
setTextAlign: aNumber
-
-
setViewportOrg: aPoint
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
verticalPixelsPerMeter
-
Answer vertical pixels per meter on the screen.
initialization & release
-
buildPrinter
-
Private - create all the operating system resources needed.
-
createDC
-
Private - Create a device context for the receiver
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initExtent
-
Private - init the width and height of GraphicsTool for the receiver.
-
releaseDC
-
Private - Closes the device context of the receiver
** This method must be redefined in concrete classes (subclassResponsibility) **
printing
-
print: aString font: aFont title: aTitle wordWrap: wordWrapBoolean marginsRect: aMarginsRect
-
Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.
-
print: aString pageHeader: aString2 font: aFont title: aTitle collate: collateBoolean copies: copiesInteger wordWrap: wordWrapBoolean marginsRect: aMarginsRect
-
Private - Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.
Mg: Erweitert um pageHeader
-
print: aString pageHeader: aString2 font: aFont title: aTitle wordWrap: wordWrapBoolean marginsRect: aMarginsRect
-
Private - Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.
printing process
-
endPage
-
Informs device that we are finished writing to a page.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
endPrintJob
-
End the print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.
Close and clean the device context of the receiver
-
endPrintJobWithoutRelease
-
End the print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.
Won't close the DC
** This method must be redefined in concrete classes (subclassResponsibility) **
-
formFeed
-
Send a form feed to the printer.
-
startPage
-
Starts a page.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
startPrintJob
-
Start a print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.
-
startPrintJob: aString
-
Start a print job, using aString as the job title; everything
drawn between startPrintJob and endPrintJob will become
one entry in the print queue.
-
startPrintJob: aString fileName: aFileName
-
Start a print job, using aString as the job title; everything
drawn between startPrintJob and endPrintJob will become
one entry in the print queue.
** This method must be redefined in concrete classes (subclassResponsibility) **
queries
-
supportsColor
-
-
supportsGraphics
-
testing
-
isPrinterContext
-
text printing
-
asArrayOfStringLines: aString in: aRectangle wordWrap: wordWrapBoolean
-
Private - convert aString into an array of lines; if wordWrapBoolean
is true, also perform word wrapping on the lines, within aRectangle.
-
displayString: aString at: aPoint in: aRect options: ignoredForNow adx: unknownForNow
-
TaBottom
Usage example(s):
self displayString:aString at:(aPoint x@ aPoint y).
|
-
displayStringLines: anIndexedCollection from: startIndex to: endIndex in: aRectangle
-
Private - display Strings in anIndexedCollection starting at startIndex and
ending at endIndex, clipped within the bounds of aRectangle.
-
displayStringLines: anIndexedCollection in: aRectangle
-
Private - display anIndexedCollection of Strings clipped within
the bounds of aRectangle.
-
displayText: aString at: aPoint
-
-
linesPerPageFor: aRectangle
-
-
marginsRectangleFor: aRectangle
-
Private - Answer a Rectangle defining margins based on aRectangle.
Units for aRectangle are in inches, returned margins rectangle is
in device units (pixels).
-
printPage: pageIndex in: aRectangle lines: lines headerLines: headerLines linesPerPage: linesPerPage
-
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.
-
printPage: pageIndex in: aRectangle lines: lines linesPerPage: linesPerPage
-
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.
-
stringWidthOf: aString
-
Return the width of aString
when written using the current font.
-
stringWidthOf: aString at: index
-
Return the width of aString up to index
when written using the current font; expand tabs out
to 4 spaces for calculations
** This method must be redefined in concrete classes (subclassResponsibility) **
|