home *** CD-ROM | disk | FTP | other *** search
- 29-Sep-85 16:34:31-PDT,3982;000000000005
- Return-Path: <mss%dartmouth.csnet@CSNET-RELAY.ARPA>
- Received: from CSNET-RELAY.ARPA by SUMEX-AIM.ARPA with TCP; Sun 29 Sep 85 16:34:23-PDT
- Received: from dartmouth by csnet-relay.csnet id ab09829; 29 Sep 85 19:25 EDT
- Received: by dartmouth.CSNET (4.12/1.20) id AA02021; Sun, 29 Sep 85 12:43:36 edt
- Date: 29 Sep 1985 12:40-EST
- From: mss%dartvax%dartmouth.csnet@CSNET-RELAY.ARPA
- Subject: More information about writing printer servers
- To: info-mac-request@sumex-aim.ARPA
- Message-Id: <496860000/mss@dartvax>
-
- In response to my request for printer driver info, I received the following
- from leo@Apple. Would you please place it into the printer driver
- information file you created? (I checked with leo and he said it was OK--he
- didn't send it out to the info-mac because he thought that most people
- would not be interested.)
-
- -Mark
-
- From leo@APPLE Mon Sep 23 20:31:51 1985
- Date: Wed, 18 Sep 85 01:19:13 pdt
- From: Leo Hourvitz <leo@APPLE>
- Posted-Date: Wed, 18 Sep 85 01:19:13 pdt
- To: mss%dartvax%dartmouth.csnet@CSNET-RELAY
- Subject: Printer Support for the Rest of Us
-
- Mark;
-
- Here's a quick description of the Mac's Printing Architecture (and I DO use
- the word architecture somewhat loosely).
-
- There are two ways to print, known as the high-level and low-level printing
- interfaces. In the high-level printing interface, the program calls all
- those printing routines defined in Inside Mac, like PrOpen, PrOpenDoc,
- PrOpenPage, and so forth, and gets back a printing GrafPort. The program
- then calls QuickDraw routines to draw into this GrafPort, but instead of
- being drawn in some BitMap somewhere, the drawings come out on the printer.
-
- If a program is using the low-level interface, then instead of making the
- calls to PrOpenDoc, it makes control calls on the .Print driver (driver
- refNum -3). These calls have a csCode parameters that gives the type of
- control call being made, which are the types of calls you mentioned: Here's
- a BitMap, here's a stream of text, etc.
-
- A single program never uses both levels of the interface. The sampling of
- real programs is that MacPaint uses the low-level interface, and everybody
- else uses the high-level interface.
-
- When people refer to the ImageWriter driver, they're usually referring to
- the ImageWriter resource file, which actually contains two pieces of code,
- corresponding to the two levels of interface: one is a driver, as per the
- device manager, that supports the low-level interface. The other thing in
- the printer resource file is a series of PDEF resources (fairly undocumen-
- ted) that contain the code to implement the high-level interfaces. The way
- that the high-level interface is implemented is by installing a new set of
- procedures in QuickDraw's StdProcs (in QuickDraw manual, pg. 70) that get
- called whenever the application draws into the printing grafPort.
-
- The low-level interface provided by the driver is pretty much as straight-
- forward as you mentioned. It gets a few more control calls then just
- BitMap, chars, and carriage return; there are also control calls for
- OpenDoc, OpenPage, etc.; but basically, the low-level one is simple.
-
- The only people who have written real-live Printer Drivers, as far as I
- know, are 1) Apple, 2) Aldus, and 3) Orange Micro is trying. There may be
- some others... Macintosh Tech Support, I believe, has a Tech Note with more
- details on writing a printer driver, but I don't know how you'd go about
- getting it from them (though their number is 408 973 3400)(if you have any
- other connection, try it).
-
- Unfortunately, having looked at the task before (and with the advantage of
- having access to the source of the ImageWriter driver), writing a real
- printer file is a heavy-duty task; not impossible, but not a two-weekender.
- I think just doing the low-level interface, giving you MacPaint at least,
- wouldn't be too bad...
-
- Good luck!
-
- Leovitch
-
- Leo Hourvitz
- Apple Computer, Inc.
- leo@apple.csnet
-