Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!brl-adm!umd5!uvaarpa!mcnc!decvax!dartvax!eleazar!earleh From: earleh@eleazar.Dartmouth.EDU (Earle R. Horton) Newsgroups: comp.sys.mac.programmer Subject: Re: Usenet answers (PrGeneral & ID 02s) Message-ID: <8410@eleazar.Dartmouth.EDU> Date: 13 Mar 88 04:55:03 GMT References: <44630@sun.uucp> <5720@cit-vax.Caltech.Edu> Distribution: comp Organization: Dartmouth College, Hanover, NH Lines: 71 Summary: Another opinion, or "MY driver prints with HyperCard." In article <5720@cit-vax.Caltech.Edu>, woody@tybalt.caltech.edu (William Edward Woody) writes: > In article <44630@sun.uucp> PUGH@NMFECC.ARPA writes: > >These fellows ask about Hypercard and non-Apple printer drivers: > > tgl@ZOG.CS.CMU.EDU and > > woody@tybalt.caltech.edu (William Edward Woody) > > ... > go belly up. It's the fact that PrDrvrVers() (IM II-163) is returning > 0 for every third party driver I've seen, including mine, until Now! ... > For Third Party Printer Driver developers: How to set the PrDrvrVers() val: > When your driver gets the Open call, somewhere during your driver open > routine, get your DCtlEntry, and place the version (at least 25 to fool, > er, ah, indicate to Hypercard to use your driver) into the low byte > of the dCtlQHdr.qFlags field. > > The version number for the printer driver is placed in the low order > byte of the DCtlEntry.dCtlQHdr.qFlags field. It says so right here, > buried in the middle of the first paragraph under the subject "The Driver > I/O Queue" in the Device Manager documentation. [IM II-191]. Obscure, > no? I have never done as William suggests, but my printer driver (Daisy) prints fine with HyperCard, although I did notice that the program does not use my Job Dialog. (I suppose I should feel grateful that it condescends to use my Style Dialog.) My practice has been to set the "iPrVersion" field of the Print Record as returned by my PrintDefault() routine equal to the constant "iPrRelease", which is currently 3. I ** do not ** recommend using a value of 25 or even 4, since this could present problems for users when "iPrRelease" changes, reflecting possible changes in the printer code which your driver does not now implement. This value should also be present in the default 'PREC' in the printer resource file. The fact that William got his driver to work with HyperCard by setting his "DCtlEntry.dCtlQHdr.qFlags", while Daisy works with HyperCard by setting the "iPrVersion" field of the Print Record, indicates that perhaps HyperCard looks first in the default Print Record, then calls PrDrvrVers() to make sure. It shouldn't be necessary to have the driver open() routine set the flags word for the version, since I would think setting the flags word in the copy of the driver in the resource file should be sufficient, also. (Disclaimer: Apple doesn't appear to set the low-order byte of the driver flags in the printer resource file, so maybe this wouldn't work.) There is one other detail which I am aware of, which may cause PrGlue() to handle my driver differently, although I don't see how. My printer resource file is of type 'PRER', while many third-party printer resource files are of type 'PRES' (same as ImageWriter.) While we are on the subject of printer drivers, how can I vent my anger against application developers who bypass my Job and Style dialogs? Apple has provided a mechanism whereby the print dialog code gets the top half of the screen, and applications get the bottom half for extending the dialogs (see Technical Note #95). If this is not enough, Technical Note #95 recommends having a separate application Job/Style dialog "in addition to the existing Printing Manager dialogs." Apple went to a lot of trouble to make the user interface to printing as generic as possible, and I went to a lot of trouble to follow their guidelines in my printer driver. Now, some clown comes along who thinks he can do it better, and the user never gets to see my carefully designed Job/Style dialog. It just burns me up! > Disclamer: I haven't the foggiest idea what I'm talking about... Nor do I. -- ********************************************************************* *Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755 * *********************************************************************