# Macintosh Graphics in Modula 2 1986 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-0cabab8e5a31aec53bb78a7f3800e3d23345a0f43fa6c9c2979c827526ed87f0)

Transcribed text:

Title
Macintosh Graphics in Modula-2
Author
Russell L. Schnapp
P-H
PRENTICE-HALL PERSONAL COMPUTING SERIES

Image description: A green book cover with a Macintosh-style window bar labeled Title framing the large black title, an author label box reading Russell L. Schnapp, two wireframe and shaded geometric spacecraft-like shapes, and a black footer band with a small Prentice-Hall P-H computer logo and series name.

Reading notes: Author label is printed in a small green-on-black tab; the word Author is stylized and slightly low-contrast.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/26744e97906965ceb60cafb2133277e0d911fe3478d0ecebe818f3da871e04e1/342d9e164a2cd819f7b8c3c2.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-4580b5998f02368a0886a8514d852673190391b8770bdba8410f343a3dd2ba47)

Transcribed text:

Title
Macintosh Graphics in Modula-2
Author
Russell L. Schnapp
P-H
PRENTICE-HALL PERSONAL COMPUTING SERIES

Image description: A green book cover with a dotted pattern features a beige Mac-style window titled 'Title' containing the book title, a gray 'Author' label box, two wireframe and shaded 3D aircraft-like shapes, and a black footer band with a Prentice-Hall computer logo.

Reading notes: The 'Title' and 'Author' labels are interface-style window captions rather than book text; included as printed. Logo text 'P-H' is small and stylized.

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-0f490b53142a81101ee05f568d2f93ef7735453a49da9fd693248b719460a7e1)

Macintosh Graphics in Modula-2

Transcribed text:

Macintosh
Graphics in
Modula-2
JOHN   R.   BING
Integrated   Technical   Consultants,   8nc.
P.O.   Box 547
POOLESVll   1   F:,   MARYLAND   20837

Reading notes: No image was provided, so the layout and reading order are inferred only from the supplied extracted text. The line 'POOLESVll 1 F:, MARYLAND 20837' appears garbled by extraction; the place name and state abbreviation are uncertain and should be checked against the original. The headline is inferred as the first two lines ('Macintosh Graphics in Modula-2'); the source does not mark it as a headline. The firm name 'Integrated Technical Consultants, 8nc.' contains a probable OCR error ('8nc.' for 'Inc.').

Printed product names: Macintosh · Modula-2

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-c400173ed7345a717a95507705b54c307d9ead30ce195da7dbddc1ed01419327)

Transcribed text:

Prentice-Hall   Personal   Computing   Series
Lance A.   Leventhal,   series editor
Busch,   Sorry   About the Explosion: A Humorous Guide to Computers
Dickey,   Kids Travel on Commodore 64
Fabbri,   Animation, Games, and Graphics for the   Timex-1000
Fabbri,   Animation, Games and   Sound   for the Apple II/lie
Fabbri,   Animation, Games, and   Sound   for the Commodore 64
Fabbri,   Animation, Games, and   Sound   for the IBM   PC
Fabbri,   Animation, Games, and   Sound   for the Tl 99/4A
Fabbri,   Animation, Games, and   Sound   for the VIC   20
Glazer,   Managing Money with Your Commodore 64
Glazer,   Managing Money with Your IBM   PC
Glazer,   Managing Money with Your VIC   20
Harris   &   Scofield,   IBM   PC   Conversion Handbook of   BASIC
Lima,   dBASE   II for Beginners
Lima,   Mastering   dBASE   111 in Less Than a Day
Mclaughlin   &   Boulding,   Financial Management with Lotus® 1-2-3®
Nitz,   Business Analysis and Graphics with Lotus® 1-2-3®
Scanlon,   EasyWriter II   System   Made Easy-er
Scanlon,   Microsoft Word for the IBM   PC
Scanlon,   The IBM   PC   Made Easy
Schnapp,   Macintosh Graphics in Modula-2
Schnapp   &   Stafford,   Commodore 64 Computer Graphics Toolbox
Schnapp   &   Stafford,   Computer Graphics for the Timex   1000   and Sinclair ZX-81
Schnapp   &   Stafford,   VIC   20   Computer Graphics Toolbox
Thro,   Making Friends with Apple Writer II

