[fa.info-mac] INFO-MAC Digest V3 #41

info-mac@uw-beaver (09/18/85)

From: Moderator Richard M. Alderson <INFO-MAC-REQUEST@SUMEX-AIM.arpa>


INFO-MAC Digest         Wednesday, 18 Sep 1985     Volume 3 : Issue 41

Today's Topics:
                        MacC library code (2 msgs)
                             FontDisplay 2.0
                          Re: PageMaker review
                           Commordore's Amiga
                       Doing a Launch with SUMacC?
                     This fall's disk drive upgrade?
            How to make MacTerm shut up about ImageWriter???
                               Large Fonts
                            morse code on mac
                             MOCKCHART Help
                Looking for a printer driver for Lexitron
            How do you move the print head on an imagewriter?
              Writing Print Managaers on the Macintosh (long)


----------------------------------------------------------------------

Date: Mon, 9 Sep 85 16:56:09 PDT
From: shebanow%ucbernie@Berkeley (Mike Shebanow)
Subject: more library code

The next message contains a massive quantity of library code, for use with
MacC and MDS.  A large percentage of the [ Pascal Only ] calls from Inside
Mac are implemented, and nearly all of the ToolBox level calls have been
implemented.  There is a new version of the code for accessing finder
information and all sorts of other things.  Would you please post this to
net.sources.mac as well?  Our poster seems to be busted.  This code may be
given away, but it may not be sold.

Andrew Shebanow
c/o shebanow@ucbernie.arpa

[Done.  --RMA]

------------------------------

Date: Mon, 9 Sep 85 16:56:37 PDT
From: shebanow%ucbernie@Berkeley (Mike Shebanow)
Subject: MacC library code

A Modest proposal:

This is the list of functions that are not implemented as traps in the
current Mac ROMs.  Apple provides most of these routines in the Lisa Pascal
environment only.  I have implemented quite a few of these routines for my
own purposes.  Many of them are extremely useful.  Some of them simply
return the contents of global variables.

I am submitting this with the hope that somebody (or somebodies) out there
will implement the remaining functions and post them.  I will probably
implement the routines from the 'OS Event Manager' and Text Edit' sections
sometime soon.  I have no plans to do the driver level calls.  If I can't
figure out a way to use Apple's Print Manager routines for MDS effectively,
I will rewrite those as well.

All of the code is written for Consulair C, and take register based
arguments.  All the code was written by me, with the exception of the File
Manager code, which was written by Russ Whetmore.  I am reposting these,
since I have added some routines and made some unnecessary changes.  I
don't have the author's mail address, so I hope he doesn't object to the
reposting.  I greatly appreciated his code, since it cut the size of my
application by about 1.5K (I had implemented the calls in C).  I hope more
people will submit general purpose library code for MacC and other
compilers.  A few of these routines have been posted to info-mac
previously.  These versions supersede the previous versions.

Most of the routines have been very well tested by a make program I am in
the final phases of.  The only exception to this is the code in
Packages.asm, of which I have used only the string comparison functions of
the International Utils package, and the SFGetFile routine from the
Standard File package.  The other routines should work, since the code is
pretty straightforward, but bugs are a distinct possibility.

A special note:  the routines in FinderParms.c contain not only the listed
routines from the Segment Loader, but also some routines for creating NEW
argument lists, which can be used to open documents when launching.  The
first step is to call ZeroAppFiles(), which wipes the slate clean.  The
second step is to call SetAppMessage(appPrint) if you want to set the
message to appPrint.  Finally, call AddAppFile() once for each filename you
wish to add, in order.  AddAppFile() accepts a pointer to a structure of
type AppFile as its argument.  This is the same structure filled in by
GetAppFiles(), as described in the Segment loader docs.

Hope this stuff is useful...

Andrew Shebanow
c/o shebanow@ucbernie.ARPA

[Archived as [SUMEX]<INFO-MAC>UTILITY-MACC-LIBRARY.CODE.  Must be operated
on with a text editor to separate the various routines, as indicated by
instructions in the file.  --RMA]

