eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PrinterContext':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PrinterContext


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--PrinterContext

Package:
stx:libview2
Category:
Interface-Printing
Version:
rev: 1.23 date: 2016/08/11 17:40:15
user: stefan
file: PrinterContext.st directory: libview2
module: stx stc-classLibrary: libview2
Author:
Felix Madrid (fm@exept.de)

Description:


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.


Class protocol:

accessing
o  default
Answer the default Printer, or nil if none.
usage example(s):
     self default

o  defaultMargins
Private - answer aPoint containing the default horizontal and vertical
margins for a page (units in inches).

o  defaultPrinterName
Answer the name of the default printer, or nil if none.
usage example(s):
     PrinterContext defaultPrinterName

o  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 raises an error - it must be redefined in concrete classes **

o  named: aName
Answer a new instance of Printer which represents
the printer named aName as specified in the host
Control Panel.

o  printerNames
Answer a collection of all known printer names.

instance creation
o  fromPrinterInfo: aPrinterInfo

** This method raises an error - it must be redefined in concrete classes **


Instance protocol:

abort handling
o  abortPrintJob
Abort the current print job.

o  aborted
Answer whether the user aborted from PrintAbortDialog.

accessing
o  container

o  getCharHeight
Private - answer the height of the font selected in the receiver's
device context.

** This method raises an error - it must be redefined in concrete classes **

o  horizontalPixelsPerMeter
Answer horizontal pixels per meter on the screen.

o  name
Answer the receiver's name from the current printerInfo.

o  name: aName
Set the receiver's printer name to aName.

o  numberOfColorBitsPerPixel

** This method raises an error - it must be redefined in concrete classes **

o  physicalOffsetX

** This method raises an error - it must be redefined in concrete classes **

o  physicalOffsetY

** This method raises an error - it must be redefined in concrete classes **

o  pixelsPerInchOfScreenHeight

** This method raises an error - it must be redefined in concrete classes **

o  pixelsPerInchOfScreenWidth

** This method raises an error - it must be redefined in concrete classes **

o  printerHeightArea

** This method raises an error - it must be redefined in concrete classes **

o  printerInfo

o  printerInfo: aPrinterInfo

o  printerInfoWithName: aName

o  printerPhysicalHeight

** This method raises an error - it must be redefined in concrete classes **

o  printerPhysicalWidth

** This method raises an error - it must be redefined in concrete classes **

o  printerUserFriendlyName
Answer the receiver's name from the current printerInfo.

o  printerWidthArea

** This method raises an error - it must be redefined in concrete classes **

o  setPrinterFont: aFont

o  setTextAlign: aNumber

o  setViewportOrg: aPoint

** This method raises an error - it must be redefined in concrete classes **

o  verticalPixelsPerMeter
Answer vertical pixels per meter on the screen.

initialization & release
o  buildPrinter
Private - create all the operating system resources needed.

o  createDC
Private - Create a device context for the receiver

** This method raises an error - it must be redefined in concrete classes **

o  initExtent
Private - init the width and height of GraphicsTool for the receiver.

o  releaseDC
Private - Closes the device context of the receiver

** This method raises an error - it must be redefined in concrete classes **

printing
o  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.

o  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

o  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
o  endPage
Informs device that we are finished writing to a page.

** This method raises an error - it must be redefined in concrete classes **

o  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

o  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 raises an error - it must be redefined in concrete classes **

o  formFeed
Send a form feed to the printer.

o  startPage
Starts a page.

** This method raises an error - it must be redefined in concrete classes **

o  startPrintJob
Start a print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.

o  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.

o  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 raises an error - it must be redefined in concrete classes **

queries
o  supportsColor

o  supportsGraphics

testing
o  isPrinterContext

text printing
o  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.

o  displayString: aString at: aPoint in: aRect options: ignoredForNow adx: unknownForNow
TaBottom
usage example(s):
self displayString:aString at:(aPoint x@ aPoint y).

o  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.

o  displayStringLines: anIndexedCollection in: aRectangle
Private - display anIndexedCollection of Strings clipped within
the bounds of aRectangle.

o  displayText: aString at: aPoint

o  linesPerPageFor: aRectangle

o  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).

o  printPage: pageIndex in: aRectangle lines: lines headerLines: headerLines linesPerPage: linesPerPage
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.

o  printPage: pageIndex in: aRectangle lines: lines linesPerPage: linesPerPage
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.

o  stringWidthOf: aString
Return the width of aString
when written using the current font.

o  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 raises an error - it must be redefined in concrete classes **

o  withLineStyle: aSymbol lineWidth: lw paint: paintColor do: aBlock



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Mon, 12 Nov 2018 22:40:15 GMT