Reading notes: Series name and editor line may be a header rather than a product title Some author surnames are abbreviated or unclear in reading order OCR-style spacing and possible character errors such as 'Tl 99/4A' and '111'

Printed product names: Sorry About the Explosion: A Humorous Guide to Computers · Kids Travel on Commodore 64 · Animation, Games, and Graphics for the Timex-1000 · Animation, Games and Sound for the Apple II/lie · Animation, Games, and Sound for the Commodore 64 · Animation, Games, and Sound for the IBM PC · Animation, Games, and Sound for the Tl 99/4A · Animation, Games, and Sound for the VIC 20 · Managing Money with Your Commodore 64 · Managing Money with Your IBM PC · Managing Money with Your VIC 20 · IBM PC Conversion Handbook of BASIC · dBASE II for Beginners · Mastering dBASE 111 in Less Than a Day · Financial Management with Lotus® 1-2-3® · Business Analysis and Graphics with Lotus® 1-2-3® · EasyWriter II System Made Easy-er · Microsoft Word for the IBM PC · The IBM PC Made Easy · Macintosh Graphics in Modula-2 · Commodore 64 Computer Graphics Toolbox · Computer Graphics for the Timex 1000 and Sinclair ZX-81 · VIC 20 Computer Graphics Toolbox · Making Friends with Apple Writer II

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-2f36feb25b435bd937b2caa522f0e86a8b6b7119fd74e5f68927a9e02a0df212)

Transcribed text:

Title
Macintosh Graphics in Modula-2
Author
Russell L. Schnapp
Prentice-Hall, Inc., Englewood Cliffs, New Jersey 07632

Image description: A book cover with a Mac-style window labeled Title containing the large title, an Author tab below it, two wireframe and shaded 3D space shuttle images in the middle, and a publisher line at the bottom.

Reading notes: Title window label and Author tab text are small Mac-style interface text, transcribed as shown Publisher line is small fine print at the bottom of the page

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-c5d08cf1a43df4da53c23784a3be5ff766e0e61cd0913fe0dceba107d7c8746d)

Transcribed text:

Library of Congress Cataloging-in-Publication Data
Schnapp, Russell L.   (date)
Macintosh graphics in Modula-2.
Includes bibliographies and index.
1. Macintosh (Computer)-Programming.
2. Modula-2 (Computer program language)
3.   Computer graphics.   1. Title.
QA76.8.M3S36   1986   001.64'2   85-12116
ISBN   0-13-542309-0
Editorial/production supervision and
interior design:   Lisa Schulz
Cover design:   Russell Schnapp
Manufacturing buyer:   Gordon Osbourne
Macintosh'l'M   is a trademark licensed to Apple Computer, Inc.
Apple ® is a registered trademark of Apple Computer, Inc.
MacModula-2 is a trademark of Modula Corporation.
© 1986 by Prentice-Hall, Inc., Englewood Cliffs, New Jersey   07632
The author and publisher of this book have used their best efforts in preparing this book.
These efforts include the development, research, and testing of the theories and programs
to determine their effectiveness. The author and publisher make no warranty of any kind,
expressed or implied, with regard to these programs or the documentation contained in
this book. The author and publisher shall not be liable in any event for incidental or
consequential damages in connection with, or arising out of, the furnishing, performance,
or use of these programs.
All rights reserved. No part of this book may be
reproduced, in any form or by any means,
without permission in writing from the publisher.
Printed in the   United   States of America
10   9   8   7   6   5   4   3   2   1
ISBN   0-13-542309-0   01
Prentice-Hall International (UK) Limited,   London
Prentice-Hall of Australia Pty. Limited,   Sydney
Bditora   Prentice-Hall do Brasil, Ltda.,   Rio de Janeiro
Prentice-Hall Canada Inc.,   Toronto
Prentice-Hall Hispanoamericana, S.A.,   Mexico
Prentice-Hall of India Private Limited,   New Delhi
Prentice-Hall of Japan, Inc.,   Tokyo
Prentice-Hall of Southeast Asia Pte. Ltd.,   Singapore
Whitehall Books Limited,   Wellington, New Zealand

