Develop-22 9506 June 1995.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
develop E D I T O R I A L S T A F F T H I N G S T O K N O W C O N T A C T I N G U S Editor-in-Cheek Caroline Rose develop, The Apple Technical Feedback. Send editorial suggestions Managing Editor Toni Moccia Journal, a quarterly publication of or comments to Caroline Rose at Technical Buckstopper Dave Johnson Apple Computer’s Developer Press AppleLink CROSE, Internet group, is published in March, June, [email protected], or fax Bookmark CD Leader Alex Dosher September, and December. develop (408)974-6395. Send technical Able Assistant Meredith Best articles and code have been reviewed questions about develop to Dave Our Boss Greg Joswiak for robustness by Apple engineers. Johnson at AppleLink JOHNSON.DK, His Boss Dennis Matthews Internet [email protected], CompuServe This issue’s CD. Subscription issues Review Board Pete “Luke” Alexander, Dave 75300,715, or fax (408)974-6395. Or of develop are accompanied by the Radcliffe, Jim Reekes, Bryan K. “Beaker” write to Caroline or Dave at Apple develop Bookmark CD. This CD contains Ressler, Larry Rosenstein, Andy Shebanow, Computer, Inc., 1 Infinite Loop, M/S a subset of the materials on the monthly Gregg Williams 303-4DP, Cupertino, CA 95014. Developer CD Series, available from Contributing Editors Lorraine Anderson, APDA. Included on the CD are this Article submissions. Ask for our Steve Chernicoff, Toni Haskell, Jody Larson, issue and all back issues of develop along Author’s Guidelines and a submission Cheryl Potter with the code that the articles describe. form at AppleLink DEVELOP, Indexer Marc Savage (The code is updated periodically, so Internet [email protected], always use the most recent CD.) The or fax (408)974-6395. Or write to A R T & P R O D U C T I O N CD also contains Technical Notes, Caroline Rose at the above address. Production Manager Diane Wilcox sample code, and other documentation and tools (these contents are subject to Subscriptions and back issues. Technical Illustration Deb Dennis, Shawn change). Items referred to as being on You can subscribe to develop through Morningstar, John Ryan “this issue’s CD” are located on either APDA (see below) or use the Formatting Forbes Mill Press the Bookmark CD or the Reference subscription card in this issue. You can Photography Sharon Beals, Deb Dennis, Library or Tool Chest edition of the also order printed back issues. For Maggie Fishell Developer CD Series. The develop issues subscription changes or queries or back Cover Illustration Graham Metcalfe of and code are also available in the issue orders, call 1-800-877-5548 in Metcalfe/Shuhert Design; modeled and Developer Services areas on AppleLink the U.S., (815)734-1116 outside the rendered in Strata StudioPro and eWorld and at ftp.info.apple.com. U.S. Or write AppleLink DEV.SUBS or Online Production Cassi Carpenter (Selected articles are on the World Internet [email protected]. Wide Web at http://www.apple.com, Be sure to include your name, address, and account number as it appears on your mailing ISSN #1047-0735. © 1995 Apple Computer, Inc. also in the Developer Services area.) All rights reserved. Apple, the Apple logo, APDA, label in all correspondence related to your AppleLink, AppleScript, AppleShare, AppleTalk, Macintosh Technical Notes. subscription. One-year U.S. subscription LaserWriter, Mac, MacApp, Macintosh, Macintosh Where references to Macintosh price is $30 for 4 issues of develop and the Quadra, MacTCP, MPW, MultiFinder, Newton, Technical Notes in develop are followed develop Bookmark CD; all other countries, PowerBook, QuickTime, and TrueType are trademarks by something like “(QT 4),” this $50 U.S. For Canadian orders, price of Apple Computer, Inc., registered in the U.S. and other countries. AOCE, AppleScript, A/ROSE, indicates the category and number of includes GST (R100236199). Back issues Balloon Help, develop, Finder, NewtonMail, OpenDoc, the Note on this issue’s CD. (QT is the are $13 each in the U.S., $20 all other Power Macintosh, PowerTalk, and QuickDraw are QuickTime category.) countries. trademarks of Apple Computer, Inc. PostScript is a trademark of Adobe Systems Incorporated, which may E-mail addresses. Most e-mail APDA. To order products from APDA be registered in certain jurisdictions. PowerPC is a addresses mentioned in develop are or receive a catalog, call 1-800-282- trademark of International Business Machines AppleLink addresses; to convert one of 2732 in the U.S., 1-800-637-0029 in Corporation, used under license therefrom. NuBus is a trademark of Texas Instruments. UNIX is a registered these to an Internet address, append Canada, (716)871-6555 internationally, trademark of Novell, Inc. in the United States and “@applelink.apple.com” to it. For or (716)871-6511 for fax. Order other countries, licensed exclusively through X/Open example, DEVELOP on AppleLink electronically at AppleLink APDA, Company, Ltd. All other trademarks are the property becomes [email protected] Internet [email protected], of their respective owners. on the Internet. Append “@eworld.com” CompuServe 76666,2405, or America to eWorld addresses, and append Online APDAorder. Or write APDA, “@online.apple.com” to NewtonMail Apple Computer, Inc., P.O. Box 319, Printed on recycled paper addresses. Buffalo, NY 14207-0319. Issue 22 June 1995 A R T I C L E S 6 QuickDraw 3D: A New Dimension for Macintosh Graphics by Pablo Fernicola and Nick Thompson Introducing QuickDraw 3D, a powerful, flexible new 3D graphics package for the Power Macintosh. This article provides an architectural overview and shows how to support 3D data in your application. 29 Copland: The Mac OS Moves Into the Future by Tim Dierks Here’s a preview of the future of the Mac OS, detailing some of the major features and components and giving some suggestions about how to get ready for it now. 42 Creating PCI Device Drivers by Martin Minow All about the new driver model on PCI-based Macintosh computers, and advice on porting existing drivers. 66 Custom Color Search Procedures by Jim Wintermyre Learn about this useful method of customizing Color QuickDraw’s color handling. A real-world graphics problem is investigated and then solved using a custom color search procedure and a hash table. 83 The OpenDoc User Experience by Dave Curbow and Elizabeth Dykstra-Erickson This article provides an overview of OpenDoc from the user’s perspective: understanding the user experience is a prerequisite to designing good part editors. 98 Futures: Don’t Wait Forever by Greg Anderson Futures are an invaluable abstraction for applications that handle multiple asynchronous Apple events, allowing cleaner code and eliminating the need for completion routines. C O L U M N S 39 BALANCE OF POWER 112 MACINTOSH Q & A MacsBug for PowerPC Apple’s Developer Support Center answers by Dave Evans and Jim Murphy questions about Macintosh product MacsBug changes with the times. development. 63 MPW TIPS AND TRICKS 121 NEWTON Q & A: ASK THE LLAMA Building a Better (Development) Environment Answers to Newton-related development by Tim Maroney questions, along with a bit of llama lore. Send Some things to think about when you’re in your own questions for a chance at a T-shirt. building a shared development environment. 124 KON AND BAL’S PUZZLE PAGE 81 ACCORDING TO SCRIPT A Branch Too Far Scripting Quandaries by Chris Yerga by Cal Simone Yet another multifaceted mystery is unraveled Bits of wisdom and advice for developers before your very eyes, as guest puzzler Chris supporting scripting in their applications. Yerga tries to stump the master. 94 THE VETERAN NEOPHYTE Paper Juggling by Dave Johnson 2 EDITOR’S NOTE You can invent multiperson juggling patterns 3 LETTERS even if you’re not a juggler. Really. 130 INDEX CONTENTS 1 EDITOR’S NOTE This is a very forward-looking issue of develop. The cover article is on QuickDraw 3D, whose final release won’t have shipped by the time you read this (though it should be soon). We’ve also got articles on Copland and OpenDoc, which aren’t due for final release for a while yet. You’ll learn how Copland will take the Mac OS into the future and how OpenDoc will affect the way users work with documents. There’s an article on creating PCI device drivers that will be — as far as we can tell as of this writing — forward compatible with Copland. And we’ve got an article on the very subject of futures, a convenient way of implementing asynchronous interapplication communication, which will be especially valuable as more applications become scriptable and as component-oriented systems like OpenDoc become more prevalent. All in all, we’re looking ahead. Having articles on technology that hasn’t shipped yet makes it tough for us to give you CAROLINE ROSE solid information and code that we know will withstand the test of time and not change in the future. QuickDraw 3D is shipping soon enough that we know that article and its code are reasonably solid — but the software is “beta” as of this writing, so changes can still happen. The Copland and OpenDoc articles provide only background information that should prove helpful as you consider how to use those technologies in your work; these articles provide no code, but only a context for the respective technologies. And although the PCI article does its best to tell you what may or may not work with Copland, there are limits to how far it can see into the future. While it’s certainly atypical to have develop articles that aren’t based on good, solid code, we felt these articles would nonetheless be of interest to you.