------------------------------

Date: 14 Sep 85 12:46:53 EDT
From: Jeffrey Shulman <SHULMAN@RED.RUTGERS.EDU>
Subject: FontDisplay 2.0

Below is a PackIt file containing FontDisplay 2.0 and documentation.  The
major differences from version 1.0 are that 2.0:

1) handles kerning and zero width characters better;
2) has the ability to open a disk to Print Catalog all font files on a
   disk;
3) adds a Style menu for the sample window;
4) has the ability to print a style sheet;
5) uses the standard printing package.

Enjoy!

						Jeff

uucp:  ...{harvard, seismo, ut-sally, sri-iu, ihnp4!packard}!topaz!shulman
arpa:  SHULMAN@RUTGERS
[This has been posted to net.sources.mac]

[And archived as [SUMEX]<INFO-MAC>UTILITY-FONTDISPLAY.HQX.  --RMA]

------------------------------

Date: Mon, 16 Sep 85 00:34:16 MDT
From: thomas%utah-gr@utah-cs.arpa (Spencer W. Thomas)
Subject: Re: PageMaker review

In article <1552@uw-beaver> you write:

>PageMaker seems to work pretty well with both Word and MacWrite.  I had
>wome weird translation problems with a lot of special symbols, though:  I
>used "...", apostrophe, and printers em-dash in Times Roman font.  They
>looked OK on the screen in PageMaker, but came out in some (!!??!)
>printings as U's, Q's, and the like.  I gave up on figuring it out and
>took them out of the text, replacing with old-fashioned 's and double-
>hyphens and such.

These characters have values >128 (i.e., the 8th bit is turned on).  This
may be your problem (if somehow only 7 bits are being sent to the LW or if
it is ignoring parity).  This might explain why it only happens sometimes.

--
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA)
	"The difference between reality and unreality is that reality has
	 so little to recommend it."  -- Allan Sherman

------------------------------

Date: Thu, 12 Sep 85 21:24 ???
From: Rich Muller <muller%umass-ece.csnet@CSNET-RELAY.ARPA>
Subject: Commordore's Amiga

Can someone point me to a net group discussing the Amiga?  Commodore's
supposedly shipping now, and the machines should be available soon.
Thanks.

------------------------------

Date: Mon, 16 Sep 85 18:22:50 EDT
From: Mark H. Nodine <mnodine@BBNH.ARPA>
Subject: Doing a Launch with SUMacC?

Has anybody successfully used SUMacC to write a program which launches
another?  If so, how do you call the Launch procedure and how do you pass
the Finder information so it can open the right documents?

Thanks in advance.

	--Mark

------------------------------

Date: 17 Sep 85 10:56:53 EDT (Tuesday)
Subject: This fall's disk drive upgrade?
From: Steve <Haehn.Wbst@Xerox.ARPA>

I have been wondering about the hardware upgrade that Apple is supposed to
release this fall for the Macintosh, particularly the 800k disk drive
replacement for the internal 400k drive.  Does anyone know if we will get
to keep the old drive?  If we do get to keep it, is there a relatively easy
way to make that drive be an external drive to be plugged into the back of
the Mac?

  ~~ Steve Haehn  <Haehn.Wbst>@Xerox.ARPA

------------------------------

Date: Tue, 17 Sep 85 16:22:19 pdt
From: adobe!greid@glacier (Glenn Reid)
Subject: How to make MacTerm shut up about ImageWriter???

Is there some way to keep MacTerminal from checking to see that you don't
have an ImageWriter file in your system disk and putting that irritating
dialog box on the screen every time I start up MacTerminal?

I know full well I don't have an ImageWriter, and I don't see why I should
have to keep the ImageWriter file on my disk just to pacify MacTerminal.
Grrrrrrrr

Glenn Reid
..greid@Glacier.ARPA

------------------------------

Date: 9 Sep 1985 1545-EDT
From: DEUFEL at DEC-MARLBORO.ARPA
Reply-to: Deufel at DEC-MARLBORO.ARPA
Subject: Large Fonts