Reading notes: Bditora in publisher listing may be an OCR error Catalog number 001.64'2 and QA76.8.M3S36 are cataloging codes, not dates

Printed product names: Macintosh · MacModula-2

Printed dates: 1986 · 85-12116

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-7ef184dca06ec5312fb0ad15d2c294438335b0f1bb5f7f7f868c1d8a79d5c96c)

Image description: The image is a plain, entirely white blank page with no visible artwork, layout, or markings.

Reading notes: No visible text was found on the page, so all printed fields are empty.

[Original PDF page 6](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-ec071bf5a2175232a387c0c119da839d4463ae258195ebb028fad9f9f07aa5c3)

Transcribed text:

Content;s
PREFACE   xi
ABOUT   THE   AUTHOR   xv
ONE:   INTRODUCTION   TO   MODULA-2   1
Fundamental Features of Modula-2   1
MODULEs   2
Separate Compilation   4
Type-Checking   5
Program   Control Statements   6
Warnings   7
Why   Use   Modula-2?   8
Overview of Macintosh Modula-2   8
Using   Macintosh Modula-2   9
Creating a Disk for Editing   9
Working with an Internal Drive   Only   10
Working with an Internal   Plus   External Drive   10
The Development Cycle   11
Exercises   17
Bibliography   18
vii

Reading notes: Source appears to be a table of contents rather than advertising copy; headline left null Heading 'Content;s' contains a stray semicolon, possibly an OCR artifact

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-c7ef54b78da5f46f6de1060253e6f6feeb3d6b3f1eef91a733f17f25794878ca)

Transcribed text:

viii
TWO:   MACINTOSH   GRAPHICS   FACILITIES   20
Macintosh Graphics Hardware   20
A Quickdraw Module   21
Module MiniQD   22
Using   MiniQD   29
Module Concentric   29
Patterns   33
Module Patterns   33
Using   Patterns   36
Module FillConcen   36
Lines and Text   38
Module Draw   38
A Turtle-Graphics Module   44
Module Turtle   44
Using   Turtle   47
Module Boxes: Drawing fractals   48
Exercises   53
Bibliography   53
THREE:   ANIMATION   AND   SIMULATION   54
Moving   Simple   Elements   54
Module Sweep   55
Simulation of Motion   58
Module Timer   59
Simulation   60
Module Motion   61
Module BounceBall   66
Moving Complex   Shapes   72
Module ScrollBall   74
Exercises   78
Bibliography   78
FOUR:   INTERACTIVE   GRAPHICS   79
What Is a   User   Interface?   79
Mouse   80
Module Mouse   80
Direct Manipulation with Mouse   82
Module Drag   82
Events   86
Menus   88
Module Menu   88
Module TestMenu   92
Contents

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-81a10086e5ba29c38b6bf45a3a1a49afdb0250145bbf8086c85edf238abedfbc)

Transcribed text:

ix
Windows   96
Module Windows   97
Module TestWindow   105
Interactive Graphics   108
Module MicroDraw   109
Exercises   121
Bibliography   123
FIVE:   THE   THIRD   DIMENSION   124
Basics of Three-Dimensional Graphics   124
Coordinates   124
Projection   124
Scaling   126
Rotation   126
Translation   128
Module ThreeDee   128
Drawing Wire-Frame   Objects   131
Module Draw3D   132
Hidden Edges   140
Module SolidCube   140
Shading   144
Module PolyQD   145
Module ShadedCube   147
A More General Hidden-Edge Display Technique   151
Module RegionQD   151
Module Poly3D   154
Exercises   163
Bibliography   164
A:   IMPORTANT   QUICKDRAW   PROCEDURES   166
B:   IMPORTANT   TOOLBOX   PROCEDURES   174
C:   GLOSSARY   179
INDEX   185
DISKETTE   OFFER   190
Contents

Reading notes: Heading 'Contents' is a table-of-contents page with page numbers only; no advertised products or prices present.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-024ddd1e090beb8cfb4ab4d2b60d9ca9732fe44a235bc7d8a31410d598d5bb9c)

Transcribed text:

Preface
This book is a about three subjects:
•   Computer graphics.
•   The Modula-2 language.
•   The Apple® Macintosh   TM   personal computer.
It is   intended both as an example of applying Modula-2 to a task and
as an introduction to Macintosh graphics, with a Modula-2 orientation.
You   will   learn   how   to   edit,   compile,   and run programs with the
Macintosh Modula-2 package. You will see how to take advantage of unique
aspects of Modula-2,   such as modules, abstract data types, and separate
compilation.
You will also find explanations and examples of key built-in Macintosh
tools. This book describes many of the Macintosh's graphics and user   inter-
face procedures.
This book assumes you have at least the following equipment:
•   Any Macintosh computer (the 128K version will do). A single-drive
machine is adequate, although it requires a lot of disk swapping.
•   The Macintosh Modula-2 package, from Modula Corporation. This   in-
cludes a program editor, compiler, linker, and some uncompiled and
precompiled modules and interfaces.
•   A copy of the book,   Programming in Modula-2   (Springer-Verlag, 1982)
by Niklaus Wirth. This is the standard reference for Modula.
xi

Reading notes: Possible OCR spacing artifacts in 'Macintosh   TM' and 'inter-face' lines

Printed product names: Apple® Macintosh · Macintosh Modula-2 package · Programming in Modula-2

Printed dates: 1982

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/1#scan-95af5ddcbd1dbb00015a8dce77890ac3f87a590810e0aa28c845ef5a0e5e1ff6)

Transcribed text:

xii   Preface
You might also want an ImageWriter or equivalent printer.
If this is your first encounter with Modula, you should at least be
familiar with   Pascal.
Note that you can buy a disk containing the modules and programs
described in this book.   It   will save you a lot of typing and debugging time.
For ordering information, see page 190.
This book is organized as follows:
Chapter   1   introduces   the   Modula-2   language.   After   describing
Modula-2's major features, it discusses the Macintosh implementation and
goes through the development cycle for a sample program.
Chapter   2   introduces   Macintosh   graphics.   This   chapter   presents   a
Modula interface to the Macintosh   QuickDraw   graphics routines.   It   develops
and demonstrates a module that   provides fill patterns. The chapter then
describes a turtle graphics module and tests it with a program that draws a
fractal curve.
Chapter   3   discusses animation and the simulation of motion. It presents
techniques for calculating the path, velocity, and acceleration of objects. The
chapter contains examples of a moving line and a rubber ball.
Chapter   4   covers interactive graphics.   It   presents a module that gives
Modula programmers access to some Macintosh user interface software. This
chapter also describes the use of the mouse to control the size and   place-
ment of graphic elements, and select from pop-up menus.   It   also explains
how to use windows in your programs. Finally, it develops a graphic editing
program that allows you to save, load, and edit pictures.
Chapter   5   presents techniques used in representing and displaying   three-
dimensional objects.   It   includes a module that performs rotation, scaling,
translation, and perspective mapping on 3-D coordinates.   It   then develops
and demonstrates hidden-line and shading techniques.
This book provides you with several   "toolbox"   modules that you can
use in your own programs. By the time you finish, you should also have
gained a solid understanding of Macintosh's QuickDraw and user interface
software.
ACKNOWLEDGMENTS
First, to my spouse: Thank you, Brig! I really do recognize and appreciate
the value of your patience and suggestions.
Next:   I approach the acknowledgment of corporations with   trepida-
tion.   They   tend   toward   fickleness   more   than   individuals.   Still,   these
companies went out on a limb to improve the state of the art of the   market-
place. The first, as you may guess, is Apple Computer. The Macintosh is a
truly fine piece of software and hardware engineering. Also, my thanks go
to   Microsoft Corporation. Their Microsoft Word product is a tremendous
leap forward, and the   MS-DOS   version helped me greatly in the preparation

Reading notes: Page number 'xii' and some hyphenated line breaks may affect reading order Some line spacing in the source appears irregular, possibly from extraction

Printed product names: Modula-2 · Macintosh · ImageWriter · Pascal · QuickDraw · Microsoft Word · MS-DOS · Apple Computer

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/37ed73ed6685a5e8fe6218b2ee3ee0a0e04a31baef0d3d718870de2d852a9f1d/Macintosh_Graphics_in_Modula_2_1986.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-macintosh-graphics-in-modula-2-1986-7452dd/2.md)
