Metrowerks CodeWarrior Programming
From the originals
13 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
Metrowerks CodeWarrior Programming
New Technology Building Blocks Metrowerks CodeWarrior Programming SECOND EDITION CD-ROM INCLUDED • Fully updated for version 10 • Includes coverage of the new Java compiler • Try out CodeWarrior with CodeWarrior Lite—free on the CD-ROM! CodeWarrior LITE INSIDE metrowerks Dan Parks Sydow M&T BOOKS
A book cover with a black and yellow title band, a red stripe reading SECOND EDITION, and a red-toned photo of a handprint in sand with a small computer chip beside it on a dark green panel.
Reading notes: The '10' in 'version 10' is a version number rather than a date and is listed only as a printed number. The 'CD-ROM INCLUDED' badge text is curved and was read from the circular seal, so its exact arrangement is approximate.
- Printed product names
- Metrowerks CodeWarrior Programming · CodeWarrior · CodeWarrior Lite
- Printed dates
- 10
- Languages
- English
PDF page 1
Metrowerks CodeWarrior Programming
New Technology Building Blocks Metrowerks CodeWarrior Programming SECOND EDITION CD-ROM INCLUDED • Fully updated for version 10 • Includes coverage of the new Java compiler • Try out CodeWarrior with CodeWarrior Lite—free on the CD-ROM! CodeWarrior LITE INSIDE metrowerks M&T BOOKS Dan Parks Sydow
A book cover with large yellow title text on black and red bands, a red hand print in sand with a small chip image on the right, and a yellow-orange gradient strip with a CD-ROM badge on the left.
Reading notes: The 'New Technology Building Blocks' series line at top is small and italicized, so spacing may be approximate. The M&T Books logo text is small and partly stylized; 'BOOKS' is read vertically.
- Printed product names
- Metrowerks CodeWarrior Programming · CodeWarrior Lite
- Printed dates
- version 10
- Languages
- English
PDF page 2
Metrowerks CodeWarrior Programming
Metrowerks CodeWarrior Programming Second Edition Dan Parks Sydow M&T BOOKS
A book title page with a black-and-white engraving of a man in work clothes carrying a large floppy-disk-like object at top right, with bold stacked title text centered below, and the M&T Books logo at the bottom center.
Reading notes: Faint background text and ghosted fine print behind the title (apparently from the reverse or a scanned overlay) is largely illegible and was not transcribed. Small text at the top right edge and faint lines near the title block are not legible enough to transcribe. The M&T BOOKS logo text is partially stylized; 'BOOKS' is read vertically along the right side.
- Printed product names
- Metrowerks CodeWarrior
- Languages
- English
PDF page 3
M&T Books A Division of MIS:Press, Inc. A Subsidiary of Henry Holt and Company, Inc. 115West18th Street New York, New York 10011 http:/ /www.mispress.com Copyright© 1997 by M&T Books Printed in the United States of America All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without prior written permission from the Pub- lisher. Contact the Publisher for information on foreign rights. Limits of Liability and Disclaimer of Warranty The Author and Publisher of this book have used their best efforts in preparing the book and the programs contained in it. These efforts include the development, researcfi., and test- ing 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 con- nection with, or arising out of, the furnishing, performance, or use of these programs. All products, names and services are trademarks or registered trademarks of their respec- tive companies. First Edition-1997 Library of Congress Cataloging-in-Publication Data p. cm. ISBN 1-55851-505-4 MIS:Press and M&T Books are available at special discounts for bulk purchases for sales promotions, premiums, and fundraising. Special editions or book excerpts can also be created to specification. For details contact: 10 9 8 7 6 5 4 3 2 1 Special Sales Director MIS:Press and M&T Books Subsidiaries of Henry Holt and Company, Inc. 115West18th Street New York, New York 10011 Associate Publisher: Paul Farrell Executive Editor: Cary Sullivan Editor: Michael Sprague Copy Edit Manager: Shari Chappell Production Editor: Patricia Wallenburg Copy Editor: Suzanne Ingrao
Reading notes: Headline not clearly identifiable; source is a copyright/front-matter page with no primary heading. Printed date '1997' appears in both the copyright line and the First Edition line.
- Printed dates
- 1997
- Languages
- English
PDF page 4
The image is a entirely blank white portrait-oriented page with no visible artwork, layout, or text.
Reading notes: The image appears to be a blank white page with no visible text, so the transcript and printed fields are empty.
PDF page 5
Acknowledgments Michael Sprague, Editor, M&T Books, for keeping things rolling along. Patty Wallenburg, Production Editor, for a page layout effort that resulted in such a polished looking book. The many Metrowerks people who were so readily accessible and quick to provide information. Among those at Metrowerks who answered questions or provided input: Greg Galanos, President; Jim Trudeau, CodeWarrior Documentation; Ron Liechty, Middleman Extrordinaire; Joshua Golub, ZoneRanger; Eric Scouten, Constructor; Greg Dow, PowerPlant; Steve Nicolai, Profiler; and Greg Combs, CD Burnmeister. Carole McClendon, Waterside Productions, for making this book happen. Mike E. Floyd, for permission to use his Blue Angels picture in Chapter 12.
Reading notes: Irregular spacing in some lines may reflect layout justification rather than original text
- Languages
- English
PDF page 6
Table of Contents
Table of Contents Introduction x About the CD-ROM ... .. .... .................... . . . . ..... xviii About This Book ............... .... ...... ... .............. xix Chapter 1: lntrodaction to CodeWarrior 1 Some Terminology .. ...................................... . . 2 Metrowerks and the CodeWarrior IDE .. ...... ............. 2 CodeWarrior Editions and Versions ........... ............. 2 680x0, 68K, PowerPC, and PPC . . .... ... .. .. . .. . .... .. .. ... 5 Native Code, Emulation, and Fat Applications . . .... . ....... 5 Aboutthe CodeWarrior CD-ROM Package .. . .... .............. 8 The Metrowerks CodeWarrior Folder ......... ............ 10 The Metrowerks PowerPlant Folder ..... . ..... ... . ........ 11 The Other Metrowerks Tools Folder ....... . ... ........... 13
Reading notes: OCR-style spacing and possible misreading of 'lntrodaction' (likely 'Introduction') and 'Aboutthe' in the table of contents
- Printed product names
- CodeWarrior · CodeWarrior IDE · PowerPlant
- Languages
- English
PDF page 7
viii Metrowerks CodeWarrlor Programming. Second Edition Other Items of Interest on the CodeWarrior CDs ............ 14 Chapter Summary ......................................... 15 Chapter Z: CocleWarrior Projecb 17 Introduction to Projects ..................................... 18 Creating a New Project Using Project Stationery ............ 18 Compiling and Running the Project's Code ................ 26 What's Missing? ....................................... 29 Creating an Application .................................... 29 Creating a New Project .................................. 30 Creating and Adding a Resource File to a Project ........... 32 Creating and Adding a Source Code File to a Project ........ 42 Specifying which Compiler CodeWarrior Should Use ....... 46 Compiling and Running the Project's Code ................ 47 Supplying a New Name for the Application ............... 49 Examining the Results of Your Efforts ..................... 51 Other CodeWarrior Project Types ............................ 52 Console Projects ........................................ 52 C ++ Projects ........................................... 55 Chapter Summary ......................................... 57 Chapter J: Understanding the Universal Interface Fila 59 Header Files and the Toolbox ............................... 60 Apple's Universal Interface Header Files .................. 60 Universal Interface Header Files and Your Code ............ 62 MacHeaders and the #include Directive ................... 67 The SpeakPhrase Example Program .......................... 68 The SetVolume Project .................................. 68 The SpeakPhrase Source Code ........................... 70 Verifying that Header Files and Libraries are Necessary ..... 71
Reading notes: Table of contents text with OCR-like spacing artifacts; page numbers and dotted leaders may be imprecise
- Printed product names
- CodeWarrior · Project Stationery · Universal Interface · MacHeaders · SpeakPhrase · SetVolume
- Languages
- English
PDF page 8
Table of Contents ix Errors and the Universal Header Files ........................ 74 The PlaySound Project .................................. 75 The Faulty PlaySound Source Code ....................... 78 Correcting the Type Mismatch Error ...................... 80 Searching the Universal Interface Files ....................... 86 The Find Dialog Box and Search Sets ...................... 87 The DelaySound Example Program ....................... 90 Using the Search Set to Correct an Error ................... 93 Chapter Summary ......................................... 96 Chapter 4: Debugging and MW Debug 99 Debugger Basics .......................................... 100 Installing the Debugger ................................ 100 Enabling the Debugger for a Project ...................... 101 MW Debug Windows .................................. 102 Controlling Program Execution ......................... 106 Debugging an Example Program ........................... 108 The ChangingValues68K Program ....................... 108 Executing ChangingValues68K without MW Debug ........ 110 Executing ChangingValues68K with MW Debug ........... 111 Variables, Data Structures, and the Debugger ................. 115 Variables and the Variables Pane ........................ 116 The Rect Data Type .................................... 120 The WindowPtr, WindowRecord, and GrafPort Data Types . 122 Experimenting with the GrafPort ........................ 126 Further Investigation of the GrafPort ..................... 130 Chapter Summary ........................................ 133 Chapter 5: fat Applications 135 Executable Code and Resources ............................ 136
Reading notes: Source is a table of contents excerpt with no advertised products, prices, or dates. Some chapter titles appear damaged, including 'Chapter 5: fat Applications' and 'MW Debug'.
- Languages
- English
PDF page 9
Metrowerks CodeWarrlor Programming. Second Edition x 68K Applications and Code Resources ................... 136 PowerPC Applications and Data Fork Code ............... 137 Fat Applications and Executable Code ................... 138 Building a Fat Binary Application ........................... 139 Creating 68K and Power PC Projects ..................... 140 Using a Single Source Code File for Both Projects .......... 142 Building the Applications .............................. 144 Creating the Fat Application Project ..................... 145 Creating the Fat Application ............................ 147 Examining the Programs with a Resource Editor .......... 149 Summary ................................................ 152 Chapter 6: Java. Applets. and the World Wide Web 155 Web Browsers, Applets, and the Web ........................ 156 About Web Browsers .................................. 156 Applets and Platform Independence ..................... 158 Java Interpreters and Bytecode .......................... 160 The Java Applet Project .................................... 162 Creating a Java Applet Project .......................... 163 The Files in a Java Project ............................... 164 Running the Default Applet ............................ 169 HTML and Applets ....................................... 174 The <applet> Tag ...................................... 174 Applets and Web Browsers ............................. 176 Java Source Code and the TrivialApplet ..................... 178 Import Statements ..................................... 178 The Applet Class ...................................... 179 Methods ............................................. 180 Summary ................................................ 181
Reading notes: OCR reads 'CodeWarrlor' in the running header, likely a misreading of 'CodeWarrior'
- Languages
- English
PDF page 10
Chapter 7: Getting Started with PowerPlant and Constructor
Chapter 7: Getting Started with PowerPlant and Constructor Table of Contents 183 The PowerPlant Project .................................... 184 What the Example PowerPlant Application Does .......... 185 Creating a PowerPlant Project ........................... 188 PowerPlant Projects and PowerPlant Classes .............. 190 Running the Default Program ........................... 192 PowerPlant Resource Files ................................. 194 The PP Basic Resource.rsrc File .......................... 195 The PP Action Strings.rsrc File .......................... 199 The PP DebugAlerts.rsrc File ............................ 200 The PP Basic Resource.ppob File ........................ 201 Constructor and PowerPlant Resources ...................... 201 Constructor-The Resource Editor ....................... 202 The PPob Resource Type ............................... 207 Other Resource Types .................................. 217 Summary ................................................ 219 Chapter 8: PowerPlant Classes 221 PowerPlant Classes ....................................... 222 PowerPlant Naming Conventions .......................... 224 Class Names .......................................... 225 Variable Names ....................................... 226 Data Type Names ..................................... 226 Constant Names ...................................... 226 Function Parameter Names ............................. 227 Select PowerPlant Classes ................................. 228 The LApplication Class ................................ 228 The LWindow Class ................................... 236 xi
Reading notes: Table of contents page numbers and some heading spacing appear irregular in the extracted text.
- Printed product names
- PowerPlant · Constructor
- Languages
- English
PDF page 11
xii Metrowerks CocleWarrior Programming, Second Edition PowerPlant Classes and Static Member Functions ......... 237 PowerPlant Classes and the Toolbox ..................... 238 The PP Basic Starter Source Code ........................... 240 The main() Function ................................... 240 The LApplication Derived Class ......................... 242 What's Left? .......................................... 245 Summary ................................................ 245 Chapter 9: PowerPlant and Menus 247 Menu Resources and PowerPlant ........................... 248 The PowerPlantlntro68K Program ....................... 248 MENU and MBAR Resources ........................... 249 Menu Items and the Mcmd Resource ..................... 251 Menus, Commands, and Commanders ...................... 256 Menu Items, Commands, and the Target .................. 256 Commands and the Chain of Command .................. 257 The Target and the LCommander Class .................. 262 Handling Menu Selections ................................. 263 ObeyCommand() and the Chain of Command ............ 264 Overriding ObeyCommand() ........................... 267 A Look at the ObeyCommand() Member Function ......... 271 Overriding FindCommandStatus() ...................... 277 Adding Application-Specific Menu Items .................... 279 Command Numbers and Application Menus ............. 280 Adding Resources for a New Menu ...................... 280 Defining Menu Item Constants .......................... 280 Writing the ObeyCommand() Function ................... 281 Writing the FindCommandStatus() Function .............. 283 The PowerPlantMenu68K Example Application .............. 284 The PowerPlantMenu68K Project ........................ 285 The PowerPlantMenu68K Resources ..................... 285
Reading notes: Source text appears to be a table of contents with hyphenated or spaced words in places; reading order is list-like rather than narrative.
- Languages
- English