Has anyone developed large versions of the Geneva and/or New York fonts?
Specifically, I am looking for a 36 pt, 48 pt, and 72 pt version of each.
Before I go font editing I thought I'd ask if anyone else knows of the
availability (hopefully free) of any of these sizes.

			Cheers,
			-Abdul-

------------------------------

Date: 10 Sep 85 02:27 EDT
From: Crawford @ DCA-EMS
Subject: morse code on mac

does anyone out ther have any programs or good algorithms for sending and
receivng morse code with a mac connected to a radio?

jerry

------------------------------

Date: Tue 10 Sep 85 08:57:27-PDT
From: Steve Dennett <DENNETT@SRI-NIC.ARPA>
Subject: MOCKCHART Help

I hate to appear dumb, but could someone please send me some instructions
on how to use Mockchart?  Or is there some documentation that I missed (I
didn't get any).  Thanks.

Steve Dennett
dennett@sri-nic.arpa

------------------------------

Date: Sun 15 Sep 85 20:19:29-PDT
From: Jyh-Jye (Juoming) Yeh <YEH@SU-SIERRA.ARPA>
Subject: Looking for a printer driver for Lexitron

Does any one know of a printer driver for a Lexitron printer??  We are
looking into the possibility of linking our Mac to the Lexitron printer and
make use of its high quality printing as well as its capability of printing
special characters.  I would appreciate very much for any informatin.

J.J
yeh@su-sierra

------------------------------

Date: Sat, 14 Sep 85 15:47:19 pdt
From: oster%ucblapis.CC@Berkeley
Subject: How do you move the print head on an imagewriter?

Anybody know the sequences of escape characters you send to an imagewriter
(or a C.Itoh) to position the print head?  Ordinarily, the head only moves
when there are some dots to print, but Thunderscan makes the head move
without printing anything.  I hunted through the ImageWriter manual, but I
didn't happen to come across it.  I know its possible.  How is it done?

-- David Oster

------------------------------

Date: Sat, 14 Sep 85 15:44:43 pdt
From: oster%ucblapis.CC@Berkeley
Subject: Writing Print Managaers on the Macintosh

Creating a Macintosh Printer Manager

(All of this information was in Inside Mac, but much of it is omitted in
the current version, and unless you've written print managers, the info is
difficult to understand.  Here it is in condensed form.)

A Macintosh Print Manager is a file containing 68000 machine language
procedures that are called by application programs.  These procedures are
expected to:

1.)  modify fields in a 120 byte print record that the application looks in
to find the resolution of the printer, the size of the paper, the number of
copies, and the page range to print.

2.  Provide a grafPort for the application to do its drawing on.  This
grafPort has special procedures in its QDProcs field that customize
quickdraw appropriately for the printer.

A Macintosh Printer Driver may print bitmaps and/or it may print characters
and do carriage returns and line feeds.  Access to the printer driver is
controlled by the Print Manager, so you can provide what ever capabilities
you want and still use existing application programs.

Applications print by
a.)  Setup the page by calling PrintDefault or PrStylDialog.
b.)  define the job (quality, page range, and no. of copies) by calling
     PrJobDialog
c.)  call PrOpenDoc
d.)  for each page, "i"
e.)    call PrOpenPage
f.)    do their own code to draw page(i)
g.)    call PrClosePage
h.)  call PrCloseDoc
i.)  if the print manager has told it to, the application calls PrPicFile to
     playback any printer spool file to the printer.

Your Print Manager gets control on every one of those Pr... calls.  It can
tell the user (by the dialogs) what capabilities are available, and it can
pick and choose which quickdraw calls to interpret and which not.

Examples:  When the Imagewriter is spooling, it just uses the Picture
mechanism of QuickDraw to buffer up a page of QuickDraw calls into a
picture structure that it writes to disk.  When the application is done
drawing data it calls PrPicFile, which as defined in the file ImageWriter,
allocates a bitmap representing a band of the page and calls DrawPicture.
It sends the bitmap to the Printer Driver.  Then it reallocates the bitmap
to represent the next band of the page and calls drawPicture again.  It
repeats this until it has drawn the entire page.

