A/UX® Toolbox: Macintosh® ROM Interface
Total Page:16
File Type:pdf, Size:1020Kb
A/UX®Toolbox: Macintosh®ROM Interface .® A/UX® Toolbox: Macintosh® ROM Interface 030-0787-A • APPLE COMPUTER, INC. © 1990, Apple Computer, Inc. POSTSCRIPT is a registered trademark, All rights reserved. and Illustrator is a trademark of Adobe No part of this publication may be Systems, Incorporated. reproduced, stored in a retrieval UNIX is a registered trademark of system, or transmitted, in any form or AT&T. by any means, mechanical, electronic, Simultaneously published in the photocopying, recording, or United States and Canada. otherwise, without prior written permission of Apple Computer, Inc. Printed in the United States of America. The Apple logo is a registered trademark of Apple Computer, Inc. Use of the "keyboard" logo (Option Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. Apple Computer, Inc. 20525 Mariani Ave. Cupertino, California 95014 (408) 996-1010 Apple, the Apple logo, AppleLink, AppleShare, AppleTalk, A!UX, LaserWriter, LocalTalk, Macintosh, MacTCP, MPW, MultiFinder and SANE are registered trademarks of Apple Computer, Inc. APDA, Finder, MacX, QuickDraw, ResEdit and SuperDrive are trademarks of Apple Computer, Inc. Ethernet is a registered trademark of Xerox Corporation. ITC Garamond and ITC Zapf Dingbats are registered trademarks of International Typeface Corporation. Microsoft is a registered trademark of ¥icrosoft Corporation. NuBus is a trademark of Texas Instruments. 030-0787-A LIMITED WARRAN1Y ON MEDIA Even though Apple has reviewed this AND REPLACEMENT manual, APPLE MAKES NO WARRANTY OR REPRESENTATION, If you discover physical defects in the EITHER EXPRESS OR IMPLIED, manual or in the media on which a WITH RESPECT TO THIS MANUAL, software product is distributed, Apple ITS QUALITY, ACCURACY, will replace the media or manual at MERCHANTABIllTY, OR FITNESS no charge to you provided you return FOR A PARTICULAR PURPOSE. AS A the item to be replaced with proof of RESULT, THIS MANUAL IS SOLD purchase to Apple or an authorized "AS IS," AND YOU, THE Apple dealer during the 90-day period PURCHASER, ARE ASSUMING THE after you purchased the software. In ENTIRE RISK AS TO ITS QUALITY addition, Apple will replace damaged AND ACCURACY. software media and manuals for as long as the software product is IN NO EVENT WILL APPLE BE included in Apple's Media Exchange liABlE FOR DIRECT, INDIRECT, Program. While not an upgrade or SPECIAL, INCIDENTAL, OR update method, this program offers CONSEQUENTIAL DAMAGES additional protection for up to two RESULTING FROM ANY DEFECT OR years or more from the date of your INACCURACY IN THIS MANUAL, original purchase. See your even if advised of the possibility of authorized Apple dealer for program such damages. coverage and details. In some countries the replacement period THE WARRANTY AND REMEDIES may be different; check with your SET FORTII ABOVE ARE EXCLUSIVE authorized Apple dealer. AND IN LIEU OF All OTHERS, ORAL OR WRfITEN, EXPRESS OR All IMPLIED WARRANTIES ON IMPLIED. No Apple dealer, agent, or THIS MANUAL, INCLUDING employee is authorized to make any IMPLIED WARRANTIES OF modification, extension, or addition to MERCHANTABILITY AND FITNESS this warranty. FOR A PARTICULAR PURPOSE, ARE LIMITED IN DURATION TO NINE1Y Some states do not allow the exclusion (90) DAYS FROM THE DATE OF THE or limitation of implied warranties or ORIGINAL RETAn PURCHASE OF liability for incidental or consequential TIDS PRODUCT. damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. 030-0787-A Contents Figures and tables / xiii Preface I xv What's in this guide / xvi What you need to know / xvii Conventions used in this guide / xvii Keys and key combinations / xviii Terminology / xviii The Courier font / xix Font styles / xx A!UX command syntax / xx Command reference notation / xxi Cross-referencing / xxii 1 About the A/UX Toolbox I 1-1 Overview / 1-2 Configuration requirements: none / 1-3 Contents of the A!UX Toolbox / 1-3 Standards compliance of A!UX Release 2.0 / 1-5 New features in A!UX Release 2.0 / 1-5 A/UX Finder user interface / 1-6 Compatibility requirements / 1-6 Increased manager support / 1-7 Additional enhanced support / 1-8 Ease-of-use extensions / 1-9 Connectivity support / 1-9 International character support / 1-10 How the A!UX Toolbox works / 1-11 V 030-0787-A 2 Using the Alux Toolbox / 2-1 Application development environments / 2-2 Your application in the A!UX Finder environment / 2-4 Using the ui_setselect call / 2-5 Porting a Macintosh application to A!UX / 2-6 Developing an A!UX Toolbox application / 2-6 Developing the source code / 2-7 Developing the resource file / 2-10 Building and running the sample programs / 2-11 3 Alux Toolbox Utilities and Extensions / 3-1 Using the utilities / 3-2 fcnvt / 3-3 rez / 3-6 derez / 3-9 A!UX Toolbox variables / 3-14 Additional traps and routines / 3-14 AUXDispatch trap / 3-15 A!UX Toolbox environment variables / 3-17 Making A!UX system calls / 3-18 Using select / 3-20 The MacsBug debugger under A!UX / 3-21 4 Compatibility Checklist / 4-1 Differences in execution environments / 4-2 32-bit address violations / 4-2 Privileged microprocessor instructions / 4-4 Direct hardware access / 4-5 Newline characters / 4-7 File Manager / 4-8 Memory Manager / 4-8 Differences in C compilers / 4-9 Differences in language conventions / 4-10 vi A!UX Toolbox: Macintosh ROM Interface 030-0787-A 5 Inside AlUX Macintosh / 5-1 About the Macintosh interface library / 5-2 32-Bit QuickDraw with Color QuickDraw / 5-4 Apple Desktop Bus / 5-5 AppleTalk Manager / 5-5 Binary-Decimal Conversion Package / 5-5 Color Manager / 5-6 Color Picker Package / 5-6 Control Manager / 5-6 Deferred Task Manager / 5-7 Desk Manager / 5-7 Device Manager / 5-7 Dialog Manager / 5-8 Disk Driver / 5-8 Disk Initialization Package / 5-9 Event Manager, Operating System / 5-9 Event Manager, Toolbox / 5-10 File Manager / 5-11 Floating-Point Arithmetic and Transcendental Functions Packages / 5-11 Font Manager / 5-12 Gestalt facility / 5-13 International Utilities Package / 5-13 List Manager Package / 5-14 Memory Manager / 5-14 Menu Manager / 5-14 Notification Manager / 5-14 Package Manager / 5-15 Palette Manager / 5-15 Printing Manager / 5-15 Resource Manager / 5-16 Scrap Manager / 5-17 Script Manager / 5-18 SCSI Manager / 5-18 Contents vii 030-07S7-A Segment Loader / 5-18 Finder information / 5-19 Segment Loader routines / 5-20 The jump table / 5-20 Summary of the Segment Loader / 5-20 Serial Driver / 5-20 Shutdown Manager / 5-22 Slot Manager / 5-22 Sound Manager / 5-25 Support details / 5-26 The raw sound driver / 5-27 Standard File Package / 5-29 System Error Handler / 5-29 TextEdit / 5-29 Time Manager / 5-30 Utilities, Operating System / 5-30 Date and time operations / 5-31 Miscellaneous utilities / 5-31 Utilities, Toolbox / 5-31 Vertical Retrace Manager / 5-32 Window Manager / 5-32 6 File Systems and File Formats / 6-1 File systems / 6-2 Overall file organization / 6-2 Pathnames and filenames / 6-3 Access permissions / 6-4 Extended file attributes / 6-6 Text files / 6-7 Automatic conversion / 6-8 Mounting and unmounting floppy disks / 6-9 Storing files in the Macintosh OS and in A!UX / 6-10 AppleSingle and AppleDouble format internals / 6-15 AppleSingle format / 6-16 viii A!UX Toolbox: Macintosh ROM Interface 030-07S7-A AppleDouble format / 6-19 Filename conventions / 6-20 AppleSingle format / 6-20 AppleDouble format / 6-20 A Additional Reading / A-I Information sources / A-2 Required references / A-3 Supplementary references / A-4 B Toolbox Contents / B-1 C Implementation Notes / C-l The A/UX Finder and Toolbox Applications / C-2 Running an A/UX Toolbox application / C-2 User-interface device driver / C-3 Initialization routine / C-3 A-line traps / C-4 "Not in ROM" routines / C-6 Macintosh global variables / C-6 File type and creator / C-6 Converting between C and Pascal conventions / C-7 Storing strings / C-8 Ordering and storing parameters / C-8 Passing QuickDraw point values / C-9 Returning function results / C-9 Register conventions / C-10 D Low-Memory Global Variables / D-l Contents ix 030-0787-A E Resource CompHer and Decompller / E-l About the resource compiler and decompiler / E-2 Standard type declaration files / E-3 Using rez and derez / E-3 Structure of a resource description file / E-5 Sample resource description file / E-6 Resource description statements / E-7 Syntax notation / E-7 include-include resources from another file / E-9 read-read data as a resource / E-11 data-specify raw data / E-11 t ype-declare resource type / E-12 Syntax / E-12 Description / E-12 Data-type specifications / E-13 Fill and align types / E-18 Array type / E-19 Switch type / E-21 Sample type statement / E-22 Symbol definitions / E-22 delete-delete a resource / E-23 change-change a resource's vital information / E-24 resource-specify resource data / E-25 Syntax / E-25 Description / E-25 Data statements / E-26 Sample resource definition / E-27 Labels / E-29 Syntax / E-29 Description / E-29 Built-in functions that access resource data / E-30 Declaring labels within arrays / E-31 Label limitations / E-32 Using labels: two examples / E-33 x AlUX Toolbox: Macintosh ROM Interface 030-0787-A Preprocessor directives / E-37 Variable definitions / E-37 incl ude directives / E-38 If-then-else processing / E-38 Print directive / E-39 Resource description syntax / E-40