Metrowerks CodeWarrior Programming
From the originals
12 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
New Technology Building Blocks Metrowerks CodeWarrior Programming THE AUTHORIZED EDITION CD-ROM INCLUDED Includes CodeWarrior Lite Full coverage of PowerPlant The only authorized edition! M&T BOOKS Dan Parks Sydow
A book cover with bold yellow title text on dark navy and black bands, a CD-ROM badge at left, bullet points beside a red-orange photo of a handprint in sand with a small computer chip, and a yellow vertical stripe on the left edge with the M&T Books logo.
Reading notes: The small vertical text on the right edge of the cover is not legible and was not transcribed. Reading order of the bullet points and the CD-ROM badge is approximate.
- Printed product names
- CodeWarrior Lite · PowerPlant · CodeWarrior
- Languages
- English
PDF page 1
New Technology Building Blocks Metrowerks CodeWarrior Programming THE AUTHORIZED EDITION CD-ROM INCLUDED Includes CodeWarrior Lite Full coverage of PowerPlant The only authorized edition! Dan Parks Sydow M&T BOOKS
A book cover with bold yellow title text on a dark navy and black band, a yellow side stripe, a CD-ROM badge, bullet points, and a photo of a handprint in orange sand beside a small computer chip.
Reading notes: Series line 'New Technology Building Blocks' is set in small spaced italic type at the top and was transcribed as printed. Publisher logo 'M&T BOOKS' is partly stylized; spacing of the vertical spine text was read from a rotated layout.
- Printed product names
- CodeWarrior Lite · PowerPlant
- Languages
- English
PDF page 2
metrowerks CodeWarrior
A black-and-white woodcut-style illustration of a factory interior with workers carrying stacks of floppy disks, a worker in the foreground holding a large floppy disk, a sweeping worker with a broom, and a sign reading metrowerks CodeWarrior above workers at machines, with a large clock or gear at the upper right.
Reading notes: The sign text 'metrowerks CodeWarrior' is stylized and the lowercase 'm' in metrowerks is rendered in a distinctive display style; spelling reproduced as printed. No other legible copy, prices, or dates are visible in the image.
- Printed product names
- metrowerks CodeWarrior
- Languages
- English
PDF page 4 · PDF page 3
The image is a plain, entirely blank white page with no visible artwork, layout, or text.
PDF page 5
M&T Books A Division of MIS:Press, Inc. ·A Subsidiary of Henry Holt and Company, Inc. 115West18th Street Ne\Y York, New York 10011 © 1995 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 Publisher. 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, 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 pro- grams. All products, names and services are trademarks or registered trademarks of their respective companies. ISBN: 1-55851-435-X Editor-In-Chief: Paul Farrell Managing Editor: Cary Sullivan Development Editor: Michael Sprague Copy Edit Manager: Shari Chappell Copy Editor: Suzanne Ingrao Production Editor: Stephanie Doyle
Reading notes: Headline not identifiable in supplied copy; primary heading may be absent from extracted text
- Printed dates
- 1995
- Languages
- English
PDF page 6
The image is a plain, entirely blank white page with no visible artwork, layout, or markings.
PDF page 7
Table of Contents
Table of Contents CHAPTER 1 Introduction to CodeWarrior ................. 1 Some Terminology ........................................................................ 2 680x0, 68K, PowerPC, and PPC ............................................... 2 CodeWarrior Editions ............................................................... 2 CodeWarrior Versions .............................................................. 4 About the CodeWarrior CD-ROM Package ............................... 4 The Metrowerks C/C++ f Folder ........................................... 5 Other Items of Interest on the CodeWarrior CD ................... 7 Chapter Summary ....................................................................... 10 CHAPTER Z CodeWarrior Projects ........................... 11 PPC and 68K Projects ............. ; ................................................... 12 The EmptyWindow Resource File ........................................ 12 vii
Reading notes: The chapter title 'CHAPTER Z' may be an OCR misreading of 'CHAPTER 2'. Some characters in the list of contents are uncertain, such as 'PPC and 68K Projects' spacing and '; ....' fragment.
- Printed product names
- CodeWarrior · CodeWarrior CD-ROM · CodeWarrior CD · EmptyWindow
- Languages
- English
PDF page 8
viii Metrowerks CocleWarrior Programming for the Mac The Empty Window MW CIC++ 68K Project .................... 15 The Empty Window MW C/C++ PPC Project ................... 21 Headers, Libraries, and the Toolbox ........................................ 24 Apple's Universal Header Files ............................................ 25 The Universal Header Files and the Toolbox ...................... 26 MacHeaders and the #include Directive .............................. 28 Libraries and the Toolbox ...................................................... 29 The SetVolume Example Program ............................................ 30 The SetVolume Project ............................................................ 32 The SetVolume Source Code .................................................. 36 Verifying that Header Files and Libraries are Necessary .. 38 CodeWarrior Projects and Libraries ......................................... 41 C++ Projects and Libraries ..................................................... 42 ANSI Projects and Libraries .................................................. 43 SIOUX Projects and Libraries ................................................ 50 Project Stationary .................................................................... 54 Chapter Summary ....................................................................... 55 CHAPTER 3 Onderstanding the Oniversal "eader files ..................................... 57 Errors and the Universal Header Files .................................... 58 The PlaySound Project ............................................................ 59 The Faulty PlaySound Source Code ..................................... 62 Correcting the Type Mismatch Error .................................... 63 Correcting Errors Involving the Toolbox ................................ 67
Reading notes: OCR damage in 'CocleWarrior', 'Onderstanding', 'Oniversal' and 'Universal' header line; heading and table-of-contents line structure may not reflect the original layout
- Languages
- English
PDF page 9
Table of Contents ix The Find Dialog Box and Search Sets ................................... 68 The DelaySound Example Program ..................................... 70 Using the Search Set to Correct an Error ............................. 73 Improving the PlaySound Program ......................................... 75 Using the Search Set ................................................................ 76 Making the Changes ............................................................... 78 Chapter Summary ..................................................................... , 79 CHAPTER 4 Debugging and MW Debug ................ 81 Installing and Running MW Debug ........................................ 82 Installing the Debugger .......................................................... 82 Installing the Debugger Nub Files ........................................ 82 Debugger Basics ........................................................................... 84 The ChangingValues68K Program ....................................... 86 MW Debug Windows ............................................................. 87 Controlling Program Execution ............................................ 89 Debugging the ChangingValues68K Program ........................ 91 Executing the ChangingValues68K Program ...................... 91 Variables, Data Structures, and the Debugger ........................ 95 Variables and the Locals Pane ............................................... 95 The Rect Data Type ................................................................. 98 The WindowPtr, WindowRecord, and GrafPort Data Types ......................................................... 100 Experimenting with the GrafPort ....................................... 104 Further Investigation of the GrafPort... .............................. 108 Chapter Summary ..................................................................... 110
Reading notes: Source is a table of contents; no headline or advertised content present. Some heading lines contain stray punctuation such as ', ,' and ', 79' that may be extraction artifacts.
- Languages
- English
PDF page 10
Metrowerks CocleWarrior Programming for the Mac x fat Applications .................................. 111 Executable Code and Resources ............................................. 112 68K Applications and Code Resources ............................. 112 PowerPC Applications and Data Fork Code .................... 113 Fat Applications and Executable Code .............................. 114 Building a Fat Binary Application .......................................... 116 Creating 68K and PowerPC Applications ......................... 116 Get Ready for the Fat App ................................................... 119 Get the PPC Project Ready ................................................... 119 Build the Fat Binary Application ........................................ 123 Examining the Programs with a Resource Editor ............ 124 Chapter Summary ..................................................................... 126 Getting Started with PowerPlant ..... 129 The Example Application ......................................................... 130 What the PPintro68K Example Does .................................. 130 The Example Source Code Listing ...................................... 132 The PowerPlant Project ............................................................. 133 The PPintro68K Example Project Folder ........................... 133 The Project and PowerPlant Classes .................................. 134 PowerPlant Resources .............................................................. 137 The Project Resource File ..................................................... 138 The PowerPlant PPob Resource .......................................... 141
Reading notes: Source appears to be a table of contents rather than advertising copy; no headline or advertised products or prices identified.
- Languages
- English
PDF page 11
Tabler of Contents xi PowerPlant Classes ................................................................... 143 PowerPlant Naming Conventions ...................................... 144 The LApplication Class ........................................................ 148 The LWindow Class .............................................................. 154 PowerPlant Classes and Static Member Functions .......... 155 PowerPlant Classes and the Toolbox .................................. 157 Source Code and the PowerPlant Project.. ............................. 158 The #pragma once Directive and Include Files ................. 158 The LApplication Derived Class ......................................... 160 The CPPintroApp Class Constructor ................................. 160 What's Left? ........................................................................... 163 The PPintroApp.h Header File Source Code Listing ....... 164 The PPintroApp.cp Source Code Listing ........................... 165 PowerPlant and the MW CIC++ PPC Compiler ............ 167 Chapter Summary .................................................................... 168 CHAPTER 7 Menus and PowerPlant ...................... 171 Menus, Resources, and PowerPlant.. ...................................... 172 The PPintro68K Program ..................................................... 172 Adding the MENU and MBAR Resources ........................ 173 Menu Items and the Mcmd Resource ................................ 174 The Mcmd Resource and Resorcerer .................................. 178 The Mcmd Resource and ResEdit.. ..................................... 184 Adding Application-Specific Menu Items ............................. 188 Command Numbers and Application Menus .................. 189 Adding Resources for a New Menu ................................... 189
Reading notes: Table of contents text contains irregular spacing and some dropped or uncertain characters (e.g., 'Tabler' likely 'Table', 'Resorcerer' likely 'Resorcerer' as printed).
- Languages
- English
PDF page 12
xii Metrowerks CocleWarrior Programming for the Mac Menus, Commands, and Commanders ................................. 191 Defining Menu Item Constants ........................................... 191 Menu Items, Commands, and the Target .......................... 192 Commands and the Chain of Command ........................... 194 The Target and the LCommander Class ............................ 196 ObeyCommand() and the Chain of Command ................ 197 Overriding ObeyCommand() .............................................. 201 A Look at the ObeyCommand() Member Function ......... 204 Overriding FindCommandStatus() .................................... 210 The PPMenu68K Example Application ................................. 214 The PPMenu68K Project ....................................................... 215 The PPMenu68K Resources ................................................. 217 The PPMenuApp.h Header File Source Code Listing ..... 221 The CPPMenuApp.cp Source Code Listing ...................... 222 PPMenu and the MW CIC++ PPC Compiler ................... 225 Adding to the PPMenu68K Example ..................................... 226 The PPMoreMenu68K Project ............................................. 226 Adding the New Menu-Related Resources ....................... 227 Adding the New Menu-Related Source Code .................. 228 PPMoreMenu and the MW C/C++ PPC Compiler ......... 233 Chapter Summary .................................................................... 233 CHAPTER 8 Panes. Constructor. and PowerPlant .... 235 Windows, Views, and Panes ................................................... 236 About PowerPlant Panes ..................................................... 236 Creating Panes ....................................................................... 237
Reading notes: Source appears to be a table of contents rather than advertising copy; no headline or product, price, or date content is identifiable.
- Languages
- English