When it is not spooling, i.e. when it is in draft mode, the ImageWriter
printer manager overrides most of the QDprocs, and interprets attempts to
draw text by telling the printer driver to move to a particular spot on the
paper and draw the characters in one of the printer's built in fonts.

The print manager is where all the work happens.  Very few things call the
print driver directly.  The shift-command-4 screen printing is all I can
think of.

Now, writing your own printer manager:

The Choose Printer desk accessory looks for files on the startup Disk whose
type is 'PRES', so you should create 'PRES' file to hold your printer code.
Create a file whose type is 'PRES' and whose creator field is some 4
characters of your own, but for compatability with the rest of the
universe, should be a mix of upper and lower case, not contflicting with
anyone else's:  'Dave' for example.  (all entirely lower case names and
many upper case names are alreay in use or reserved by apple)

Summary:  A printer manager is a file with:
   Type:  'PRES'
Creator:  up to you:  ('Dave' for example)
containing resources:
 type    id
'BNDL'   128   - so you manager will have an icon on the desktop
'ICN#'         - so you manager will have an icon on the desktop
'FREF'         - so you manager will have an icon on the desktop
'Dave'         -  (for example) ditto

'DRVR'   $E000 - device manager for this printer
'PREC'   $E000 - (optional) private storage for this printer
'PREC'   $0000 - 120 byte default print record for this printer
'STR '   $E001 - default spool file name (like "Print File")

'DLOG'   $E000 - Page Setup Dialog
'DITL'   $E000 - Page Setup Dialog Item List
'DLOG'   $E001 - Job Dialog
'DITL'   $E001 - Job Dialog Item List

Lastly, you will need 6 resources whose contents contain pure 68000 machine
language. These are:

'PDEF'   $0000 - Called to do draft printing
'PDEF'   $0001 - Called to do spool printing (high and standard quality)
'PDEF'   $0002 - (Optional) print method A
'PDEF'   $0003 - (Optional) print method B

Each of these 4 resources starts with the following code:
	BRA.W	MyPrOpenDocProc
	BRA.W	MyPrCloseDocProc
	BRA.W	MyPrOpenPageProc
	BRA.W	MyPrClosePagePrc
	... the actual code

This code is used as a jump table to actually dispatch to a particular
procedure.

'PDEF'   $0004 - The dialogs

This resource starts with the following code:
	BRA.W	MyPrintDefaultProc
	BRA.W	MyPrStlDialogProc
	BRA.W	MyPrJobDialogProc
	BRA.W	MyPrStlInitProc
	BRA.W	MyPrJobInitProc
	BRA.W	MyPrDlgMainProc
	BRA.W	MyPrValidateProc
	BRA.W	MyPrJobMergeProc

'PDEF'   $0005 - The printer spool file interpreter

This resource starts with the code to do MyPrPicFileProc.

All of the code obeys the pascal calling conventions:

Registers A2-A6, D1-D7 must be preserved, parameters are on the stack,
first parameter farthest from the top of stack, and the called routine must
pop the parameters before it returns.

The individual calling sequences of the Pr...procs are given in IM, so I
won't repeat them here.

Macintosh applications call the correct one of 'PDEF's 0-3 by looking in
the .bjDocLoop field of the print record.  The print record is set by the
procedures MyPrStlDialog and MyPrJobDialog which the application calls to
present the pageSetup and Printing dialogs, respectively, to the user, So
the writer of the print manager has a lot of flexibility.

I hope this inspires somebody to write some new print managers I would like
to see one for the standard imagewriter that calls the standard manager to
do most of the work, but gives me control over the margins.  It would also
be possible to write one manager that drove many different kinds of
plotters and dot matrix printers.

-- David Oster

[This message is archived in its entirety as
[SUMEX]<INFO-MAC>PRINT-DRIVERS.TXT.  --RMA]

------------------------------

End of INFO-MAC Digest
**********************